2 * Dissector routines for the ZigBee Device Profile (ZDP)
3 * By Owen Kirby <osk@exegin.com>
4 * Copyright 2009 Exegin Technologies Limited
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include <epan/packet.h>
17 #include <epan/expert.h>
18 #include <wsutil/bits_ctz.h>
19 #include <wsutil/str_util.h>
21 #include "packet-zbee.h"
22 #include "packet-zbee-aps.h"
23 #include "packet-zbee-nwk.h"
24 #include "packet-zbee-zdp.h"
25 #include "packet-zbee-zdp.h"
27 void proto_reg_handoff_zbee_zdp(void);
28 void proto_register_zbee_zdp(void);
30 /*************************/
31 /* Function Declarations */
32 /*************************/
33 /* Local Helper routines. */
34 static uint16_t zdp_convert_2003cluster (uint8_t cluster
);
37 /**************************************
39 **************************************
41 /* Global field indices. */
42 static int proto_zbee_zdp
;
43 static int hf_zbee_zdp_seqno
;
45 static int hf_zbee_zdp_length
; /* Deprecates since ZigBee 2006. */
48 /* General indices. */
49 int hf_zbee_zdp_ext_addr
;
50 int hf_zbee_zdp_nwk_addr
;
51 int hf_zbee_zdp_req_type
;
52 int hf_zbee_zdp_index
;
53 static int hf_zbee_zdp_status
;
54 int hf_zbee_zdp_ep_count
;
55 int hf_zbee_zdp_endpoint
;
56 int hf_zbee_zdp_profile
;
57 int hf_zbee_zdp_cluster
;
58 int hf_zbee_zdp_addr_mode
;
59 int hf_zbee_zdp_table_size
;
60 int hf_zbee_zdp_table_count
;
61 int hf_zbee_zdp_in_count
;
62 int hf_zbee_zdp_out_count
;
63 int hf_zbee_zdp_in_cluster
;
64 int hf_zbee_zdp_out_cluster
;
65 int hf_zbee_zdp_assoc_device_count
;
66 int hf_zbee_zdp_assoc_device
;
67 int hf_zbee_zdp_cache_address
;
69 /* Capability information indices. */
70 static int hf_zbee_zdp_cinfo
;
71 static int hf_zbee_zdp_cinfo_alloc
;
72 static int hf_zbee_zdp_cinfo_security
;
73 static int hf_zbee_zdp_cinfo_idle_rx
;
74 static int hf_zbee_zdp_cinfo_power
;
75 static int hf_zbee_zdp_cinfo_ffd
;
76 static int hf_zbee_zdp_cinfo_alt_coord
;
78 /* Server mode flag indices. */
79 static int hf_zbee_zdp_server
;
80 static int hf_zbee_zdp_server_pri_trust
;
81 static int hf_zbee_zdp_server_bak_trust
;
82 static int hf_zbee_zdp_server_pri_bind
;
83 static int hf_zbee_zdp_server_bak_bind
;
84 static int hf_zbee_zdp_server_pri_disc
;
85 static int hf_zbee_zdp_server_bak_disc
;
86 static int hf_zbee_zdp_server_network_manager
;
87 static int hf_zbee_zdp_server_stk_compl_rev
;
89 /* Node descriptor indices. */
90 static int hf_zbee_zdp_node_type
;
91 static int hf_zbee_zdp_node_complex
;
92 static int hf_zbee_zdp_node_user
;
93 static int hf_zbee_zdp_node_frag_support
;
94 static int hf_zbee_zdp_node_freq_868
;
95 static int hf_zbee_zdp_node_freq_900
;
96 static int hf_zbee_zdp_node_freq_2400
;
97 static int hf_zbee_zdp_node_freq_eu_sub_ghz
;
98 static int hf_zbee_zdp_node_manufacturer
;
99 static int hf_zbee_zdp_node_max_buffer
;
100 static int hf_zbee_zdp_node_max_incoming_transfer
;
101 static int hf_zbee_zdp_node_max_outgoing_transfer
;
102 static int hf_zbee_zdp_dcf
;
103 static int hf_zbee_zdp_dcf_eaela
;
104 static int hf_zbee_zdp_dcf_esdla
;
106 /* Power descriptor indices. */
107 static int hf_zbee_zdp_power
;
108 static int hf_zbee_zdp_power_mode
;
109 static int hf_zbee_zdp_power_avail_ac
;
110 static int hf_zbee_zdp_power_avail_recharge
;
111 static int hf_zbee_zdp_power_avail_dispose
;
112 static int hf_zbee_zdp_power_source_ac
;
113 static int hf_zbee_zdp_power_source_recharge
;
114 static int hf_zbee_zdp_power_source_dispose
;
115 static int hf_zbee_zdp_power_level
;
117 /* Simple descriptor indices. */
118 static int hf_zbee_zdp_simple_app_device
;
119 static int hf_zbee_zdp_simple_zll_app_device
;
120 static int hf_zbee_zdp_simple_ha_app_device
;
121 static int hf_zbee_zdp_simple_app_version
;
122 int hf_zbee_zdp_simple_length
;
124 /* Complex descriptor indices. */
125 int hf_zbee_zdp_complex_length
;
126 static int hf_zbee_zdp_complex
;
128 /* User descriptor indices. */
129 int hf_zbee_zdp_user
;
130 int hf_zbee_zdp_user_length
;
132 /* Discovery indices. */
133 int hf_zbee_zdp_cache
;
134 int hf_zbee_zdp_disc_node_size
;
135 int hf_zbee_zdp_disc_power_size
;
136 int hf_zbee_zdp_disc_ep_count
;
137 int hf_zbee_zdp_disc_simple_count
;
138 int hf_zbee_zdp_disc_simple_size
;
140 /* Binding indices. */
141 int hf_zbee_zdp_target
;
142 int hf_zbee_zdp_replacement
;
143 int hf_zbee_zdp_replacement_ep
;
144 int hf_zbee_zdp_bind_src
;
145 int hf_zbee_zdp_bind_src64
;
146 int hf_zbee_zdp_bind_src_ep
;
147 int hf_zbee_zdp_bind_dst
;
148 int hf_zbee_zdp_bind_dst64
;
149 int hf_zbee_zdp_bind_dst_ep
;
151 /* Network Management indices. */
152 int hf_zbee_zdp_duration
;
153 int hf_zbee_zdp_leave_children
;
154 int hf_zbee_zdp_leave_rejoin
;
155 int hf_zbee_zdp_significance
;
156 int hf_zbee_zdp_scan_count
;
157 int hf_zbee_zdp_update_id
;
158 int hf_zbee_zdp_manager
;
159 int hf_zbee_zdp_tx_total
;
160 int hf_zbee_zdp_tx_fail
;
161 int hf_zbee_zdp_tx_retries
;
162 int hf_zbee_zdp_period_time_results
;
163 int hf_zbee_zdp_channel_count
;
164 int hf_zbee_zdp_channel_mask
;
165 int hf_zbee_zdp_channel_page
;
166 int hf_zbee_zdp_channel_page_count
;
167 int hf_zbee_zdp_channel_energy
;
168 int hf_zbee_zdp_pan_eui64
;
169 int hf_zbee_zdp_pan_uint
;
170 int hf_zbee_zdp_channel
;
171 int hf_zbee_zdp_nwk_desc_profile
;
172 int hf_zbee_zdp_profile_version
;
173 int hf_zbee_zdp_beacon
;
174 int hf_zbee_zdp_superframe
;
175 int hf_zbee_zdp_permit_joining
;
176 int hf_zbee_zdp_extended_pan
;
177 int hf_zbee_zdp_addr
;
178 int hf_zbee_zdp_table_entry_type
;
179 int hf_zbee_zdp_table_entry_idle_rx_0c
;
180 int hf_zbee_zdp_table_entry_relationship_70
;
181 int hf_zbee_zdp_table_entry_idle_rx_04
;
182 int hf_zbee_zdp_table_entry_relationship_18
;
183 int hf_zbee_zdp_depth
;
184 int hf_zbee_zdp_permit_joining_03
;
186 static int hf_zbee_zdp_scan_channel
;
187 int hf_zbee_zdp_ieee_join_start_index
;
188 int hf_zbee_zdp_ieee_join_update_id
;
189 int hf_zbee_zdp_ieee_join_policy
;
190 int hf_zbee_zdp_ieee_join_list_total
;
191 int hf_zbee_zdp_ieee_join_list_start
;
192 int hf_zbee_zdp_ieee_join_list_count
;
193 int hf_zbee_zdp_ieee_join_list_ieee
;
194 int hf_zbee_zdp_number_of_children
;
195 int hf_zbee_zdp_beacon_survey_scan_mask
;
196 int hf_zbee_zdp_beacon_survey_scan_mask_cnt
;
197 int hf_zbee_zdp_beacon_survey_conf_mask
;
198 int hf_zbee_zdp_beacon_survey_total
;
199 int hf_zbee_zdp_beacon_survey_cur_zbn
;
200 int hf_zbee_zdp_beacon_survey_cur_zbn_potent_parents
;
201 int hf_zbee_zdp_beacon_survey_other_zbn
;
202 int hf_zbee_zdp_beacon_survey_current_parent
;
203 int hf_zbee_zdp_beacon_survey_cnt_parents
;
204 int hf_zbee_zdp_beacon_survey_parent
;
205 int hf_zbee_zdp_tlv_count
;
206 int hf_zbee_zdp_tlv_id
;
209 int hf_zbee_zdp_rtg_entry
;
210 int hf_zbee_zdp_rtg_destination
;
211 int hf_zbee_zdp_rtg_next_hop
;
212 int hf_zbee_zdp_rtg_status
;
215 /* Subtree indices. */
216 static int ett_zbee_zdp
;
217 int ett_zbee_zdp_endpoint
;
218 int ett_zbee_zdp_match_in
;
219 int ett_zbee_zdp_match_out
;
220 int ett_zbee_zdp_node
;
221 static int ett_zbee_zdp_node_in
;
222 static int ett_zbee_zdp_node_out
;
223 int ett_zbee_zdp_power
;
224 int ett_zbee_zdp_simple
;
225 int ett_zbee_zdp_cinfo
;
226 int ett_zbee_zdp_server
;
227 int ett_zbee_zdp_simple_sizes
;
228 int ett_zbee_zdp_bind
;
229 int ett_zbee_zdp_bind_entry
;
230 int ett_zbee_zdp_bind_end_in
;
231 int ett_zbee_zdp_bind_end_out
;
232 static int ett_zbee_zdp_bind_table
;
233 int ett_zbee_zdp_bind_source
;
234 int ett_zbee_zdp_assoc_device
;
235 int ett_zbee_zdp_nwk
;
236 int ett_zbee_zdp_perm_join_fc
;
237 int ett_zbee_zdp_lqi
;
238 int ett_zbee_zdp_rtg
;
239 int ett_zbee_zdp_cache
;
240 int ett_zbee_zdp_nwk_desc
;
241 int ett_zbee_zdp_table_entry
;
242 static int ett_zbee_zdp_descriptor_capability_field
;
245 static expert_field ei_deprecated_command
;
247 /**************************************
249 **************************************
251 static const value_string zbee_zdp_req_types
[] = {
252 { ZBEE_ZDP_REQ_TYPE_SINGLE
, "Single Device Response" },
253 { ZBEE_ZDP_REQ_TYPE_EXTENDED
, "Extended Response" },
257 const value_string zbee_zdp_cluster_names
[] = {
258 { ZBEE_ZDP_REQ_NWK_ADDR
, "Network Address Request" },
259 { ZBEE_ZDP_REQ_IEEE_ADDR
, "Extended Address Request" },
260 { ZBEE_ZDP_REQ_NODE_DESC
, "Node Descriptor Request" },
261 { ZBEE_ZDP_REQ_POWER_DESC
, "Power Descriptor Request" },
262 { ZBEE_ZDP_REQ_SIMPLE_DESC
, "Simple Descriptor Request" },
263 { ZBEE_ZDP_REQ_ACTIVE_EP
, "Active Endpoint Request" },
264 { ZBEE_ZDP_REQ_MATCH_DESC
, "Match Descriptor Request" },
265 { ZBEE_ZDP_REQ_COMPLEX_DESC
, "Complex Descriptor Request" },
266 { ZBEE_ZDP_REQ_USER_DESC
, "User Descriptor Request" },
267 { ZBEE_ZDP_REQ_DISCOVERY_CACHE
, "Discovery Cache Request" },
268 { ZBEE_ZDP_REQ_DEVICE_ANNCE
, "Device Announcement" },
269 { ZBEE_ZDP_REQ_PARENT_ANNCE
, "Parent Announce" },
270 { ZBEE_ZDP_REQ_SET_USER_DESC
, "Set User Descriptor Request" },
271 { ZBEE_ZDP_REQ_SYSTEM_SERVER_DISC
, "Server Discovery Request" },
272 { ZBEE_ZDP_REQ_STORE_DISCOVERY
, "Store Discovery Request" },
273 { ZBEE_ZDP_REQ_STORE_NODE_DESC
, "Store Node Descriptor Request" },
274 { ZBEE_ZDP_REQ_STORE_POWER_DESC
, "Store Power Descriptor Request" },
275 { ZBEE_ZDP_REQ_STORE_ACTIVE_EP
, "Store Active Endpoints Request" },
276 { ZBEE_ZDP_REQ_STORE_SIMPLE_DESC
, "Store Simple Descriptor Request" },
277 { ZBEE_ZDP_REQ_REMOVE_NODE_CACHE
, "Remove Node Cache Request" },
278 { ZBEE_ZDP_REQ_FIND_NODE_CACHE
, "Find Node Cache Request" },
279 { ZBEE_ZDP_REQ_EXT_SIMPLE_DESC
, "Extended Simple Descriptor Request" },
280 { ZBEE_ZDP_REQ_EXT_ACTIVE_EP
, "Extended Active Endpoint Request" },
281 { ZBEE_ZDP_REQ_END_DEVICE_BIND
, "End Device Bind Request" },
282 { ZBEE_ZDP_REQ_BIND
, "Bind Request" },
283 { ZBEE_ZDP_REQ_UNBIND
, "Unbind Request" },
284 { ZBEE_ZDP_REQ_BIND_REGISTER
, "Bind Register Request" },
285 { ZBEE_ZDP_REQ_REPLACE_DEVICE
, "Replace Device Request" },
286 { ZBEE_ZDP_REQ_STORE_BAK_BIND_ENTRY
, "Store Backup Binding Request" },
287 { ZBEE_ZDP_REQ_REMOVE_BAK_BIND_ENTRY
, "Remove Backup Binding Request" },
288 { ZBEE_ZDP_REQ_BACKUP_BIND_TABLE
, "Backup Binding Table Request" },
289 { ZBEE_ZDP_REQ_RECOVER_BIND_TABLE
, "Recover Binding Table Request" },
290 { ZBEE_ZDP_REQ_BACKUP_SOURCE_BIND
, "Backup Source Binding Request" },
291 { ZBEE_ZDP_REQ_RECOVER_SOURCE_BIND
, "Recover Source Binding Request" },
292 { ZBEE_ZDP_REQ_CLEAR_ALL_BINDINGS
, "Clear All Bindings Request" },
294 { ZBEE_ZDP_REQ_MGMT_NWK_DISC
, "Network Discovery Request" },
295 { ZBEE_ZDP_REQ_MGMT_LQI
, "Link Quality Request" },
296 { ZBEE_ZDP_REQ_MGMT_RTG
, "Routing Table Request" },
297 { ZBEE_ZDP_REQ_MGMT_BIND
, "Binding Table Request" },
298 { ZBEE_ZDP_REQ_MGMT_LEAVE
, "Leave Request" },
299 { ZBEE_ZDP_REQ_MGMT_DIRECT_JOIN
, "Direct Join Request" },
300 { ZBEE_ZDP_REQ_MGMT_PERMIT_JOIN
, "Permit Join Request" },
301 { ZBEE_ZDP_REQ_MGMT_CACHE
, "Cache Request" },
302 { ZBEE_ZDP_REQ_MGMT_NWKUPDATE
, "Network Update Request" },
303 { ZBEE_ZDP_REQ_MGMT_NWKUPDATE_ENH
, "Network Update Enhanced Request" },
304 { ZBEE_ZDP_REQ_MGMT_IEEE_JOIN_LIST
, "IEEE Joining List Request" },
305 { ZBEE_ZDP_REQ_MGMT_NWK_BEACON_SURVEY
, "Beacon Survey Request"},
306 { ZBEE_ZDP_REQ_SECURITY_START_KEY_NEGOTIATION
,"Security Start Key Negotiation Request" },
307 { ZBEE_ZDP_REQ_SECURITY_GET_AUTH_TOKEN
, "Security Get Authentication Token Request"},
308 { ZBEE_ZDP_REQ_SECURITY_GET_AUTH_LEVEL
, "Security Get Authentication Level Request"},
309 { ZBEE_ZDP_REQ_SECURITY_SET_CONFIGURATION
, "Security Set Configuration Request"},
310 { ZBEE_ZDP_REQ_SECURITY_GET_CONFIGURATION
, "Security Get Configuration Request"},
311 { ZBEE_ZDP_REQ_SECURITY_START_KEY_UPDATE
, "Security Start Key Update Request"},
312 { ZBEE_ZDP_REQ_SECURITY_DECOMMISSION
, "Security Decommission Request"},
313 { ZBEE_ZDP_REQ_SECURITY_CHALLENGE
, "Security Challenge Request"},
315 { ZBEE_ZDP_RSP_NWK_ADDR
, "Network Address Response" },
316 { ZBEE_ZDP_RSP_IEEE_ADDR
, "Extended Address Response" },
317 { ZBEE_ZDP_RSP_NODE_DESC
, "Node Descriptor Response" },
318 { ZBEE_ZDP_RSP_POWER_DESC
, "Power Descriptor Response" },
319 { ZBEE_ZDP_RSP_SIMPLE_DESC
, "Simple Descriptor Response" },
320 { ZBEE_ZDP_RSP_ACTIVE_EP
, "Active Endpoint Response" },
321 { ZBEE_ZDP_RSP_MATCH_DESC
, "Match Descriptor Response" },
322 { ZBEE_ZDP_RSP_COMPLEX_DESC
, "Complex Descriptor Response" },
323 { ZBEE_ZDP_RSP_USER_DESC
, "User Descriptor Response" },
324 { ZBEE_ZDP_RSP_DISCOVERY_CACHE
, "Discovery Cache Response" },
325 { ZBEE_ZDP_RSP_CONF_USER_DESC
, "Set User Descriptor Confirm" },
326 { ZBEE_ZDP_RSP_SYSTEM_SERVER_DISC
, "Server Discovery Response" },
327 { ZBEE_ZDP_RSP_STORE_DISCOVERY
, "Store Discovery Response" },
328 { ZBEE_ZDP_RSP_STORE_NODE_DESC
, "Store Node Descriptor Response" },
329 { ZBEE_ZDP_RSP_STORE_POWER_DESC
, "Store Power Descriptor Response" },
330 { ZBEE_ZDP_RSP_STORE_ACTIVE_EP
, "Store Active Endpoints Response" },
331 { ZBEE_ZDP_RSP_STORE_SIMPLE_DESC
, "Store Simple Descriptor Response" },
332 { ZBEE_ZDP_RSP_REMOVE_NODE_CACHE
, "Remove Node Cache Response" },
333 { ZBEE_ZDP_RSP_FIND_NODE_CACHE
, "Find Node Cache Response" },
334 { ZBEE_ZDP_RSP_EXT_SIMPLE_DESC
, "Extended Simple Descriptor Response" },
335 { ZBEE_ZDP_RSP_EXT_ACTIVE_EP
, "Extended Active Endpoint Response" },
336 { ZBEE_ZDP_RSP_PARENT_ANNCE
, "Parent Announce Response" },
337 { ZBEE_ZDP_RSP_END_DEVICE_BIND
, "End Device Bind Response" },
338 { ZBEE_ZDP_RSP_BIND
, "Bind Response" },
339 { ZBEE_ZDP_RSP_UNBIND
, "Unbind Response" },
340 { ZBEE_ZDP_RSP_BIND_REGISTER
, "Bind Register Response" },
341 { ZBEE_ZDP_RSP_REPLACE_DEVICE
, "Replace Device Response" },
342 { ZBEE_ZDP_RSP_STORE_BAK_BIND_ENTRY
, "Store Backup Binding Response" },
343 { ZBEE_ZDP_RSP_REMOVE_BAK_BIND_ENTRY
, "Remove Backup Binding Response" },
344 { ZBEE_ZDP_RSP_BACKUP_BIND_TABLE
, "Backup Binding Table Response" },
345 { ZBEE_ZDP_RSP_RECOVER_BIND_TABLE
, "Recover Binding Table Response" },
346 { ZBEE_ZDP_RSP_BACKUP_SOURCE_BIND
, "Backup Source Binding Response" },
347 { ZBEE_ZDP_RSP_RECOVER_SOURCE_BIND
, "Recover Source Binding Response" },
348 { ZBEE_ZDP_RSP_CLEAR_ALL_BINDINGS
, "Clear All Bindings Response" },
349 { ZBEE_ZDP_RSP_MGMT_NWK_DISC
, "Network Discovery Response" },
350 { ZBEE_ZDP_RSP_MGMT_LQI
, "Link Quality Response" },
351 { ZBEE_ZDP_RSP_MGMT_RTG
, "Routing Table Response" },
352 { ZBEE_ZDP_RSP_MGMT_BIND
, "Binding Table Response" },
353 { ZBEE_ZDP_RSP_MGMT_LEAVE
, "Leave Response" },
354 { ZBEE_ZDP_RSP_MGMT_DIRECT_JOIN
, "Direct Join Response" },
355 { ZBEE_ZDP_RSP_MGMT_PERMIT_JOIN
, "Permit Join Response" },
356 { ZBEE_ZDP_RSP_MGMT_CACHE
, "Cache Response" },
357 { ZBEE_ZDP_NOT_MGMT_NWKUPDATE
, "Network Update Notify" },
358 { ZBEE_ZDP_NOT_MGMT_NWKUPDATE_ENH
, "Network Enhanced Update Notify" },
359 { ZBEE_ZDP_RSP_MGMT_IEEE_JOIN_LIST
, "IEEE Joining List Response" },
360 { ZBEE_ZDP_NOT_MGMT_UNSOLICITED_NWKUPDATE
, "Unsolicited Enhanced Network Update Notify" },
361 { ZBEE_ZDP_RSP_MGMT_NWK_BEACON_SURVEY
, "Beacon Survey Response"},
362 { ZBEE_ZDP_RSP_SECURITY_START_KEY_NEGOTIATION
,"Security Start Key Negotiation Response" },
363 { ZBEE_ZDP_RSP_SECURITY_GET_AUTH_TOKEN
, "Security Get Authentication Token Response"},
364 { ZBEE_ZDP_RSP_SECURITY_GET_AUTH_LEVEL
, "Security Get Authentication Level Response"},
365 { ZBEE_ZDP_RSP_SECURITY_SET_CONFIGURATION
, "Security Set Configuration Response"},
366 { ZBEE_ZDP_RSP_SECURITY_GET_CONFIGURATION
, "Security Get Configuration Response"},
367 { ZBEE_ZDP_RSP_SECURITY_START_KEY_UPDATE
, "Security Start Key Update Response"},
368 { ZBEE_ZDP_RSP_SECURITY_DECOMMISSION
, "Security Decommission Response"},
369 { ZBEE_ZDP_RSP_SECURITY_CHALLENGE
, "Security Challenge Response"},
373 static const value_string zbee_zdp_status_names
[] = {
374 { ZBEE_ZDP_STATUS_SUCCESS
, "Success" },
375 { ZBEE_ZDP_STATUS_INV_REQUESTTYPE
, "Invalid Request Type" },
376 { ZBEE_ZDP_STATUS_DEVICE_NOT_FOUND
, "Device Not Found" },
377 { ZBEE_ZDP_STATUS_INVALID_EP
, "Invalid Endpoint" },
378 { ZBEE_ZDP_STATUS_NOT_ACTIVE
, "Not Active" },
379 { ZBEE_ZDP_STATUS_NOT_SUPPORTED
, "Not Supported" },
380 { ZBEE_ZDP_STATUS_TIMEOUT
, "Timeout" },
381 { ZBEE_ZDP_STATUS_NO_MATCH
, "No Match" },
382 { ZBEE_ZDP_STATUS_NO_ENTRY
, "No Entry" },
383 { ZBEE_ZDP_STATUS_NO_DESCRIPTOR
, "No Descriptor" },
384 { ZBEE_ZDP_STATUS_INSUFFICIENT_SPACE
, "Insufficient Space" },
385 { ZBEE_ZDP_STATUS_NOT_PERMITTED
, "Not Permitted" },
386 { ZBEE_ZDP_STATUS_TABLE_FULL
, "Table Full" },
387 { ZBEE_ZDP_STATUS_NOT_AUTHORIZED
, "Not Authorized" },
388 { ZBEE_ZDP_STATUS_DEVICE_BINDING_TABLE_FULL
, "Device Binding Table Full" },
389 { ZBEE_ZDP_STATUS_INVALID_INDEX
, "Invalid Index" },
390 { ZBEE_ZDP_STATUS_RESPONSE_TOO_LARGE
, "Response Too Large" },
391 { ZBEE_ZDP_STATUS_MISSING_TLV
, "Missing TLV" },
395 static const value_string zbee_zll_device_names
[] = {
396 { ZBEE_ZLL_DEVICE_ON_OFF_LIGHT
, "On/Off light" },
397 { ZBEE_ZLL_DEVICE_ON_OFF_PLUG_IN_UNIT
, "On/Off plug-in unit" },
398 { ZBEE_ZLL_DEVICE_DIMMABLE_LIGHT
, "Dimmable light" },
399 { ZBEE_ZLL_DEVICE_DIMMABLE_PLUG_IN_UNIT
, "Dimmable plug-in unit" },
400 { ZBEE_ZLL_DEVICE_COLOR_LIGHT
, "Color light" },
401 { ZBEE_ZLL_DEVICE_EXTENDED_COLOR_LIGHT
, "Extended color light" },
402 { ZBEE_ZLL_DEVICE_COLOR_TEMPERATURE_LIGHT
, "Color temperature light" },
403 { ZBEE_ZLL_DEVICE_COLOR_CONTROLLER
, "Color controller" },
404 { ZBEE_ZLL_DEVICE_COLOR_SCENE_CONTROLLER
, "Color scene controller" },
405 { ZBEE_ZLL_DEVICE_NON_COLOR_CONTROLLER
, "Non-color controller" },
406 { ZBEE_ZLL_DEVICE_NON_COLOR_SCENE_CONTROLLER
, "Non-color scene controller" },
407 { ZBEE_ZLL_DEVICE_CONTROL_BRIDGE
, "Control Bridge" },
408 { ZBEE_ZLL_DEVICE_ON_OFF_SENSOR
, "On/Off sensor" },
412 static const value_string zbee_ha_device_names
[] = {
413 { ZBEE_HA_DEVICE_ON_OFF_LIGHT
, "On/Off light" },
414 { ZBEE_HA_DEVICE_DIMMABLE_LIGHT
, "Dimmable light" },
415 { ZBEE_HA_DEVICE_COLOR_DIMMABLE_LIGHT
, "Color dimmable light" },
416 { ZBEE_HA_DEVICE_ON_OFF_LIGHT_SWITCH
, "On/Off light switch" },
417 { ZBEE_HA_DEVICE_DIMMER_SWITCH
, "Dimmer switch" },
418 { ZBEE_HA_DEVICE_COLOR_DIMMER_SWITCH
, "Color dimmer switch" },
419 { ZBEE_HA_DEVICE_LIGHT_SENSOR
, "Light sensor" },
420 { ZBEE_HA_DEVICE_OCCUPANCY_SENSOR
, "Occupancy sensor" },
421 { ZBEE_HA_DEVICE_ON_OFF_BALLAST
, "On/Off ballast" },
422 { ZBEE_HA_DEVICE_DIMMABLE_BALLAST
, "Dimmable ballast" },
423 { ZBEE_HA_DEVICE_ON_OFF_PLUG_IN_UNIT
, "On/Off plug-in unit" },
424 { ZBEE_HA_DEVICE_DIMMABLE_PLUG_IN_UNIT
, "Dimmable plug-in unit" },
425 { ZBEE_HA_DEVICE_COLOR_TEMPERATURE_LIGHT
, "Color temperature light" },
426 { ZBEE_HA_DEVICE_EXTENDED_COLOR_LIGHT
, "Extended color light" },
427 { ZBEE_HA_DEVICE_LIGHT_LEVEL_SENSOR
, "Light level sensor" },
428 { ZBEE_HA_DEVICE_COLOR_CONTROLLER
, "Color controller" },
429 { ZBEE_HA_DEVICE_COLOR_SCENE_CONTROLLER
, "Color scene controller" },
430 { ZBEE_HA_DEVICE_NON_COLOR_CONTROLLER
, "Non-color controller" },
431 { ZBEE_HA_DEVICE_NON_COLOR_SCENE_CONTROLLER
, "Non-color scene controller" },
432 { ZBEE_HA_DEVICE_CONTROL_BRIDGE
, "Control Bridge" },
433 { ZBEE_HA_DEVICE_ON_OFF_SENSOR
, "On/Off sensor" },
437 const value_string zbee_zdp_rtg_status_vals
[] = {
439 { 0x01, "Discovery Underway" },
440 { 0x02, "Discovery Failed" },
441 { 0x03, "Inactive" },
445 static const value_string zbee_zdp_ieee_join_policy_vals
[] = {
446 { 0x00, "All Join" },
447 { 0x01, "IEEE Join" },
452 /* The reason this has it's own value_string and doesn't use
453 tfs_get_string(), is that some hf_ fields use bitmasks larger
454 than 0x01, and it's intentional that those other values be
455 "Unknown" (which is what value_string will give us)
457 static const value_string zbee_zdp_true_false_plus_vals
[] = {
463 static const value_string zbee_zdp_table_entry_type_vals
[] = {
464 { 0x00, "Coordinator" },
466 { 0x02, "End Device" },
470 static const value_string zbee_zdp_relationship_vals
[] = {
475 { 0x04, "Previous Child" },
479 static const range_string zbee_zcl_zdp_address_modes
[] = {
480 { 0x0, 0x0, "Reserved" },
481 { ZBEE_ZDP_ADDR_MODE_GROUP
, ZBEE_ZDP_ADDR_MODE_GROUP
, "Group" },
482 { 0x02, 0x02, "Reserved" },
483 { ZBEE_ZDP_ADDR_MODE_UNICAST
, ZBEE_ZDP_ADDR_MODE_UNICAST
, "Unicast" },
484 { 0x03, 0xFF, "Reserved" },
490 if (type == 0x00) proto_item_append_text(ti, ", Type: Coordinator");
491 else if (type == 0x01) proto_item_append_text(ti, ", Type: Router");
492 else if (type == 0x02) proto_item_append_text(ti, ", Type: End Device");
493 else proto_item_append_text(ti, ", Type: Unknown");
495 if (idle_rx == 0x00) proto_item_append_text(ti, ", Idle Rx: False");
496 else if (idle_rx==0x01) proto_item_append_text(ti, ", Idle Rx: True");
497 else proto_item_append_text(ti, ", Idle Rx: Unknown");
499 if (rel == 0x00) proto_item_append_text(ti, ", Relationship: Parent");
500 else if (rel == 0x01) proto_item_append_text(ti, ", Relationship: Child");
501 else if (rel == 0x02) proto_item_append_text(ti, ", Relationship: Sibling");
502 else if (rel == 0x03) proto_item_append_text(ti, ", Relationship: None");
503 else if (rel == 0x04) proto_item_append_text(ti, ", Relationship: Previous Child");
504 else proto_item_append_text(ti, ", Relationship: Unknown");
509 *Returns a status name for a given status value.
513 zdp_status_name(uint8_t status
)
515 return val_to_str_const(status
, zbee_zdp_status_names
, "Reserved");
516 } /* zdp_status_name */
519 *Converts a ZigBee 2003 & earlier cluster ID to a 2006
523 zdp_convert_2003cluster(uint8_t cluster
)
525 uint16_t cluster16
= (uint16_t)cluster
;
527 if (cluster16
& ZBEE_ZDP_MSG_RESPONSE_BIT_2003
) {
528 /* Clear the 2003 request bit. */
529 cluster16
&= ~(ZBEE_ZDP_MSG_RESPONSE_BIT_2003
);
530 /* Set the 2006 request bit. */
531 cluster16
|= (ZBEE_ZDP_MSG_RESPONSE_BIT
);
534 } /* zdp_convert_2003cluster */
537 *Helper functions dumps any excess data into the data dissector.
539 *@param tvb pointer to buffer containing raw packet.
540 *@param offset offset after parsing last item.
541 *@param pinfo packet information structure.
542 *@param tree pointer to data tree Wireshark uses to display packet.
545 zdp_dump_excess(tvbuff_t
*tvb
, unsigned offset
, packet_info
*pinfo
, proto_tree
*tree
)
547 proto_tree
*root
= proto_tree_get_root(tree
);
548 unsigned length
= tvb_captured_length_remaining(tvb
, offset
);
552 excess
= tvb_new_subset_remaining(tvb
, offset
);
553 call_data_dissector(excess
, pinfo
, root
);
555 } /* zdp_dump_excess */
558 *ZigBee helper function. Appends the info to the info column
560 *@param item item to display info on.
561 *@param pinfo packet info struct.
562 *@param format format string.
565 zbee_append_info(proto_item
*item
, packet_info
*pinfo
, const char *format
, ...)
567 static char buffer
[512];
570 va_start(ap
, format
);
571 vsnprintf(buffer
, 512, format
, ap
);
574 proto_item_append_text(item
, "%s", buffer
);
576 col_append_str(pinfo
->cinfo
, COL_INFO
, buffer
);
577 } /* zbee_add_info */
580 *ZigBee helper function. extracts an EUI64 address and displays
582 *@param tree pointer to data tree Wireshark uses to display packet.
583 *@param hfindex index to field information.
584 *@param tvb pointer to buffer containing raw packet.
585 *@param offset pointer to value of offset.
586 *@param length length of the value to extract.
587 *@param ti optional pointer to get the created proto item.
588 *@return the value read out of the tvbuff and added to the tree.
591 zbee_parse_eui64(proto_tree
*tree
, int hfindex
, tvbuff_t
*tvb
, unsigned *offset
, unsigned length
, proto_item
**ti
)
593 proto_item
*item
= NULL
;
597 value
= tvb_get_letoh64(tvb
, *offset
);
600 item
= proto_tree_add_eui64(tree
, hfindex
, tvb
, *offset
, length
, value
);
602 /* Increment the offset. */
603 *offset
+= (int)sizeof(uint64_t);
605 /* return the item if requested. */
608 /* return the value. */
610 } /* zbee_parse_eui64 */
613 *Parses and displays the status value.
615 *@param tree pointer to data tree Wireshark uses to display packet.
616 *@param tvb pointer to buffer containing raw packet.
617 *@param offset offset into the tvb to find the status value.
620 zdp_parse_status(proto_tree
*tree
, tvbuff_t
*tvb
, unsigned *offset
)
624 /* Get and display the flags. */
625 status
= tvb_get_uint8(tvb
, *offset
);
626 proto_tree_add_uint(tree
, hf_zbee_zdp_status
, tvb
, *offset
, (int)sizeof(uint8_t), status
);
628 *offset
+= (int)sizeof(uint8_t);
631 } /* zdp_parse_status */
635 *Parses and displays the a channel mask.
637 *@param tree pointer to data tree Wireshark uses to display packet.
638 *@param tvb pointer to buffer containing raw packet.
639 *@param offset offset into the tvb to find the status value.
642 zdp_parse_chanmask(proto_tree
*tree
, tvbuff_t
*tvb
, unsigned *offset
, int hf_page
, int hf_channel
)
649 /* Get and display the channel mask. */
650 mask
= tvb_get_letohl(tvb
, *offset
);
652 page
= (uint8_t)((mask
& ZBEE_ZDP_NWKUPDATE_PAGE
) >> 27);
653 mask
&= ZBEE_ZDP_NWKUPDATE_CHANNEL
;
655 proto_tree_add_uint(tree
, hf_page
, tvb
, *offset
, 4, page
);
656 ti
= proto_tree_add_uint_format(tree
, hf_channel
, tvb
, *offset
, 4, mask
, "Channels: ");
658 /* Check if there are any channels to display. */
660 proto_item_append_text(ti
, "None");
662 /* Display the first channel #. */
663 for (i
=0; i
<32; i
++) {
665 proto_item_append_text(ti
, "%d", i
++);
669 /* Display the rest of the channels. */
671 if (!((1<<i
) & mask
)) {
672 /* This channel isn't selected. */
675 /* If the previous channel wasn't selected, then display the
678 if ( ! ((1<<(i
-1)) & mask
) ) {
679 proto_item_append_text(ti
, ", %d", i
);
682 * If the next channel is selected too, skip past it and display
683 * a range of values instead.
686 while ((2<<i
) & mask
) i
++;
687 proto_item_append_text(ti
, "-%d", i
);
691 *offset
+= (int)sizeof(uint32_t);
694 } /* zdp_parse_chanmask */
697 *Parses and displays MAC capability info flags.
699 *@param tree pointer to data tree Wireshark uses to display packet.
700 *@param ettindex subtree index to create the node descriptor in, or -1
701 *@param tvb pointer to buffer containing raw packet.
702 *@param offset offset into the tvb to find the node descriptor.
705 zdp_parse_cinfo(proto_tree
*tree
, int ettindex
, tvbuff_t
*tvb
, unsigned *offset
)
708 static int * const cinfo
[] = {
709 &hf_zbee_zdp_cinfo_alt_coord
,
710 &hf_zbee_zdp_cinfo_ffd
,
711 &hf_zbee_zdp_cinfo_power
,
712 &hf_zbee_zdp_cinfo_idle_rx
,
713 &hf_zbee_zdp_cinfo_security
,
714 &hf_zbee_zdp_cinfo_alloc
,
718 /* Get and display the flags. */
719 proto_tree_add_bitmask_with_flags(tree
, tvb
, *offset
, hf_zbee_zdp_cinfo
, ettindex
, cinfo
, ENC_NA
, BMT_NO_APPEND
);
720 flags
= tvb_get_uint8(tvb
, *offset
);
724 } /* zdp_parse_cinfo */
727 *Parses and displays server mode flags.
729 *@param tree pointer to data tree Wireshark uses to display packet.
730 *@param ettindex subtree index to create the node descriptor in, or -1
731 *@param tvb pointer to buffer containing raw packet.
732 *@param offset offset into the tvb to find the node descriptor.
735 zdp_parse_server_flags(proto_tree
*tree
, int ettindex
, tvbuff_t
*tvb
, unsigned *offset
)
738 static int * const server_flags
[] = {
739 &hf_zbee_zdp_server_pri_trust
,
740 &hf_zbee_zdp_server_bak_trust
,
741 &hf_zbee_zdp_server_pri_bind
,
742 &hf_zbee_zdp_server_bak_bind
,
743 &hf_zbee_zdp_server_pri_disc
,
744 &hf_zbee_zdp_server_bak_disc
,
745 &hf_zbee_zdp_server_network_manager
,
746 &hf_zbee_zdp_server_stk_compl_rev
,
750 /* Get and display the flags. */
751 flags
= tvb_get_letohs(tvb
, *offset
);
752 proto_tree_add_bitmask_with_flags(tree
, tvb
, *offset
, hf_zbee_zdp_server
, ettindex
, server_flags
, ENC_LITTLE_ENDIAN
, BMT_NO_APPEND
);
756 } /* zdp_parse_server_flags */
759 *Parses and displays a node descriptor to the specified
761 *@param tree pointer to data tree Wireshark uses to display packet.
762 *@param ettindex subtree index to create the node descriptor in, or -1
763 *@param tvb pointer to buffer containing raw packet.
764 *@param offset offset into the tvb to find the node descriptor.
767 zdp_parse_node_desc(proto_tree
*tree
, packet_info
*pinfo
, bool show_ver_flags
, int ettindex
, tvbuff_t
*tvb
, unsigned *offset
, uint8_t version
)
770 proto_item
*field_root
= NULL
;
771 proto_tree
*field_tree
= NULL
;
774 /*uint8_t capability;*/
775 /*uint16_t mfr_code;*/
776 /*uint8_t max_buff;*/
777 /*uint16_t max_transfer;*/
778 static int * const nodes
[] = {
779 &hf_zbee_zdp_node_complex
,
780 &hf_zbee_zdp_node_user
,
781 &hf_zbee_zdp_node_frag_support
,
782 &hf_zbee_zdp_node_freq_868
,
783 &hf_zbee_zdp_node_freq_900
,
784 &hf_zbee_zdp_node_freq_2400
,
785 &hf_zbee_zdp_node_freq_eu_sub_ghz
,
789 if ((tree
) && (ettindex
!= -1)) {
790 field_tree
= proto_tree_add_subtree(tree
, tvb
, *offset
, -1, ettindex
, &field_root
, "Node Descriptor");
795 /* Get and display the flags. */
796 flags
= tvb_get_letohs(tvb
, *offset
);
798 uint16_t type
= flags
& ZBEE_ZDP_NODE_TYPE
;
799 ti
= proto_tree_add_uint(field_tree
, hf_zbee_zdp_node_type
, tvb
, *offset
, 2, type
);
800 /* XXX - should probably be converted to proto_tree_add_bitmask */
801 proto_tree_add_bitmask_list(field_tree
, tvb
, *offset
, 2, nodes
, ENC_LITTLE_ENDIAN
);
803 /* Enumerate the type field. */
804 if (type
== ZBEE_ZDP_NODE_TYPE_COORD
) proto_item_append_text(ti
, " (Coordinator)");
805 else if (type
== ZBEE_ZDP_NODE_TYPE_FFD
) proto_item_append_text(ti
, " (Router)");
806 else if (type
== ZBEE_ZDP_NODE_TYPE_RFD
) proto_item_append_text(ti
, " (End Device)");
807 else proto_item_append_text(ti
, " (Reserved)");
811 /* Get and display the capability flags. */
812 /*capability =*/ zdp_parse_cinfo(field_tree
, ett_zbee_zdp_cinfo
, tvb
, offset
);
813 proto_tree_add_item(field_tree
, hf_zbee_zdp_node_manufacturer
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
815 proto_tree_add_item(field_tree
, hf_zbee_zdp_node_max_buffer
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
817 proto_tree_add_item(field_tree
, hf_zbee_zdp_node_max_incoming_transfer
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
820 /* Get and display the server flags. */
821 if (version
>= ZBEE_VERSION_2007
) {
823 static int * const descriptors
[] = {
824 &hf_zbee_zdp_dcf_eaela
,
825 &hf_zbee_zdp_dcf_esdla
,
829 ver_flags
= zdp_parse_server_flags(field_tree
, ett_zbee_zdp_server
, tvb
, offset
) & ZBEE_ZDP_NODE_SERVER_STACK_COMPL_REV
;
830 if (show_ver_flags
&& ver_flags
) {
831 zbee_append_info(tree
, pinfo
, ", Rev: %d",
832 (ver_flags
>> ws_ctz(ZBEE_ZDP_NODE_SERVER_STACK_COMPL_REV
)));
834 proto_tree_add_item(field_tree
, hf_zbee_zdp_node_max_outgoing_transfer
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
836 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
);
840 /* Correct the length of the subtree. */
841 if (tree
&& (ettindex
!= -1)) {
842 proto_item_set_len(field_root
, *offset
);
845 } /* zdp_parse_node_desc */
848 static const value_string zbee_zdp_power_mode_vals
[] = {
849 { ZBEE_ZDP_POWER_MODE_RX_ON
, "Receiver Always On" },
850 { ZBEE_ZDP_POWER_MODE_RX_PERIODIC
, "Receiver Periodically On" },
851 { ZBEE_ZDP_POWER_MODE_RX_STIMULATE
, "Receiver On When Stimulated" },
856 static const value_string zbee_zdp_power_level_vals
[] = {
857 { ZBEE_ZDP_POWER_LEVEL_FULL
, "Full" },
858 { ZBEE_ZDP_POWER_LEVEL_OK
, "OK" },
859 { ZBEE_ZDP_POWER_LEVEL_LOW
, "Low" },
860 { ZBEE_ZDP_POWER_LEVEL_CRITICAL
, "Critical" },
865 *Parses and displays a node descriptor to the specified
867 *@param tree pointer to data tree Wireshark uses to display packet.
868 *@param ettindex subtree index to create the node descriptor in, or -1
869 *@param tvb pointer to buffer containing raw packet.
870 *@param offset offset into the tvb to find the node descriptor.
873 zdp_parse_power_desc(proto_tree
*tree
, int ettindex
, tvbuff_t
*tvb
, unsigned *offset
)
875 static int * const power_desc
[] = {
876 &hf_zbee_zdp_power_mode
,
877 &hf_zbee_zdp_power_avail_ac
,
878 &hf_zbee_zdp_power_avail_recharge
,
879 &hf_zbee_zdp_power_avail_dispose
,
880 &hf_zbee_zdp_power_source_ac
,
881 &hf_zbee_zdp_power_source_recharge
,
882 &hf_zbee_zdp_power_source_dispose
,
883 &hf_zbee_zdp_power_level
,
887 proto_tree_add_bitmask_with_flags(tree
, tvb
, *offset
, hf_zbee_zdp_power
, ettindex
, power_desc
, ENC_LITTLE_ENDIAN
, BMT_NO_APPEND
);
889 } /* zdp_parse_power_desc */
892 *Parses and displays a simple descriptor to the specified
894 *@param tree pointer to data tree Wireshark uses to display packet.
895 *@param ettindex subtree index to create the node descriptor in, or -1
896 *@param tvb pointer to buffer containing raw packet.
897 *@param offset offset into the tvb to find the node descriptor.
900 zdp_parse_simple_desc(proto_tree
*tree
, int ettindex
, tvbuff_t
*tvb
, unsigned *offset
, uint8_t version
)
902 proto_item
*field_root
= NULL
;
903 proto_tree
*field_tree
= NULL
, *cluster_tree
= NULL
;
904 unsigned i
, sizeof_cluster
;
908 uint32_t in_count
, out_count
;
910 if ((tree
) && (ettindex
!= -1)) {
911 field_tree
= proto_tree_add_subtree(tree
, tvb
, *offset
, -1, ettindex
, &field_root
, "Simple Descriptor");
913 else field_tree
= tree
;
915 proto_tree_add_item(field_tree
, hf_zbee_zdp_endpoint
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
918 proto_tree_add_item_ret_uint(field_tree
, hf_zbee_zdp_profile
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
, &profile
);
923 case ZBEE_PROFILE_ZLL
: hf_app_device
= hf_zbee_zdp_simple_zll_app_device
; break;
924 case ZBEE_PROFILE_HA
: hf_app_device
= hf_zbee_zdp_simple_ha_app_device
; break;
925 default: hf_app_device
= hf_zbee_zdp_simple_app_device
; break;
927 proto_tree_add_item(field_tree
, hf_app_device
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
930 proto_tree_add_item(field_tree
, hf_zbee_zdp_simple_app_version
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
933 sizeof_cluster
= (version
>= ZBEE_VERSION_2007
)?(int)sizeof(uint16_t):(int)sizeof(uint8_t);
935 proto_tree_add_item_ret_uint(field_tree
, hf_zbee_zdp_in_count
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
, &in_count
);
938 if ((tree
) && (in_count
)) {
939 cluster_tree
= proto_tree_add_subtree(field_tree
, tvb
, *offset
, in_count
*sizeof_cluster
,
940 ett_zbee_zdp_node_in
, NULL
, "Input Cluster List");
942 for (i
=0; i
<in_count
&& tvb_bytes_exist(tvb
, *offset
, sizeof_cluster
); i
++) {
943 proto_tree_add_item(cluster_tree
, hf_zbee_zdp_in_cluster
, tvb
, *offset
, sizeof_cluster
, ENC_LITTLE_ENDIAN
);
944 *offset
+= sizeof_cluster
;
947 proto_tree_add_item_ret_uint(field_tree
, hf_zbee_zdp_out_count
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
, &out_count
);
949 if ((tree
) && (out_count
)) {
950 cluster_tree
= proto_tree_add_subtree(field_tree
, tvb
, *offset
, out_count
*sizeof_cluster
,
951 ett_zbee_zdp_node_out
, NULL
, "Output Cluster List");
953 for (i
=0; (i
<out_count
) && tvb_bytes_exist(tvb
, *offset
, sizeof_cluster
); i
++) {
954 proto_tree_add_item(cluster_tree
, hf_zbee_zdp_out_cluster
, tvb
, *offset
, sizeof_cluster
, ENC_LITTLE_ENDIAN
);
955 *offset
+= sizeof_cluster
;
958 if (tree
&& (ettindex
!= -1)) {
959 proto_item_set_len(field_root
, *offset
);
961 } /* zdp_parse_simple_desc */
964 *Parses and displays a simple descriptor to the specified
966 *@param tree pointer to data tree Wireshark uses to display packet.
967 *@param ettindex subtree index to create the node descriptor in, or -1
968 *@param tvb pointer to buffer containing raw packet.
969 *@param offset offset into the tvb to find the node descriptor.
970 *@param length length of the complex descriptor.
973 zdp_parse_complex_desc(packet_info
*pinfo
, proto_tree
*tree
, int ettindex
, tvbuff_t
*tvb
, unsigned *offset
, unsigned length
)
985 static const char *tag_name
[] = {
996 proto_tree
*field_tree
;
1001 if ((tree
) && (ettindex
!= -1)) {
1002 field_tree
= proto_tree_add_subtree(tree
, tvb
, *offset
, length
, ettindex
, NULL
, "Complex Descriptor");
1007 tag
= tvb_get_uint8(tvb
, *offset
);
1008 if (tag
== tag_charset
) {
1011 uint8_t charset
= tvb_get_uint8(tvb
, *offset
+ 3);
1012 const char *charset_str
;
1014 if (charset
== 0x00) charset_str
= "ASCII";
1015 else charset_str
= "Unknown Character Set";
1017 ch
= tvb_get_uint8(tvb
, *offset
+ 1);
1018 lang_str
[0] = format_char(pinfo
->pool
, ch
);
1019 ch
= tvb_get_uint8(tvb
, *offset
+ 2);
1020 lang_str
[1] = format_char(pinfo
->pool
, ch
);
1022 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
]);
1024 else if (tag
== tag_icon
) {
1026 complex = wmem_strdup_printf(pinfo
->pool
, "<%s>FixMe</%s>", tag_name
[tag_icon
], tag_name
[tag_icon
]);
1031 str
= (char *) tvb_get_string_enc(pinfo
->pool
, tvb
, *offset
+1, length
-1, ENC_ASCII
);
1032 /* Handles all string type XML tags. */
1033 if (tag
<= tag_icon_url
) {
1034 complex = wmem_strdup_printf(pinfo
->pool
, "<%s>%s</%s>", tag_name
[tag
], str
, tag_name
[tag
]);
1037 complex = wmem_strdup_printf(pinfo
->pool
, "<%s>%s</%s>", tag_name
[0], str
, tag_name
[0]);
1040 proto_tree_add_string(field_tree
, hf_zbee_zdp_complex
, tvb
, *offset
, length
, complex);
1041 *offset
+= (length
);
1042 } /* zdp_parse_complex_desc */
1045 *ZigBee Device Profile dissector for wireshark.
1047 *@param tvb pointer to buffer containing raw packet.
1048 *@param pinfo pointer to packet information fields
1049 *@param tree pointer to data tree Wireshark uses to display packet.
1052 dissect_zbee_zdp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
1054 proto_tree
*zdp_tree
;
1055 proto_item
*proto_root
;
1060 unsigned offset
= 0;
1061 zbee_nwk_packet
*nwk
;
1063 /* Reject the packet if data is NULL */
1066 nwk
= (zbee_nwk_packet
*)data
;
1068 /* Create the protocol tree. */
1069 proto_root
= proto_tree_add_protocol_format(tree
, proto_zbee_zdp
, tvb
, offset
, tvb_captured_length(tvb
), "ZigBee Device Profile");
1070 zdp_tree
= proto_item_add_subtree(proto_root
, ett_zbee_zdp
);
1073 /* Overwrite the protocol column */
1074 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "ZigBee ZDP");
1076 /* Get and display the sequence number. */
1077 seqno
= tvb_get_uint8(tvb
, offset
);
1078 proto_tree_add_uint(zdp_tree
, hf_zbee_zdp_seqno
, tvb
, offset
, (int)sizeof(uint8_t), seqno
);
1080 offset
+= (int)sizeof(uint8_t);
1082 if (nwk
->version
<= ZBEE_VERSION_2004
) {
1083 /* ZigBee 2004 and earlier had different cluster identifiers, need to convert
1084 * them into the ZigBee 2006 & later values. */
1085 cluster
= zdp_convert_2003cluster((uint8_t)nwk
->cluster_id
);
1088 cluster
= nwk
->cluster_id
;
1092 proto_item_append_text(zdp_tree
, ", %s", val_to_str_const(cluster
, zbee_zdp_cluster_names
, "Unknown Cluster"));
1093 col_set_str(pinfo
->cinfo
, COL_INFO
, val_to_str_const(cluster
, zbee_zdp_cluster_names
, "Unknown Cluster"));
1095 /* Create a new tvb for the zdp message. */
1096 zdp_tvb
= tvb_new_subset_remaining(tvb
, offset
);
1099 case ZBEE_ZDP_REQ_NWK_ADDR
:
1100 dissect_zbee_zdp_req_nwk_addr(zdp_tvb
, pinfo
, zdp_tree
);
1102 case ZBEE_ZDP_REQ_IEEE_ADDR
:
1103 dissect_zbee_zdp_req_ext_addr(zdp_tvb
, pinfo
, zdp_tree
);
1105 case ZBEE_ZDP_REQ_NODE_DESC
:
1106 dissect_zbee_zdp_req_node_desc(zdp_tvb
, pinfo
, zdp_tree
);
1108 case ZBEE_ZDP_REQ_POWER_DESC
:
1109 dissect_zbee_zdp_req_power_desc(zdp_tvb
, pinfo
, zdp_tree
);
1111 case ZBEE_ZDP_REQ_SIMPLE_DESC
:
1112 dissect_zbee_zdp_req_simple_desc(zdp_tvb
, pinfo
, zdp_tree
);
1114 case ZBEE_ZDP_REQ_ACTIVE_EP
:
1115 dissect_zbee_zdp_req_active_ep(zdp_tvb
, pinfo
, zdp_tree
);
1117 case ZBEE_ZDP_REQ_MATCH_DESC
:
1118 dissect_zbee_zdp_req_match_desc(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1120 case ZBEE_ZDP_REQ_COMPLEX_DESC
:
1121 dissect_zbee_zdp_req_complex_desc(zdp_tvb
, pinfo
, zdp_tree
);
1122 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1124 case ZBEE_ZDP_REQ_USER_DESC
:
1125 dissect_zbee_zdp_req_user_desc(zdp_tvb
, pinfo
, zdp_tree
);
1126 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1128 case ZBEE_ZDP_REQ_DISCOVERY_CACHE
:
1129 dissect_zbee_zdp_req_discovery_cache(zdp_tvb
, pinfo
, zdp_tree
);
1130 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1132 case ZBEE_ZDP_REQ_DEVICE_ANNCE
:
1133 dissect_zbee_zdp_device_annce(zdp_tvb
, pinfo
, zdp_tree
);
1135 case ZBEE_ZDP_REQ_SET_USER_DESC
:
1136 dissect_zbee_zdp_req_set_user_desc(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1137 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1139 case ZBEE_ZDP_REQ_SYSTEM_SERVER_DISC
:
1140 dissect_zbee_zdp_req_system_server_disc(zdp_tvb
, pinfo
, zdp_tree
);
1142 case ZBEE_ZDP_REQ_STORE_DISCOVERY
:
1143 dissect_zbee_zdp_req_store_discovery(zdp_tvb
, pinfo
, zdp_tree
);
1144 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1146 case ZBEE_ZDP_REQ_STORE_NODE_DESC
:
1147 dissect_zbee_zdp_req_store_node_desc(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1148 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1150 case ZBEE_ZDP_REQ_STORE_POWER_DESC
:
1151 dissect_zbee_zdp_req_store_power_desc(zdp_tvb
, pinfo
, zdp_tree
);
1152 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1154 case ZBEE_ZDP_REQ_STORE_ACTIVE_EP
:
1155 dissect_zbee_zdp_req_store_active_ep(zdp_tvb
, pinfo
, zdp_tree
);
1156 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1158 case ZBEE_ZDP_REQ_STORE_SIMPLE_DESC
:
1159 dissect_zbee_zdp_req_store_simple_desc(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1160 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1162 case ZBEE_ZDP_REQ_REMOVE_NODE_CACHE
:
1163 dissect_zbee_zdp_req_remove_node_cache(zdp_tvb
, pinfo
, zdp_tree
);
1164 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1166 case ZBEE_ZDP_REQ_FIND_NODE_CACHE
:
1167 dissect_zbee_zdp_req_find_node_cache(zdp_tvb
, pinfo
, zdp_tree
);
1168 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1170 case ZBEE_ZDP_REQ_EXT_SIMPLE_DESC
:
1171 dissect_zbee_zdp_req_ext_simple_desc(zdp_tvb
, pinfo
, zdp_tree
);
1172 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1174 case ZBEE_ZDP_REQ_EXT_ACTIVE_EP
:
1175 dissect_zbee_zdp_req_ext_active_ep(zdp_tvb
, pinfo
, zdp_tree
);
1176 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1178 case ZBEE_ZDP_REQ_PARENT_ANNCE
:
1179 dissect_zbee_zdp_parent_annce(zdp_tvb
, pinfo
, zdp_tree
);
1181 case ZBEE_ZDP_REQ_END_DEVICE_BIND
:
1182 dissect_zbee_zdp_req_end_device_bind(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1183 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1185 case ZBEE_ZDP_REQ_BIND
:
1186 dissect_zbee_zdp_req_bind(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1188 case ZBEE_ZDP_REQ_UNBIND
:
1189 dissect_zbee_zdp_req_unbind(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1191 case ZBEE_ZDP_REQ_BIND_REGISTER
:
1192 dissect_zbee_zdp_req_bind_register(zdp_tvb
, pinfo
, zdp_tree
);
1193 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1195 case ZBEE_ZDP_REQ_REPLACE_DEVICE
:
1196 dissect_zbee_zdp_req_replace_device(zdp_tvb
, pinfo
, zdp_tree
);
1197 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1199 case ZBEE_ZDP_REQ_STORE_BAK_BIND_ENTRY
:
1200 dissect_zbee_zdp_req_store_bak_bind_entry(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1201 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1203 case ZBEE_ZDP_REQ_REMOVE_BAK_BIND_ENTRY
:
1204 dissect_zbee_zdp_req_remove_bak_bind_entry(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1205 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1207 case ZBEE_ZDP_REQ_BACKUP_BIND_TABLE
:
1208 dissect_zbee_zdp_req_backup_bind_table(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1209 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1211 case ZBEE_ZDP_REQ_RECOVER_BIND_TABLE
:
1212 dissect_zbee_zdp_req_recover_bind_table(zdp_tvb
, pinfo
, zdp_tree
);
1213 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1215 case ZBEE_ZDP_REQ_BACKUP_SOURCE_BIND
:
1216 dissect_zbee_zdp_req_backup_source_bind(zdp_tvb
, pinfo
, zdp_tree
);
1217 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1219 case ZBEE_ZDP_REQ_RECOVER_SOURCE_BIND
:
1220 dissect_zbee_zdp_req_recover_source_bind(zdp_tvb
, pinfo
, zdp_tree
);
1221 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1223 case ZBEE_ZDP_REQ_CLEAR_ALL_BINDINGS
:
1224 dissect_zbee_zdp_req_clear_all_bindings(zdp_tvb
, pinfo
, zdp_tree
);
1226 case ZBEE_ZDP_REQ_MGMT_NWK_DISC
:
1227 dissect_zbee_zdp_req_mgmt_nwk_disc(zdp_tvb
, pinfo
, zdp_tree
, hf_zbee_zdp_scan_channel
);
1229 case ZBEE_ZDP_REQ_MGMT_LQI
:
1230 dissect_zbee_zdp_req_mgmt_lqi(zdp_tvb
, pinfo
, zdp_tree
);
1232 case ZBEE_ZDP_REQ_MGMT_RTG
:
1233 dissect_zbee_zdp_req_mgmt_rtg(zdp_tvb
, pinfo
, zdp_tree
);
1235 case ZBEE_ZDP_REQ_MGMT_BIND
:
1236 dissect_zbee_zdp_req_mgmt_bind(zdp_tvb
, pinfo
, zdp_tree
);
1238 case ZBEE_ZDP_REQ_MGMT_LEAVE
:
1239 dissect_zbee_zdp_req_mgmt_leave(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1241 case ZBEE_ZDP_REQ_MGMT_DIRECT_JOIN
:
1242 dissect_zbee_zdp_req_mgmt_direct_join(zdp_tvb
, pinfo
, zdp_tree
);
1243 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1245 case ZBEE_ZDP_REQ_MGMT_PERMIT_JOIN
:
1246 dissect_zbee_zdp_req_mgmt_permit_join(zdp_tvb
, pinfo
, zdp_tree
);
1248 case ZBEE_ZDP_REQ_MGMT_CACHE
:
1249 dissect_zbee_zdp_req_mgmt_cache(zdp_tvb
, pinfo
, zdp_tree
);
1250 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1252 case ZBEE_ZDP_REQ_MGMT_NWKUPDATE
:
1253 dissect_zbee_zdp_req_mgmt_nwkupdate(zdp_tvb
, pinfo
, zdp_tree
);
1255 case ZBEE_ZDP_REQ_MGMT_NWKUPDATE_ENH
:
1256 dissect_zbee_zdp_req_mgmt_nwkupdate_enh(zdp_tvb
, pinfo
, zdp_tree
);
1258 case ZBEE_ZDP_REQ_MGMT_IEEE_JOIN_LIST
:
1259 dissect_zbee_zdp_req_mgmt_ieee_join_list(zdp_tvb
, pinfo
, zdp_tree
);
1261 case ZBEE_ZDP_REQ_MGMT_NWK_BEACON_SURVEY
:
1262 dissect_zbee_zdp_req_mgmt_nwk_beacon_survey(zdp_tvb
, pinfo
, zdp_tree
);
1264 case ZBEE_ZDP_REQ_SECURITY_START_KEY_NEGOTIATION
:
1265 dissect_zbee_zdp_req_security_start_key_negotiation(zdp_tvb
, pinfo
, zdp_tree
);
1267 case ZBEE_ZDP_REQ_SECURITY_GET_AUTH_TOKEN
:
1268 dissect_zbee_zdp_req_security_get_auth_token(zdp_tvb
, pinfo
, zdp_tree
);
1270 case ZBEE_ZDP_REQ_SECURITY_GET_AUTH_LEVEL
:
1271 dissect_zbee_zdp_req_security_get_auth_level(zdp_tvb
, pinfo
, zdp_tree
);
1273 case ZBEE_ZDP_REQ_SECURITY_SET_CONFIGURATION
:
1274 dissect_zbee_zdp_req_security_set_configuration(zdp_tvb
, pinfo
, zdp_tree
);
1276 case ZBEE_ZDP_REQ_SECURITY_GET_CONFIGURATION
:
1277 dissect_zbee_zdp_req_security_get_configuration(zdp_tvb
, pinfo
, zdp_tree
);
1279 case ZBEE_ZDP_REQ_SECURITY_START_KEY_UPDATE
:
1280 dissect_zbee_zdp_req_security_start_key_update(zdp_tvb
, pinfo
, zdp_tree
);
1282 case ZBEE_ZDP_REQ_SECURITY_DECOMMISSION
:
1283 dissect_zbee_zdp_req_security_decommission(zdp_tvb
, pinfo
, zdp_tree
);
1285 case ZBEE_ZDP_REQ_SECURITY_CHALLENGE
:
1286 dissect_zbee_zdp_req_security_challenge(zdp_tvb
, pinfo
, zdp_tree
);
1288 case ZBEE_ZDP_RSP_NWK_ADDR
:
1289 dissect_zbee_zdp_rsp_nwk_addr(zdp_tvb
, pinfo
, zdp_tree
);
1291 case ZBEE_ZDP_RSP_IEEE_ADDR
:
1292 dissect_zbee_zdp_rsp_ext_addr(zdp_tvb
, pinfo
, zdp_tree
);
1294 case ZBEE_ZDP_RSP_NODE_DESC
:
1295 dissect_zbee_zdp_rsp_node_desc(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1297 case ZBEE_ZDP_RSP_POWER_DESC
:
1298 dissect_zbee_zdp_rsp_power_desc(zdp_tvb
, pinfo
, zdp_tree
);
1300 case ZBEE_ZDP_RSP_SIMPLE_DESC
:
1301 dissect_zbee_zdp_rsp_simple_desc(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1303 case ZBEE_ZDP_RSP_ACTIVE_EP
:
1304 dissect_zbee_zdp_rsp_active_ep(zdp_tvb
, pinfo
, zdp_tree
);
1306 case ZBEE_ZDP_RSP_MATCH_DESC
:
1307 dissect_zbee_zdp_rsp_match_desc(zdp_tvb
, pinfo
, zdp_tree
);
1309 case ZBEE_ZDP_RSP_COMPLEX_DESC
:
1310 dissect_zbee_zdp_rsp_complex_desc(zdp_tvb
, pinfo
, zdp_tree
);
1311 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1313 case ZBEE_ZDP_RSP_USER_DESC
:
1314 dissect_zbee_zdp_rsp_user_desc(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1315 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1317 case ZBEE_ZDP_RSP_DISCOVERY_CACHE
:
1318 dissect_zbee_zdp_rsp_discovery_cache(zdp_tvb
, pinfo
, zdp_tree
);
1319 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1321 case ZBEE_ZDP_RSP_CONF_USER_DESC
:
1322 dissect_zbee_zdp_rsp_user_desc_conf(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1323 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1325 case ZBEE_ZDP_RSP_SYSTEM_SERVER_DISC
:
1326 dissect_zbee_zdp_rsp_system_server_disc(zdp_tvb
, pinfo
, zdp_tree
);
1328 case ZBEE_ZDP_RSP_STORE_DISCOVERY
:
1329 dissect_zbee_zdp_rsp_discovery_store(zdp_tvb
, pinfo
, zdp_tree
);
1330 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1332 case ZBEE_ZDP_RSP_STORE_NODE_DESC
:
1333 dissect_zbee_zdp_rsp_store_node_desc(zdp_tvb
, pinfo
, zdp_tree
);
1334 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1336 case ZBEE_ZDP_RSP_STORE_POWER_DESC
:
1337 dissect_zbee_zdp_rsp_store_power_desc(zdp_tvb
, pinfo
, zdp_tree
);
1338 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1340 case ZBEE_ZDP_RSP_STORE_ACTIVE_EP
:
1341 dissect_zbee_zdp_rsp_store_active_ep(zdp_tvb
, pinfo
, zdp_tree
);
1342 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1344 case ZBEE_ZDP_RSP_STORE_SIMPLE_DESC
:
1345 dissect_zbee_zdp_rsp_store_simple_desc(zdp_tvb
, pinfo
, zdp_tree
);
1346 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1348 case ZBEE_ZDP_RSP_REMOVE_NODE_CACHE
:
1349 dissect_zbee_zdp_rsp_remove_node_cache(zdp_tvb
, pinfo
, zdp_tree
);
1350 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1352 case ZBEE_ZDP_RSP_FIND_NODE_CACHE
:
1353 dissect_zbee_zdp_rsp_find_node_cache(zdp_tvb
, pinfo
, zdp_tree
);
1354 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1356 case ZBEE_ZDP_RSP_EXT_SIMPLE_DESC
:
1357 dissect_zbee_zdp_rsp_ext_simple_desc(zdp_tvb
, pinfo
, zdp_tree
);
1358 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1360 case ZBEE_ZDP_RSP_EXT_ACTIVE_EP
:
1361 dissect_zbee_zdp_rsp_ext_active_ep(zdp_tvb
, pinfo
, zdp_tree
);
1362 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1364 case ZBEE_ZDP_RSP_PARENT_ANNCE
:
1365 dissect_zbee_zdp_rsp_parent_annce(zdp_tvb
, pinfo
, zdp_tree
);
1367 case ZBEE_ZDP_RSP_END_DEVICE_BIND
:
1368 dissect_zbee_zdp_rsp_end_device_bind(zdp_tvb
, pinfo
, zdp_tree
);
1370 case ZBEE_ZDP_RSP_BIND
:
1371 dissect_zbee_zdp_rsp_bind(zdp_tvb
, pinfo
, zdp_tree
);
1373 case ZBEE_ZDP_RSP_UNBIND
:
1374 dissect_zbee_zdp_rsp_unbind(zdp_tvb
, pinfo
, zdp_tree
);
1376 case ZBEE_ZDP_RSP_BIND_REGISTER
:
1377 dissect_zbee_zdp_rsp_bind_register(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1378 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1380 case ZBEE_ZDP_RSP_REPLACE_DEVICE
:
1381 dissect_zbee_zdp_rsp_replace_device(zdp_tvb
, pinfo
, zdp_tree
);
1382 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1384 case ZBEE_ZDP_RSP_STORE_BAK_BIND_ENTRY
:
1385 dissect_zbee_zdp_rsp_store_bak_bind_entry(zdp_tvb
, pinfo
, zdp_tree
);
1386 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1388 case ZBEE_ZDP_RSP_REMOVE_BAK_BIND_ENTRY
:
1389 dissect_zbee_zdp_rsp_remove_bak_bind_entry(zdp_tvb
, pinfo
, zdp_tree
);
1390 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1392 case ZBEE_ZDP_RSP_BACKUP_BIND_TABLE
:
1393 dissect_zbee_zdp_rsp_backup_bind_table(zdp_tvb
, pinfo
, zdp_tree
);
1394 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1396 case ZBEE_ZDP_RSP_RECOVER_BIND_TABLE
:
1397 dissect_zbee_zdp_rsp_recover_bind_table(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1398 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1400 case ZBEE_ZDP_RSP_BACKUP_SOURCE_BIND
:
1401 dissect_zbee_zdp_rsp_backup_source_bind(zdp_tvb
, pinfo
, zdp_tree
);
1402 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1404 case ZBEE_ZDP_RSP_RECOVER_SOURCE_BIND
:
1405 dissect_zbee_zdp_rsp_recover_source_bind(zdp_tvb
, pinfo
, zdp_tree
);
1406 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1408 case ZBEE_ZDP_RSP_CLEAR_ALL_BINDINGS
:
1409 dissect_zbee_zdp_rsp_clear_all_bindings(zdp_tvb
, pinfo
, zdp_tree
);
1411 case ZBEE_ZDP_RSP_MGMT_NWK_DISC
:
1412 dissect_zbee_zdp_rsp_mgmt_nwk_disc(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1414 case ZBEE_ZDP_RSP_MGMT_LQI
:
1415 dissect_zbee_zdp_rsp_mgmt_lqi(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1417 case ZBEE_ZDP_RSP_MGMT_RTG
:
1418 dissect_zbee_zdp_rsp_mgmt_rtg(zdp_tvb
, pinfo
, zdp_tree
);
1420 case ZBEE_ZDP_RSP_MGMT_BIND
:
1421 dissect_zbee_zdp_rsp_mgmt_bind(zdp_tvb
, pinfo
, zdp_tree
, nwk
->version
);
1423 case ZBEE_ZDP_RSP_MGMT_LEAVE
:
1424 dissect_zbee_zdp_rsp_mgmt_leave(zdp_tvb
, pinfo
, zdp_tree
);
1426 case ZBEE_ZDP_RSP_MGMT_DIRECT_JOIN
:
1427 dissect_zbee_zdp_rsp_mgmt_direct_join(zdp_tvb
, pinfo
, zdp_tree
);
1428 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1430 case ZBEE_ZDP_RSP_MGMT_PERMIT_JOIN
:
1431 dissect_zbee_zdp_rsp_mgmt_permit_join(zdp_tvb
, pinfo
, zdp_tree
);
1433 case ZBEE_ZDP_RSP_MGMT_CACHE
:
1434 dissect_zbee_zdp_rsp_mgmt_cache(zdp_tvb
, pinfo
, zdp_tree
);
1435 expert_add_info(pinfo
, zdp_tree
, &ei_deprecated_command
);
1437 case ZBEE_ZDP_NOT_MGMT_NWKUPDATE
:
1438 case ZBEE_ZDP_NOT_MGMT_NWKUPDATE_ENH
:
1439 dissect_zbee_zdp_not_mgmt_nwkupdate(zdp_tvb
, pinfo
, zdp_tree
);
1441 case ZBEE_ZDP_RSP_MGMT_IEEE_JOIN_LIST
:
1442 dissect_zbee_zdp_rsp_mgmt_ieee_join_list(zdp_tvb
, pinfo
, zdp_tree
);
1444 case ZBEE_ZDP_NOT_MGMT_UNSOLICITED_NWKUPDATE
:
1445 dissect_zbee_zdp_not_mgmt_unsolicited_nwkupdate(zdp_tvb
, pinfo
, zdp_tree
);
1447 case ZBEE_ZDP_RSP_MGMT_NWK_BEACON_SURVEY
:
1448 dissect_zbee_zdp_rsp_mgmt_nwk_beacon_survey(zdp_tvb
, pinfo
, zdp_tree
);
1450 case ZBEE_ZDP_RSP_SECURITY_START_KEY_NEGOTIATION
:
1451 dissect_zbee_zdp_rsp_security_start_key_negotiation(zdp_tvb
, pinfo
, zdp_tree
);
1453 case ZBEE_ZDP_RSP_SECURITY_GET_AUTH_TOKEN
:
1454 dissect_zbee_zdp_rsp_security_get_auth_token(zdp_tvb
, pinfo
, zdp_tree
);
1456 case ZBEE_ZDP_RSP_SECURITY_GET_AUTH_LEVEL
:
1457 dissect_zbee_zdp_rsp_security_get_auth_level(zdp_tvb
, pinfo
, zdp_tree
);
1459 case ZBEE_ZDP_RSP_SECURITY_SET_CONFIGURATION
:
1460 dissect_zbee_zdp_rsp_security_set_configuration(zdp_tvb
, pinfo
, zdp_tree
);
1462 case ZBEE_ZDP_RSP_SECURITY_GET_CONFIGURATION
:
1463 dissect_zbee_zdp_rsp_security_get_configuration(zdp_tvb
, pinfo
, zdp_tree
);
1465 case ZBEE_ZDP_RSP_SECURITY_START_KEY_UPDATE
:
1466 dissect_zbee_zdp_rsp_security_start_key_update(zdp_tvb
, pinfo
, zdp_tree
);
1468 case ZBEE_ZDP_RSP_SECURITY_DECOMMISSION
:
1469 dissect_zbee_zdp_rsp_security_decommission(zdp_tvb
, pinfo
, zdp_tree
);
1471 case ZBEE_ZDP_RSP_SECURITY_CHALLENGE
:
1472 dissect_zbee_zdp_rsp_security_challenge(zdp_tvb
, pinfo
, zdp_tree
);
1475 /* Invalid Cluster Identifier. */
1476 call_data_dissector(zdp_tvb
, pinfo
, tree
);
1480 return tvb_captured_length(tvb
);
1481 } /* dissect_zbee_zdp */
1484 *ZigBee Device Profile protocol registration routine.
1487 void proto_register_zbee_zdp(void)
1489 static hf_register_info hf
[] = {
1490 { &hf_zbee_zdp_seqno
,
1491 { "Sequence Number", "zbee_zdp.seqno", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1495 { &hf_zbee_zdp_length
,
1496 { "Length", "zbee_zdp.length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1500 { &hf_zbee_zdp_ext_addr
,
1501 { "Extended Address", "zbee_zdp.ext_addr", FT_EUI64
, BASE_NONE
, NULL
, 0x0,
1504 { &hf_zbee_zdp_nwk_addr
,
1505 { "Nwk Addr of Interest", "zbee_zdp.nwk_addr", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1508 { &hf_zbee_zdp_req_type
,
1509 { "Request Type", "zbee_zdp.req_type", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_req_types
), 0x0,
1512 { &hf_zbee_zdp_index
,
1513 { "Index", "zbee_zdp.index", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1516 { &hf_zbee_zdp_status
,
1517 { "Status", "zbee_zdp.status", FT_UINT8
, BASE_HEX
, VALS(zbee_zdp_status_names
), 0x0,
1520 { &hf_zbee_zdp_endpoint
,
1521 { "Endpoint", "zbee_zdp.endpoint", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1524 { &hf_zbee_zdp_ep_count
,
1525 { "Endpoint Count", "zbee_zdp.ep_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1528 { &hf_zbee_zdp_profile
,
1529 { "Profile", "zbee_zdp.profile", FT_UINT16
, BASE_HEX
| BASE_RANGE_STRING
, RVALS(zbee_aps_apid_names
), 0x0,
1532 { &hf_zbee_zdp_addr_mode
,
1533 { "Address Mode", "zbee_zdp.addr_mode", FT_UINT8
, BASE_DEC
| BASE_RANGE_STRING
, RVALS(zbee_zcl_zdp_address_modes
), 0x0,
1536 { &hf_zbee_zdp_cluster
,
1537 { "Cluster", "zbee_zdp.cluster", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1540 { &hf_zbee_zdp_table_size
,
1541 { "Table Size", "zbee_zdp.table_size", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1542 "Number of entries in the table.", HFILL
}},
1544 { &hf_zbee_zdp_table_count
,
1545 { "Table Count", "zbee_zdp.table_count", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1546 "Number of table entries included in this message.", HFILL
}},
1548 { &hf_zbee_zdp_cache_address
,
1549 { "Cache Address", "zbee_zdp.cache_address", FT_EUI64
, BASE_NONE
, NULL
, 0x0,
1552 { &hf_zbee_zdp_in_count
,
1553 { "Input Cluster Count", "zbee_zdp.in_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1556 { &hf_zbee_zdp_out_count
,
1557 { "Output Cluster Count", "zbee_zdp.out_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1560 { &hf_zbee_zdp_in_cluster
,
1561 { "Input Cluster", "zbee_zdp.in_cluster", FT_UINT16
, BASE_HEX
| BASE_RANGE_STRING
, RVALS(zbee_aps_cid_names
), 0x0,
1564 { &hf_zbee_zdp_out_cluster
,
1565 { "Output Cluster", "zbee_zdp.out_cluster", FT_UINT16
, BASE_HEX
| BASE_RANGE_STRING
, RVALS(zbee_aps_cid_names
), 0x0,
1568 { &hf_zbee_zdp_assoc_device_count
,
1569 { "Associated Device Count", "zbee_zdp.assoc_device_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1572 { &hf_zbee_zdp_assoc_device
,
1573 { "Associated Device", "zbee_zdp.assoc_device", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1576 { &hf_zbee_zdp_cinfo
,
1577 { "Capability Information", "zbee_zdp.cinfo", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1580 { &hf_zbee_zdp_cinfo_alt_coord
,
1581 { "Alternate Coordinator", "zbee_zdp.cinfo.alt_coord", FT_BOOLEAN
, 8, NULL
, ZBEE_CINFO_ALT_COORD
,
1582 "Indicates that the device is able to operate as a PAN coordinator.", HFILL
}},
1584 { &hf_zbee_zdp_cinfo_ffd
,
1585 { "Full-Function Device", "zbee_zdp.cinfo.ffd", FT_BOOLEAN
, 8, NULL
, ZBEE_CINFO_FFD
,
1588 { &hf_zbee_zdp_cinfo_power
,
1589 { "AC Power", "zbee_zdp.cinfo.power", FT_BOOLEAN
, 8, NULL
, ZBEE_CINFO_POWER
,
1590 "Indicates this device is using AC/Mains power.", HFILL
}},
1592 { &hf_zbee_zdp_cinfo_idle_rx
,
1593 { "Rx On When Idle", "zbee_zdp.cinfo.idle_rx", FT_BOOLEAN
, 8, NULL
, ZBEE_CINFO_IDLE_RX
,
1594 "Indicates the receiver is active when the device is idle.", HFILL
}},
1596 { &hf_zbee_zdp_cinfo_security
,
1597 { "Security Capability", "zbee_zdp.cinfo.security", FT_BOOLEAN
, 8, NULL
, ZBEE_CINFO_SECURITY
,
1598 "Indicates this device is capable of performing encryption/decryption.", HFILL
}},
1600 { &hf_zbee_zdp_cinfo_alloc
,
1601 { "Allocate Short Address", "zbee_zdp.cinfo.alloc", FT_BOOLEAN
, 8, NULL
, ZBEE_CINFO_ALLOC
,
1602 "Flag requesting the parent to allocate a short address for this device.", HFILL
}},
1605 { "Descriptor Capability Field", "zbee_zdp.dcf", FT_UINT8
, BASE_HEX
, NULL
, 0,
1608 { &hf_zbee_zdp_dcf_eaela
,
1609 { "Extended Active Endpoint List Available", "zbee_zdp.dcf.eaela", FT_BOOLEAN
, 8, NULL
, ZBEE_ZDP_DCF_EAELA
,
1612 { &hf_zbee_zdp_dcf_esdla
,
1613 { "Extended Simple Descriptor List Available", "zbee_zdp.dcf.esdla", FT_BOOLEAN
, 8, NULL
, ZBEE_ZDP_DCF_ESDLA
,
1616 { &hf_zbee_zdp_server
,
1617 { "Server Flags", "zbee_zdp.server", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1620 { &hf_zbee_zdp_server_pri_trust
,
1621 { "Primary Trust Center", "zbee_zdp.server.pri_trust", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_SERVER_PRIMARY_TRUST
,
1624 { &hf_zbee_zdp_server_bak_trust
,
1625 { "Backup Trust Center", "zbee_zdp.server.bak_trust", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_SERVER_BACKUP_TRUST
,
1628 { &hf_zbee_zdp_server_pri_bind
,
1629 { "Primary Binding Table Cache","zbee_zdp.server.pri_bind", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_SERVER_PRIMARY_BIND
,
1632 { &hf_zbee_zdp_server_bak_bind
,
1633 { "Backup Binding Table Cache", "zbee_zdp.server.bak_bind", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_SERVER_BACKUP_BIND
,
1636 { &hf_zbee_zdp_server_pri_disc
,
1637 { "Primary Discovery Cache", "zbee_zdp.server.pri_disc", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_SERVER_PRIMARY_DISC
,
1640 { &hf_zbee_zdp_server_bak_disc
,
1641 { "Backup Discovery Cache", "zbee_zdp.server.bak_disc", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_SERVER_BACKUP_DISC
,
1644 { &hf_zbee_zdp_server_network_manager
,
1645 { "Network Manager", "zbee_zdp.server.nwk_mgr", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_SERVER_NETWORK_MANAGER
,
1648 { &hf_zbee_zdp_server_stk_compl_rev
,
1649 { "Stack Compliance Revision", "zbee_zdp.server.stack_compliance_revision", FT_UINT16
, BASE_DEC
, NULL
, ZBEE_ZDP_NODE_SERVER_STACK_COMPL_REV
,
1652 { &hf_zbee_zdp_node_type
,
1653 { "Type", "zbee_zdp.node.type", FT_UINT16
, BASE_DEC
, NULL
, ZBEE_ZDP_NODE_TYPE
,
1656 { &hf_zbee_zdp_node_complex
,
1657 { "Complex Descriptor", "zbee_zdp.node.complex", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_COMPLEX
,
1660 { &hf_zbee_zdp_node_user
,
1661 { "User Descriptor", "zbee_zdp.node.user", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_USER
,
1664 { &hf_zbee_zdp_node_frag_support
,
1665 { "Fragmentation Supported", "zbee_zdp.node.frag_support", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_FRAG_SUPPORT
,
1668 { &hf_zbee_zdp_node_freq_868
,
1669 { "868MHz BPSK Band", "zbee_zdp.node.freq.868mhz", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_FREQ_868MHZ
,
1672 { &hf_zbee_zdp_node_freq_900
,
1673 { "900MHz BPSK Band", "zbee_zdp.node.freq.900mhz", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_FREQ_900MHZ
,
1676 { &hf_zbee_zdp_node_freq_2400
,
1677 { "2.4GHz OQPSK Band", "zbee_zdp.node.freq.2400mhz", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_FREQ_2400MHZ
,
1680 { &hf_zbee_zdp_node_freq_eu_sub_ghz
,
1681 { "EU Sub-GHz FSK Band", "zbee_zdp.node.freq.eu_sub_ghz", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_NODE_FREQ_EU_SUB_GHZ
,
1684 { &hf_zbee_zdp_node_manufacturer
,
1685 { "Manufacturer Code", "zbee_zdp.node.manufacturer", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1688 { &hf_zbee_zdp_node_max_buffer
,
1689 { "Max Buffer Size", "zbee_zdp.node.max_buffer", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1692 { &hf_zbee_zdp_node_max_incoming_transfer
,
1693 { "Max Incoming Transfer Size", "zbee_zdp.node.max_incoming_transfer", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1696 { &hf_zbee_zdp_node_max_outgoing_transfer
,
1697 { "Max Outgoing Transfer Size", "zbee_zdp.node.max_outgoing_transfer", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1700 { &hf_zbee_zdp_power
,
1701 { "Power Descriptor", "zbee_zdp.power", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1704 { &hf_zbee_zdp_power_mode
,
1705 { "Mode", "zbee_zdp.power.mode", FT_UINT16
, BASE_DEC
, VALS(zbee_zdp_power_mode_vals
), ZBEE_ZDP_POWER_MODE
,
1708 { &hf_zbee_zdp_power_avail_ac
,
1709 { "Available AC Power", "zbee_zdp.power.avail.ac", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_POWER_AVAIL_AC
,
1712 { &hf_zbee_zdp_power_avail_recharge
,
1713 { "Available Rechargeable Battery", "zbee_zdp.power.avail.rech", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_POWER_AVAIL_RECHARGEABLE
,
1716 { &hf_zbee_zdp_power_avail_dispose
,
1717 { "Available Disposable Battery", "zbee_zdp.power.avail.disp", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_POWER_AVAIL_DISPOSABLE
,
1720 { &hf_zbee_zdp_power_source_ac
,
1721 { "Using AC Power", "zbee_zdp.power.source.ac", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_POWER_SOURCE_AC
,
1724 { &hf_zbee_zdp_power_source_recharge
,
1725 { "Using Rechargeable Battery", "zbee_zdp.power.source.recharge", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_POWER_SOURCE_RECHARGEABLE
,
1728 { &hf_zbee_zdp_power_source_dispose
,
1729 { "Using Disposable Battery", "zbee_zdp.power.source.dispose", FT_BOOLEAN
, 16, NULL
, ZBEE_ZDP_POWER_SOURCE_DISPOSABLE
,
1732 { &hf_zbee_zdp_power_level
,
1733 { "Level", "zbee_zdp.power.level", FT_UINT16
, BASE_DEC
, VALS(zbee_zdp_power_level_vals
), ZBEE_ZDP_POWER_LEVEL
,
1736 { &hf_zbee_zdp_simple_app_device
,
1737 { "Application Device", "zbee_zdp.app.device", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1740 { &hf_zbee_zdp_simple_zll_app_device
,
1741 { "Application Device", "zbee_zdp.app.device", FT_UINT16
, BASE_HEX
, VALS(zbee_zll_device_names
), 0x0,
1744 { &hf_zbee_zdp_simple_ha_app_device
,
1745 { "Application Device", "zbee_zdp.app.device", FT_UINT16
, BASE_HEX
, VALS(zbee_ha_device_names
), 0x0,
1748 { &hf_zbee_zdp_simple_app_version
,
1749 { "Application Version", "zbee_zdp.app.version", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1752 { &hf_zbee_zdp_complex_length
,
1753 { "Complex Descriptor Length", "zbee_zdp.complex_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1756 { &hf_zbee_zdp_complex
,
1757 { "Complex Descriptor", "zbee_zdp.complex", FT_STRING
, BASE_NONE
, NULL
, 0x0,
1760 { &hf_zbee_zdp_user
,
1761 { "User Descriptor", "zbee_zdp.user", FT_STRING
, BASE_NONE
, NULL
, 0x0,
1764 { &hf_zbee_zdp_user_length
,
1765 { "User Descriptor Length", "zbee_zdp.user_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1768 { &hf_zbee_zdp_simple_length
,
1769 { "Simple Descriptor Length", "zbee_zdp.simple_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1772 { &hf_zbee_zdp_disc_node_size
,
1773 { "Node Descriptor Size", "zbee_zdp.node_size", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1776 { &hf_zbee_zdp_disc_power_size
,
1777 { "Power Descriptor Size", "zbee_zdp.power_size", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1780 { &hf_zbee_zdp_cache
,
1781 { "Cache", "zbee_zdp.cache", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1782 "Address of the device containing the discovery cache.", HFILL
}},
1784 { &hf_zbee_zdp_disc_ep_count
,
1785 { "Active Endpoint Count", "zbee_zdp.ep_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1788 { &hf_zbee_zdp_disc_simple_count
,
1789 { "Simple Descriptor Count", "zbee_zdp.simple_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1792 { &hf_zbee_zdp_disc_simple_size
,
1793 { "Simple Descriptor Size", "zbee_zdp.simple_size", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1796 { &hf_zbee_zdp_target
,
1797 { "Target", "zbee_zdp.target", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1800 { &hf_zbee_zdp_replacement
,
1801 { "Replacement", "zbee_zdp.replacement", FT_EUI64
, BASE_NONE
, NULL
, 0x0,
1804 { &hf_zbee_zdp_replacement_ep
,
1805 { "Replacement Endpoint", "zbee_zdp.replacement_ep", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1808 { &hf_zbee_zdp_bind_src
,
1809 { "Source", "zbee_zdp.bind.src", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1812 { &hf_zbee_zdp_bind_src64
,
1813 { "Source", "zbee_zdp.bind.src64", FT_EUI64
, BASE_NONE
, NULL
, 0x0,
1816 { &hf_zbee_zdp_bind_src_ep
,
1817 { "Source Endpoint", "zbee_zdp.bind.src_ep", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1820 { &hf_zbee_zdp_bind_dst
,
1821 { "Destination", "zbee_zdp.bind.dst", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1824 { &hf_zbee_zdp_bind_dst64
,
1825 { "Destination", "zbee_zdp.bind.dst64", FT_EUI64
, BASE_NONE
, NULL
, 0x0,
1828 { &hf_zbee_zdp_bind_dst_ep
,
1829 { "Destination Endpoint", "zbee_zdp.bind.dst_ep", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1832 { &hf_zbee_zdp_duration
,
1833 { "Duration", "zbee_zdp.duration", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1836 { &hf_zbee_zdp_leave_children
,
1837 { "Remove Children", "zbee_zdp.leave.children", FT_BOOLEAN
, 8, NULL
, ZBEE_ZDP_MGMT_LEAVE_CHILDREN
,
1840 { &hf_zbee_zdp_leave_rejoin
,
1841 { "Rejoin", "zbee_zdp.leave.rejoin", FT_BOOLEAN
, 8, NULL
, ZBEE_ZDP_MGMT_LEAVE_REJOIN
,
1844 { &hf_zbee_zdp_significance
,
1845 { "Significance", "zbee_zdp.significance", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1848 { &hf_zbee_zdp_scan_count
,
1849 { "Scan Count", "zbee_zdp.scan_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1852 { &hf_zbee_zdp_update_id
,
1853 { "Update ID", "zbee_zdp.update_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1856 { &hf_zbee_zdp_manager
,
1857 { "Network Manager", "zbee_zdp.manager", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1860 { &hf_zbee_zdp_tx_total
,
1861 { "Total Transmissions", "zbee_zdp.tx_total", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1864 { &hf_zbee_zdp_tx_fail
,
1865 { "Failed Transmissions", "zbee_zdp.tx_fail", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1868 { &hf_zbee_zdp_tx_retries
,
1869 { "Retried Transmissions", "zbee_zdp.tx_retries", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1872 { &hf_zbee_zdp_period_time_results
,
1873 { "Period of Time For Results", "zbee_zdp.period_time_results", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1876 { &hf_zbee_zdp_channel_count
,
1877 { "Channel List Count", "zbee_zdp.channel_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1880 { &hf_zbee_zdp_channel_page_count
,
1881 { "Channel Page Count", "zbee_zdp.channel_page_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1884 { &hf_zbee_zdp_channel_page
,
1885 { "Channel Page", "zbee_zdp.channel_page", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1888 { &hf_zbee_zdp_channel_mask
,
1889 { "Channels", "zbee_zdp.channel_mask", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1892 { &hf_zbee_zdp_channel_energy
,
1893 { "Channel Energy", "zbee_zdp.channel_energy", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1896 { &hf_zbee_zdp_pan_eui64
,
1897 { "Pan", "zbee_zdp.pan.eui64", FT_EUI64
, BASE_NONE
, NULL
, 0x0,
1900 { &hf_zbee_zdp_pan_uint
,
1901 { "Pan", "zbee_zdp.pan.uint", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1904 { &hf_zbee_zdp_channel
,
1905 { "Channel", "zbee_zdp.channel", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1908 { &hf_zbee_zdp_nwk_desc_profile
,
1909 { "Profile", "zbee_zdp.profile", FT_UINT16
, BASE_HEX
, NULL
, 0x0F,
1912 { &hf_zbee_zdp_profile_version
,
1913 { "Version", "zbee_zdp.profile_version", FT_UINT8
, BASE_DEC
, NULL
, 0xF0,
1916 { &hf_zbee_zdp_beacon
,
1917 { "Beacon Order", "zbee_zdp.beacon", FT_UINT8
, BASE_DEC
, NULL
, 0x0F,
1920 { &hf_zbee_zdp_superframe
,
1921 { "Superframe Order", "zbee_zdp.superframe", FT_UINT8
, BASE_DEC
, NULL
, 0xF0,
1924 { &hf_zbee_zdp_permit_joining
,
1925 { "Permit Joining", "zbee_zdp.permit_joining", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_true_false_plus_vals
), 0x01,
1928 { &hf_zbee_zdp_permit_joining_03
,
1929 { "Permit Joining", "zbee_zdp.permit_joining", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_true_false_plus_vals
), 0x03,
1932 { &hf_zbee_zdp_extended_pan
,
1933 { "Extended Pan", "zbee_zdp.extended_pan", FT_EUI64
, BASE_NONE
, NULL
, 0x0,
1936 { &hf_zbee_zdp_addr
,
1937 { "Addr", "zbee_zdp.addr", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1940 { &hf_zbee_zdp_depth
,
1941 { "Depth", "zbee_zdp.depth", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1945 { "LQI", "zbee_zdp.lqi", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1948 { &hf_zbee_zdp_scan_channel
,
1949 { "Scan Channels", "zbee_zdp.scan_channel", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1952 { &hf_zbee_zdp_table_entry_type
,
1953 { "Type", "zbee_zdp.table_entry_type", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_table_entry_type_vals
), 0x03,
1956 { &hf_zbee_zdp_table_entry_idle_rx_0c
,
1957 { "Idle Rx", "zbee_zdp.idle_rx", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_true_false_plus_vals
), 0x0c,
1960 { &hf_zbee_zdp_table_entry_idle_rx_04
,
1961 { "Idle Rx", "zbee_zdp.idle_rx", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_true_false_plus_vals
), 0x04,
1964 { &hf_zbee_zdp_table_entry_relationship_18
,
1965 { "Relationship", "zbee_zdp.relationship", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_relationship_vals
), 0x18,
1968 { &hf_zbee_zdp_table_entry_relationship_70
,
1969 { "Relationship", "zbee_zdp.relationship", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_relationship_vals
), 0x70,
1973 { "Routing Table", "zbee_zdp.routing", FT_NONE
, BASE_NONE
, NULL
, 0x0,
1976 { &hf_zbee_zdp_rtg_entry
,
1977 { "Routing Table Entry", "zbee_zdp.routing.entry", FT_NONE
, BASE_NONE
, NULL
, 0x0,
1980 { &hf_zbee_zdp_rtg_destination
,
1981 { "Destination", "zbee_zdp.routing.destination", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1984 { &hf_zbee_zdp_rtg_status
,
1985 { "Status", "zbee_zdp.routing.status", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_rtg_status_vals
), 0x0,
1988 { &hf_zbee_zdp_rtg_next_hop
,
1989 { "Next Hop", "zbee_zdp.routing.next_hop", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1992 { &hf_zbee_zdp_ieee_join_start_index
,
1993 { "Start Index", "zbee_zdp.ieee_joining_list.start_index", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1996 { &hf_zbee_zdp_ieee_join_update_id
,
1997 { "Update Id", "zbee_zdp.ieee_joining_list.update_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2000 { &hf_zbee_zdp_ieee_join_policy
,
2001 { "Policy", "zbee_zdp.ieee_joining_list.policy", FT_UINT8
, BASE_DEC
, VALS(zbee_zdp_ieee_join_policy_vals
), 0x0,
2004 { &hf_zbee_zdp_ieee_join_list_total
,
2005 { "List Total Count", "zbee_zdp.ieee_joining_list.total", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2008 { &hf_zbee_zdp_ieee_join_list_start
,
2009 { "List Start", "zbee_zdp.ieee_joining_list.start", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2012 { &hf_zbee_zdp_ieee_join_list_count
,
2013 { "List Count", "zbee_zdp.ieee_joining_list.count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2016 { &hf_zbee_zdp_ieee_join_list_ieee
,
2017 { "IEEE", "zbee_zdp.ieee_joining_list.ieee", FT_EUI64
, BASE_NONE
, NULL
, 0x0,
2020 { &hf_zbee_zdp_number_of_children
,
2021 { "NumberOfChildren", "zbee_zdp.n_children", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2024 { &hf_zbee_zdp_beacon_survey_scan_mask
,
2025 { "ScanChannelItem", "zbee_zdp.scan_ch_list", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
2028 { &hf_zbee_zdp_beacon_survey_scan_mask_cnt
,
2029 { "ScanChannelCount", "zbee_zdp.scan_ch_cnt", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2032 { &hf_zbee_zdp_beacon_survey_conf_mask
,
2033 { "Configuration Bitmask", "zbee_zdp.conf_mask", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
2036 { &hf_zbee_zdp_beacon_survey_total
,
2037 { "Total beacons surveyed", "zbee_zdp.total_beacons", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2040 { &hf_zbee_zdp_beacon_survey_cur_zbn
,
2041 { "On-network beacons", "zbee_zdp.on_nwk_beacons", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2044 { &hf_zbee_zdp_beacon_survey_cur_zbn_potent_parents
,
2045 { "Potential Parent Beacons", "zbee_zdp.num_of_parents", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2048 { &hf_zbee_zdp_beacon_survey_other_zbn
,
2049 { "Other Network Beacons", "zbee_zdp.other_nwk_beacons", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2052 { &hf_zbee_zdp_beacon_survey_current_parent
,
2053 { "Current Parent", "zbee_zdp.cur_parent", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
2056 { &hf_zbee_zdp_beacon_survey_parent
,
2057 { "Potential Parent", "zbee_zdp.p_parent", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
2060 { &hf_zbee_zdp_beacon_survey_cnt_parents
,
2061 { "Count of potential parents", "zbee_zdp.cnt_parents", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2064 { &hf_zbee_zdp_tlv_count
,
2065 { "TLV Count", "zbee_zdp.tlv_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2068 { &hf_zbee_zdp_tlv_id
,
2069 { "TLV_ID", "zbee_zdp.tlv_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2074 static int *ett
[] = {
2076 &ett_zbee_zdp_endpoint
,
2077 &ett_zbee_zdp_match_in
,
2078 &ett_zbee_zdp_match_out
,
2080 &ett_zbee_zdp_node_in
,
2081 &ett_zbee_zdp_node_out
,
2082 &ett_zbee_zdp_power
,
2083 &ett_zbee_zdp_simple
,
2084 &ett_zbee_zdp_cinfo
,
2085 &ett_zbee_zdp_server
,
2086 &ett_zbee_zdp_simple_sizes
,
2088 &ett_zbee_zdp_bind_entry
,
2089 &ett_zbee_zdp_bind_end_in
,
2090 &ett_zbee_zdp_bind_end_out
,
2091 &ett_zbee_zdp_bind_table
,
2092 &ett_zbee_zdp_bind_source
,
2093 &ett_zbee_zdp_assoc_device
,
2097 &ett_zbee_zdp_cache
,
2098 &ett_zbee_zdp_nwk_desc
,
2099 &ett_zbee_zdp_table_entry
,
2100 &ett_zbee_zdp_descriptor_capability_field
,
2101 &ett_zbee_zdp_perm_join_fc
,
2104 expert_module_t
*expert_zbee_zdp
;
2106 static ei_register_info ei
[] = {
2108 &ei_deprecated_command
,
2109 { "zbee_zdp.zdo_command_deprecated", PI_DEPRECATED
, PI_WARN
,
2110 "Deprecated ZDO Command", EXPFILL
}
2114 /* Register ZigBee ZDP protocol with Wireshark. */
2115 proto_zbee_zdp
= proto_register_protocol("ZigBee Device Profile", "ZigBee ZDP", "zbee_zdp");
2116 proto_register_field_array(proto_zbee_zdp
, hf
, array_length(hf
));
2117 proto_register_subtree_array(ett
, array_length(ett
));
2118 expert_zbee_zdp
= expert_register_protocol(proto_zbee_zdp
);
2119 expert_register_field_array(expert_zbee_zdp
, ei
, array_length(ei
));
2121 /* Register the ZDP dissector. */
2122 register_dissector("zbee_zdp", dissect_zbee_zdp
, proto_zbee_zdp
);
2123 } /* proto_register_zbee_zdp */
2126 *Registers the Zigbee Device Profile dissector with Wireshark.
2129 void proto_reg_handoff_zbee_zdp(void)
2131 dissector_handle_t zdp_handle
;
2133 /* Register our dissector with the ZigBee application dissectors. */
2134 zdp_handle
= find_dissector("zbee_zdp");
2135 dissector_add_uint("zbee.profile", ZBEE_ZDP_PROFILE
, zdp_handle
);
2136 } /* proto_reg_handoff_zbee_zdp */
2139 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2144 * indent-tabs-mode: nil
2147 * vi: set shiftwidth=4 tabstop=8 expandtab:
2148 * :indentSize=4:tabSize=8:noTabs=true: