1 /* packet-zbee-zdp-discovery.c
2 * Dissector helper routines for the discovery services of the ZigBee Device Profile
3 * By Owen Kirby <osk@exegin.com>
4 * Copyright 2009 Exegin Technologies Limited
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #endif /* HAVE_CONFIG_H */
35 #include <epan/packet.h>
36 #include <epan/addr_resolv.h>
38 #include "packet-zbee.h"
39 #include "packet-zbee-zdp.h"
41 /**************************************
43 **************************************
45 /*FUNCTION:------------------------------------------------------
47 * dissect_zbee_zdp_req_nwk_addr
49 * ZigBee Device Profile dissector for the network address
50 * request. Cluster ID = 0x0000.
52 * tvbuff_t *tvb - pointer to buffer containing raw packet.
53 * packet_into *pinfo - pointer to packet information fields
54 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
57 *---------------------------------------------------------------
60 dissect_zbee_zdp_req_nwk_addr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
68 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
69 req_type = zbee_parse_uint(tree, hf_zbee_zdp_req_type, tvb, &offset, sizeof(guint8), NULL);
70 idx = zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, sizeof(guint8), NULL);
72 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
74 /* Dump any leftover bytes. */
75 zdp_dump_excess(tvb, offset, pinfo, tree);
76 } /* dissect_zbee_zdp_req_nwk_addr */
78 /*FUNCTION:------------------------------------------------------
80 * dissect_zbee_zdp_req_ext_addr
82 * ZigBee Device Profile dissector for the extended address
83 * request. Cluster ID = 0x0001.
85 * tvbuff_t *tvb - pointer to buffer containing raw packet.
86 * packet_into *pinfo - pointer to packet information fields
87 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
90 *---------------------------------------------------------------
93 dissect_zbee_zdp_req_ext_addr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
101 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
102 req_type = zbee_parse_uint(tree, hf_zbee_zdp_req_type, tvb, &offset, sizeof(guint8), NULL);
103 idx = zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, sizeof(guint8), NULL);
105 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
107 /* Dump any leftover bytes. */
108 zdp_dump_excess(tvb, offset, pinfo, tree);
109 } /* dissect_zbee_zdp_req_ext_addr */
111 /*FUNCTION:------------------------------------------------------
113 * dissect_zbee_zdp_req_desc
115 * ZigBee Device Profile dissector for the descriptor
116 * requests. Cluster ID = 0x0002.
118 * tvbuff_t *tvb - pointer to buffer containing raw packet.
119 * packet_into *pinfo - pointer to packet information fields
120 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
123 *---------------------------------------------------------------
126 dissect_zbee_zdp_req_node_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
131 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
133 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
135 /* Dump any leftover bytes. */
136 zdp_dump_excess(tvb, offset, pinfo, tree);
137 } /* dissect_zbee_zdp_req_node_desc */
139 /*FUNCTION:------------------------------------------------------
141 * dissect_zbee_zdp_req_power_desc
143 * ZigBee Device Profile dissector for the node descriptor
144 * request. Cluster ID = 0x0003.
146 * tvbuff_t *tvb - pointer to buffer containing raw packet.
147 * packet_into *pinfo - pointer to packet information fields
148 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
151 *---------------------------------------------------------------
154 dissect_zbee_zdp_req_power_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
159 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
161 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
163 /* Dump any leftover bytes. */
164 zdp_dump_excess(tvb, offset, pinfo, tree);
165 } /* dissect_zbee_zdp_req_power_desc */
167 /*FUNCTION:------------------------------------------------------
169 * dissect_zbee_zdp_req_simple_desc
171 * ZigBee Device Profile dissector for the simple descriptor
172 * request. Cluster ID = 0x0004.
174 * tvbuff_t *tvb - pointer to buffer containing raw packet.
175 * packet_into *pinfo - pointer to packet information fields
176 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
179 *---------------------------------------------------------------
182 dissect_zbee_zdp_req_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
188 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
189 endpt = zbee_parse_uint(tree, hf_zbee_zdp_endpoint, tvb, &offset, sizeof(guint8), NULL);
191 zbee_append_info(tree, pinfo, ", Device: 0x%04x, Endpoint: %d", device, endpt);
193 /* Dump any leftover bytes. */
194 zdp_dump_excess(tvb, offset, pinfo, tree);
195 } /* dissect_zbee_zdp_req_simple_desc */
197 /*FUNCTION:------------------------------------------------------
199 * dissect_zbee_zdp_req_active_ep
201 * ZigBee Device Profile dissector for the active endpoint list
202 * request. Cluster ID = 0x0005.
204 * tvbuff_t *tvb - pointer to buffer containing raw packet.
205 * packet_into *pinfo - pointer to packet information fields
206 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
209 *---------------------------------------------------------------
212 dissect_zbee_zdp_req_active_ep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
217 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
219 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
221 /* Dump any leftover bytes. */
222 zdp_dump_excess(tvb, offset, pinfo, tree);
223 } /* dissect_zbee_zdp_req_active_ep */
225 /*FUNCTION:------------------------------------------------------
227 * dissect_zbee_zdp_req_match_desc
229 * ZigBee Device Profile dissector for the matching descriptor
230 * request. Cluster ID = 0x0006.
232 * tvbuff_t *tvb - pointer to buffer containing raw packet.
233 * packet_into *pinfo - pointer to packet information fields
234 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
237 *---------------------------------------------------------------
240 dissect_zbee_zdp_req_match_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
243 proto_tree *field_tree = NULL;
245 guint sizeof_cluster = (pinfo->zbee_stack_vers >= ZBEE_VERSION_2007)?sizeof(guint16):sizeof(guint8);
252 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
253 profile = zbee_parse_uint(tree, hf_zbee_zdp_profile, tvb, &offset, sizeof(guint16), NULL);
255 /* Add the input cluster list. */
256 in_count = zbee_parse_uint(tree, hf_zbee_zdp_in_count, tvb, &offset, sizeof(guint8), NULL);
257 if (tree && in_count) {
258 ti = proto_tree_add_text(tree, tvb, offset, in_count*sizeof_cluster, "Input Cluster List");
259 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_match_in);
261 for (i=0; i<in_count; i++) zbee_parse_uint(field_tree, hf_zbee_zdp_in_cluster, tvb, &offset, sizeof_cluster, NULL);
263 /* Add the output cluster list. */
264 out_count = zbee_parse_uint(tree, hf_zbee_zdp_out_count, tvb, &offset, sizeof(guint8), NULL);
265 if (tree && out_count) {
266 ti = proto_tree_add_text(tree, tvb, offset, out_count*sizeof_cluster, "Output Cluster List");
267 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_match_out);
269 for (i=0; i<out_count; i++) zbee_parse_uint(field_tree, hf_zbee_zdp_out_cluster, tvb, &offset, sizeof_cluster, NULL);
271 zbee_append_info(tree, pinfo, ", Device: 0x%04x, Profile: 0x%04x", device, profile);
273 /* Dump any leftover bytes. */
274 zdp_dump_excess(tvb, offset, pinfo, tree);
275 } /* dissect_zbee_zdp_req_simple_desc */
277 /*FUNCTION:------------------------------------------------------
279 * dissect_zbee_zdp_req_complex_desc
281 * ZigBee Device Profile dissector for the complex descriptor
282 * request. Cluster ID = 0x0010.
284 * tvbuff_t *tvb - pointer to buffer containing raw packet.
285 * packet_into *pinfo - pointer to packet information fields
286 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
289 *---------------------------------------------------------------
292 dissect_zbee_zdp_req_complex_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
297 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
299 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
301 /* Dump any leftover bytes. */
302 zdp_dump_excess(tvb, offset, pinfo, tree);
303 } /* dissect_zbee_zdp_req_complex_desc */
305 /*FUNCTION:------------------------------------------------------
307 * dissect_zbee_zdp_req_user_desc
309 * ZigBee Device Profile dissector for the user descriptor
310 * request. Cluster ID = 0x0011.
312 * tvbuff_t *tvb - pointer to buffer containing raw packet.
313 * packet_into *pinfo - pointer to packet information fields
314 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
317 *---------------------------------------------------------------
320 dissect_zbee_zdp_req_user_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
325 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
327 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
329 /* Dump any leftover bytes. */
330 zdp_dump_excess(tvb, offset, pinfo, tree);
331 } /* dissect_zbee_zdp_req_user_desc */
333 /*FUNCTION:------------------------------------------------------
335 * dissect_zbee_zdp_req_discovery_cache
337 * ZigBee Device Profile dissector for the discovery cache
338 * request. Cluster ID = 0x0012.
340 * tvbuff_t *tvb - pointer to buffer containing raw packet.
341 * packet_into *pinfo - pointer to packet information fields
342 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
345 *---------------------------------------------------------------
348 dissect_zbee_zdp_req_discovery_cache(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
354 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
355 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
357 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
359 /* Dump any leftover bytes. */
360 zdp_dump_excess(tvb, offset, pinfo, tree);
361 } /* dissect_zbee_zdp_req_discovery_cache */
363 /*FUNCTION:------------------------------------------------------
365 * dissect_zbee_zdp_device_annce
367 * ZigBee Device Profile dissector for the device announcement.
368 * Cluster ID = 0x0013.
370 * tvbuff_t *tvb - pointer to buffer containing raw packet.
371 * packet_into *pinfo - pointer to packet information fields
372 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
375 *---------------------------------------------------------------
378 dissect_zbee_zdp_device_annce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
385 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
386 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
387 capability = zdp_parse_cinfo(tree, ett_zbee_zdp_cinfo, tvb, &offset);
389 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
391 /* Dump any leftover bytes. */
392 zdp_dump_excess(tvb, offset, pinfo, tree);
393 } /* dissect_zbee_zdp_device_annce */
395 /*FUNCTION:------------------------------------------------------
397 * dissect_zbee_zdp_req_set_user_desc
399 * ZigBee Device Profile dissector for the end set user
400 * descriptor request. Cluster ID = 0x0014.
402 * tvbuff_t *tvb - pointer to buffer containing raw packet.
403 * packet_into *pinfo - pointer to packet information fields
404 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
407 *---------------------------------------------------------------
410 dissect_zbee_zdp_req_set_user_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
417 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
418 if (pinfo->zbee_stack_vers >= ZBEE_VERSION_2007) {
419 user_length = zbee_parse_uint(tree, hf_zbee_zdp_user_length, tvb, &offset, sizeof(guint8), NULL);
422 /* No Length field in ZigBee 2003 & earlier, uses a fixed length of 16. */
425 user = ep_alloc(user_length+1);
426 user = tvb_memcpy(tvb, user, offset, user_length);
427 user[user_length] = '\0';
429 proto_tree_add_string(tree, hf_zbee_zdp_user, tvb, offset, user_length, user);
431 offset += user_length;
433 zbee_append_info(tree, pinfo, ", Device: 0x%04x, Desc: \'%s\'", device, user);
435 /* Dump any leftover bytes. */
436 zdp_dump_excess(tvb, offset, pinfo, tree);
437 } /* dissect_zbee_zdp_req_set_user_desc */
439 /*FUNCTION:------------------------------------------------------
441 * dissect_zbee_zdp_req_system_server_disc
443 * ZigBee Device Profile dissector for the system server
444 * discovery request. Cluster ID = 0x0015.
446 * tvbuff_t *tvb - pointer to buffer containing raw packet.
447 * packet_into *pinfo - pointer to packet information fields
448 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
451 *---------------------------------------------------------------
454 dissect_zbee_zdp_req_system_server_disc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
457 guint16 server_flags;
459 server_flags = zdp_parse_server_flags(tree, ett_zbee_zdp_server, tvb, &offset);
461 /* Dump any leftover bytes. */
462 zdp_dump_excess(tvb, offset, pinfo, tree);
463 } /* dissect_zbee_zdp_req_system_server_disc */
465 /*FUNCTION:------------------------------------------------------
467 * dissect_zbee_zdp_req_store_discovery
469 * ZigBee Device Profile dissector for the store node cache
470 * request. Cluster ID = 0x0016.
472 * tvbuff_t *tvb - pointer to buffer containing raw packet.
473 * packet_into *pinfo - pointer to packet information fields
474 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
477 *---------------------------------------------------------------
480 dissect_zbee_zdp_req_store_discovery(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
483 proto_tree *field_tree = NULL;
494 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
495 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
496 node_size = zbee_parse_uint(tree, hf_zbee_zdp_disc_node_size, tvb, &offset, sizeof(guint8), NULL);
497 power_size = zbee_parse_uint(tree, hf_zbee_zdp_disc_power_size, tvb, &offset, sizeof(guint8), NULL);
498 ep_count = zbee_parse_uint(tree, hf_zbee_zdp_disc_ep_count, tvb, &offset, sizeof(guint8), NULL);
499 simple_count= zbee_parse_uint(tree, hf_zbee_zdp_disc_simple_count, tvb, &offset, sizeof(guint8), NULL);
502 ti = proto_tree_add_text(tree, tvb, offset, simple_count, "Simple Descriptor Sizes");
503 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_simple_sizes);
505 for (i=0; i<simple_count; i++) {
506 zbee_parse_uint(field_tree, hf_zbee_zdp_disc_simple_size, tvb, &offset, sizeof(guint8), NULL);
509 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
511 /* Dump any leftover bytes. */
512 zdp_dump_excess(tvb, offset, pinfo, tree);
513 } /* dissect_zbee_zdp_req_store_discovery */
515 /*FUNCTION:------------------------------------------------------
517 * dissect_zbee_zdp_req_store_node_desc
519 * ZigBee Device Profile dissector for the store node descriptor
520 * request. Cluster ID = 0x0017.
522 * tvbuff_t *tvb - pointer to buffer containing raw packet.
523 * packet_into *pinfo - pointer to packet information fields
524 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
527 *---------------------------------------------------------------
530 dissect_zbee_zdp_req_store_node_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
536 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
537 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
538 zdp_parse_node_desc(tree, ett_zbee_zdp_node, tvb, &offset, pinfo);
540 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
542 /* Dump any leftover bytes. */
543 zdp_dump_excess(tvb, offset, pinfo, tree);
544 } /* dissect_zbee_zdp_req_store_node_desc */
546 /*FUNCTION:------------------------------------------------------
548 * dissect_zbee_zdp_req_store_power_desc
550 * ZigBee Device Profile dissector for the store power descriptor
551 * request. Cluster ID = 0x0018.
553 * tvbuff_t *tvb - pointer to buffer containing raw packet.
554 * packet_into *pinfo - pointer to packet information fields
555 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
558 *---------------------------------------------------------------
561 dissect_zbee_zdp_req_store_power_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
567 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
568 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
569 zdp_parse_power_desc(tree, ett_zbee_zdp_power, tvb, &offset);
571 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
573 /* Dump any leftover bytes. */
574 zdp_dump_excess(tvb, offset, pinfo, tree);
575 } /* dissect_zbee_zdp_req_store_power_desc */
577 /*FUNCTION:------------------------------------------------------
579 * dissect_zbee_zdp_req_store_active_ep
581 * ZigBee Device Profile dissector for the store active endpoint
582 * request. Cluster ID = 0x0019.
584 * tvbuff_t *tvb - pointer to buffer containing raw packet.
585 * packet_into *pinfo - pointer to packet information fields
586 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
589 *---------------------------------------------------------------
592 dissect_zbee_zdp_req_store_active_ep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
595 proto_tree *field_tree = NULL;
603 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
604 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
605 ep_count = zbee_parse_uint(tree, hf_zbee_zdp_ep_count, tvb, &offset, sizeof(guint8), NULL);
608 ti = proto_tree_add_text(tree, tvb, offset, ep_count, "Active Endpoints");
609 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_endpoint);
611 for (i=0; i<ep_count; i++) {
612 (void)zbee_parse_uint(field_tree, hf_zbee_zdp_endpoint, tvb, &offset, sizeof(guint8), NULL);
615 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
617 /* Dump any leftover bytes. */
618 zdp_dump_excess(tvb, offset, pinfo, tree);
619 } /* dissect_zbee_zdp_req_store_active_ep */
621 /*FUNCTION:------------------------------------------------------
623 * dissect_zbee_zdp_req_store_simple_desc
625 * ZigBee Device Profile dissector for the store simple descriptor
626 * request. Cluster ID = 0x001a.
628 * tvbuff_t *tvb - pointer to buffer containing raw packet.
629 * packet_into *pinfo - pointer to packet information fields
630 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
633 *---------------------------------------------------------------
636 dissect_zbee_zdp_req_store_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
643 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
644 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
645 simple_len = zbee_parse_uint(tree, hf_zbee_zdp_simple_length, tvb, &offset, sizeof(guint8), NULL);
646 zdp_parse_simple_desc(tree, ett_zbee_zdp_simple, tvb, &offset, pinfo);
648 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
650 /* Dump any leftover bytes. */
651 zdp_dump_excess(tvb, offset, pinfo, tree);
652 } /* dissect_zbee_zdp_req_store_simple_desc */
654 /*FUNCTION:------------------------------------------------------
656 * dissect_zbee_zdp_req_remove_node_cache
658 * ZigBee Device Profile dissector for the remove node cache
659 * request. Cluster ID = 0x001b.
661 * tvbuff_t *tvb - pointer to buffer containing raw packet.
662 * packet_into *pinfo - pointer to packet information fields
663 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
666 *---------------------------------------------------------------
669 dissect_zbee_zdp_req_remove_node_cache(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
675 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
676 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
678 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
680 /* Dump any leftover bytes. */
681 zdp_dump_excess(tvb, offset, pinfo, tree);
682 } /* dissect_zbee_zdp_req_remove_node_cache */
684 /*FUNCTION:------------------------------------------------------
686 * dissect_zbee_zdp_req_find_node_cache
688 * ZigBee Device Profile dissector for the find node cache
689 * request. Cluster ID = 0x001c.
691 * tvbuff_t *tvb - pointer to buffer containing raw packet.
692 * packet_into *pinfo - pointer to packet information fields
693 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
696 *---------------------------------------------------------------
699 dissect_zbee_zdp_req_find_node_cache(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
705 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
706 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
708 zbee_append_info(tree, pinfo, ", Device: %s", get_eui64_name(ext_addr));
710 /* Dump any leftover bytes. */
711 zdp_dump_excess(tvb, offset, pinfo, tree);
712 } /* dissect_zbee_zdp_req_find_node_cache */
714 /*FUNCTION:------------------------------------------------------
716 * dissect_zbee_zdp_req_ext_simple_desc
718 * ZigBee Device Profile dissector for the extended simple
719 * descriptor request. Cluster ID = 0x001d.
721 * tvbuff_t *tvb - pointer to buffer containing raw packet.
722 * packet_into *pinfo - pointer to packet information fields
723 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
726 *---------------------------------------------------------------
729 dissect_zbee_zdp_req_ext_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
736 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
737 endpt = zbee_parse_uint(tree, hf_zbee_zdp_endpoint, tvb, &offset, sizeof(guint8), NULL);
738 idx = zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, sizeof(guint8), NULL);
740 zbee_append_info(tree, pinfo, ", Device: 0x%04x, Endpoint: %d", device, endpt);
742 /* Dump any leftover bytes. */
743 zdp_dump_excess(tvb, offset, pinfo, tree);
744 } /* dissect_zbee_zdp_req_ext_simple_desc */
746 /*FUNCTION:------------------------------------------------------
748 * dissect_zbee_zdp_req_ext_active_ep
750 * ZigBee Device Profile dissector for the extended active
751 * endpoint list request. Cluster ID = 0x001e.
753 * tvbuff_t *tvb - pointer to buffer containing raw packet.
754 * packet_into *pinfo - pointer to packet information fields
755 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
758 *---------------------------------------------------------------
761 dissect_zbee_zdp_req_ext_active_ep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
767 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
768 idx = zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, sizeof(guint8), NULL);
770 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
772 /* Dump any leftover bytes. */
773 zdp_dump_excess(tvb, offset, pinfo, tree);
774 } /* dissect_zbee_zdp_req_ext_active_ep */
776 /**************************************
777 * DISCOVERY RESPONSES
778 **************************************
780 /*FUNCTION:------------------------------------------------------
782 * dissect_zbee_zdp_rsp_nwk_addr
784 * ZigBee Device Profile dissector for the network address
785 * response. Cluster ID = 0x8000.
787 * tvbuff_t *tvb - pointer to buffer containing raw packet.
788 * packet_into *pinfo - pointer to packet information fields
789 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
792 *---------------------------------------------------------------
795 dissect_zbee_zdp_rsp_nwk_addr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
798 proto_tree *field_tree = NULL;
808 status = zdp_parse_status(tree, tvb, &offset);
809 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
810 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
812 if (tvb_bytes_exist(tvb, offset, 2*sizeof(guint8))) {
813 /* The presence of these fields depends on the request message. Include them if they exist. */
814 assoc = zbee_parse_uint(tree, hf_zbee_zdp_assoc_device_count, tvb, &offset, sizeof(guint8), NULL);
815 idx = zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, sizeof(guint8), NULL);
817 if ((tree) && (assoc)) {
818 ti = proto_tree_add_text(tree, tvb, offset, assoc*sizeof(guint16), "Associated Device List");
819 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_assoc_device);
821 for (i=0; i<assoc; i++) {
822 (void)zbee_parse_uint(field_tree, hf_zbee_zdp_assoc_device, tvb, &offset, sizeof(guint16), NULL);
826 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
827 if (status == ZBEE_ZDP_STATUS_SUCCESS) {
828 zbee_append_info(tree, pinfo, ", Device: %s = 0x%04x", get_eui64_name(ext_addr), device);
831 /* Dump any leftover bytes. */
832 zdp_dump_excess(tvb, offset, pinfo, tree);
833 } /* dissect_zbee_zdp_rsp_nwk_addr */
835 /*FUNCTION:------------------------------------------------------
837 * dissect_zbee_zdp_rsp_ext_addr
839 * ZigBee Device Profile dissector for the extended address
840 * response. Cluster ID = 0x8001.
842 * tvbuff_t *tvb - pointer to buffer containing raw packet.
843 * packet_into *pinfo - pointer to packet information fields
844 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
847 *---------------------------------------------------------------
850 dissect_zbee_zdp_rsp_ext_addr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
853 proto_tree *field_tree = NULL;
863 status = zdp_parse_status(tree, tvb, &offset);
864 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
865 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
867 if (tvb_bytes_exist(tvb, offset, 2*sizeof(guint8))) {
868 /* The presence of these fields depends on the request message. Include them if they exist. */
869 assoc = zbee_parse_uint(tree, hf_zbee_zdp_assoc_device_count, tvb, &offset, sizeof(guint8), NULL);
870 idx = zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, sizeof(guint8), NULL);
872 if ((tree) && (assoc)) {
873 ti = proto_tree_add_text(tree, tvb, offset, assoc*sizeof(guint16), "Associated Device List");
874 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_assoc_device);
876 for (i=0; i<assoc; i++) {
877 (void)zbee_parse_uint(field_tree, hf_zbee_zdp_assoc_device, tvb, &offset, sizeof(guint16), NULL);
881 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
882 if (status == ZBEE_ZDP_STATUS_SUCCESS) {
883 zbee_append_info(tree, pinfo, ", Device: 0x%04x = %s", device, get_eui64_name(ext_addr));
886 /* Dump any leftover bytes. */
887 zdp_dump_excess(tvb, offset, pinfo, tree);
888 } /* dissect_zbee_zdp_rsp_ext_addr */
890 /*FUNCTION:------------------------------------------------------
892 * dissect_zbee_zdp_rsp_node_desc
894 * ZigBee Device Profile dissector for the node descriptor
895 * response. Cluster ID = 0x8002.
897 * tvbuff_t *tvb - pointer to buffer containing raw packet.
898 * packet_into *pinfo - pointer to packet information fields
899 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
902 *---------------------------------------------------------------
905 dissect_zbee_zdp_rsp_node_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
912 status = zdp_parse_status(tree, tvb, &offset);
913 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
914 if (status == ZBEE_ZDP_STATUS_SUCCESS) {
915 zdp_parse_node_desc(tree, ett_zbee_zdp_node, tvb, &offset, pinfo);
918 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
919 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
921 /* Dump any leftover bytes. */
922 zdp_dump_excess(tvb, offset, pinfo, tree);
923 } /* dissect_zbee_zdp_rsp_node_desc */
925 /*FUNCTION:------------------------------------------------------
927 * dissect_zbee_zdp_rsp_power_desc
929 * ZigBee Device Profile dissector for the power descriptor
930 * response. Cluster ID = 0x8003.
932 * tvbuff_t *tvb - pointer to buffer containing raw packet.
933 * packet_into *pinfo - pointer to packet information fields
934 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
937 *---------------------------------------------------------------
940 dissect_zbee_zdp_rsp_power_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
947 status = zdp_parse_status(tree, tvb, &offset);
948 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
949 if (status == ZBEE_ZDP_STATUS_SUCCESS) {
950 zdp_parse_power_desc(tree, ett_zbee_zdp_power, tvb, &offset);
953 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
954 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
956 /* Dump any leftover bytes. */
957 zdp_dump_excess(tvb, offset, pinfo, tree);
958 } /* dissect_zbee_zdp_rsp_power_desc */
960 /*FUNCTION:------------------------------------------------------
962 * dissect_zbee_zdp_rsp_simple_desc
964 * ZigBee Device Profile dissector for the simple descriptor
965 * response. Cluster ID = 0x8004.
967 * tvbuff_t *tvb - pointer to buffer containing raw packet.
968 * packet_into *pinfo - pointer to packet information fields
969 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
972 *---------------------------------------------------------------
975 dissect_zbee_zdp_rsp_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
983 status = zdp_parse_status(tree, tvb, &offset);
984 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
985 length = zbee_parse_uint(tree, hf_zbee_zdp_simple_length, tvb, &offset, sizeof(guint8), NULL);
986 if (status == ZBEE_ZDP_STATUS_SUCCESS) {
987 zdp_parse_simple_desc(tree, ett_zbee_zdp_simple, tvb, &offset, pinfo);
990 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
991 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
993 /* Dump any leftover bytes. */
994 zdp_dump_excess(tvb, offset, pinfo, tree);
995 } /* dissect_zbee_zdp_rsp_simple_desc */
997 /*FUNCTION:------------------------------------------------------
999 * dissect_zbee_zdp_rsp_active_ep
1001 * ZigBee Device Profile dissector for the active endpoint
1002 * response. Cluster ID = 0x8005.
1004 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1005 * packet_into *pinfo - pointer to packet information fields
1006 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1009 *---------------------------------------------------------------
1012 dissect_zbee_zdp_rsp_active_ep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1015 proto_tree *field_tree = NULL;
1023 status = zdp_parse_status(tree, tvb, &offset);
1024 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
1025 ep_count = zbee_parse_uint(tree, hf_zbee_zdp_ep_count, tvb, &offset, sizeof(guint8), NULL);
1027 if (tree && ep_count) {
1028 ti = proto_tree_add_text(tree, tvb, offset, ep_count*sizeof(guint8), "Active Endpoint List");
1029 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_endpoint);
1031 for (i=0; i<ep_count; i++) {
1032 (void)zbee_parse_uint(field_tree, hf_zbee_zdp_endpoint, tvb, &offset, sizeof(guint8), NULL);
1035 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
1036 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1038 /* Dump any leftover bytes. */
1039 zdp_dump_excess(tvb, offset, pinfo, tree);
1040 } /* dissect_zbee_zdp_rsp_active_ep */
1042 /*FUNCTION:------------------------------------------------------
1044 * dissect_zbee_zdp_rsp_match_desc
1046 * ZigBee Device Profile dissector for the simple descriptor
1047 * response. Cluster ID = 0x8003.
1049 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1050 * packet_into *pinfo - pointer to packet information fields
1051 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1054 *---------------------------------------------------------------
1057 dissect_zbee_zdp_rsp_match_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1060 proto_tree *field_tree = NULL;
1068 status = zdp_parse_status(tree, tvb, &offset);
1069 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
1070 ep_count = zbee_parse_uint(tree, hf_zbee_zdp_ep_count, tvb, &offset, sizeof(guint8), NULL);
1072 if (tree && ep_count) {
1073 ti = proto_tree_add_text(tree, tvb, offset, ep_count*sizeof(guint8), "Matching Endpoint List");
1074 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_endpoint);
1076 for (i=0; i<ep_count; i++) {
1077 (void)zbee_parse_uint(field_tree, hf_zbee_zdp_endpoint, tvb, &offset, sizeof(guint8), NULL);
1080 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
1081 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1083 /* Dump any leftover bytes. */
1084 zdp_dump_excess(tvb, offset, pinfo, tree);
1085 } /* dissect_zbee_zdp_rsp_match_desc */
1087 /*FUNCTION:------------------------------------------------------
1089 * dissect_zbee_zdp_rsp_complex_desc
1091 * ZigBee Device Profile dissector for the complex descriptor
1092 * response. Cluster ID = 0x8010.
1094 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1095 * packet_into *pinfo - pointer to packet information fields
1096 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1099 *---------------------------------------------------------------
1102 dissect_zbee_zdp_rsp_complex_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1110 status = zdp_parse_status(tree, tvb, &offset);
1111 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
1112 length = zbee_parse_uint(tree, hf_zbee_zdp_complex_length, tvb, &offset, sizeof(guint8), NULL);
1114 zdp_parse_complex_desc(tree, -1, tvb, &offset, length);
1117 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
1118 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1120 /* Dump any leftover bytes. */
1121 zdp_dump_excess(tvb, offset, pinfo, tree);
1122 } /* dissect_zbee_zdp_rsp_complex_desc */
1124 /*FUNCTION:------------------------------------------------------
1126 * dissect_zbee_zdp_rsp_user_desc
1128 * ZigBee Device Profile dissector for the user descriptor
1129 * response. Cluster ID = 0x8011.
1131 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1132 * packet_into *pinfo - pointer to packet information fields
1133 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1136 *---------------------------------------------------------------
1139 dissect_zbee_zdp_rsp_user_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1147 status = zdp_parse_status(tree, tvb, &offset);
1148 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
1149 if ((pinfo->zbee_stack_vers >= ZBEE_VERSION_2007) || (status == ZBEE_ZDP_STATUS_SUCCESS)) {
1150 /* In ZigBee 2003 & earlier, the length field is omitted if not successful. */
1151 user_length = zbee_parse_uint(tree, hf_zbee_zdp_user_length, tvb, &offset, sizeof(guint8), NULL);
1153 else user_length = 0;
1155 user = tvb_get_ephemeral_string(tvb, offset, user_length);
1157 proto_tree_add_string(tree, hf_zbee_zdp_user, tvb, offset, user_length, user);
1159 offset += user_length;
1161 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
1162 if (status == ZBEE_ZDP_STATUS_SUCCESS) {
1163 zbee_append_info(tree, pinfo, ", Desc: \'%s\'", user);
1165 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1167 /* Dump any leftover bytes. */
1168 zdp_dump_excess(tvb, offset, pinfo, tree);
1169 } /* dissect_zbee_zdp_rsp_user_desc */
1171 /*FUNCTION:------------------------------------------------------
1173 * dissect_zbee_zdp_rsp_user_desc_conf
1175 * ZigBee Device Profile dissector for the set user descriptor
1176 * confirmation. Cluster ID = 0x8014.
1178 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1179 * packet_into *pinfo - pointer to packet information fields
1180 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1183 *---------------------------------------------------------------
1186 dissect_zbee_zdp_rsp_user_desc_conf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1192 status = zdp_parse_status(tree, tvb, &offset);
1193 if (pinfo->zbee_stack_vers >= ZBEE_VERSION_2007) {
1194 /* Device address present only on ZigBee 2006 & later. */
1195 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
1198 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
1199 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1201 /* Dump any leftover bytes. */
1202 zdp_dump_excess(tvb, offset, pinfo, tree);
1203 } /* dissect_zbee_zdp_rsp_user_desc_conf */
1205 /*FUNCTION:------------------------------------------------------
1207 * dissect_zbee_zdp_rsp_discovery_cache
1209 * ZigBee Device Profile dissector for the discovery cache
1210 * response. Cluster ID = 0x8012.
1212 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1213 * packet_into *pinfo - pointer to packet information fields
1214 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1217 *---------------------------------------------------------------
1220 dissect_zbee_zdp_rsp_discovery_cache(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1226 status = zdp_parse_status(tree, tvb, &offset);
1228 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1230 /* Dump any leftover bytes. */
1231 zdp_dump_excess(tvb, offset, pinfo, tree);
1232 } /* dissect_zbee_zdp_rsp_discovery_cache */
1234 /*FUNCTION:------------------------------------------------------
1236 * dissect_zbee_zdp_rsp_system_server_disc
1238 * ZigBee Device Profile dissector for the system server discovery
1239 * response. Cluster ID = 0x8015.
1241 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1242 * packet_into *pinfo - pointer to packet information fields
1243 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1246 *---------------------------------------------------------------
1249 dissect_zbee_zdp_rsp_system_server_disc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1256 status = zdp_parse_status(tree, tvb, &offset);
1257 server = zdp_parse_server_flags(tree, ett_zbee_zdp_server, tvb, &offset);
1259 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1261 /* Dump any leftover bytes. */
1262 zdp_dump_excess(tvb, offset, pinfo, tree);
1263 } /* dissect_zbee_zdp_rsp_system_server_disc */
1265 /*FUNCTION:------------------------------------------------------
1267 * dissect_zbee_zdp_rsp_discovery_store
1269 * ZigBee Device Profile dissector for the discovery store
1270 * response. Cluster ID = 0x8016.
1272 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1273 * packet_into *pinfo - pointer to packet information fields
1274 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1277 *---------------------------------------------------------------
1280 dissect_zbee_zdp_rsp_discovery_store(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1286 status = zdp_parse_status(tree, tvb, &offset);
1288 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1290 /* Dump any leftover bytes. */
1291 zdp_dump_excess(tvb, offset, pinfo, tree);
1292 } /* dissect_zbee_zdp_rsp_discovery_store */
1294 /*FUNCTION:------------------------------------------------------
1296 * dissect_zbee_zdp_rsp_store_node_desc
1298 * ZigBee Device Profile dissector for the store node descriptor
1299 * response. Cluster ID = 0x8017.
1301 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1302 * packet_into *pinfo - pointer to packet information fields
1303 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1306 *---------------------------------------------------------------
1309 dissect_zbee_zdp_rsp_store_node_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1315 status = zdp_parse_status(tree, tvb, &offset);
1317 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1319 /* Dump any leftover bytes. */
1320 zdp_dump_excess(tvb, offset, pinfo, tree);
1321 } /* dissect_zbee_zdp_rsp_store_node_desc */
1323 /*FUNCTION:------------------------------------------------------
1325 * dissect_zbee_zdp_rsp_store_power_desc
1327 * ZigBee Device Profile dissector for the store power descriptor
1328 * response. Cluster ID = 0x8018.
1330 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1331 * packet_into *pinfo - pointer to packet information fields
1332 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1335 *---------------------------------------------------------------
1338 dissect_zbee_zdp_rsp_store_power_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1344 status = zdp_parse_status(tree, tvb, &offset);
1346 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1348 /* Dump any leftover bytes. */
1349 zdp_dump_excess(tvb, offset, pinfo, tree);
1350 } /* dissect_zbee_zdp_rsp_store_power_desc */
1352 /*FUNCTION:------------------------------------------------------
1354 * dissect_zbee_zdp_rsp_store_active_ep
1356 * ZigBee Device Profile dissector for the store active endpoints
1357 * response. Cluster ID = 0x8019.
1359 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1360 * packet_into *pinfo - pointer to packet information fields
1361 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1364 *---------------------------------------------------------------
1367 dissect_zbee_zdp_rsp_store_active_ep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1373 status = zdp_parse_status(tree, tvb, &offset);
1375 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1377 /* Dump any leftover bytes. */
1378 zdp_dump_excess(tvb, offset, pinfo, tree);
1379 } /* dissect_zbee_zdp_rsp_store_active_ep */
1381 /*FUNCTION:------------------------------------------------------
1383 * dissect_zbee_zdp_rsp_store_simple_desc
1385 * ZigBee Device Profile dissector for the store power descriptor
1386 * response. Cluster ID = 0x801a.
1388 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1389 * packet_into *pinfo - pointer to packet information fields
1390 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1393 *---------------------------------------------------------------
1396 dissect_zbee_zdp_rsp_store_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1402 status = zdp_parse_status(tree, tvb, &offset);
1404 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1406 /* Dump any leftover bytes. */
1407 zdp_dump_excess(tvb, offset, pinfo, tree);
1408 } /* dissect_zbee_zdp_rsp_store_simple_desc */
1410 /*FUNCTION:------------------------------------------------------
1412 * dissect_zbee_zdp_rsp_remove_node_cache
1414 * ZigBee Device Profile dissector for the remove node cache
1415 * response. Cluster ID = 0x801b.
1417 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1418 * packet_into *pinfo - pointer to packet information fields
1419 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1422 *---------------------------------------------------------------
1425 dissect_zbee_zdp_rsp_remove_node_cache(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1431 status = zdp_parse_status(tree, tvb, &offset);
1433 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1435 /* Dump any leftover bytes. */
1436 zdp_dump_excess(tvb, offset, pinfo, tree);
1437 } /* dissect_zbee_zdp_rsp_remove_node_cache */
1439 /*FUNCTION:------------------------------------------------------
1441 * dissect_zbee_zdp_rsp_find_node_cache
1443 * ZigBee Device Profile dissector for the find node cache
1444 * response. Cluster ID = 0x801c.
1446 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1447 * packet_into *pinfo - pointer to packet information fields
1448 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1451 *---------------------------------------------------------------
1454 dissect_zbee_zdp_rsp_find_node_cache(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1462 cache = zbee_parse_uint(tree, hf_zbee_zdp_cache, tvb, &offset, sizeof(guint16), NULL);
1463 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
1464 ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, sizeof(guint64), NULL);
1466 zbee_append_info(tree, pinfo, ", Cache: 0x%04x", cache);
1467 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
1469 /* Dump any leftover bytes. */
1470 zdp_dump_excess(tvb, offset, pinfo, tree);
1471 } /* dissect_zbee_zdp_rsp_find_node_cache */
1473 /*FUNCTION:------------------------------------------------------
1475 * dissect_zbee_zdp_rsp_ext_simple_desc
1477 * ZigBee Device Profile dissector for the extended simple
1478 * descriptor response. Cluster ID = 0x801d.
1480 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1481 * packet_into *pinfo - pointer to packet information fields
1482 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1485 *---------------------------------------------------------------
1488 dissect_zbee_zdp_rsp_ext_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1492 guint sizeof_cluster = sizeof(guint16);
1501 status = zdp_parse_status(tree, tvb, &offset);
1502 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
1503 endpt = zbee_parse_uint(tree, hf_zbee_zdp_endpoint, tvb, &offset, sizeof(guint8), NULL);
1504 in_count = zbee_parse_uint(tree, hf_zbee_zdp_in_count, tvb, &offset, sizeof(guint8), NULL);
1505 out_count = zbee_parse_uint(tree, hf_zbee_zdp_out_count, tvb, &offset, sizeof(guint8), NULL);
1506 idx = zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, sizeof(guint8), NULL);
1508 /* Display the input cluster list. */
1509 for (i=idx; (i<in_count) && tvb_bytes_exist(tvb, offset, sizeof_cluster); i++) {
1510 zbee_parse_uint(tree, hf_zbee_zdp_in_cluster, tvb, &offset, sizeof_cluster, NULL);
1512 for (i-=in_count; (i<out_count) && tvb_bytes_exist(tvb, offset, sizeof_cluster); i++) {
1513 zbee_parse_uint(tree, hf_zbee_zdp_out_cluster, tvb, &offset, sizeof_cluster, NULL);
1516 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
1517 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1519 /* Dump any leftover bytes. */
1520 zdp_dump_excess(tvb, offset, pinfo, tree);
1521 } /* dissect_zbee_zdp_rsp_ext_simple_desc */
1523 /*FUNCTION:------------------------------------------------------
1525 * dissect_zbee_zdp_rsp_ext_active_ep
1527 * ZigBee Device Profile dissector for the extended active
1528 * endpoint response. Cluster ID = 0x801e.
1530 * tvbuff_t *tvb - pointer to buffer containing raw packet.
1531 * packet_into *pinfo - pointer to packet information fields
1532 * proto_tree *tree - pointer to data tree Wireshark uses to display packet.
1535 *---------------------------------------------------------------
1538 dissect_zbee_zdp_rsp_ext_active_ep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1541 proto_tree *field_tree = NULL;
1550 status = zdp_parse_status(tree, tvb, &offset);
1551 device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, sizeof(guint16), NULL);
1552 ep_count = zbee_parse_uint(tree, hf_zbee_zdp_ep_count, tvb, &offset, sizeof(guint8), NULL);
1553 idx = zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, sizeof(guint8), NULL);
1555 if (tree && ep_count) {
1556 ti = proto_tree_add_text(tree, tvb, offset, ep_count*sizeof(guint8), "Active Endpoint List");
1557 field_tree = proto_item_add_subtree(ti, ett_zbee_zdp_endpoint);
1558 for (i=idx; (i<ep_count) && tvb_bytes_exist(tvb, offset, sizeof(guint8)); i++) {
1559 (void)zbee_parse_uint(field_tree, hf_zbee_zdp_endpoint, tvb, &offset, sizeof(guint8), NULL);
1563 zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
1564 zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
1566 /* Dump any leftover bytes. */
1567 zdp_dump_excess(tvb, offset, pinfo, tree);
1568 } /* dissect_zbee_zdp_rsp_ext_active_ep */