Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Network Management

Network Management. More...

Data Structures

struct  net_event_ipv6_addr
 Network Management event information structure Used to pass information on network events like NET_EVENT_IPV6_ADDR_ADD, NET_EVENT_IPV6_ADDR_DEL, NET_EVENT_IPV6_MADDR_ADD and NET_EVENT_IPV6_MADDR_DEL when CONFIG_NET_MGMT_EVENT_INFO enabled and event generator pass the information. More...
 
struct  net_event_ipv6_nbr
 Network Management event information structure Used to pass information on network events like NET_EVENT_IPV6_NBR_ADD and NET_EVENT_IPV6_NBR_DEL when CONFIG_NET_MGMT_EVENT_INFO enabled and event generator pass the information. More...
 
struct  net_event_ipv6_route
 Network Management event information structure Used to pass information on network events like NET_EVENT_IPV6_ROUTE_ADD and NET_EVENT_IPV6_ROUTE_DEL when CONFIG_NET_MGMT_EVENT_INFO enabled and event generator pass the information. More...
 
struct  net_event_ipv6_prefix
 Network Management event information structure Used to pass information on network events like NET_EVENT_IPV6_PREFIX_ADD and NET_EVENT_IPV6_PREFIX_DEL when CONFIG_NET_MGMT_EVENT_INFO is enabled and event generator pass the information. More...
 
struct  net_event_l4_hostname
 Network Management event information structure Used to pass information on NET_EVENT_HOSTNAME_CHANGED event when CONFIG_NET_MGMT_EVENT_INFO is enabled and event generator pass the information. More...
 
struct  net_event_ipv6_pe_filter
 Network Management event information structure Used to pass information on network events like NET_EVENT_IPV6_PE_FILTER_ADD and NET_EVENT_IPV6_PE_FILTER_DEL when CONFIG_NET_MGMT_EVENT_INFO is enabled and event generator pass the information. More...
 
struct  net_mgmt_event_callback
 Network Management event callback structure Used to register a callback into the network management event part, in order to let the owner of this struct to get network event notification based on given event mask. More...
 

Macros

#define NET_EVENT_IF_DOWN    (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_DOWN)
 Event emitted when the network interface goes down.
 
#define NET_EVENT_IF_UP    (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_UP)
 Event emitted when the network interface goes up.
 
#define NET_EVENT_IF_ADMIN_DOWN    (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_DOWN)
 Event emitted when the network interface is taken down manually.
 
#define NET_EVENT_IF_ADMIN_UP    (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_UP)
 Event emitted when the network interface goes up manually.
 
#define NET_EVENT_IPV6_ADDR_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_ADD)
 Event emitted when an IPv6 address is added to the system.
 
#define NET_EVENT_IPV6_ADDR_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL)
 Event emitted when an IPv6 address is removed from the system.
 
#define NET_EVENT_IPV6_MADDR_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD)
 Event emitted when an IPv6 multicast address is added to the system.
 
#define NET_EVENT_IPV6_MADDR_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_DEL)
 Event emitted when an IPv6 multicast address is removed from the system.
 
#define NET_EVENT_IPV6_PREFIX_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD)
 Event emitted when an IPv6 prefix is added to the system.
 
#define NET_EVENT_IPV6_PREFIX_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL)
 Event emitted when an IPv6 prefix is removed from the system.
 
#define NET_EVENT_IPV6_MCAST_JOIN    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_JOIN)
 Event emitted when an IPv6 multicast group is joined.
 
#define NET_EVENT_IPV6_MCAST_LEAVE    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_LEAVE)
 Event emitted when an IPv6 multicast group is left.
 
#define NET_EVENT_IPV6_ROUTER_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_ADD)
 Event emitted when an IPv6 router is added to the system.
 
#define NET_EVENT_IPV6_ROUTER_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_DEL)
 Event emitted when an IPv6 router is removed from the system.
 
#define NET_EVENT_IPV6_ROUTE_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_ADD)
 Event emitted when an IPv6 route is added to the system.
 
#define NET_EVENT_IPV6_ROUTE_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_DEL)
 Event emitted when an IPv6 route is removed from the system.
 
#define NET_EVENT_IPV6_DAD_SUCCEED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_SUCCEED)
 Event emitted when an IPv6 duplicate address detection succeeds.
 
#define NET_EVENT_IPV6_DAD_FAILED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_FAILED)
 Event emitted when an IPv6 duplicate address detection fails.
 
