Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
DHCPv4 server. More...
Typedefs | |
typedef void(* | net_dhcpv4_lease_cb_t) (struct net_if *iface, struct dhcpv4_addr_slot *lease, void *user_data) |
Callback used while iterating over active DHCPv4 address leases. | |
Functions | |
int | net_dhcpv4_server_start (struct net_if *iface, struct in_addr *base_addr) |
Start DHCPv4 server instance on an iface. | |
int | net_dhcpv4_server_stop (struct net_if *iface) |
Stop DHCPv4 server instance on an iface. | |
int | net_dhcpv4_server_foreach_lease (struct net_if *iface, net_dhcpv4_lease_cb_t cb, void *user_data) |
Iterate over all DHCPv4 address leases on a given network interface and call callback for each lease. | |
DHCPv4 server.
net_dhcpv4_lease_cb_t |
#include <zephyr/net/dhcpv4_server.h>
Callback used while iterating over active DHCPv4 address leases.
iface | Pointer to the network interface |
lease | Pointer to the DHPCv4 address lease slot |
user_data | A valid pointer to user data or NULL |
int net_dhcpv4_server_foreach_lease | ( | struct net_if * | iface, |
net_dhcpv4_lease_cb_t | cb, | ||
void * | user_data | ||
) |
#include <zephyr/net/dhcpv4_server.h>
Iterate over all DHCPv4 address leases on a given network interface and call callback for each lease.
In case no network interface is provided (NULL interface pointer), will iterate over all interfaces running DHCPv4 server instance.
iface | Pointer to the network interface, can be NULL |
cb | User-supplied callback function to call |
user_data | User specified data |
#include <zephyr/net/dhcpv4_server.h>
Start DHCPv4 server instance on an iface.
Start DHCPv4 server on a given interface. The server will start listening for DHCPv4 Discover/Request messages on the interface and assign IPv4 addresses from the configured address pool accordingly.
iface | A valid pointer on an interface |
base_addr | First IPv4 address from the DHCPv4 address pool. The number of addresses in the pool is configured statically with Kconfig (CONFIG_NET_DHCPV4_SERVER_ADDR_COUNT). |
int net_dhcpv4_server_stop | ( | struct net_if * | iface | ) |
#include <zephyr/net/dhcpv4_server.h>
Stop DHCPv4 server instance on an iface.
Stop DHCPv4 server on a given interface. DHCPv4 requests will no longer be handled on the interface, and all of the allocations are cleared.
iface | A valid pointer on an interface |