| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
packet-zbee-tlv.h
1
2/* packet-zbee-tlv.h
3 * Dissector routines for the Zbee TLV (R23+)
4 * Copyright 2021 DSR Corporation, http://dsr-wireless.com/
5 *
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13#ifndef _PACKET_ZBEE_TLV_H
14#define _PACKET_ZBEE_TLV_H
15
16#define ZBEE_TLV_HEADER_LENGTH 2
17#define ZBEE_TLV_GLOBAL_START_NUMBER 64
18
19/* Global TLV */
20#define ZBEE_TLV_TYPE_MANUFACTURER_SPECIFIC 64
21#define ZBEE_TLV_TYPE_SUPPORTED_KEY_NEGOTIATION_METHODS 65
22#define ZBEE_TLV_TYPE_PANID_CONFLICT_REPORT 66
23#define ZBEE_TLV_TYPE_NEXT_PAN_ID 67
24#define ZBEE_TLV_TYPE_NEXT_CHANNEL_CHANGE 68
25#define ZBEE_TLV_TYPE_PASSPHRASE 69
26#define ZBEE_TLV_TYPE_ROUTER_INFORMATION 70
27#define ZBEE_TLV_TYPE_FRAGMENTATION_PARAMETERS 71
28#define ZBEE_TLV_TYPE_JOINER_ENCAPSULATION_GLOBAL 72
29#define ZBEE_TLV_TYPE_BEACON_APPENDIX_ENCAPSULATION_GLOBAL 73
30/* RESERVED 74 */
31#define ZBEE_TLV_TYPE_CONFIGURATION_MODE_PARAMETERS 75
32#define ZBEE_TLV_TYPE_DEVICE_CAPABILITY_EXTENSION 76 /* zb direct */
33
34/* ZigBee local TLV source types */
35#define ZBEE_TLV_SRC_TYPE_DEFAULT 0x00
36#define ZBEE_TLV_SRC_TYPE_ZBEE_NWK 0x01
37#define ZBEE_TLV_SRC_TYPE_ZBEE_APS 0x02
38#define ZBEE_TLV_SRC_TYPE_ZBEE_ZDP 0x03
39#define ZBEE_TLV_SRC_TYPE_ZB_DIRECT 0x04
40
41/* Local TLV Tags*/
42/* Clear All Bindings Request */
43#define ZBEE_TLV_TYPE_CLEAR_ALL_BINDIGS_REQ_EUI64 0
44/* Security Key Update request/response */
45#define ZBEE_TLV_TYPE_KEY_UPD_REQ_SELECTED_KEY_NEGOTIATION_METHOD 0
46/* Security Start Key Negotiation request/response */
47#define ZBEE_TLV_TYPE_KEY_NEG_REQ_CURVE25519_PUBLIC_POINT 0
48/* Security Get Authentication Token Request */
49#define ZBEE_TLV_TYPE_REQUESTED_AUTH_TOKEN_ID 0
50/* Security Get Authentication Token Request */
51#define ZBEE_TLV_TYPE_TARGET_IEEE_ADDRESS 0
52/* Security Decommission Request */
53#define ZBEE_TLV_TYPE_EUI64 0
54/* Beacon Survey Request */
55#define ZBEE_TLV_TYPE_BEACON_SURVEY_CONFIGURATION 0
56#define ZBEE_TLV_TYPE_BEACON_SURVEY_RESULTS 1
57#define ZBEE_TLV_TYPE_BEACON_SURVEY_POTENTIAL_PARENTS 2
58
59/* Security Get_Authentication_Level Response */
60#define ZBEE_TLV_TYPE_GET_AUTH_LEVEL 0
61
62/* Route Request */
63#define ZBEE_TLV_TYPE_EXTENDED_ROUTE_INFO 0
64#define ZBEE_TLV_TYPE_CONCENTRATOR_INFO 1
65#define ZBEE_TLV_TYPE_SOURCE_ROUTE_SOLICIT_INFO 2
66
67/* ZigBee Direct Communication Service */
68#define ZBEE_TLV_TYPE_COMM_EXT_PAN_ID 0 /* Extended PAN ID */
69#define ZBEE_TLV_TYPE_COMM_SHORT_PAN_ID 1 /* Short PAN ID */
70#define ZBEE_TLV_TYPE_COMM_NWK_CH 2 /* Short PAN ID */
71#define ZBEE_TLV_TYPE_COMM_NWK_KEY 3 /* Network Channel */
72#define ZBEE_TLV_TYPE_COMM_LNK_KEY 4 /* Link Key */
73#define ZBEE_TLV_TYPE_COMM_DEV_TYPE 5 /* Device Type */
74#define ZBEE_TLV_TYPE_COMM_NWK_ADDR 6 /* NWK Address */
75#define ZBEE_TLV_TYPE_COMM_JOIN_METHOD 7 /* Joining Method */
76#define ZBEE_TLV_TYPE_COMM_IEEE_ADDR 8 /* IEEE Address */
77#define ZBEE_TLV_TYPE_COMM_TC_ADDR 9 /* Trust Center Address */
78#define ZBEE_TLV_TYPE_COMM_NWK_STATUS_MAP 10 /* Network Status Map */
79#define ZBEE_TLV_TYPE_COMM_NWK_UPD_ID 11 /* NWK Update ID */
80#define ZBEE_TLV_TYPE_COMM_KEY_SEQ_NUM 12 /* NWK Active Key Seq Number */
81#define ZBEE_TLV_TYPE_COMM_ADMIN_KEY 13 /* Admin Key */
82#define ZBEE_TLV_TYPE_COMM_STATUS_CODE 14 /* Extended Status Code */
83
84/* ZigBee Direct Manage Joiners TLV IDs */
85#define ZBEE_TLV_TYPE_COMM_MJ_PROVISIONAL_LINK_KEY 0 /* Provisional Link Key */
86#define ZBEE_TLV_TYPE_COMM_MJ_IEEE_ADDR 1 /* IEEE Address */
87#define ZBEE_TLV_TYPE_COMM_MJ_CMD 2 /* Manage Joiners Command */
88
89/* ZigBee Direct Tunnel Service */
90#define ZBEE_TLV_TYPE_TUNNELING_NPDU_MESSAGE 0 /* NPDU Message */
91
92/* ZigBee Direct Security Service */
93#define ZBEE_TLV_TYPE_KEY_METHOD 0 /* ZigBee Direct Key Negotiation Method */
94#define ZBEE_TLV_TYPE_PUB_POINT_P256 1 /* ZigBee Direct Key Negotiation P-256 Public Point */
95#define ZBEE_TLV_TYPE_PUB_POINT_C25519 2 /* ZigBee Direct Key Negotiation Curve25519 Public Point */
96#define ZBEE_TLV_TYPE_NWK_KEY_SEQ_NUM 3 /* Network Key Sequence Number */
97#define ZBEE_TLV_TYPE_MAC_TAG 4 /* MacTag */
98
99/* TLV parameters*/
100#define ZBEE_TLV_SUPPORTED_KEY_NEGOTIATION_METHODS_KEY_REQUEST 1 << 0
101#define ZBEE_TLV_SUPPORTED_KEY_NEGOTIATION_METHODS_ANONYMOUS_ECDHE_USING_CURVE25519_AES_MMO128 1 << 1
102#define ZBEE_TLV_SUPPORTED_KEY_NEGOTIATION_METHODS_ANONYMOUS_ECDHE_USING_CURVE25519_SHA256 1 << 2
103#define ZBEE_TLV_SUPPORTED_KEY_NEGOTIATION_METHODS_ECDHE_AUTHENTICATION_CURVE25519_AES_MMO128 1 << 3
104#define ZBEE_TLV_SUPPORTED_KEY_NEGOTIATION_METHODS_ECDHE_AUTHENTICATION_CURVE25519_SHA256 1 << 4
105
106#define ZBEE_TLV_SELECTED_KEY_NEGOTIATION_METHODS_ZB_30 0x0
107#define ZBEE_TLV_SELECTED_KEY_NEGOTIATION_METHODS_ECDHE_USING_CURVE25519_AES_MMO128 0x1
108#define ZBEE_TLV_SELECTED_KEY_NEGOTIATION_METHODS_ECDHE_USING_CURVE25519_SHA256 0x2
109
110#define ZBEE_TLV_SELECTED_PRE_SHARED_WELL_KNOWN_KEY 0xff
111#define ZBEE_TLV_SELECTED_PRE_SHARED_SECRET_AUTH_TOKEN 0x00
112#define ZBEE_TLV_SELECTED_PRE_SHARED_SECRET_LINK_KEY_IC 0x01
113#define ZBEE_TLV_SELECTED_PRE_SHARED_SECRET_VLEN_PASSCODE 0x02
114#define ZBEE_TLV_SELECTED_PRE_SHARED_SECRET_BASIC_ACCESS_KEY 0x03
115#define ZBEE_TLV_SELECTED_PRE_SHARED_SECRET_ADMIN_ACCESS_KEY 0x04
116
117#define ZBEE_TLV_ROUTER_INFORMATION_HUB_CONNECTIVITY 1 << 0
118#define ZBEE_TLV_ROUTER_INFORMATION_UPTIME 1 << 1
119#define ZBEE_TLV_ROUTER_INFORMATION_PREF_PARENT 1 << 2
120#define ZBEE_TLV_ROUTER_INFORMATION_BATTERY_BACKUP 1 << 3
121#define ZBEE_TLV_ROUTER_INFORMATION_ENHANCED_BEACON_REQUEST_SUPPORT 1 << 4
122#define ZBEE_TLV_ROUTER_INFORMATION_MAC_DATA_POLL_KEEPALIVE_SUPPORT 1 << 5
123#define ZBEE_TLV_ROUTER_INFORMATION_END_DEVICE_KEEPALIVE_SUPPORT 1 << 6
124#define ZBEE_TLV_ROUTER_INFORMATION_POWER_NEGOTIATION_SUPPORT 1 << 7
125
126#define ZBEE_TLV_LINK_KEY_UNIQUE 1 << 0
127#define ZBEE_TLV_LINK_KEY_PROVISIONAL 1 << 1
128
129#define ZBEE_TLV_STATUS_MAP_JOINED_STATUS 0b00000111
130#define ZBEE_TLV_STATUS_MAP_OPEN_STATUS 0b00001000
131#define ZBEE_TLV_STATUS_MAP_NETWORK_TYPE 0b00010000
132
133#define ZBEE_TLV_TYPE_MSG_SE1 1
134#define ZBEE_TLV_TYPE_MSG_SE2 2
135#define ZBEE_TLV_TYPE_MSG_SE3 3
136#define ZBEE_TLV_TYPE_MSG_SE4 4
137
138#define ZBEE_TLV_TYPE_KEY_ECDHE_KEY_REQUEST_ZB_30 0 /* Static Key Update Request */
139#define ZBEE_TLV_TYPE_DIRECT_KEY_ECDHE_RESERVED_MIN 0 /* 0 is reserved in zigbee direct */
140#define ZBEE_TLV_TYPE_KEY_ECDHE_CURVE_25519_HASH_AESMMO128 1
141#define ZBEE_TLV_TYPE_KEY_ECDHE_CURVE_25519_HASH_SHA256 2
142#define ZBEE_TLV_TYPE_KEY_ECDHE_RESERVED_MAX 3 /* 3-15 is reserved in r23 */
143#define ZBEE_TLV_TYPE_KEY_ECDHE_CURVE_P256_HASH_SHA256 3
144
145#define ZBEE_TLV_TYPE_PSK_WELL_KNOWN_KEY 0xFF
146#define ZBEE_TLV_TYPE_PSK_SECRET_AUTH_TOKEN 0
147#define ZBEE_TLV_TYPE_PSK_SECRET_INSTALL_CODE 1
148#define ZBEE_TLV_TYPE_PSK_SECRET_PAKE_PASSCODE 2
149#define ZBEE_TLV_TYPE_PSK_SECRET_BASIC_ACCESS_KEY 3
150#define ZBEE_TLV_TYPE_PSK_SECRET_ADMINISTRATIVE_ACCESS_KEY 4
151
152#define ZBEE_TLV_TYPE_DEV_TYPE_ZC 0
153#define ZBEE_TLV_TYPE_DEV_TYPE_ZR 1
154#define ZBEE_TLV_TYPE_DEV_TYPE_ED 2
155
156#define ZBEE_TLV_TYPE_JOIN_METHOD_MAC_ASS 0
157#define ZBEE_TLV_TYPE_JOIN_METHOD_NWK_REJ 1
158#define ZBEE_TLV_TYPE_JOIN_METHOD_OOB_WITH_CHECK 2
159#define ZBEE_TLV_TYPE_JOIN_METHOD_OOB_WITHOUT_CHECK 3
160
161#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_GENERAL 0x00
162#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_FORM 0x01
163#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_JOIN 0x02
164#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_PERMIT_JOIN 0x03
165#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_LEAVE 0x04
166#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_MANAGE_JOINERS 0x05
167#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_IDENTIFY 0x06
168#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_FINDING_BINDING 0x07
169#define ZBEE_TLV_TYPE_ZBD_STATUS_DOMAIN_MAX 0x08
170
171#define ZBEE_TLV_TYPE_JOINED_STATUS_NO_NWK 0
172#define ZBEE_TLV_TYPE_JOINED_STATUS_JOINING 1
173#define ZBEE_TLV_TYPE_JOINED_STATUS_JOINED 2
174#define ZBEE_TLV_TYPE_JOINED_STATUS_JOINED_NO_PARENT 3
175#define ZBEE_TLV_TYPE_JOINED_STATUS_LEAVING 4
176
177#define ZBEE_TLV_NWK_TYPE_DISTRIBUTED 0
178#define ZBEE_TLV_NWK_TYPE_CENTRALIZED 1
179
180#define ZBEE_TLV_TYPE_NWK_STATE_CLOSED 0
181#define ZBEE_TLV_TYPE_NWK_STATE_OPENED 1
182
183#define ZBEE_TLV_TYPE_MANAGE_JOINERS_CMD_DROP 0
184#define ZBEE_TLV_TYPE_MANAGE_JOINERS_CMD_ADD 1
185#define ZBEE_TLV_TYPE_MANAGE_JOINERS_CMD_REMOVE 2
186
187#define ZBEE_TLV_TYPE_LINK_KEY_FLAG_GLOBAL 0
188#define ZBEE_TLV_TYPE_LINK_KEY_FLAG_UNIQUE 1
189
190#define ZBEE_TLV_TYPE_LINK_KEY_FLAG_PERMANENT 0
191#define ZBEE_TLV_TYPE_LINK_KEY_FLAG_PROVISIONAL 1
192
193#define ZBEE_TLV_LK_FEATURES_CAPABILITIES_FC_SYNC_SUPPORTED 0b00000001
194
195 unsigned dissect_zbee_tlvs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, void *data, uint8_t source_type, unsigned cmd_id);
196
197#endif
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.