#define NET_EVENT_IPV6_NBR_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_ADD)
 Event emitted when an IPv6 neighbor is added to the system.
 
#define NET_EVENT_IPV6_NBR_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_DEL)
 Event emitted when an IPv6 neighbor is removed from the system.
 
#define NET_EVENT_IPV6_DHCP_START    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_START)
 Event emitted when an IPv6 DHCP client starts.
 
#define NET_EVENT_IPV6_DHCP_BOUND    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_BOUND)
 Event emitted when an IPv6 DHCP client address is bound.
 
#define NET_EVENT_IPV6_DHCP_STOP    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_STOP)
 Event emitted when an IPv6 DHCP client is stopped.
 
#define NET_EVENT_IPV6_ADDR_DEPRECATED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEPRECATED)
 IPv6 address is deprecated.
 
#define NET_EVENT_IPV6_PE_ENABLED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_ENABLED)
 IPv6 Privacy extension is enabled.
 
#define NET_EVENT_IPV6_PE_DISABLED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_DISABLED)
 IPv6 Privacy extension is disabled.
 
#define NET_EVENT_IPV6_PE_FILTER_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_FILTER_ADD)
 IPv6 Privacy extension filter is added.
 
#define NET_EVENT_IPV6_PE_FILTER_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_FILTER_DEL)
 IPv6 Privacy extension filter is removed.
 
#define NET_EVENT_IPV4_ADDR_ADD    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_ADD)
 Event emitted when an IPv4 address is added to the system.
 
#define NET_EVENT_IPV4_ADDR_DEL    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL)
 Event emitted when an IPv4 address is removed from the system.
 
#define NET_EVENT_IPV4_MADDR_ADD    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_ADD)
 Event emitted when an IPv4 multicast address is added to the system.
 
#define NET_EVENT_IPV4_MADDR_DEL    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_DEL)
 Event emitted when an IPv4 multicast address is removed from the system.
 
#define NET_EVENT_IPV4_ROUTER_ADD    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD)
 Event emitted when an IPv4 router is added to the system.
 
#define NET_EVENT_IPV4_ROUTER_DEL    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL)
 Event emitted when an IPv4 router is removed from the system.
 
#define NET_EVENT_IPV4_DHCP_START    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_START)
 Event emitted when an IPv4 DHCP client is started.
 
#define NET_EVENT_IPV4_DHCP_BOUND    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_BOUND)
 Event emitted when an IPv4 DHCP client address is bound.
 
#define NET_EVENT_IPV4_DHCP_STOP    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_STOP)
 Event emitted when an IPv4 DHCP client is stopped.
 
#define NET_EVENT_IPV4_MCAST_JOIN    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_JOIN)
 Event emitted when an IPv4 multicast group is joined.
 
#define NET_EVENT_IPV4_MCAST_LEAVE    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_LEAVE)
 Event emitted when an IPv4 multicast group is left.
 
#define NET_EVENT_IPV4_ACD_SUCCEED    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_SUCCEED)
 Event emitted when an IPv4 address conflict detection succeeds.
 
#define NET_EVENT_IPV4_ACD_FAILED    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_FAILED)
 Event emitted when an IPv4 address conflict detection fails.
 
#define NET_EVENT_IPV4_ACD_CONFLICT    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_CONFLICT)
 Event emitted when an IPv4 address conflict was detected after the address was confirmed as safe to use.
 
#define NET_EVENT_L4_CONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CONNECTED)
 Event emitted when the system is considered to be connected.
 
#define NET_EVENT_L4_DISCONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DISCONNECTED)
 Event emitted when the system is no longer connected.
 
#define NET_EVENT_L4_IPV4_CONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV4_CONNECTED)
 Event raised when IPv4 network connectivity is available.
 
#define NET_EVENT_L4_IPV4_DISCONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV4_DISCONNECTED)
 Event emitted when IPv4 network connectivity is lost.
 
#define NET_EVENT_L4_IPV6_CONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV6_CONNECTED)
 Event emitted when IPv6 network connectivity is available.
 
#define NET_EVENT_L4_IPV6_DISCONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV6_DISCONNECTED)
 Event emitted when IPv6 network connectivity is lost.
 
#define NET_EVENT_DNS_SERVER_ADD    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_ADD)
 Event emitted when a DNS server is added to the system.
 
