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,
80#define _NET_IPV4_LAYER NET_MGMT_LAYER_L3
81#define _NET_IPV4_CORE_CODE 0x004
82#define _NET_EVENT_IPV4_BASE (NET_MGMT_EVENT_BIT | \
83 NET_MGMT_IFACE_BIT | \
84 NET_MGMT_LAYER(_NET_IPV4_LAYER) | \
85 NET_MGMT_LAYER_CODE(_NET_IPV4_CORE_CODE))
87enum net_event_ipv4_cmd {
88 NET_EVENT_IPV4_CMD_ADDR_ADD = 1,
89 NET_EVENT_IPV4_CMD_ADDR_DEL,
90 NET_EVENT_IPV4_CMD_MADDR_ADD,
91 NET_EVENT_IPV4_CMD_MADDR_DEL,
92 NET_EVENT_IPV4_CMD_ROUTER_ADD,
93 NET_EVENT_IPV4_CMD_ROUTER_DEL,
94 NET_EVENT_IPV4_CMD_DHCP_START,
95 NET_EVENT_IPV4_CMD_DHCP_BOUND,
96 NET_EVENT_IPV4_CMD_DHCP_STOP,
97 NET_EVENT_IPV4_CMD_MCAST_JOIN,
98 NET_EVENT_IPV4_CMD_MCAST_LEAVE,
102#define _NET_L4_LAYER NET_MGMT_LAYER_L4
103#define _NET_L4_CORE_CODE 0x114
104#define _NET_EVENT_L4_BASE (NET_MGMT_EVENT_BIT | \
105 NET_MGMT_IFACE_BIT | \
106 NET_MGMT_LAYER(_NET_L4_LAYER) | \
107 NET_MGMT_LAYER_CODE(_NET_L4_CORE_CODE))
109enum net_event_l4_cmd {
110 NET_EVENT_L4_CMD_CONNECTED = 1,
111 NET_EVENT_L4_CMD_DISCONNECTED,
112 NET_EVENT_L4_CMD_DNS_SERVER_ADD,
113 NET_EVENT_L4_CMD_DNS_SERVER_DEL,
114 NET_EVENT_L4_CMD_HOSTNAME_CHANGED,
115 NET_EVENT_L4_CMD_CAPTURE_STARTED,
116 NET_EVENT_L4_CMD_CAPTURE_STOPPED,
122#define NET_EVENT_IF_DOWN \
123 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_DOWN)
126#define NET_EVENT_IF_UP \
127 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_UP)
130#define NET_EVENT_IF_ADMIN_DOWN \
131 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_DOWN)
134#define NET_EVENT_IF_ADMIN_UP \
135 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_UP)
138#define NET_EVENT_IPV6_ADDR_ADD \
139 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_ADD)
142#define NET_EVENT_IPV6_ADDR_DEL \
143 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL)
146#define NET_EVENT_IPV6_MADDR_ADD \
147 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD)
150#define NET_EVENT_IPV6_MADDR_DEL \
151 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_DEL)
154#define NET_EVENT_IPV6_PREFIX_ADD \
155 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD)
158#define NET_EVENT_IPV6_PREFIX_DEL \
159 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL)
162#define NET_EVENT_IPV6_MCAST_JOIN \
163 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_JOIN)
166#define NET_EVENT_IPV6_MCAST_LEAVE \
167 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_LEAVE)
170#define NET_EVENT_IPV6_ROUTER_ADD \
171 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_ADD)
174#define NET_EVENT_IPV6_ROUTER_DEL \
175 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_DEL)
178#define NET_EVENT_IPV6_ROUTE_ADD \
179 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_ADD)
182#define NET_EVENT_IPV6_ROUTE_DEL \
183 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_DEL)
186#define NET_EVENT_IPV6_DAD_SUCCEED \
187 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_SUCCEED)
190#define NET_EVENT_IPV6_DAD_FAILED \
191 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_FAILED)
194#define NET_EVENT_IPV6_NBR_ADD \
195 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_ADD)
198#define NET_EVENT_IPV6_NBR_DEL \
199 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_DEL)
202#define NET_EVENT_IPV6_DHCP_START \
203 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_START)
206#define NET_EVENT_IPV6_DHCP_BOUND \
207 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_BOUND)
210#define NET_EVENT_IPV6_DHCP_STOP \
211 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_STOP)
214#define NET_EVENT_IPV6_ADDR_DEPRECATED \
215 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEPRECATED)
218#define NET_EVENT_IPV6_PE_ENABLED \
219 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_ENABLED)
222#define NET_EVENT_IPV6_PE_DISABLED \
223 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_DISABLED)
226#define NET_EVENT_IPV6_PE_FILTER_ADD \
227 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_FILTER_ADD)
230#define NET_EVENT_IPV6_PE_FILTER_DEL \
231 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_FILTER_DEL)
234#define NET_EVENT_IPV4_ADDR_ADD \
235 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_ADD)
238#define NET_EVENT_IPV4_ADDR_DEL \
239 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL)
242#define NET_EVENT_IPV4_MADDR_ADD \
243 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_ADD)
246#define NET_EVENT_IPV4_MADDR_DEL \
247 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_DEL)
250#define NET_EVENT_IPV4_ROUTER_ADD \
251 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD)
254#define NET_EVENT_IPV4_ROUTER_DEL \
255 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL)
258#define NET_EVENT_IPV4_DHCP_START \
259 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_START)
262#define NET_EVENT_IPV4_DHCP_BOUND \
263 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_BOUND)
266#define NET_EVENT_IPV4_DHCP_STOP \
267 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_STOP)
270#define NET_EVENT_IPV4_MCAST_JOIN \
271 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_JOIN)
274#define NET_EVENT_IPV4_MCAST_LEAVE \
275 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_LEAVE)
281#define NET_EVENT_L4_CONNECTED \
282 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CONNECTED)
289#define NET_EVENT_L4_DISCONNECTED \
290 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DISCONNECTED)
293#define NET_EVENT_DNS_SERVER_ADD \
294 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_ADD)
297#define NET_EVENT_DNS_SERVER_DEL \
298 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_DEL)
301#define NET_EVENT_HOSTNAME_CHANGED \
302 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_HOSTNAME_CHANGED)
305#define NET_EVENT_CAPTURE_STARTED \
306 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CAPTURE_STARTED)
309#define NET_EVENT_CAPTURE_STOPPED \
310 (_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
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:322
struct in6_addr addr
IPv6 address related to this event.
Definition: net_event.h:324
Network Management event information structure Used to pass information on network events like NET_EV...
Definition: net_event.h:336
struct in6_addr addr
Neighbor IPv6 address.
Definition: net_event.h:338
int idx
Neighbor index in cache.
Definition: net_event.h:340
Network Management event information structure Used to pass information on network events like NET_EV...
Definition: net_event.h:398
bool is_deny_list
IPv6 filter deny or allow list.
Definition: net_event.h:402
struct in6_addr prefix
IPv6 address of privacy extension filter.
Definition: net_event.h:400
Network Management event information structure Used to pass information on network events like NET_EV...
Definition: net_event.h:368
uint8_t len
IPv6 prefix length.
Definition: net_event.h:372
struct in6_addr addr
IPv6 prefix.
Definition: net_event.h:370
uint32_t lifetime
IPv6 prefix lifetime in seconds.
Definition: net_event.h:374
Network Management event information structure Used to pass information on network events like NET_EV...
Definition: net_event.h:351
struct in6_addr addr
IPv6 address or prefix of the route.
Definition: net_event.h:355
uint8_t prefix_len
IPv6 prefix length.
Definition: net_event.h:357
struct in6_addr nexthop
IPv6 address of the next hop.
Definition: net_event.h:353
Network Management event information structure Used to pass information on NET_EVENT_HOSTNAME_CHANGED...
Definition: net_event.h:383
char hostname[NET_HOSTNAME_SIZE]
New hostname.
Definition: net_event.h:385