12#ifndef ZEPHYR_INCLUDE_NET_NET_EVENT_H_
13#define ZEPHYR_INCLUDE_NET_NET_EVENT_H_
29#define _NET_IF_LAYER NET_MGMT_LAYER_L2
30#define _NET_IF_CORE_CODE 0x001
31#define _NET_EVENT_IF_BASE (NET_MGMT_EVENT_BIT | \
32 NET_MGMT_IFACE_BIT | \
33 NET_MGMT_LAYER(_NET_IF_LAYER) | \
34 NET_MGMT_LAYER_CODE(_NET_IF_CORE_CODE))
36enum net_event_if_cmd {
37 NET_EVENT_IF_CMD_DOWN = 1,
39 NET_EVENT_IF_CMD_ADMIN_DOWN,
40 NET_EVENT_IF_CMD_ADMIN_UP,
44#define NET_EVENT_IF_DOWN \
45 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_DOWN)
47#define NET_EVENT_IF_UP \
48 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_UP)
50#define NET_EVENT_IF_ADMIN_DOWN \
51 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_DOWN)
53#define NET_EVENT_IF_ADMIN_UP \
54 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_UP)
58#define _NET_IPV6_LAYER NET_MGMT_LAYER_L3
59#define _NET_IPV6_CORE_CODE 0x060
60#define _NET_EVENT_IPV6_BASE (NET_MGMT_EVENT_BIT | \
61 NET_MGMT_IFACE_BIT | \
62 NET_MGMT_LAYER(_NET_IPV6_LAYER) | \
63 NET_MGMT_LAYER_CODE(_NET_IPV6_CORE_CODE))
65enum net_event_ipv6_cmd {
66 NET_EVENT_IPV6_CMD_ADDR_ADD = 1,
67 NET_EVENT_IPV6_CMD_ADDR_DEL,
68 NET_EVENT_IPV6_CMD_MADDR_ADD,
69 NET_EVENT_IPV6_CMD_MADDR_DEL,
70 NET_EVENT_IPV6_CMD_PREFIX_ADD,
71 NET_EVENT_IPV6_CMD_PREFIX_DEL,
72 NET_EVENT_IPV6_CMD_MCAST_JOIN,
73 NET_EVENT_IPV6_CMD_MCAST_LEAVE,
74 NET_EVENT_IPV6_CMD_ROUTER_ADD,
75 NET_EVENT_IPV6_CMD_ROUTER_DEL,
76 NET_EVENT_IPV6_CMD_ROUTE_ADD,
77 NET_EVENT_IPV6_CMD_ROUTE_DEL,
78 NET_EVENT_IPV6_CMD_DAD_SUCCEED,
79 NET_EVENT_IPV6_CMD_DAD_FAILED,
80 NET_EVENT_IPV6_CMD_NBR_ADD,
81 NET_EVENT_IPV6_CMD_NBR_DEL,
82 NET_EVENT_IPV6_CMD_DHCP_START,
83 NET_EVENT_IPV6_CMD_DHCP_BOUND,
84 NET_EVENT_IPV6_CMD_DHCP_STOP,
87#define NET_EVENT_IPV6_ADDR_ADD \
88 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_ADD)
90#define NET_EVENT_IPV6_ADDR_DEL \
91 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL)
93#define NET_EVENT_IPV6_MADDR_ADD \
94 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD)
96#define NET_EVENT_IPV6_MADDR_DEL \
97 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_DEL)
99#define NET_EVENT_IPV6_PREFIX_ADD \
100 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD)
102#define NET_EVENT_IPV6_PREFIX_DEL \
103 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL)
105#define NET_EVENT_IPV6_MCAST_JOIN \
106 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_JOIN)
108#define NET_EVENT_IPV6_MCAST_LEAVE \
109 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_LEAVE)
111#define NET_EVENT_IPV6_ROUTER_ADD \
112 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_ADD)
114#define NET_EVENT_IPV6_ROUTER_DEL \
115 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_DEL)
117#define NET_EVENT_IPV6_ROUTE_ADD \
118 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_ADD)
120#define NET_EVENT_IPV6_ROUTE_DEL \
121 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_DEL)
123#define NET_EVENT_IPV6_DAD_SUCCEED \
124 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_SUCCEED)
126#define NET_EVENT_IPV6_DAD_FAILED \
127 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_FAILED)
129#define NET_EVENT_IPV6_NBR_ADD \
130 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_ADD)
132#define NET_EVENT_IPV6_NBR_DEL \
133 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_DEL)
135#define NET_EVENT_IPV6_DHCP_START \
136 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV6_CMD_DHCP_START)
138#define NET_EVENT_IPV6_DHCP_BOUND \
139 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV6_CMD_DHCP_BOUND)
141#define NET_EVENT_IPV6_DHCP_STOP \
142 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV6_CMD_DHCP_STOP)
145#define _NET_IPV4_LAYER NET_MGMT_LAYER_L3
146#define _NET_IPV4_CORE_CODE 0x004
147#define _NET_EVENT_IPV4_BASE (NET_MGMT_EVENT_BIT | \
148 NET_MGMT_IFACE_BIT | \
149 NET_MGMT_LAYER(_NET_IPV4_LAYER) | \
150 NET_MGMT_LAYER_CODE(_NET_IPV4_CORE_CODE))
152enum net_event_ipv4_cmd {
153 NET_EVENT_IPV4_CMD_ADDR_ADD = 1,
154 NET_EVENT_IPV4_CMD_ADDR_DEL,
155 NET_EVENT_IPV4_CMD_MADDR_ADD,
156 NET_EVENT_IPV4_CMD_MADDR_DEL,
157 NET_EVENT_IPV4_CMD_ROUTER_ADD,
158 NET_EVENT_IPV4_CMD_ROUTER_DEL,
159 NET_EVENT_IPV4_CMD_DHCP_START,
160 NET_EVENT_IPV4_CMD_DHCP_BOUND,
161 NET_EVENT_IPV4_CMD_DHCP_STOP,
162 NET_EVENT_IPV4_CMD_MCAST_JOIN,
163 NET_EVENT_IPV4_CMD_MCAST_LEAVE,
166#define NET_EVENT_IPV4_ADDR_ADD \
167 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_ADD)
169#define NET_EVENT_IPV4_ADDR_DEL \
170 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL)
172#define NET_EVENT_IPV4_MADDR_ADD \
173 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_ADD)
175#define NET_EVENT_IPV4_MADDR_DEL \
176 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_DEL)
178#define NET_EVENT_IPV4_ROUTER_ADD \
179 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD)
181#define NET_EVENT_IPV4_ROUTER_DEL \
182 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL)
184#define NET_EVENT_IPV4_DHCP_START \
185 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_START)
187#define NET_EVENT_IPV4_DHCP_BOUND \
188 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_BOUND)
190#define NET_EVENT_IPV4_DHCP_STOP \
191 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_STOP)
193#define NET_EVENT_IPV4_MCAST_JOIN \
194 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_JOIN)
196#define NET_EVENT_IPV4_MCAST_LEAVE \
197 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_LEAVE)
201#define _NET_L4_LAYER NET_MGMT_LAYER_L4
202#define _NET_L4_CORE_CODE 0x114
203#define _NET_EVENT_L4_BASE (NET_MGMT_EVENT_BIT | \
204 NET_MGMT_IFACE_BIT | \
205 NET_MGMT_LAYER(_NET_L4_LAYER) | \
206 NET_MGMT_LAYER_CODE(_NET_L4_CORE_CODE))
208enum net_event_l4_cmd {
209 NET_EVENT_L4_CMD_CONNECTED = 1,
210 NET_EVENT_L4_CMD_DISCONNECTED,
211 NET_EVENT_L4_CMD_DNS_SERVER_ADD,
212 NET_EVENT_L4_CMD_DNS_SERVER_DEL,
215#define NET_EVENT_L4_CONNECTED \
216 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CONNECTED)
218#define NET_EVENT_L4_DISCONNECTED \
219 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DISCONNECTED)
221#define NET_EVENT_DNS_SERVER_ADD \
222 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_ADD)
224#define NET_EVENT_DNS_SERVER_DEL \
225 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_DEL)
IPv6 and IPv4 definitions.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
IPv6 address struct.
Definition: net_ip.h:139
Network Management event information structure Used to pass information on network events like NET_EV...
Definition: net_event.h:239
struct in6_addr addr
Definition: net_event.h:240
Network Management event information structure Used to pass information on network events like NET_EV...
Definition: net_event.h:252
struct in6_addr addr
Definition: net_event.h:253
int idx
Definition: net_event.h:254
Network Management event information structure Used to pass information on network events like NET_EV...
Definition: net_event.h:279
uint8_t len
Definition: net_event.h:281
struct in6_addr addr
Definition: net_event.h:280
uint32_t lifetime
Definition: net_event.h:282
Network Management event information structure Used to pass information on network events like NET_EV...
Definition: net_event.h:265
struct in6_addr addr
Definition: net_event.h:267
uint8_t prefix_len
Definition: net_event.h:268
struct in6_addr nexthop
Definition: net_event.h:266