HACK: 2nd try to match RowsetProperties
[wireshark-wip.git] / epan / dissectors / packet-zbee-aps.h
blobdaf1353393d97fd779dd393e71c14a0a397b3a5f
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
6 * $Id$
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifndef PACKET_ZBEE_APS_H
28 #define PACKET_ZBEE_APS_H
30 /* ZigBee APS */
31 #define ZBEE_APS_FCF_FRAME_TYPE 0x03
32 #define ZBEE_APS_FCF_DELIVERY_MODE 0x0c
33 #define ZBEE_APS_FCF_INDIRECT_MODE 0x10 /* ZigBee 2004 and earlier. */
34 #define ZBEE_APS_FCF_ACK_FORMAT 0x10 /* ZigBee 2007 and later. */
35 #define ZBEE_APS_FCF_SECURITY 0x20
36 #define ZBEE_APS_FCF_ACK_REQ 0x40
37 #define ZBEE_APS_FCF_EXT_HEADER 0x80
39 #define ZBEE_APS_FCF_DATA 0x00
40 #define ZBEE_APS_FCF_CMD 0x01
41 #define ZBEE_APS_FCF_ACK 0x02
43 #define ZBEE_APS_FCF_UNICAST 0x00
44 #define ZBEE_APS_FCF_INDIRECT 0x01
45 #define ZBEE_APS_FCF_BCAST 0x02
46 #define ZBEE_APS_FCF_GROUP 0x03 /* ZigBee 2006 and later. */
48 #define ZBEE_APS_EXT_FCF_FRAGMENT 0x03
49 #define ZBEE_APS_EXT_FCF_FRAGMENT_NONE 0x00
50 #define ZBEE_APS_EXT_FCF_FRAGMENT_FIRST 0x01
51 #define ZBEE_APS_EXT_FCF_FRAGMENT_MIDDLE 0x02
53 #define ZBEE_APS_CMD_SKKE1 0x01
54 #define ZBEE_APS_CMD_SKKE2 0x02
55 #define ZBEE_APS_CMD_SKKE3 0x03
56 #define ZBEE_APS_CMD_SKKE4 0x04
57 #define ZBEE_APS_CMD_TRANSPORT_KEY 0x05
58 #define ZBEE_APS_CMD_UPDATE_DEVICE 0x06
59 #define ZBEE_APS_CMD_REMOVE_DEVICE 0x07
60 #define ZBEE_APS_CMD_REQUEST_KEY 0x08
61 #define ZBEE_APS_CMD_SWITCH_KEY 0x09
62 #define ZBEE_APS_CMD_EA_INIT_CHLNG 0x0a
63 #define ZBEE_APS_CMD_EA_RESP_CHLNG 0x0b
64 #define ZBEE_APS_CMD_EA_INIT_MAC_DATA 0x0c
65 #define ZBEE_APS_CMD_EA_RESP_MAC_DATA 0x0d
66 #define ZBEE_APS_CMD_TUNNEL 0x0e
68 #define ZBEE_APS_CMD_KEY_TC_MASTER 0x00
69 #define ZBEE_APS_CMD_KEY_STANDARD_NWK 0x01
70 #define ZBEE_APS_CMD_KEY_APP_MASTER 0x02
71 #define ZBEE_APS_CMD_KEY_APP_LINK 0x03
72 #define ZBEE_APS_CMD_KEY_TC_LINK 0x04
73 #define ZBEE_APS_CMD_KEY_HIGH_SEC_NWK 0x05
75 #define ZBEE_APS_CMD_SKKE_DATA_LENGTH 16
76 #define ZBEE_APS_CMD_KEY_LENGTH 16
78 #define ZBEE_APS_CMD_REQ_NWK_KEY 0x01
79 #define ZBEE_APS_CMD_REQ_APP_KEY 0x02
81 #define ZBEE_APS_CMD_UPDATE_STANDARD_SEC_REJOIN 0x00
82 #define ZBEE_APS_CMD_UPDATE_STANDARD_UNSEC_JOIN 0x01
83 #define ZBEE_APS_CMD_UPDATE_LEAVE 0x02
84 #define ZBEE_APS_CMD_UPDATE_STANDARD_UNSEC_REJOIN 0x03
85 #define ZBEE_APS_CMD_UPDATE_HIGH_SEC_REJOIN 0x04
86 #define ZBEE_APS_CMD_UPDATE_HIGH_UNSEC_JOIN 0x05
87 #define ZBEE_APS_CMD_UPDATE_HIGH_UNSEC_REJOIN 0x07
89 #define ZBEE_APS_CMD_EA_KEY_NWK 0x00
90 #define ZBEE_APS_CMD_EA_KEY_LINK 0x01
91 #define ZBEE_APS_CMD_EA_CHALLENGE_LENGTH 16
92 #define ZBEE_APS_CMD_EA_MAC_LENGTH 16
93 #define ZBEE_APS_CMD_EA_DATA_LENGTH 4
95 /* Fields for ZigBee 2004 and earlier. */
96 #define ZBEE_APP_TYPE 0xF0
97 #define ZBEE_APP_COUNT 0x0F
99 #define ZBEE_APP_TYPE_KVP 0x01
100 #define ZBEE_APP_TYPE_MSG 0x02
102 #define ZBEE_APP_KVP_CMD 0x0F
103 #define ZBEE_APP_KVP_TYPE 0xF0
105 #define ZBEE_APP_KVP_SET 0x01
106 #define ZBEE_APP_KVP_EVENT 0x02
107 #define ZBEE_APP_KVP_GET_ACK 0x04
108 #define ZBEE_APP_KVP_SET_ACK 0x05
109 #define ZBEE_APP_KVP_EVENT_ACK 0x06
110 #define ZBEE_APP_KVP_GET_RESP 0x08
111 #define ZBEE_APP_KVP_SET_RESP 0x09
112 #define ZBEE_APP_KVP_EVENT_RESP 0x0A
114 #define ZBEE_APP_KVP_NO_DATA 0x00
115 #define ZBEE_APP_KVP_UINT8 0x01
116 #define ZBEE_APP_KVP_INT8 0x02
117 #define ZBEE_APP_KVP_UINT16 0x03
118 #define ZBEE_APP_KVP_INT16 0x04
119 #define ZBEE_APP_KVP_FLOAT16 0x0B
120 #define ZBEE_APP_KVP_ABS_TIME 0x0C
121 #define ZBEE_APP_KVP_REL_TIME 0x0D
122 #define ZBEE_APP_KVP_CHAR_STRING 0x0E
123 #define ZBEE_APP_KVP_OCT_STRING 0x0F
125 #define ZBEE_APP_KVP_OVERHEAD 4
127 /* ZCL Cluster IDs - General */
128 #define ZBEE_ZCL_CID_BASIC 0x0000
129 #define ZBEE_ZCL_CID_POWER_CONFIG 0x0001
130 #define ZBEE_ZCL_CID_DEVICE_TEMP_CONFIG 0x0002
131 #define ZBEE_ZCL_CID_IDENTIFY 0x0003
132 #define ZBEE_ZCL_CID_GROUPS 0x0004
133 #define ZBEE_ZCL_CID_SCENES 0x0005
134 #define ZBEE_ZCL_CID_ON_OFF 0x0006
135 #define ZBEE_ZCL_CID_ON_OFF_SWITCH_CONFIG 0x0007
136 #define ZBEE_ZCL_CID_LEVEL_CONTROL 0x0008
137 #define ZBEE_ZCL_CID_ALARMS 0x0009
138 #define ZBEE_ZCL_CID_TIME 0x000a
139 #define ZBEE_ZCL_CID_RSSI_LOCATION 0x000b
140 #define ZBEE_ZCL_CID_ANALOG_INPUT_BASIC 0x000c
141 #define ZBEE_ZCL_CID_ANALOG_OUTPUT_BASIC 0x000d
142 #define ZBEE_ZCL_CID_ANALOG_VALUE_BASIC 0x000e
143 #define ZBEE_ZCL_CID_BINARY_INPUT_BASIC 0x000f
144 #define ZBEE_ZCL_CID_BINARY_OUTPUT_BASIC 0x0010
145 #define ZBEE_ZCL_CID_BINARY_VALUE_BASIC 0x0011
146 #define ZBEE_ZCL_CID_MULTISTATE_INPUT_BASIC 0x0012
147 #define ZBEE_ZCL_CID_MULTISTATE_OUTPUT_BASIC 0x0013
148 #define ZBEE_ZCL_CID_MULTISTATE_VALUE_BASIC 0x0014
149 #define ZBEE_ZCL_CID_COMMISSIONING 0x0015
150 #define ZBEE_ZCL_CID_PARTITION 0x0016
151 /* */
152 #define ZBEE_ZCL_CID_POWER_PROFILE 0x001a
153 #define ZBEE_ZCL_CID_APPLIANCE_CONTROL 0x001b
155 /* ZCL Cluster IDs - Closures */
156 #define ZBEE_ZCL_CID_SHADE_CONFIG 0x0100
157 #define ZBEE_ZCL_CID_DOOR_LOCK 0X0101
159 /* ZCL Cluster IDs - HVAC */
160 #define ZBEE_ZCL_CID_PUMP_CONFIG_CONTROL 0x0200
161 #define ZBEE_ZCL_CID_THERMOSTAT 0x0201
162 #define ZBEE_ZCL_CID_FAN_CONTROL 0x0202
163 #define ZBEE_ZCL_CID_DEHUMIDIFICATION_CONTROL 0x0203
164 #define ZBEE_ZCL_CID_THERMOSTAT_UI_CONFIG 0x0204
166 /* ZCL Cluster IDs - Lighting */
167 #define ZBEE_ZCL_CID_COLOR_CONTROL 0x0300
168 #define ZBEE_ZCL_CID_BALLAST_CONFIG 0x0301
170 /* ZCL Cluster IDs - Measurement and Sensing */
171 #define ZBEE_ZCL_CID_ILLUMINANCE_MEASUREMENT 0x0400
172 #define ZBEE_ZCL_CID_ILLUMINANCE_LEVEL_SENSING 0x0401
173 #define ZBEE_ZCL_CID_TEMPERATURE_MEASUREMENT 0x0402
174 #define ZBEE_ZCL_CID_PRESSURE_MEASUREMENT 0x0403
175 #define ZBEE_ZCL_CID_FLOW_MEASUREMENT 0x0404
176 #define ZBEE_ZCL_CID_REL_HUMIDITY_MEASUREMENT 0x0405
177 #define ZBEE_ZCL_CID_OCCUPANCY_SENSING 0x0406
179 /* ZCL Cluster IDs - Security and Safety */
180 #define ZBEE_ZCL_CID_IAS_ZONE 0x0500
181 #define ZBEE_ZCL_CID_IAS_ACE 0x0501
182 #define ZBEE_ZCL_CID_IAS_WD 0x0502
184 /* ZCL Cluster IDs - Protocol Interfaces */
185 #define ZBEE_ZCL_CID_GENERIC_TUNNEL 0x0600
186 #define ZBEE_ZCL_CID_BACNET_PROTOCOL_TUNNEL 0x0601
187 #define ZBEE_ZCL_CID_BACNET_ANALOG_INPUT_REG 0x0602
188 #define ZBEE_ZCL_CID_BACNET_ANALOG_INPUT_EXT 0x0603
189 #define ZBEE_ZCL_CID_BACNET_ANALOG_OUTPUT_REG 0x0604
190 #define ZBEE_ZCL_CID_BACNET_ANALOG_OUTPUT_EXT 0x0605
191 #define ZBEE_ZCL_CID_BACNET_ANALOG_VALUE_REG 0x0606
192 #define ZBEE_ZCL_CID_BACNET_ANALOG_VALUE_EXT 0x0607
193 #define ZBEE_ZCL_CID_BACNET_BINARY_INPUT_REG 0x0608
194 #define ZBEE_ZCL_CID_BACNET_BINARY_INPUT_EXT 0x0609
195 #define ZBEE_ZCL_CID_BACNET_BINARY_OUTPUT_REG 0x060a
196 #define ZBEE_ZCL_CID_BACNET_BINARY_OUTPUT_EXT 0x060b
197 #define ZBEE_ZCL_CID_BACNET_BINARY_VALUE_REG 0x060c
198 #define ZBEE_ZCL_CID_BACNET_BINARY_VALUE_EXT 0x060d
199 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_INPUT_REG 0x060e
200 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_INPUT_EXT 0x060f
201 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_OUTPUT_REG 0x0610
202 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_OUTPUT_EXT 0x0611
203 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_VALUE_REG 0x0612
204 #define ZBEE_ZCL_CID_BACNET_MULTISTATE_VALUE_EXT 0x0613
206 /* ZCL Cluster IDs - Smart Energy */
207 #define ZBEE_ZCL_CID_PRICE 0x0700
208 #define ZBEE_ZCL_CID_DEMAND_RESPONSE_LOAD_CONTROL 0x0701
209 #define ZBEE_ZCL_CID_SIMPLE_METERING 0x0702
210 #define ZBEE_ZCL_CID_MESSAGE 0x0703
211 #define ZBEE_ZCL_CID_SMART_ENERGY_TUNNELING 0x0704
212 #define ZBEE_ZCL_CID_PRE_PAYMENT 0x0705
214 /* ZCL Cluster IDs - Home Automation */
215 #define ZBEE_ZCL_CID_APPLIANCE_IDENTIFICATION 0x0b00
216 #define ZBEE_ZCL_CID_METER_IDENTIFICATION 0x0b01
217 #define ZBEE_ZCL_CID_APPLIANCE_EVENTS_AND_ALERT 0x0b02
218 #define ZBEE_ZCL_CID_APPLIANCE_STATISTICS 0x0b03
220 /* Structure to contain the APS frame information */
221 typedef struct{
222 gboolean indirect_mode; /* ZigBee 2004 and Earlier */
223 guint8 type;
224 guint8 delivery;
225 gboolean ack_format; /* ZigBee 2007 and Later */
226 gboolean security;
227 gboolean ack_req;
228 gboolean ext_header; /* ZigBee 2007 and Later */
230 guint8 dst;
231 guint16 group; /* ZigBee 2006 and Later */
232 guint16 profile;
233 guint8 src;
234 guint8 counter;
236 /* Fragmentation Fields. */
237 guint8 fragmentation; /* ZigBee 2007 and Later */
238 guint8 block_number; /* ZigBee 2007 and Later */
239 guint8 ack_bitfield; /* ZigBee 2007 and Later */
241 /* Some helpers for the upper layers. */
242 gboolean profile_present;
243 gboolean dst_present;
244 gboolean src_present;
245 } zbee_aps_packet;
247 #endif /* PACKET_ZBEE_APS_H*/