Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

DHCPv6

DHCPv6
[IPv6]

DHCPv6 client: IPv6 address autoconfiguration as per RFC 3315 (stateful DHCPv6) and RFC 3736 (stateless DHCPv6). More...

Functions

void dhcp6_set_struct (struct netif *netif, struct dhcp6 *dhcp6)
 Set a statically allocated struct dhcp6 to work with.
void dhcp6_cleanup (struct netif *netif)
 Removes a struct dhcp6 from a netif.
err_t dhcp6_enable_stateful (struct netif *netif)
 Enable stateful DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_MANAGED_ADDR_CONFIG flag set.
err_t dhcp6_enable_stateless (struct netif *netif)
 Enable stateless DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_OTHER_CONFIG flag set.
void dhcp6_disable (struct netif *netif)
 Disable stateful or stateless DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_OTHER_CONFIG flag set.

Detailed Description

DHCPv6 client: IPv6 address autoconfiguration as per RFC 3315 (stateful DHCPv6) and RFC 3736 (stateless DHCPv6).

For now, only stateless DHCPv6 is implemented!

TODO:

  • enable/disable API to not always start when RA is received
  • stateful DHCPv6 (for now, only stateless DHCPv6 for DNS and NTP servers works)
  • create Client Identifier?
  • only start requests if a valid local address is available on the netif
  • only start information requests if required (not for every RA)

dhcp6_enable_stateful() enables stateful DHCPv6 for a netif (stateless disabled)
dhcp6_enable_stateless() enables stateless DHCPv6 for a netif (stateful disabled)
dhcp6_disable() disable DHCPv6 for a netif

When enabled, requests are only issued after receipt of RA with the corresponding bits set.


Function Documentation

void dhcp6_cleanup ( struct netif netif )

Removes a struct dhcp6 from a netif.

ATTENTION: Only use this when not using dhcp6_set_struct() to allocate the struct dhcp6 since the memory is passed back to the heap.

Parameters:
netifthe netif from which to remove the struct dhcp

Definition at line 206 of file lwip_dhcp6.c.

void dhcp6_disable ( struct netif netif )

Disable stateful or stateless DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_OTHER_CONFIG flag set.

Definition at line 346 of file lwip_dhcp6.c.

err_t dhcp6_enable_stateful ( struct netif netif )

Enable stateful DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_MANAGED_ADDR_CONFIG flag set.

A struct dhcp6 will be allocated for this netif if not set via dhcp6_set_struct before.

Definition at line 299 of file lwip_dhcp6.c.

err_t dhcp6_enable_stateless ( struct netif netif )

Enable stateless DHCPv6 on this netif Requests are sent on receipt of an RA message with the ND6_RA_FLAG_OTHER_CONFIG flag set.

A struct dhcp6 will be allocated for this netif if not set via dhcp6_set_struct before.

Definition at line 316 of file lwip_dhcp6.c.

void dhcp6_set_struct ( struct netif netif,
struct dhcp6 *  dhcp6 
)

Set a statically allocated struct dhcp6 to work with.

Using this prevents dhcp6_start to allocate it using mem_malloc.

Parameters:
netifthe netif for which to set the struct dhcp
dhcp6(uninitialised) dhcp6 struct allocated by the application

Definition at line 185 of file lwip_dhcp6.c.