#define NET_EVENT_DNS_SERVER_DEL    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_DEL)
 Event emitted when a DNS server is removed from the system.
 
#define NET_EVENT_HOSTNAME_CHANGED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_HOSTNAME_CHANGED)
 Event emitted when the system hostname is changed.
 
#define NET_EVENT_CAPTURE_STARTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CAPTURE_STARTED)
 Network packet capture is started.
 
#define NET_EVENT_CAPTURE_STOPPED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CAPTURE_STOPPED)
 Network packet capture is stopped.
 
#define net_mgmt(_mgmt_request, _iface, _data, _len)    net_mgmt_##_mgmt_request(_mgmt_request, _iface, _data, _len)
 Generate a network management event.
 
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
 Declare a request handler function for the given network event.
 
#define NET_MGMT_REGISTER_REQUEST_HANDLER(_mgmt_request, _func)    FUNC_ALIAS(_func, net_mgmt_##_mgmt_request, int)
 Create a request handler function for the given network event.
 
#define NET_MGMT_REGISTER_EVENT_HANDLER(_name, _event_mask, _func, _user_data)
 Define a static network event handler.
 

Typedefs

typedef int(* net_mgmt_request_handler_t) (uint32_t mgmt_request, struct net_if *iface, void *data, size_t len)
 Signature which all Net MGMT request handler need to follow.
 
typedef void(* net_mgmt_event_handler_t) (struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface)
 Define the user's callback handler function signature.
 
typedef void(* net_mgmt_event_static_handler_t) (uint32_t mgmt_event, struct net_if *iface, void *info, size_t info_length, void *user_data)
 Define the user's callback handler function signature.
 

Functions

static void net_mgmt_init_event_callback (struct net_mgmt_event_callback *cb, net_mgmt_event_handler_t handler, uint32_t mgmt_event_mask)
 Helper to initialize a struct net_mgmt_event_callback properly.
 
void net_mgmt_add_event_callback (struct net_mgmt_event_callback *cb)
 Add a user callback.
 
void net_mgmt_del_event_callback (struct net_mgmt_event_callback *cb)
 Delete a user callback.
 
void net_mgmt_event_notify_with_info (uint32_t mgmt_event, struct net_if *iface, const void *info, size_t length)
 Used by the system to notify an event.
 
static void net_mgmt_event_notify (uint32_t mgmt_event, struct net_if *iface)
 Used by the system to notify an event without any additional information.
 
int net_mgmt_event_wait (uint32_t mgmt_event_mask, uint32_t *raised_event, struct net_if **iface, const void **info, size_t *info_length, k_timeout_t timeout)
 Used to wait synchronously on an event mask.
 
int net_mgmt_event_wait_on_iface (struct net_if *iface, uint32_t mgmt_event_mask, uint32_t *raised_event, const void **info, size_t *info_length, k_timeout_t timeout)
 Used to wait synchronously on an event mask for a specific iface.
 
void net_mgmt_event_init (void)
 Used by the core of the network stack to initialize the network event processing.
 

Detailed Description

Network Management.

Macro Definition Documentation

◆ NET_EVENT_CAPTURE_STARTED

#define NET_EVENT_CAPTURE_STARTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CAPTURE_STARTED)

#include <zephyr/net/net_event.h>

Network packet capture is started.

◆ NET_EVENT_CAPTURE_STOPPED

#define NET_EVENT_CAPTURE_STOPPED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CAPTURE_STOPPED)

#include <zephyr/net/net_event.h>

Network packet capture is stopped.

◆ NET_EVENT_DNS_SERVER_ADD

#define NET_EVENT_DNS_SERVER_ADD    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_ADD)

#include <zephyr/net/net_event.h>

Event emitted when a DNS server is added to the system.

◆ NET_EVENT_DNS_SERVER_DEL

#define NET_EVENT_DNS_SERVER_DEL    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DNS_SERVER_DEL)

#include <zephyr/net/net_event.h>

Event emitted when a DNS server is removed from the system.

◆ NET_EVENT_HOSTNAME_CHANGED

#define NET_EVENT_HOSTNAME_CHANGED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_HOSTNAME_CHANGED)

#include <zephyr/net/net_event.h>

Event emitted when the system hostname is changed.

◆ NET_EVENT_IF_ADMIN_DOWN

#define NET_EVENT_IF_ADMIN_DOWN    (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_DOWN)

