12#ifndef ZEPHYR_INCLUDE_NET_NET_EVENT_H_
13#define ZEPHYR_INCLUDE_NET_NET_EVENT_H_
30#define _NET_IF_LAYER NET_MGMT_LAYER_L2
31#define _NET_IF_CORE_CODE 0x001
32#define _NET_EVENT_IF_BASE (NET_MGMT_EVENT_BIT | \
33 NET_MGMT_IFACE_BIT | \
34 NET_MGMT_LAYER(_NET_IF_LAYER) | \
35 NET_MGMT_LAYER_CODE(_NET_IF_CORE_CODE))
37enum net_event_if_cmd {
38 NET_EVENT_IF_CMD_DOWN = 1,
40 NET_EVENT_IF_CMD_ADMIN_DOWN,
41 NET_EVENT_IF_CMD_ADMIN_UP,
45#define _NET_IPV6_LAYER NET_MGMT_LAYER_L3
46#define _NET_IPV6_CORE_CODE 0x060
47#define _NET_EVENT_IPV6_BASE (NET_MGMT_EVENT_BIT | \
48 NET_MGMT_IFACE_BIT | \
49 NET_MGMT_LAYER(_NET_IPV6_LAYER) | \
50 NET_MGMT_LAYER_CODE(_NET_IPV6_CORE_CODE))
52enum net_event_ipv6_cmd {
53 NET_EVENT_IPV6_CMD_ADDR_ADD = 1,
54 NET_EVENT_IPV6_CMD_ADDR_DEL,
55 NET_EVENT_IPV6_CMD_MADDR_ADD,
56 NET_EVENT_IPV6_CMD_MADDR_DEL,
57 NET_EVENT_IPV6_CMD_PREFIX_ADD,
58 NET_EVENT_IPV6_CMD_PREFIX_DEL,
59 NET_EVENT_IPV6_CMD_MCAST_JOIN,
60 NET_EVENT_IPV6_CMD_MCAST_LEAVE,
61 NET_EVENT_IPV6_CMD_ROUTER_ADD,
62 NET_EVENT_IPV6_CMD_ROUTER_DEL,
63 NET_EVENT_IPV6_CMD_ROUTE_ADD,
64 NET_EVENT_IPV6_CMD_ROUTE_DEL,
65 NET_EVENT_IPV6_CMD_DAD_SUCCEED,
66 NET_EVENT_IPV6_CMD_DAD_FAILED,
67 NET_EVENT_IPV6_CMD_NBR_ADD,
68 NET_EVENT_IPV6_CMD_NBR_DEL,
69 NET_EVENT_IPV6_CMD_DHCP_START,
70 NET_EVENT_IPV6_CMD_DHCP_BOUND,
71 NET_EVENT_IPV6_CMD_DHCP_STOP,
72 NET_EVENT_IPV6_CMD_ADDR_DEPRECATED,
73 NET_EVENT_IPV6_CMD_PE_ENABLED,
74 NET_EVENT_IPV6_CMD_PE_DISABLED,
75 NET_EVENT_IPV6_CMD_PE_FILTER_ADD,
76 NET_EVENT_IPV6_CMD_PE_FILTER_DEL,
77 NET_EVENT_IPV6_CMD_PMTU_CHANGED,
81#define _NET_IPV4_LAYER NET_MGMT_LAYER_L3
82#define _NET_IPV4_CORE_CODE 0x004
83#define _NET_EVENT_IPV4_BASE (NET_MGMT_EVENT_BIT | \
84 NET_MGMT_IFACE_BIT | \
85 NET_MGMT_LAYER(_NET_IPV4_LAYER) | \
86 NET_MGMT_LAYER_CODE(_NET_IPV4_CORE_CODE))
88enum net_event_ipv4_cmd {
89 NET_EVENT_IPV4_CMD_ADDR_ADD = 1,
90 NET_EVENT_IPV4_CMD_ADDR_DEL,
91 NET_EVENT_IPV4_CMD_MADDR_ADD,
92 NET_EVENT_IPV4_CMD_MADDR_DEL,
93 NET_EVENT_IPV4_CMD_ROUTER_ADD,
94 NET_EVENT_IPV4_CMD_ROUTER_DEL,
95 NET_EVENT_IPV4_CMD_DHCP_START,
96 NET_EVENT_IPV4_CMD_DHCP_BOUND,
97 NET_EVENT_IPV4_CMD_DHCP_STOP,
98 NET_EVENT_IPV4_CMD_MCAST_JOIN,
99 NET_EVENT_IPV4_CMD_MCAST_LEAVE,
100 NET_EVENT_IPV4_CMD_ACD_SUCCEED,
101 NET_EVENT_IPV4_CMD_ACD_FAILED,
102 NET_EVENT_IPV4_CMD_ACD_CONFLICT,
103 NET_EVENT_IPV4_CMD_PMTU_CHANGED,
107#define _NET_L4_LAYER NET_MGMT_LAYER_L4
108#define _NET_L4_CORE_CODE 0x114
109#define _NET_EVENT_L4_BASE (NET_MGMT_EVENT_BIT | \
110 NET_MGMT_IFACE_BIT | \
111 NET_MGMT_LAYER(_NET_L4_LAYER) | \
112 NET_MGMT_LAYER_CODE(_NET_L4_CORE_CODE))
114enum net_event_l4_cmd {
115 NET_EVENT_L4_CMD_CONNECTED = 1,
116 NET_EVENT_L4_CMD_DISCONNECTED,
117 NET_EVENT_L4_CMD_IPV4_CONNECTED,
118 NET_EVENT_L4_CMD_IPV4_DISCONNECTED,
119 NET_EVENT_L4_CMD_IPV6_CONNECTED,
120 NET_EVENT_L4_CMD_IPV6_DISCONNECTED,
121 NET_EVENT_L4_CMD_DNS_SERVER_ADD,
122 NET_EVENT_L4_CMD_DNS_SERVER_DEL,
123 NET_EVENT_L4_CMD_HOSTNAME_CHANGED,
124 NET_EVENT_L4_CMD_CAPTURE_STARTED,
125 NET_EVENT_L4_CMD_CAPTURE_STOPPED,
131#define NET_EVENT_IF_DOWN \
132 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_DOWN)
135#define NET_EVENT_IF_UP \
136 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_UP)
139#define NET_EVENT_IF_ADMIN_DOWN \
140 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_DOWN)
143#define NET_EVENT_IF_ADMIN_UP \
144 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_UP)
147#define NET_EVENT_IPV6_ADDR_ADD \
148 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_ADD)
151#define NET_EVENT_IPV6_ADDR_DEL \
152 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL)
155#define NET_EVENT_IPV6_MADDR_ADD \
156 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD)
159#define NET_EVENT_IPV6_MADDR_DEL \
160 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_DEL)
163#define NET_EVENT_IPV6_PREFIX_ADD \
164 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD)
167#define NET_EVENT_IPV6_PREFIX_DEL \
168 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL)
171#define NET_EVENT_IPV6_MCAST_JOIN \
172 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_JOIN)
175#define NET_EVENT_IPV6_MCAST_LEAVE \
176 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_LEAVE)
179#define NET_EVENT_IPV6_ROUTER_ADD \
180 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_ADD)
183#define NET_EVENT_IPV6_ROUTER_DEL \
184 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_DEL)
187#define NET_EVENT_IPV6_ROUTE_ADD \
188 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_ADD)
191#define NET_EVENT_IPV6_ROUTE_DEL \
192 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_DEL)
195#define NET_EVENT_IPV6_DAD_SUCCEED \
196 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_SUCCEED)
199#define NET_EVENT_IPV6_DAD_FAILED \
200 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_FAILED)
203#define NET_EVENT_IPV6_NBR_ADD \
204 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_ADD)
207#define NET_EVENT_IPV6_NBR_DEL \
208 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_DEL)
211#define NET_EVENT_IPV6_DHCP_START \
212 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_START)
215#define NET_EVENT_IPV6_DHCP_BOUND \
216 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_BOUND)
219#define NET_EVENT_IPV6_DHCP_STOP \
220 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_STOP)
223#define NET_EVENT_IPV6_ADDR_DEPRECATED \
224 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEPRECATED)
227#define NET_EVENT_IPV6_PE_ENABLED \
228 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_ENABLED)
231#define NET_EVENT_IPV6_PE_DISABLED \
232 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_DISABLED)
235#define NET_EVENT_IPV6_PE_FILTER_ADD \
236 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_FILTER_ADD)
239#define NET_EVENT_IPV6_PE_FILTER_DEL \
240 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_FILTER_DEL)
243#define NET_EVENT_IPV6_PMTU_CHANGED \
244 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PMTU_CHANGED)
247#define NET_EVENT_IPV4_ADDR_ADD \
248 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_ADD)
251#define NET_EVENT_IPV4_ADDR_DEL \
252 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL)
255#define NET_EVENT_IPV4_MADDR_ADD \
256 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_ADD)
259#define NET_EVENT_IPV4_MADDR_DEL \
260 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_DEL)
263#define NET_EVENT_IPV4_ROUTER_ADD \
264 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD)
267#define NET_EVENT_IPV4_ROUTER_DEL \
268 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL)
271#define NET_EVENT_IPV4_DHCP_START \
272 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_START)
275#define NET_EVENT_IPV4_DHCP_BOUND \
276 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_BOUND)
279#define NET_EVENT_IPV4_DHCP_STOP \
280 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_STOP)
283#define NET_EVENT_IPV4_MCAST_JOIN \
284 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_JOIN)
287#define NET_EVENT_IPV4_MCAST_LEAVE \
288 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_LEAVE)
291#define NET_EVENT_IPV4_ACD_SUCCEED \
292 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_SUCCEED)
295#define NET_EVENT_IPV4_ACD_FAILED \
296 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_FAILED)
302#define NET_EVENT_IPV4_ACD_CONFLICT \
303 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_CONFLICT)
306#define NET_EVENT_IPV4_PMTU_CHANGED \
307 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_PMTU_CHANGED)
313#define NET_EVENT_L4_CONNECTED \
314 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CONNECTED)
321#define NET_EVENT_L4_DISCONNECTED \
322 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DISCONNECTED)
326#define NET_EVENT_L4_IPV4_CONNECTED \
327 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV4_CONNECTED)
330#define NET_EVENT_L4_IPV4_DISCONNECTED \
331 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV4_DISCONNECTED)
334#define NET_EVENT_L4_IPV6_CONNECTED \
335 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV6_CONNECTED)
338#define NET_EVENT_L4_IPV6_DISCONNECTED \
339 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV6_DISCONNECTED)
342#define NET_EVENT_DNS_SERVER_ADD \
343 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_ADD)
346#define NET_EVENT_DNS_SERVER_DEL \
347 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_DEL)
350#define NET_EVENT_HOSTNAME_CHANGED \
351 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_HOSTNAME_CHANGED)
354#define NET_EVENT_CAPTURE_STARTED \
355 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CAPTURE_STARTED)
358#define NET_EVENT_CAPTURE_STOPPED \
359 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CAPTURE_STOPPED)
Hostname configuration definitions.
IPv6 and IPv4 definitions.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
IPv6 address struct.
Definition net_ip.h:143
IPv4 address struct.
Definition net_ip.h:155
Network Management event information structure Used to pass information on network event NET_EVENT_IP...
Definition net_event.h:461
struct in_addr dst
IPv4 address.
Definition net_event.h:463
uint16_t mtu
New MTU.
Definition net_event.h:465
Network Management event information structure Used to pass information on network events like NET_EV...
Definition net_event.h:371
struct in6_addr addr
IPv6 address related to this event.
Definition net_event.h:373
Network Management event information structure Used to pass information on network events like NET_EV...
Definition net_event.h:385
struct in6_addr addr
Neighbor IPv6 address.
Definition net_event.h:387
int idx
Neighbor index in cache.
Definition net_event.h:389
Network Management event information structure Used to pass information on network events like NET_EV...
Definition net_event.h:447
bool is_deny_list
IPv6 filter deny or allow list.
Definition net_event.h:451
struct in6_addr prefix
IPv6 address of privacy extension filter.
Definition net_event.h:449
Network Management event information structure Used to pass information on network event NET_EVENT_IP...
Definition net_event.h:475
uint32_t mtu
New MTU.
Definition net_event.h:479
struct in6_addr dst
IPv6 address.
Definition net_event.h:477
Network Management event information structure Used to pass information on network events like NET_EV...
Definition net_event.h:417
uint8_t len
IPv6 prefix length.
Definition net_event.h:421
struct in6_addr addr
IPv6 prefix.
Definition net_event.h:419
uint32_t lifetime
IPv6 prefix lifetime in seconds.
Definition net_event.h:423
Network Management event information structure Used to pass information on network events like NET_EV...
Definition net_event.h:400
struct in6_addr addr
IPv6 address or prefix of the route.
Definition net_event.h:404
uint8_t prefix_len
IPv6 prefix length.
Definition net_event.h:406
struct in6_addr nexthop
IPv6 address of the next hop.
Definition net_event.h:402
Network Management event information structure Used to pass information on NET_EVENT_HOSTNAME_CHANGED...
Definition net_event.h:432
char hostname[NET_HOSTNAME_SIZE]
New hostname.
Definition net_event.h:434