DHCPv6 client implementation. More...

Detailed Description

DHCPv6 client implementation.

Modules

 DHCPv6 client compile configurations
 
 DHCPv6 client for 6LoWPAN border routers
 DHCPv6 client bootstrapping for 6LoWPAN border routers.
 

Files

file  client.h
 DHCPv6 client definitions.
 

Data Structures

struct  dhcpv6_duid_l2_t
 DUID based on link-layer address plus time. More...
 

Macros

#define DHCPV6_CLIENT_DUID_LEN   (sizeof(dhcpv6_duid_l2_t) + 8U)
 Static length of the DUID.
 
#define DHCPV6_CLIENT_BUFLEN   (256)
 length for send and receive buffer
 

Auto-initialization parameters

#define DHCPV6_CLIENT_STACK_SIZE   (THREAD_STACKSIZE_DEFAULT)
 stack size
 
#define DHCPV6_CLIENT_PRIORITY   (THREAD_PRIORITY_MAIN - 2)
 priority
 

DHCPv6 unique identifier (DUID) definitions

See also
RFC 8415, section 11
void dhcpv6_client_auto_init (void)
 Auto-initializes the client in its own thread. More...
 
void dhcpv6_client_init (event_queue_t *event_queue, uint16_t netif)
 Initializes the client. More...
 
void dhcpv6_client_start (void)
 Let the server start listening. More...
 

Configuration functions

void dhcpv6_client_req_ia_pd (unsigned netif, unsigned pfx_len)
 Configures the client to request prefix delegation for a network interface from a server. More...
 

Stack-specific functions

These functions need to be provided by the network-stack implementation.

unsigned dhcpv6_client_get_duid_l2 (unsigned netif, dhcpv6_duid_l2_t *duid)
 Get the link-layer address DUID for the client. More...
 
void dhcpv6_client_conf_prefix (unsigned netif, const ipv6_addr_t *pfx, unsigned pfx_len, uint32_t valid, uint32_t pref)
 Configures a prefix delegation lease that is provided by the server. More...
 
uint32_t dhcpv6_client_prefix_valid_until (unsigned netif, const ipv6_addr_t *pfx, unsigned pfx_len)
 Determines how long the prefix delegation lease is still valid. More...
 

Function Documentation

◆ dhcpv6_client_auto_init()

void dhcpv6_client_auto_init ( void  )

Auto-initializes the client in its own thread.

Note
Only available with (and called by) the dhcpv6_client_auto_init module.

◆ dhcpv6_client_conf_prefix()

void dhcpv6_client_conf_prefix ( unsigned  netif,
const ipv6_addr_t pfx,
unsigned  pfx_len,
uint32_t  valid,
uint32_t  pref 
)

Configures a prefix delegation lease that is provided by the server.

Parameters
[in]netifNetwork interface the prefix delegation was for.
[in]pfxPrefix for the prefix delegation.
[in]pfx_lenLength of pfx in bits.
[in]validValid lifetime of the prefix delegation.
[in]prefPreferred lifetime of the prefix delegation.

◆ dhcpv6_client_get_duid_l2()

unsigned dhcpv6_client_get_duid_l2 ( unsigned  netif,
dhcpv6_duid_l2_t duid 
)

Get the link-layer address DUID for the client.

Parameters
[in]netifThe network interface the client is bound to. May be SOCK_ADDR_ANY_NETIF for any interface.
[out]duidThe resulting DUID.
Returns
length of the duid on success.
0, on error.

◆ dhcpv6_client_init()

void dhcpv6_client_init ( event_queue_t event_queue,
uint16_t  netif 
)

Initializes the client.

Precondition
event_queue->waiter != NULL
Parameters
[in]event_queueEvent queue to use with the client. Needs to be initialized in the handler thread.
[in]netifThe network interface the client should listen on. SOCK_ADDR_ANY_NETIF for any interface

◆ dhcpv6_client_prefix_valid_until()

uint32_t dhcpv6_client_prefix_valid_until ( unsigned  netif,
const ipv6_addr_t pfx,
unsigned  pfx_len 
)

Determines how long the prefix delegation lease is still valid.

Parameters
[in]netifNetwork interface the prefix delegation was for.
[in]pfxPrefix of the prefix delegation
[in]pfx_lenLength of pfx in bits.
Returns
Remaining valid lifetime of the prefix delegation lease in seconds.

◆ dhcpv6_client_req_ia_pd()

void dhcpv6_client_req_ia_pd ( unsigned  netif,
unsigned  pfx_len 
)

Configures the client to request prefix delegation for a network interface from a server.

Precondition
pfx_len <= 128
Parameters
[in]netifThe interface to request the prefix delegation for.
[in]pfx_lenThe desired length of the prefix (note that the server might not consider this request). Must be <= 128

◆ dhcpv6_client_start()

void dhcpv6_client_start ( void  )

Let the server start listening.

This needs to be called after all desired configuration functions where called.