#include <zephyr/net/net_event.h>

Event emitted when the network interface is taken down manually.

◆ NET_EVENT_IF_ADMIN_UP

#define NET_EVENT_IF_ADMIN_UP    (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_ADMIN_UP)

#include <zephyr/net/net_event.h>

Event emitted when the network interface goes up manually.

◆ NET_EVENT_IF_DOWN

#define NET_EVENT_IF_DOWN    (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_DOWN)

#include <zephyr/net/net_event.h>

Event emitted when the network interface goes down.

◆ NET_EVENT_IF_UP

#define NET_EVENT_IF_UP    (_NET_EVENT_IF_BASE | NET_EVENT_IF_CMD_UP)

#include <zephyr/net/net_event.h>

Event emitted when the network interface goes up.

◆ NET_EVENT_IPV4_ACD_CONFLICT

#define NET_EVENT_IPV4_ACD_CONFLICT    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_CONFLICT)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 address conflict was detected after the address was confirmed as safe to use.

It's up to the application to determine on how to act in such case.

◆ NET_EVENT_IPV4_ACD_FAILED

#define NET_EVENT_IPV4_ACD_FAILED    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_FAILED)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 address conflict detection fails.

◆ NET_EVENT_IPV4_ACD_SUCCEED

#define NET_EVENT_IPV4_ACD_SUCCEED    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ACD_SUCCEED)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 address conflict detection succeeds.

◆ NET_EVENT_IPV4_ADDR_ADD

#define NET_EVENT_IPV4_ADDR_ADD    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 address is added to the system.

◆ NET_EVENT_IPV4_ADDR_DEL

#define NET_EVENT_IPV4_ADDR_DEL    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 address is removed from the system.

◆ NET_EVENT_IPV4_DHCP_BOUND

#define NET_EVENT_IPV4_DHCP_BOUND    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_BOUND)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 DHCP client address is bound.

◆ NET_EVENT_IPV4_DHCP_START

#define NET_EVENT_IPV4_DHCP_START    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_START)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 DHCP client is started.

◆ NET_EVENT_IPV4_DHCP_STOP

#define NET_EVENT_IPV4_DHCP_STOP    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_DHCP_STOP)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 DHCP client is stopped.

◆ NET_EVENT_IPV4_MADDR_ADD

#define NET_EVENT_IPV4_MADDR_ADD    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 multicast address is added to the system.

◆ NET_EVENT_IPV4_MADDR_DEL

#define NET_EVENT_IPV4_MADDR_DEL    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MADDR_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 multicast address is removed from the system.

◆ NET_EVENT_IPV4_MCAST_JOIN

#define NET_EVENT_IPV4_MCAST_JOIN    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_JOIN)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 multicast group is joined.

◆ NET_EVENT_IPV4_MCAST_LEAVE

#define NET_EVENT_IPV4_MCAST_LEAVE    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_MCAST_LEAVE)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 multicast group is left.

◆ NET_EVENT_IPV4_ROUTER_ADD

#define NET_EVENT_IPV4_ROUTER_ADD    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 router is added to the system.

◆ NET_EVENT_IPV4_ROUTER_DEL

#define NET_EVENT_IPV4_ROUTER_DEL    (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv4 router is removed from the system.

◆ NET_EVENT_IPV6_ADDR_ADD

#define NET_EVENT_IPV6_ADDR_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 address is added to the system.

◆ NET_EVENT_IPV6_ADDR_DEL

#define NET_EVENT_IPV6_ADDR_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 address is removed from the system.

◆ NET_EVENT_IPV6_ADDR_DEPRECATED

#define NET_EVENT_IPV6_ADDR_DEPRECATED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEPRECATED)

#include <zephyr/net/net_event.h>

IPv6 address is deprecated.

◆ NET_EVENT_IPV6_DAD_FAILED

#define NET_EVENT_IPV6_DAD_FAILED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_FAILED)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 duplicate address detection fails.

◆ NET_EVENT_IPV6_DAD_SUCCEED

#define NET_EVENT_IPV6_DAD_SUCCEED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DAD_SUCCEED)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 duplicate address detection succeeds.

◆ NET_EVENT_IPV6_DHCP_BOUND

#define NET_EVENT_IPV6_DHCP_BOUND    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_BOUND)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 DHCP client address is bound.

◆ NET_EVENT_IPV6_DHCP_START

