11#ifndef ZEPHYR_INCLUDE_NET_DHCPV4_H_
12#define ZEPHYR_INCLUDE_NET_DHCPV4_H_
37enum net_dhcpv4_state {
41 NET_DHCPV4_REQUESTING,
70struct net_dhcpv4_option_callback;
104struct net_dhcpv4_option_callback {
141 __ASSERT(callback,
"Callback pointer should not be NULL");
142 __ASSERT(handler,
"Callback handler pointer should not be NULL");
143 __ASSERT(data,
"Data pointer should not be NULL");
145 callback->handler = handler;
146 callback->option = option;
147 callback->data = data;
148 callback->max_length = max_length;
177 void *data,
size_t max_length)
179 __ASSERT(callback,
"Callback pointer should not be NULL");
180 __ASSERT(handler,
"Callback handler pointer should not be NULL");
181 __ASSERT(data,
"Data pointer should not be NULL");
183 callback->handler = handler;
184 callback->option = option;
185 callback->data = data;
186 callback->max_length = max_length;
243const char *net_dhcpv4_state_name(
enum net_dhcpv4_state
state);
int net_dhcpv4_remove_option_vendor_callback(struct net_dhcpv4_option_callback *cb)
Remove an application callback for encapsulated vendor-specific options.
const char * net_dhcpv4_msg_type_name(enum net_dhcpv4_msg_type msg_type)
Return a text representation of the msg_type.
void net_dhcpv4_restart(struct net_if *iface)
Restart DHCPv4 client on an iface.
void(* net_dhcpv4_option_callback_handler_t)(struct net_dhcpv4_option_callback *cb, size_t length, enum net_dhcpv4_msg_type msg_type, struct net_if *iface)
Define the application callback handler function signature.
Definition dhcpv4.h:87
static void net_dhcpv4_init_option_callback(struct net_dhcpv4_option_callback *callback, net_dhcpv4_option_callback_handler_t handler, uint8_t option, void *data, size_t max_length)
Helper to initialize a struct net_dhcpv4_option_callback properly.
Definition dhcpv4.h:135
void net_dhcpv4_stop(struct net_if *iface)
Stop DHCPv4 client on an iface.
int net_dhcpv4_remove_option_callback(struct net_dhcpv4_option_callback *cb)
Remove an application callback.
int net_dhcpv4_add_option_vendor_callback(struct net_dhcpv4_option_callback *cb)
Add an application callback for encapsulated vendor-specific options.
net_dhcpv4_msg_type
DHCPv4 message types.
Definition dhcpv4.h:59
static void net_dhcpv4_init_option_vendor_callback(struct net_dhcpv4_option_callback *callback, net_dhcpv4_option_callback_handler_t handler, uint8_t option, void *data, size_t max_length)
Helper to initialize a struct net_dhcpv4_option_callback for encapsulated vendor-specific options pro...
Definition dhcpv4.h:175
int net_dhcpv4_add_option_callback(struct net_dhcpv4_option_callback *cb)
Add an application callback.
void net_dhcpv4_start(struct net_if *iface)
Start DHCPv4 client on an iface.
@ NET_DHCPV4_MSG_TYPE_REQUEST
Request message.
Definition dhcpv4.h:62
@ NET_DHCPV4_MSG_TYPE_ACK
Acknowledge message.
Definition dhcpv4.h:64
@ NET_DHCPV4_MSG_TYPE_OFFER
Offer message.
Definition dhcpv4.h:61
@ NET_DHCPV4_MSG_TYPE_RELEASE
Release message.
Definition dhcpv4.h:66
@ NET_DHCPV4_MSG_TYPE_NAK
Negative acknowledge message.
Definition dhcpv4.h:65
@ NET_DHCPV4_MSG_TYPE_DISCOVER
Discover message.
Definition dhcpv4.h:60
@ NET_DHCPV4_MSG_TYPE_INFORM
Inform message.
Definition dhcpv4.h:67
@ NET_DHCPV4_MSG_TYPE_DECLINE
Decline message.
Definition dhcpv4.h:63
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
state
Definition parser_state.h:29
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Network Interface structure.
Definition net_if.h:690