Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

packet-zbee-aps.h
1 /* packet-zbee-aps.h
2 * Dissector routines for the ZigBee Application Support Sub-layer (APS)
3 * By Owen Kirby <osk@exegin.com>
4 * Copyright 2009 Exegin Technologies Limited
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_APS_H
14 #define PACKET_ZBEE_APS_H
15
16 /* ZigBee APS */
17 #define ZBEE_APS_FCF_FRAME_TYPE 0x03
18 #define ZBEE_APS_FCF_DELIVERY_MODE 0x0c
19 #define ZBEE_APS_FCF_INDIRECT_MODE 0x10 /* ZigBee 2004 and earlier. */
20 #define ZBEE_APS_FCF_ACK_FORMAT 0x10 /* ZigBee 2007 and later. */
21 #define ZBEE_APS_FCF_SECURITY 0x20
22 #define ZBEE_APS_FCF_ACK_REQ 0x40
23 #define ZBEE_APS_FCF_EXT_HEADER 0x80
24
25 #define ZBEE_APS_FCF_DATA 0x00
26 #define ZBEE_APS_FCF_CMD 0x01
27 #define ZBEE_APS_FCF_ACK 0x02
28 #define ZBEE_APS_FCF_INTERPAN 0x03
29
30 #define ZBEE_APS_FCF_UNICAST 0x00
31 #define ZBEE_APS_FCF_INDIRECT 0x01
32 #define ZBEE_APS_FCF_BCAST 0x02
33 #define ZBEE_APS_FCF_GROUP 0x03 /* ZigBee 2006 and later. */
34
35 #define ZBEE_APS_EXT_FCF_FRAGMENT 0x03
36 #define ZBEE_APS_EXT_FCF_FRAGMENT_NONE 0x00
37 #define ZBEE_APS_EXT_FCF_FRAGMENT_FIRST 0x01
38 #define ZBEE_APS_EXT_FCF_FRAGMENT_MIDDLE 0x02
39
40 #define ZBEE_APS_CMD_SKKE1 0x01
41 #define ZBEE_APS_CMD_SKKE2 0x02
42 #define ZBEE_APS_CMD_SKKE3 0x03
43 #define ZBEE_APS_CMD_SKKE4 0x04
44 #define ZBEE_APS_CMD_TRANSPORT_KEY 0x05
45 #define ZBEE_APS_CMD_UPDATE_DEVICE 0x06
46 #define ZBEE_APS_CMD_REMOVE_DEVICE 0x07
47 #define ZBEE_APS_CMD_REQUEST_KEY 0x08
48 #define ZBEE_APS_CMD_SWITCH_KEY 0x09
49 #define ZBEE_APS_CMD_EA_INIT_CHLNG 0x0a
50 #define ZBEE_APS_CMD_EA_RESP_CHLNG 0x0b
51 #define ZBEE_APS_CMD_EA_INIT_MAC_DATA 0x0c
52 #define ZBEE_APS_CMD_EA_RESP_MAC_DATA 0x0d
53 #define ZBEE_APS_CMD_TUNNEL 0x0e
54 #define ZBEE_APS_CMD_VERIFY_KEY 0x0f
55 #define ZBEE_APS_CMD_CONFIRM_KEY 0x10
56
57 #define ZBEE_APS_CMD_KEY_TC_MASTER 0x00
58 #define ZBEE_APS_CMD_KEY_STANDARD_NWK 0x01
59 #define ZBEE_APS_CMD_KEY_APP_MASTER 0x02
60 #define ZBEE_APS_CMD_KEY_APP_LINK 0x03
61 #define ZBEE_APS_CMD_KEY_TC_LINK 0x04
62 #define ZBEE_APS_CMD_KEY_HIGH_SEC_NWK 0x05
63
64 #define ZBEE_APS_CMD_SKKE_DATA_LENGTH 16
65 #define ZBEE_APS_CMD_KEY_LENGTH 16
66
67 #define ZBEE_APS_CMD_REQ_NWK_KEY 0x01
68 #define ZBEE_APS_CMD_REQ_APP_KEY 0x02
69
70 #define ZBEE_APS_CMD_UPDATE_STANDARD_SEC_REJOIN 0x00
71 #define ZBEE_APS_CMD_UPDATE_STANDARD_UNSEC_JOIN 0x01
72 #define ZBEE_APS_CMD_UPDATE_LEAVE 0x02
73 #define ZBEE_APS_CMD_UPDATE_STANDARD_UNSEC_REJOIN 0x03
74 #define ZBEE_APS_CMD_UPDATE_HIGH_SEC_REJOIN 0x04
75 #define ZBEE_APS_CMD_UPDATE_HIGH_UNSEC_JOIN 0x05
76 #define ZBEE_APS_CMD_UPDATE_HIGH_UNSEC_REJOIN 0x07
77
78 #define ZBEE_APS_CMD_EA_KEY_NWK 0x00
79 #define ZBEE_APS_CMD_EA_KEY_LINK 0x01
80 #define ZBEE_APS_CMD_EA_CHALLENGE_LENGTH 16
81 #define ZBEE_APS_CMD_EA_MAC_LENGTH 16
82 #define ZBEE_APS_CMD_EA_DATA_LENGTH 4
83
84 /* Fields for ZigBee 2004 and earlier. */
85 #define ZBEE_APP_TYPE 0xF0
86 #define ZBEE_APP_COUNT 0x0F
87
88 #define ZBEE_APP_TYPE_KVP 0x01
89 #define ZBEE_APP_TYPE_MSG 0x02
90
91 #define ZBEE_APP_KVP_CMD 0x0F
92 #define ZBEE_APP_KVP_TYPE 0xF0
93
94 #define ZBEE_APP_KVP_SET 0x01
95 #define ZBEE_APP_KVP_EVENT 0x02
96 #define ZBEE_APP_KVP_GET_ACK 0x04
97 #define ZBEE_APP_KVP_SET_ACK 0x05
98 #define ZBEE_APP_KVP_EVENT_ACK 0x06
99 #define ZBEE_APP_KVP_GET_RESP 0x08
100 #define ZBEE_APP_KVP_SET_RESP 0x09
101 #define ZBEE_APP_KVP_EVENT_RESP 0x0A
102
103 #define ZBEE_APP_KVP_NO_DATA 0x00
104 #define ZBEE_APP_KVP_UINT8 0x01
105 #define ZBEE_APP_KVP_INT8 0x02
106 #define ZBEE_APP_KVP_UINT16 0x03
107 #define ZBEE_APP_KVP_INT16 0x04
108 #define ZBEE_APP_KVP_FLOAT16 0x0B
109 #define ZBEE_APP_KVP_ABS_TIME 0x0C
110 #define ZBEE_APP_KVP_REL_TIME 0x0D
111 #define ZBEE_APP_KVP_CHAR_STRING 0x0E
112 #define ZBEE_APP_KVP_OCT_STRING 0x0F
113
114 #define ZBEE_APP_KVP_OVERHEAD 4
115
116 /* ZCL Cluster IDs - General */
117 #define ZBEE_ZCL_CID_BASIC 0x0000
118 #define ZBEE_ZCL_CID_POWER_CONFIG 0x0001
119 #define ZBEE_ZCL_CID_DEVICE_TEMP_CONFIG 0x0002
120 #define ZBEE_ZCL_CID_IDENTIFY 0x0003
121 #define ZBEE_ZCL_CID_GROUPS 0x0004
122 #define ZBEE_ZCL_CID_SCENES 0x0005
123 #define ZBEE_ZCL_CID_ON_OFF 0x0006
124 #define ZBEE_ZCL_CID_ON_OFF_SWITCH_CONFIG 0x0007
125 #define ZBEE_ZCL_CID_LEVEL_CONTROL 0x0008
126 #define ZBEE_ZCL_CID_ALARMS 0x0009
127 #define ZBEE_ZCL_CID_TIME 0x000a
128 #define ZBEE_ZCL_CID_RSSI_LOCATION 0x000b
129 #define ZBEE_ZCL_CID_ANALOG_INPUT_BASIC 0x000c
130 #define ZBEE_ZCL_CID_ANALOG_OUTPUT_BASIC 0x000d
131 #define ZBEE_ZCL_CID_ANALOG_VALUE_BASIC 0x000e
132 #define ZBEE_ZCL_CID_BINARY_INPUT_BASIC 0x000f
133 #define ZBEE_ZCL_CID_BINARY_OUTPUT_BASIC 0x0010
134 #define ZBEE_ZCL_CID_BINARY_VALUE_BASIC 0x0011
135 #define ZBEE_ZCL_CID_MULTISTATE_INPUT_BASIC 0x0012
136 #define ZBEE_ZCL_CID_MULTISTATE_OUTPUT_BASIC 0x0013
137 #define ZBEE_ZCL_CID_MULTISTATE_VALUE_BASIC 0x0014
138 #define ZBEE_ZCL_CID_COMMISSIONING 0x0015
139 #define ZBEE_ZCL_CID_PARTITION 0x0016
140 #define ZBEE_ZCL_CID_OTA_UPGRADE 0x0019
141 #define ZBEE_ZCL_CID_POLL_CONTROL 0x0020
142 #define ZBEE_ZCL_CID_GP 0x0021
143 /* */
144 #define ZBEE_ZCL_CID_POWER_PROFILE 0x001a
145 #define ZBEE_ZCL_CID_APPLIANCE_CONTROL 0x001b
146
147 /* ZCL Cluster IDs - Closures */
148 #define ZBEE_ZCL_CID_SHADE_CONFIG 0x0100
149 #define ZBEE_ZCL_CID_DOOR_LOCK 0X0101
150 #define ZBEE_ZCL_CID_WINDOW_COVERING 0X0102
151
152 /* ZCL Cluster IDs - HVAC */
153 #define ZBEE_ZCL_CID_PUMP_CONFIG_CONTROL 0x0200
154 #define ZBEE_ZCL_CID_THERMOSTAT 0x0201
155 #define ZBEE_ZCL_CID_FAN_CONTROL 0x0202
156 #define ZBEE_ZCL_CID_DEHUMIDIFICATION_CONTROL 0x0203
157 #define ZBEE_ZCL_CID_THERMOSTAT_UI_CONFIG 0x0204
158
159 /* ZCL Cluster IDs - Lighting */
160 #define ZBEE_ZCL_CID_COLOR_CONTROL 0x0300
161 #define ZBEE_ZCL_CID_BALLAST_CONFIG 0x0301
162
163 /* ZCL Cluster IDs - Measurement and Sensing */
164 #define ZBEE_ZCL_CID_ILLUMINANCE_MEASUREMENT 0x0400
165 #define ZBEE_ZCL_CID_ILLUMINANCE_LEVEL_SENSING 0x0401
166 #define ZBEE_ZCL_CID_TEMPERATURE_MEASUREMENT 0x0402
167 #define ZBEE_ZCL_CID_PRESSURE_MEASUREMENT 0x0403
168 #define ZBEE_ZCL_CID_FLOW_MEASUREMENT 0x0404
169 #define ZBEE_ZCL_CID_REL_HUMIDITY_MEASUREMENT 0x0405
170 #define ZBEE_ZCL_CID_OCCUPANCY_SENSING 0x0406
171
172 /* ZCL Cluster IDs - Security and Safety */
173 #define ZBEE_ZCL_CID_IAS_ZONE 0x0500
174 #define ZBEE_ZCL_CID_IAS_ACE 0x0501
175 #define ZBEE_ZCL_CID_IAS_WD 0x0502
176
177 /* ZCL Cluster IDs - Protocol Interfaces */
178 #define ZBEE_ZCL_CID_GENERIC_TUNNEL 0x0600
179 #define ZBEE_ZCL_CID_BACNET_PROTOCOL_TUNNEL 0x0601
180 #define ZBEE_ZCL_CID_BACNET_ANALOG_INPUT_REG 0x0602
181 #define ZBEE_ZCL_CID_BACNET_ANALOG_INPUT_EXT 0x0603
182 #define ZBEE_ZCL_CID_BACNET_ANALOG_OUTPUT_REG 0x0604
183 #define ZBEE_ZCL_CID_BACNET_ANALOG_OUTPUT_EXT 0x0605
184 #define ZBEE_ZCL_CID_BACNET_ANALOG_VALUE_REG 0x0606
185 #define ZBEE_ZCL_CID_BACNET_ANALOG_VALUE_EXT 0x0607
186 #define ZBEE_ZCL_CID_BACNET_BINARY_INPUT_REG 0x0608
187 #define ZBEE_ZCL_CID_BACNET_BINARY_INPUT_EXT 0x0609
188 #define ZBEE_ZCL_CID_BACNET_BINARY_OUTPUT_REG 0x060a
189 #define ZBEE_ZCL_CID_BACNET_BINARY_OUTPUT_EXT 0x060b
190 #define ZBEE_ZCL_CID_BACNET_BINARY_VALUE_REG 0x060c
191 #define ZBEE_ZCL_CID_BACNET_BINARY_VALUE_EXT 0x060d
192 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_INPUT_REG 0x060e
193 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_INPUT_EXT 0x060f
194 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_OUTPUT_REG 0x0610
195 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_OUTPUT_EXT 0x0611
196 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_VALUE_REG 0x0612
197 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_VALUE_EXT 0x0613
198
199 /* ZCL Cluster IDs - Smart Energy */
200 #define ZBEE_ZCL_CID_KEEP_ALIVE 0x0025
201 #define ZBEE_ZCL_CID_PRICE 0x0700
202 #define ZBEE_ZCL_CID_DEMAND_RESPONSE_LOAD_CONTROL 0x0701
203 #define ZBEE_ZCL_CID_SIMPLE_METERING 0x0702
204 #define ZBEE_ZCL_CID_MESSAGE 0x0703
205 #define ZBEE_ZCL_CID_TUNNELING 0x0704
206 #define ZBEE_ZCL_CID_PRE_PAYMENT 0x0705
207 #define ZBEE_ZCL_CID_ENERGY_MANAGEMENT 0x0706
208 #define ZBEE_ZCL_CID_CALENDAR 0x0707
209 #define ZBEE_ZCL_CID_DEVICE_MANAGEMENT 0x0708
210 #define ZBEE_ZCL_CID_EVENTS 0x0709
211 #define ZBEE_ZCL_CID_MDU_PAIRING 0x070A
212 #define ZBEE_ZCL_CID_SUB_GHZ 0x070B
213
214 /* ZCL Cluster IDs - Key Establishment */
215 #define ZBEE_ZCL_CID_KE 0x0800
216
217 /* ZCL Cluster IDs - Home Automation */
218 #define ZBEE_ZCL_CID_APPLIANCE_IDENTIFICATION 0x0b00
219 #define ZBEE_ZCL_CID_METER_IDENTIFICATION 0x0b01
220 #define ZBEE_ZCL_CID_APPLIANCE_EVENTS_AND_ALERT 0x0b02
221 #define ZBEE_ZCL_CID_APPLIANCE_STATISTICS 0x0b03
222
223 #define ZBEE_ZCL_CID_ZLL 0x1000
224
225 /* ZCL Test Profile #2 Clusters */
226 #define ZBEE_APS_T2_CID_TCP 0x0001
227 #define ZBEE_APS_T2_CID_RESPC 0x0002
228 #define ZBEE_APS_T2_CID_RETPC 0x0003
229 #define ZBEE_APS_T2_CID_PCR 0x0004
230 #define ZBEE_APS_T2_CID_BTREQ 0x001c
231 #define ZBEE_APS_T2_CID_BTGREQ 0x001d
232 #define ZBEE_APS_T2_CID_BTRES 0x0054
233 #define ZBEE_APS_T2_CID_BTRES_S_SBT 0x00
234 #define ZBEE_APS_T2_CID_BTRES_S_TFOFA 0x01
235 #define ZBEE_APS_T2_CID_BTGRES 0x0055
236 #define ZBEE_APS_T2_CID_RDREQ 0x1000
237 #define ZBEE_APS_T2_CID_RDRES 0x1001
238 #define ZBEE_APS_T2_CID_FREQ 0xa0a8
239 #define ZBEE_APS_T2_CID_FRES 0xe000
240 #define ZBEE_APS_T2_CID_FNDR 0xe001
241 #define ZBEE_APS_T2_CID_BR 0xf000
242 #define ZBEE_APS_T2_CID_BTADR 0xf001
243 #define ZBEE_APS_T2_CID_BTARXOWIDR 0xf00a
244 #define ZBEE_APS_T2_CID_BTARACR 0xf00e
245
246
247 #define ZBEE_APP_STATUS_SUCCESS 0x00 /*A request has been executed successfully.*/
248 #define ZBEE_APP_STATUS_ASDU_TOO_LONG 0xa0 /*A transmit request failed since the ASDU is too large and fragmentation is not supported.*/
249 #define ZBEE_APP_STATUS_DEFRAG_DEFERRED 0xa1 /*A received fragmented frame could not be defragmented at the current time.*/
250 #define ZBEE_APP_STATUS_DEFRAG_UNSUPPORTED 0xa2 /*A received fragmented frame could not be defragmented since the device does not support fragmentation.*/
251 #define ZBEE_APP_STATUS_ILLEGAL_REQUEST 0xa3 /*A parameter value was out of range.*/
252 #define ZBEE_APP_STATUS_INVALID_BINDING 0xa4 /*An APSME-UNBIND.request failed due to the requested binding link not existing in the binding table.*/
253 #define ZBEE_APP_STATUS_INVALID_GROUP 0xa5 /*An APSME-REMOVE-GROUP.request has been issued with a group identifier that does not appear in the group table.*/
254 #define ZBEE_APP_STATUS_INVALID_PARAMETER 0xa6 /*A parameter value was invalid or out of range.*/
255 #define ZBEE_APP_STATUS_NO_ACK 0xa7 /*An APSDE-DATA.request requesting acknowledged trans-mission failed due to no acknowledgement being received.*/
256 #define ZBEE_APP_STATUS_NO_BOUND_DEVICE 0xa8 /*An APSDE-DATA.request with a destination addressing mode set to 0x00 failed due to there being no devices bound to this device.*/
257 #define ZBEE_APP_STATUS_NO_SHORT_ADDRESS 0xa9 /*An APSDE-DATA.request with a destination addressing mode set to 0x03 failed due to no corresponding short address found*/
258 #define ZBEE_APP_STATUS_NOT_SUPPORTED 0xaa /*An APSDE-DATA.request with a destination addressing mode set to 0x00 failed due to a binding table not being supported on the device.*/
259 #define ZBEE_APP_STATUS_SECURED_LINK_KEY 0xab /*An ASDU was received that was secured using a link key.*/
260 #define ZBEE_APP_STATUS_SECURED_NWK_KEY 0xac /*An ASDU was received that was secured using a network key.*/
261 #define ZBEE_APP_STATUS_SECURITY_FAIL 0xad /*An APSDE-DATA.request requesting security has resulted in an error during the corresponding security processing.*/
262 #define ZBEE_APP_STATUS_TABLE_FULL 0xae /*An APSME-BIND.request or APSME.ADD-GROUP.request issued when the binding or group tables, respectively, were full.*/
263 #define ZBEE_APP_STATUS_UNSECURED 0xaf /*An ASDU was received without any security.*/
264 #define ZBEE_APP_STATUS_UNSUPPORTED_ATTRIBUTE 0xb0 /*An APSME-GET.request or APSME-SET.request has been issued with an unknown attribute identifier.*/
265
266 /* Structure to contain the APS frame information */
267 typedef struct{
268 gboolean indirect_mode; /* ZigBee 2004 and Earlier */
269 guint8 type;
270 guint8 delivery;
271 gboolean ack_format; /* ZigBee 2007 and Later */
272 gboolean security;
273 gboolean ack_req;
274 gboolean ext_header; /* ZigBee 2007 and Later */
275
276 guint8 dst;
277 guint16 group; /* ZigBee 2006 and Later */
278 guint16 profile;
279 guint8 src;
280 guint8 counter;
281
282 /* Fragmentation Fields. */
283 guint8 fragmentation; /* ZigBee 2007 and Later */
284 guint8 block_number; /* ZigBee 2007 and Later */
285
286 /* Some helpers for the upper layers. */
287 gboolean profile_present;
288 gboolean dst_present;
289 gboolean src_present;
290 } zbee_aps_packet;
291
292 /* ZigBee Smart Energy version used for preferences */
293 extern gint gPREF_zbee_se_protocol_version;
294
295 enum {
296 ZBEE_SE_VERSION_1_1B,
297 ZBEE_SE_VERSION_1_2,
298 ZBEE_SE_VERSION_1_2A,
299 ZBEE_SE_VERSION_1_2B,
300 ZBEE_SE_VERSION_1_4
301 };
302
303 /**************************************
304 * Value Strings
305 **************************************
306 */
307
308 extern const value_string zbee_aps_cid_names[];
309 extern const range_string zbee_aps_apid_names[];
310
311 #endif /* PACKET_ZBEE_APS_H*/
312
313 /*
314 * Editor modelines - http://www.wireshark.org/tools/modelines.html
315 *
316 * Local variables:
317 * c-basic-offset: 4
318 * tab-width: 8
319 * indent-tabs-mode: nil
320 * End:
321 *
322 * vi: set shiftwidth=4 tabstop=8 expandtab:
323 * :indentSize=4:tabSize=8:noTabs=true:
324 */
zbee_aps_packet
Definition: packet-zbee-aps.h:267
profile
Definition: packet-epl.h:23
_range_string
Definition: value_string.h:234
_value_string
Definition: value_string.h:24
_header
Definition: packet-gtp.c:2361