#define NET_EVENT_IPV6_DHCP_START    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_START)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 DHCP client starts.

◆ NET_EVENT_IPV6_DHCP_STOP

#define NET_EVENT_IPV6_DHCP_STOP    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_DHCP_STOP)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 DHCP client is stopped.

◆ NET_EVENT_IPV6_MADDR_ADD

#define NET_EVENT_IPV6_MADDR_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 multicast address is added to the system.

◆ NET_EVENT_IPV6_MADDR_DEL

#define NET_EVENT_IPV6_MADDR_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 multicast address is removed from the system.

◆ NET_EVENT_IPV6_MCAST_JOIN

#define NET_EVENT_IPV6_MCAST_JOIN    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_JOIN)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 multicast group is joined.

◆ NET_EVENT_IPV6_MCAST_LEAVE

#define NET_EVENT_IPV6_MCAST_LEAVE    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MCAST_LEAVE)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 multicast group is left.

◆ NET_EVENT_IPV6_NBR_ADD

#define NET_EVENT_IPV6_NBR_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 neighbor is added to the system.

◆ NET_EVENT_IPV6_NBR_DEL

#define NET_EVENT_IPV6_NBR_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_NBR_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 neighbor is removed from the system.

◆ NET_EVENT_IPV6_PE_DISABLED

#define NET_EVENT_IPV6_PE_DISABLED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_DISABLED)

#include <zephyr/net/net_event.h>

IPv6 Privacy extension is disabled.

◆ NET_EVENT_IPV6_PE_ENABLED

#define NET_EVENT_IPV6_PE_ENABLED    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_ENABLED)

#include <zephyr/net/net_event.h>

IPv6 Privacy extension is enabled.

◆ NET_EVENT_IPV6_PE_FILTER_ADD

#define NET_EVENT_IPV6_PE_FILTER_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_FILTER_ADD)

#include <zephyr/net/net_event.h>

IPv6 Privacy extension filter is added.

◆ NET_EVENT_IPV6_PE_FILTER_DEL

#define NET_EVENT_IPV6_PE_FILTER_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PE_FILTER_DEL)

#include <zephyr/net/net_event.h>

IPv6 Privacy extension filter is removed.

◆ NET_EVENT_IPV6_PREFIX_ADD

#define NET_EVENT_IPV6_PREFIX_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 prefix is added to the system.

◆ NET_EVENT_IPV6_PREFIX_DEL

#define NET_EVENT_IPV6_PREFIX_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 prefix is removed from the system.

◆ NET_EVENT_IPV6_ROUTE_ADD

#define NET_EVENT_IPV6_ROUTE_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 route is added to the system.

◆ NET_EVENT_IPV6_ROUTE_DEL

#define NET_EVENT_IPV6_ROUTE_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTE_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 route is removed from the system.

◆ NET_EVENT_IPV6_ROUTER_ADD

#define NET_EVENT_IPV6_ROUTER_ADD    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_ADD)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 router is added to the system.

◆ NET_EVENT_IPV6_ROUTER_DEL

#define NET_EVENT_IPV6_ROUTER_DEL    (_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ROUTER_DEL)

#include <zephyr/net/net_event.h>

Event emitted when an IPv6 router is removed from the system.

◆ NET_EVENT_L4_CONNECTED

#define NET_EVENT_L4_CONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CONNECTED)

#include <zephyr/net/net_event.h>

Event emitted when the system is considered to be connected.

The connected in this context means that the network interface is up, and the interface has either IPv4 or IPv6 address assigned to it.

◆ NET_EVENT_L4_DISCONNECTED

#define NET_EVENT_L4_DISCONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DISCONNECTED)

#include <zephyr/net/net_event.h>

Event emitted when the system is no longer connected.

Typically this means that network connectivity is lost either by the network interface is going down, or the interface has no longer an IP address etc.

◆ NET_EVENT_L4_IPV4_CONNECTED

#define NET_EVENT_L4_IPV4_CONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV4_CONNECTED)

#include <zephyr/net/net_event.h>

Event raised when IPv4 network connectivity is available.

◆ NET_EVENT_L4_IPV4_DISCONNECTED

#define NET_EVENT_L4_IPV4_DISCONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV4_DISCONNECTED)

#include <zephyr/net/net_event.h>

Event emitted when IPv4 network connectivity is lost.

◆ NET_EVENT_L4_IPV6_CONNECTED

