12#ifndef PACKET_ZBEE_NWK_H
13#define PACKET_ZBEE_NWK_H
16#define ZBEE_NWK_FCF_FRAME_TYPE 0x0003
17#define ZBEE_NWK_FCF_VERSION 0x003C
18#define ZBEE_NWK_FCF_DISCOVER_ROUTE 0x00C0
19#define ZBEE_NWK_FCF_MULTICAST 0x0100
20#define ZBEE_NWK_FCF_SECURITY 0x0200
21#define ZBEE_NWK_FCF_SOURCE_ROUTE 0x0400
22#define ZBEE_NWK_FCF_EXT_DEST 0x0800
23#define ZBEE_NWK_FCF_EXT_SOURCE 0x1000
24#define ZBEE_NWK_FCF_END_DEVICE_INITIATOR 0x2000
27#define ZBEE_NWK_FCF_DATA 0x0000
28#define ZBEE_NWK_FCF_CMD 0x0001
29#define ZBEE_NWK_FCF_INTERPAN 0x0003
32#define ZBEE_NWK_FCF_DISCOVERY_SUPPRESS 0x0000
33#define ZBEE_NWK_FCF_DISCOVERY_ENABLE 0x0001
34#define ZBEE_NWK_FCF_DISCOVERY_FORCE 0x0003
37#define ZBEE_NWK_MCAST_MODE 0x03
38#define ZBEE_NWK_MCAST_RADIUS 0x1c
39#define ZBEE_NWK_MCAST_MAX_RADIUS 0xe0
40#define ZBEE_NWK_MCAST_MODE_NONMEMBER 0x00
41#define ZBEE_NWK_MCAST_MODE_MEMBER 0x01
44#define ZBEE_NWK_CMD_ROUTE_REQ 0x01
45#define ZBEE_NWK_CMD_ROUTE_REPLY 0x02
46#define ZBEE_NWK_CMD_NWK_STATUS 0x03
47#define ZBEE_NWK_CMD_LEAVE 0x04
48#define ZBEE_NWK_CMD_ROUTE_RECORD 0x05
49#define ZBEE_NWK_CMD_REJOIN_REQ 0x06
50#define ZBEE_NWK_CMD_REJOIN_RESP 0x07
51#define ZBEE_NWK_CMD_LINK_STATUS 0x08
52#define ZBEE_NWK_CMD_NWK_REPORT 0x09
53#define ZBEE_NWK_CMD_NWK_UPDATE 0x0a
54#define ZBEE_NWK_CMD_ED_TIMEOUT_REQUEST 0x0b
55#define ZBEE_NWK_CMD_ED_TIMEOUT_RESPONSE 0x0c
56#define ZBEE_NWK_CMD_LINK_PWR_DELTA 0x0d
57#define ZBEE_NWK_CMD_COMMISSIONING_REQUEST 0x0e
58#define ZBEE_NWK_CMD_COMMISSIONING_RESPONSE 0x0f
61#define ZBEE_NWK_CMD_ROUTE_OPTION_REPAIR 0x80
62#define ZBEE_NWK_CMD_ROUTE_OPTION_MCAST 0x40
63#define ZBEE_NWK_CMD_ROUTE_OPTION_DEST_EXT 0x20
64#define ZBEE_NWK_CMD_ROUTE_OPTION_MANY_MASK 0x18
65#define ZBEE_NWK_CMD_ROUTE_OPTION_RESP_EXT 0x20
66#define ZBEE_NWK_CMD_ROUTE_OPTION_ORIG_EXT 0x10
69#define ZBEE_NWK_CMD_ROUTE_OPTION_MANY_NONE 0x00
70#define ZBEE_NWK_CMD_ROUTE_OPTION_MANY_REC 0x01
71#define ZBEE_NWK_CMD_ROUTE_OPTION_MANY_NOREC 0x02
74#define ZBEE_NWK_CMD_LEAVE_OPTION_CHILDREN 0x80
75#define ZBEE_NWK_CMD_LEAVE_OPTION_REQUEST 0x40
76#define ZBEE_NWK_CMD_LEAVE_OPTION_REJOIN 0x20
79#define ZBEE_NWK_CMD_LINK_OPTION_LAST_FRAME 0x40
80#define ZBEE_NWK_CMD_LINK_OPTION_FIRST_FRAME 0x20
81#define ZBEE_NWK_CMD_LINK_OPTION_COUNT_MASK 0x1f
84#define ZBEE_NWK_CMD_LINK_INCOMMING_COST_MASK 0x07
85#define ZBEE_NWK_CMD_LINK_OUTGOING_COST_MASK 0x70
88#define ZBEE_NWK_CMD_NWK_REPORT_COUNT_MASK 0x1f
89#define ZBEE_NWK_CMD_NWK_REPORT_ID_MASK 0xe0
90#define ZBEE_NWK_CMD_NWK_REPORT_ID_PAN_CONFLICT 0x00
91#define ZBEE_NWK_CMD_NWK_REPORT_ID_ZBOSS_KEY_TRACE 6
94#define ZBEE_NWK_CMD_NWK_UPDATE_COUNT_MASK 0x1f
95#define ZBEE_NWK_CMD_NWK_UPDATE_ID_MASK 0xe0
96#define ZBEE_NWK_CMD_NWK_UPDATE_ID_PAN_UPDATE 0x00
99#define ZBEE_NWK_CMD_ED_TIMEO_RSP_PRNT_INFO_MAC_DATA_POLL_KEEPAL_SUPP 0x01
100#define ZBEE_NWK_CMD_ED_TIMEO_RSP_PRNT_INFO_ED_TIMOU_REQ_KEEPAL_SUPP 0x02
101#define ZBEE_NWK_CMD_ED_TIMEO_RSP_PRNT_INFO_PWR_NEG_SUPP 0x04
104#define ZBEE_NWK_CMD_NWK_LINK_PWR_DELTA_TYPE_MASK 0x03
107#define ZBEE_NWK_STATUS_NO_ROUTE_AVAIL 0x00
108#define ZBEE_NWK_STATUS_TREE_LINK_FAIL 0x01
109#define ZBEE_NWK_STATUS_NON_TREE_LINK_FAIL 0x02
110#define ZBEE_NWK_STATUS_LOW_BATTERY 0x03
111#define ZBEE_NWK_STATUS_NO_ROUTING 0x04
112#define ZBEE_NWK_STATUS_NO_INDIRECT 0x05
113#define ZBEE_NWK_STATUS_INDIRECT_EXPIRE 0x06
114#define ZBEE_NWK_STATUS_DEVICE_UNAVAIL 0x07
115#define ZBEE_NWK_STATUS_ADDR_UNAVAIL 0x08
116#define ZBEE_NWK_STATUS_PARENT_LINK_FAIL 0x09
117#define ZBEE_NWK_STATUS_VALIDATE_ROUTE 0x0a
118#define ZBEE_NWK_STATUS_SOURCE_ROUTE_FAIL 0x0b
119#define ZBEE_NWK_STATUS_MANY_TO_ONE_FAIL 0x0c
120#define ZBEE_NWK_STATUS_ADDRESS_CONFLICT 0x0d
121#define ZBEE_NWK_STATUS_VERIFY_ADDRESS 0x0e
122#define ZBEE_NWK_STATUS_PANID_UPDATE 0x0f
123#define ZBEE_NWK_STATUS_ADDRESS_UPDATE 0x10
124#define ZBEE_NWK_STATUS_BAD_FRAME_COUNTER 0x11
125#define ZBEE_NWK_STATUS_BAD_KEY_SEQNO 0x12
126#define ZBEE_NWK_STATUS_UNKNOWN_COMMAND 0x13
128#define ZBEE_SEC_CONST_KEYSIZE 16
148 uint8_t mcast_radius;
149 uint8_t mcast_max_radius;
151 uint8_t payload_offset;
171 ZBEE_APS_RELAY_UPSTREAM,
172 ZBEE_APS_RELAY_DOWNSTREAM
179 uint8_t key[ZBEE_SEC_CONST_KEYSIZE];
191 aps_relay_type_t relay_type ;
192 uint64_t joiner_addr64;
196extern GHashTable *zbee_table_nwk_keyring;
197extern GHashTable *zbee_table_link_keyring;
200#define ZBEE_USER_KEY 0x01
203#define ZBEE_NWK_BEACON_PROTOCOL_ID 0x00
204#define ZBEE_NWK_BEACON_STACK_PROFILE 0x000f
205#define ZBEE_NWK_BEACON_PROTOCOL_VERSION 0x00f0
206#define ZBEE_NWK_BEACON_ROUTER_CAPACITY 0x0400
207#define ZBEE_NWK_BEACON_NETWORK_DEPTH 0x7800
208#define ZBEE_NWK_BEACON_END_DEVICE_CAPACITY 0x8000
209#define ZBEE_NWK_BEACON_LENGTH 15
212#define ZBEE_IP_BEACON_PROTOCOL_ID 0x02
213#define ZBEE_IP_BEACON_ALLOW_JOIN 0x01
214#define ZBEE_IP_BEACON_ROUTER_CAPACITY 0x02
215#define ZBEE_IP_BEACON_HOST_CAPACITY 0x04
216#define ZBEE_IP_BEACON_UNSECURE 0x80
218#define ZBEE_IP_BEACON_TLV_LENGTH_MASK 0x0f
219#define ZBEE_IP_BEACON_TLV_TYPE_MASK 0xf0
220#define ZBEE_IP_BEACON_TLV_TYPE_LFDI 0x0
Definition packet-ieee802154.h:464
Definition packet-ieee802154.h:447
Definition packet-zbee-nwk.h:176
Definition packet-zbee-nwk.h:162
Definition packet-zbee-nwk.h:182
Definition packet-zbee-nwk.h:130