ArvernOS
Loading...
Searching...
No Matches
dhcp.h File Reference
#include <net/net.h>
#include <net/udp.h>
#include <sys/types.h>
Include dependency graph for dhcp.h:

Data Structures

struct  dhcp_header_t
 

Functions

bool dhcp_negotiate (net_interface_t *interface)
 
void dhcp_receive_packet (net_interface_t *interface, uint8_t *packet, udp_header_t *header)
 

Detailed Description

Function Documentation

◆ dhcp_negotiate()

bool dhcp_negotiate ( net_interface_t * interface)

Configures a network interface using DHCP.

DHCP operations fall into four phases: server discovery, IP lease offer, IP lease request, and IP lease acknowledgement. This function implements the four phases and configures the given interface once the IP lease acknowledgement is received.

Parameters
interfacethe network interface to use
Returns
true when the DHCP negotiation has succeeded, false otherwise

◆ dhcp_receive_packet()

void dhcp_receive_packet ( net_interface_t * interface,
uint8_t * packet,
udp_header_t * header )

Receives a DHCP packet.

Parameters
interfacethe interface on which the DHCP packet has been received
packetthe DHCP packet
headerthe UDP header