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,
41#define NET_EVENT_IF_DOWN \
42 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_DOWN)
44#define NET_EVENT_IF_UP \
45 (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_UP)
48#define _NET_IPV6_LAYER NET_MGMT_LAYER_L3
49#define _NET_IPV6_CORE_CODE 0x060
50#define _NET_EVENT_IPV6_BASE (NET_MGMT_EVENT_BIT | \
51 NET_MGMT_IFACE_BIT | \
52 NET_MGMT_LAYER(_NET_IPV6_LAYER) | \
53 NET_MGMT_LAYER_CODE(_NET_IPV6_CORE_CODE))
55enum net_event_ipv6_cmd {
56 NET_EVENT_IPV6_CMD_ADDR_ADD = 1,
57 NET_EVENT_IPV6_CMD_ADDR_DEL,
58 NET_EVENT_IPV6_CMD_MADDR_ADD,
59 NET_EVENT_IPV6_CMD_MADDR_DEL,
60 NET_EVENT_IPV6_CMD_PREFIX_ADD,
61 NET_EVENT_IPV6_CMD_PREFIX_DEL,
62 NET_EVENT_IPV6_CMD_MCAST_JOIN,
63 NET_EVENT_IPV6_CMD_MCAST_LEAVE,
64 NET_EVENT_IPV6_CMD_ROUTER_ADD,
65 NET_EVENT_IPV6_CMD_ROUTER_DEL,
66 NET_EVENT_IPV6_CMD_ROUTE_ADD,
67 NET_EVENT_IPV6_CMD_ROUTE_DEL,
68 NET_EVENT_IPV6_CMD_DAD_SUCCEED,
69 NET_EVENT_IPV6_CMD_DAD_FAILED,
70 NET_EVENT_IPV6_CMD_NBR_ADD,
71 NET_EVENT_IPV6_CMD_NBR_DEL,
74#define NET_EVENT_IPV6_ADDR_ADD \
75 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_ADD)
77#define NET_EVENT_IPV6_ADDR_DEL \
78 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL)
80#define NET_EVENT_IPV6_MADDR_ADD \
81 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD)
83#define NET_EVENT_IPV6_MADDR_DEL \
84 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_DEL)
86#define NET_EVENT_IPV6_PREFIX_ADD \
87 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD)
89#define NET_EVENT_IPV6_PREFIX_DEL \
90 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL)
92#define NET_EVENT_IPV6_MCAST_JOIN \
93 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_JOIN)
95#define NET_EVENT_IPV6_MCAST_LEAVE \
96 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_LEAVE)
98#define NET_EVENT_IPV6_ROUTER_ADD \
99 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_ADD)
101#define NET_EVENT_IPV6_ROUTER_DEL \
102 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_DEL)
104#define NET_EVENT_IPV6_ROUTE_ADD \
105 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_ADD)
107#define NET_EVENT_IPV6_ROUTE_DEL \
108 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_DEL)
110#define NET_EVENT_IPV6_DAD_SUCCEED \
111 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_SUCCEED)
113#define NET_EVENT_IPV6_DAD_FAILED \
114 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_FAILED)
116#define NET_EVENT_IPV6_NBR_ADD \
117 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_ADD)
119#define NET_EVENT_IPV6_NBR_DEL \
120 (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_DEL)
123#define _NET_IPV4_LAYER NET_MGMT_LAYER_L3
124#define _NET_IPV4_CORE_CODE 0x004
125#define _NET_EVENT_IPV4_BASE (NET_MGMT_EVENT_BIT | \
126 NET_MGMT_IFACE_BIT | \
127 NET_MGMT_LAYER(_NET_IPV4_LAYER) | \
128 NET_MGMT_LAYER_CODE(_NET_IPV4_CORE_CODE))
130enum net_event_ipv4_cmd {
131 NET_EVENT_IPV4_CMD_ADDR_ADD = 1,
132 NET_EVENT_IPV4_CMD_ADDR_DEL,
133 NET_EVENT_IPV4_CMD_ROUTER_ADD,
134 NET_EVENT_IPV4_CMD_ROUTER_DEL,
135 NET_EVENT_IPV4_CMD_DHCP_START,
136 NET_EVENT_IPV4_CMD_DHCP_BOUND,
137 NET_EVENT_IPV4_CMD_DHCP_STOP,
138 NET_EVENT_IPV4_CMD_MCAST_JOIN,
139 NET_EVENT_IPV4_CMD_MCAST_LEAVE,
142#define NET_EVENT_IPV4_ADDR_ADD \
143 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_ADD)
145#define NET_EVENT_IPV4_ADDR_DEL \
146 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL)
148#define NET_EVENT_IPV4_ROUTER_ADD \
149 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD)
151#define NET_EVENT_IPV4_ROUTER_DEL \
152 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL)
154#define NET_EVENT_IPV4_DHCP_START \
155 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_START)
157#define NET_EVENT_IPV4_DHCP_BOUND \
158 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_BOUND)
160#define NET_EVENT_IPV4_DHCP_STOP \
161 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_STOP)
163#define NET_EVENT_IPV4_MCAST_JOIN \
164 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_JOIN)
166#define NET_EVENT_IPV4_MCAST_LEAVE \
167 (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_LEAVE)
171#define _NET_L4_LAYER NET_MGMT_LAYER_L4
172#define _NET_L4_CORE_CODE 0x114
173#define _NET_EVENT_L4_BASE (NET_MGMT_EVENT_BIT | \
174 NET_MGMT_IFACE_BIT | \
175 NET_MGMT_LAYER(_NET_L4_LAYER) | \
176 NET_MGMT_LAYER_CODE(_NET_L4_CORE_CODE))
178enum net_event_l4_cmd {
179 NET_EVENT_L4_CMD_CONNECTED = 1,
180 NET_EVENT_L4_CMD_DISCONNECTED,
181 NET_EVENT_L4_CMD_DNS_SERVER_ADD,
182 NET_EVENT_L4_CMD_DNS_SERVER_DEL,
185#define NET_EVENT_L4_CONNECTED \
186 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CONNECTED)
188#define NET_EVENT_L4_DISCONNECTED \
189 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DISCONNECTED)
191#define NET_EVENT_DNS_SERVER_ADD \
192 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_ADD)
194#define NET_EVENT_DNS_SERVER_DEL \
195 (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_DEL)
199#ifdef CONFIG_NET_MGMT_EVENT_INFO
210struct net_event_ipv6_addr {
223struct net_event_ipv6_nbr {
236struct net_event_ipv6_route {
IPv6 and IPv4 definitions.
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58