#define NET_EVENT_L4_IPV6_CONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV6_CONNECTED)

#include <zephyr/net/net_event.h>

Event emitted when IPv6 network connectivity is available.

◆ NET_EVENT_L4_IPV6_DISCONNECTED

#define NET_EVENT_L4_IPV6_DISCONNECTED    (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_IPV6_DISCONNECTED)

#include <zephyr/net/net_event.h>

Event emitted when IPv6 network connectivity is lost.

◆ net_mgmt

#define net_mgmt (   _mgmt_request,
  _iface,
  _data,
  _len 
)     net_mgmt_##_mgmt_request(_mgmt_request, _iface, _data, _len)

#include <zephyr/net/net_mgmt.h>

Generate a network management event.

Parameters
_mgmt_requestManagement event identifier
_ifaceNetwork interface
_dataAny additional data for the event
_lenLength of the additional data.

◆ NET_MGMT_DEFINE_REQUEST_HANDLER

#define NET_MGMT_DEFINE_REQUEST_HANDLER (   _mgmt_request)

#include <zephyr/net/net_mgmt.h>

Value:
extern int net_mgmt_##_mgmt_request(uint32_t mgmt_request, \
struct net_if *iface, \
void *data, size_t len)
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
Network Interface structure.
Definition: net_if.h:678

Declare a request handler function for the given network event.

Parameters
_mgmt_requestManagement event identifier

◆ NET_MGMT_REGISTER_EVENT_HANDLER

#define NET_MGMT_REGISTER_EVENT_HANDLER (   _name,
  _event_mask,
  _func,
  _user_data 
)

#include <zephyr/net/net_mgmt.h>

Value:
const STRUCT_SECTION_ITERABLE(net_mgmt_event_static_handler, _name) = { \
.event_mask = _event_mask, \
.handler = _func, \
.user_data = (void *)_user_data, \
}
#define STRUCT_SECTION_ITERABLE(struct_type, varname)
Defines a new element for an iterable section.
Definition: iterable_sections.h:216

Define a static network event handler.

Parameters
_nameName of the event handler.
_event_maskA mask of network events on which the passed handler should be called in case those events come. Note that only the command part is treated as a mask, matching one to several commands. Layer and layer code will be made of an exact match. This means that in order to receive events from multiple layers, one must have multiple listeners registered, one for each layer being listened.
_funcThe function to be called upon network events being emitted.
_user_dataUser data passed to the handler being called on network events.

◆ NET_MGMT_REGISTER_REQUEST_HANDLER

