The client provides some events through a callback function. These events inform the application whenever e.g. the network has been successfully configured or the DHCP lease has expired.
Files | |
file | dhcp_client.c |
DHCP client implementation (license: GPLv2). | |
file | dhcp_client.h |
DHCP client header (license: GPLv2). | |
Typedefs | |
typedef void(* | dhcp_client_callback )(enum dhcp_client_event event) |
The type of callback function used for issuing events. | |
Enumerations | |
enum | dhcp_client_event { DHCP_CLIENT_EVT_LEASE_ACQUIRED, DHCP_CLIENT_EVT_LEASE_DENIED, DHCP_CLIENT_EVT_LEASE_EXPIRING, DHCP_CLIENT_EVT_LEASE_EXPIRED, DHCP_CLIENT_EVT_TIMEOUT, DHCP_CLIENT_EVT_ERROR } |
The events the DHCP client may fire. More... | |
Functions | |
bool | dhcp_client_start (dhcp_client_callback callback) |
Starts the DHCP client. | |
void | dhcp_client_abort () |
Aborts all ongoing DHCP actions and terminates the client. |
enum dhcp_client_event |
The events the DHCP client may fire.
bool dhcp_client_start | ( | dhcp_client_callback | callback | ) |
Starts the DHCP client.
When the client was started successfully, DHCP requests are being broadcasted on the network.
[in] | callback | A function pointer which is called for every event the client generates. |
true
if the client was started successfully, false
on failure. void dhcp_client_abort | ( | ) |
Aborts all ongoing DHCP actions and terminates the client.