#define NET_MGMT_REGISTER_REQUEST_HANDLER (   _mgmt_request,
  _func 
)     FUNC_ALIAS(_func, net_mgmt_##_mgmt_request, int)

#include <zephyr/net/net_mgmt.h>

Create a request handler function for the given network event.

Parameters
_mgmt_requestManagement event identifier
_funcFunction for handling this event

Typedef Documentation

◆ net_mgmt_event_handler_t

net_mgmt_event_handler_t

#include <zephyr/net/net_mgmt.h>

Define the user's callback handler function signature.

Parameters
cbOriginal struct net_mgmt_event_callback owning this handler.
mgmt_eventThe network event being notified.
ifaceA pointer on a struct net_if to which the event belongs to, if it's an event on an iface. NULL otherwise.

◆ net_mgmt_event_static_handler_t

net_mgmt_event_static_handler_t

#include <zephyr/net/net_mgmt.h>

Define the user's callback handler function signature.

Parameters
mgmt_eventThe network event being notified.
ifaceA pointer on a struct net_if to which the event belongs to, if it's an event on an iface. NULL otherwise.
infoA valid pointer on a data understood by the handler. NULL otherwise.
info_lengthLength in bytes of the memory pointed by info.
user_dataData provided by the user to the handler.

◆ net_mgmt_request_handler_t

net_mgmt_request_handler_t

#include <zephyr/net/net_mgmt.h>

Signature which all Net MGMT request handler need to follow.

Parameters
mgmt_requestThe exact request value the handler is being called through
ifaceA valid pointer on struct net_if if the request is meant to be tied to a network interface. NULL otherwise.
dataA valid pointer on a data understood by the handler. NULL otherwise.
lenLength in byte of the memory pointed by data.

Function Documentation

◆ net_mgmt_add_event_callback()

void net_mgmt_add_event_callback ( struct net_mgmt_event_callback cb)

#include <zephyr/net/net_mgmt.h>

Add a user callback.

Parameters
cbA valid pointer on user's callback to add.

◆ net_mgmt_del_event_callback()

void net_mgmt_del_event_callback ( struct net_mgmt_event_callback cb)

#include <zephyr/net/net_mgmt.h>

Delete a user callback.

Parameters
cbA valid pointer on user's callback to delete.

◆ net_mgmt_event_init()

void net_mgmt_event_init ( void  )

#include <zephyr/net/net_mgmt.h>

Used by the core of the network stack to initialize the network event processing.

◆ net_mgmt_event_notify()

static void net_mgmt_event_notify ( uint32_t  mgmt_event,
struct net_if iface 
)
inlinestatic

#include <zephyr/net/net_mgmt.h>

Used by the system to notify an event without any additional information.

Parameters
mgmt_eventThe actual network event code to notify
ifaceA valid pointer on a struct net_if if only the event is based on an iface. NULL otherwise.

◆ net_mgmt_event_notify_with_info()

void net_mgmt_event_notify_with_info ( uint32_t  mgmt_event,
struct net_if iface,
const void *  info,
size_t  length 
)

#include <zephyr/net/net_mgmt.h>

Used by the system to notify an event.

Parameters
mgmt_eventThe actual network event code to notify
ifacea valid pointer on a struct net_if if only the event is based on an iface. NULL otherwise.
infoA valid pointer on the information you want to pass along with the event. NULL otherwise. Note the data pointed there is normalized by the related event.
lengthsize of the data pointed by info pointer.

Note: info and length are disabled if CONFIG_NET_MGMT_EVENT_INFO is not defined.

◆ net_mgmt_event_wait()

int net_mgmt_event_wait ( uint32_t  mgmt_event_mask,
uint32_t raised_event,
struct net_if **  iface,
const void **  info,
size_t info_length,
k_timeout_t  timeout 
)

#include <zephyr/net/net_mgmt.h>

Used to wait synchronously on an event mask.

Parameters
mgmt_event_maskA mask of relevant events to wait on.
raised_eventa pointer on a uint32_t to get which event from the mask generated the event. Can be NULL if the caller is not interested in that information.
ifacea pointer on a place holder for the iface on which the event has originated from. This is valid if only the event mask has bit NET_MGMT_IFACE_BIT set relevantly, depending on events the caller wants to listen to.
infoa valid pointer if user wants to get the information the event might bring along. NULL otherwise.
info_lengthtells how long the info memory area is. Only valid if the info is not NULL.
timeoutA timeout delay. K_FOREVER can be used to wait indefinitely.
Returns
0 on success, a negative error code otherwise. -ETIMEDOUT will be specifically returned if the timeout kick-in instead of an actual event.

◆ net_mgmt_event_wait_on_iface()

int net_mgmt_event_wait_on_iface ( struct net_if iface,
uint32_t  mgmt_event_mask,
uint32_t raised_event,
const void **  info,
size_t info_length,
k_timeout_t  timeout 
)

#include <zephyr/net/net_mgmt.h>

Used to wait synchronously on an event mask for a specific iface.

Parameters
ifacea pointer on a valid network interface to listen event to
mgmt_event_maskA mask of relevant events to wait on. Listened to events should be relevant to iface events and thus have the bit NET_MGMT_IFACE_BIT set.
raised_eventa pointer on a uint32_t to get which event from the mask generated the event. Can be NULL if the caller is not interested in that information.
infoa valid pointer if user wants to get the information the event might bring along. NULL otherwise.
info_lengthtells how long the info memory area is. Only valid if the info is not NULL.
timeoutA timeout delay. K_FOREVER can be used to wait indefinitely.
Returns
0 on success, a negative error code otherwise. -ETIMEDOUT will be specifically returned if the timeout kick-in instead of an actual event.

◆ net_mgmt_init_event_callback()

static void net_mgmt_init_event_callback ( struct net_mgmt_event_callback cb,
net_mgmt_event_handler_t  handler,
uint32_t  mgmt_event_mask 
)
inlinestatic

#include <zephyr/net/net_mgmt.h>

Helper to initialize a struct net_mgmt_event_callback properly.

Parameters
cbA valid application's callback structure pointer.
handlerA valid handler function pointer.
mgmt_event_maskA mask of relevant events for the handler