dhcpv6_client_misc.c
@ IPV6_ADDR_STATE_TENTATIVE
An address whose uniqueness on a link is being verified.
Definition: ipv6.h:174
char_t * ipv6AddrToString(const Ipv6Addr *ipAddr, char_t *str)
Convert a binary IPv6 address to a string representation.
Definition: ipv6.c:2329
IPv6 (Internet Protocol Version 6)
void dhcpv6ClientStateInitConfirm(Dhcpv6ClientContext *context)
INIT-CONFIRM state.
Definition: dhcpv6_client_fsm.c:269
Date and time management.
bool_t dhcpv6ClientCheckServerId(Dhcpv6ClientContext *context, Dhcpv6Option *serverIdOption)
Check the Server Identifier option.
Definition: dhcpv6_client_misc.c:1475
void dhcpv6ClientParseAdvertise(Dhcpv6ClientContext *context, const Dhcpv6Message *message, size_t length)
Parse Advertise message.
Definition: dhcpv6_client_misc.c:518
void dhcpv6ClientRemoveAddr(Dhcpv6ClientContext *context, const Ipv6Addr *addr)
Remove an IPv6 address from the IA.
Definition: dhcpv6_client_misc.c:1308
Definitions common to DHCPv6 client, server and relay agent.
Ipv6AddrState ipv6GetAddrState(NetInterface *interface, const Ipv6Addr *addr)
Get the state of the specified IPv6 address.
Definition: ipv6_misc.c:56
void dhcpv6ClientStateDecline(Dhcpv6ClientContext *context)
DECLINE state.
Definition: dhcpv6_client_fsm.c:762
void dhcpv6ClientCheckTimeout(Dhcpv6ClientContext *context)
Manage DHCPv6 configuration timeout.
Definition: dhcpv6_client_misc.c:1501
const Ipv6Addr DHCPV6_ALL_RELAY_AGENTS_AND_SERVERS_ADDR
Definition: dhcpv6_common.c:54
void dhcpv6ClientFlushAddrList(Dhcpv6ClientContext *context)
Flush the list of IPv6 addresses from the IA.
Definition: dhcpv6_client_misc.c:1346
Dhcpv6Option * dhcpv6AddSubOption(Dhcpv6Option *baseOption, size_t *messageLen, uint16_t optionCode, const void *optionValue, size_t optionLen)
Add a suboption under an existing base option.
Definition: dhcpv6_common.c:168
Dhcpv6Option * dhcpv6GetOption(const uint8_t *options, size_t optionsLength, uint16_t optionCode)
Search a DHCPv6 message for a given option.
Definition: dhcpv6_common.c:229
Helper functions for DHCPv6 client.
const char_t * formatSystemTime(systime_t time, char_t *str)
Format system time.
Definition: date_time.c:77
error_t dhcpv6ClientParseIaNaOption(Dhcpv6ClientContext *context, const Dhcpv6Option *option)
Parse IA_NA option.
Definition: dhcpv6_client_misc.c:1074
void dhcpv6ClientStateInit(Dhcpv6ClientContext *context)
INIT state.
Definition: dhcpv6_client_fsm.c:59
void dhcpv6ClientDumpConfig(Dhcpv6ClientContext *context)
Dump DHCPv6 configuration for debugging purpose.
Definition: dhcpv6_client_misc.c:1641
void ipv6FlushDnsServerList(NetInterface *interface)
Flush the list of DNS servers.
Definition: ipv6_misc.c:756
void dhcpv6ClientTick(Dhcpv6ClientContext *context)
DHCPv6 client timer handler.
Definition: dhcpv6_client_misc.c:71
void dhcpv6ClientLinkChangeEvent(Dhcpv6ClientContext *context)
Callback function for link change event.
Definition: dhcpv6_client_misc.c:177
Dhcpv6StatusCode dhcpv6GetStatusCode(const uint8_t *options, size_t length)
Retrieve status code.
Definition: dhcpv6_common.c:73
DHCPv6 client (Dynamic Host Configuration Protocol for IPv6)
void dhcpv6ClientStateRenew(Dhcpv6ClientContext *context)
RENEW state.
Definition: dhcpv6_client_fsm.c:506
void dhcpv6ClientProcessMessage(NetInterface *interface, const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary, void *param)
Process incoming DHCPv6 message.
Definition: dhcpv6_client_misc.c:459
Helper functions for IPv6.
error_t udpSendBuffer(NetInterface *interface, const IpAddr *srcIpAddr, uint16_t srcPort, const IpAddr *destIpAddr, uint16_t destPort, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a UDP datagram.
Definition: udp.c:658
void dhcpv6ClientAddAddr(Dhcpv6ClientContext *context, const Ipv6Addr *addr, uint32_t validLifetime, uint32_t preferredLifetime)
Add an IPv6 address to the IA.
Definition: dhcpv6_client_misc.c:1250
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
void ipv6RemoveAddr(NetInterface *interface, const Ipv6Addr *addr)
Remove an entry from the list of IPv6 addresses.
Definition: ipv6_misc.c:339
void dhcpv6ClientStateDad(Dhcpv6ClientContext *context)
DAD state.
Definition: dhcpv6_client_fsm.c:405
uint16_t dhcpv6ClientComputeElapsedTime(Dhcpv6ClientContext *context)
Compute the time elapsed since the client sent the first message.
Definition: dhcpv6_client_misc.c:1542
NetBuffer * udpAllocBuffer(size_t length, size_t *offset)
Allocate a buffer to hold a UDP packet.
Definition: udp.c:948
void dhcpv6ClientStateRequest(Dhcpv6ClientContext *context)
REQUEST state.
Definition: dhcpv6_client_fsm.c:191
void dhcpv6ClientStateRebind(Dhcpv6ClientContext *context)
REBIND state.
Definition: dhcpv6_client_fsm.c:600
NDP (Neighbor Discovery Protocol)
error_t dhcpv6ClientSendMessage(Dhcpv6ClientContext *context, Dhcpv6MessageType type)
Send Solicit message.
Definition: dhcpv6_client_misc.c:253
error_t ipv6SetAddr(NetInterface *interface, uint_t index, const Ipv6Addr *addr, Ipv6AddrState state, systime_t validLifetime, systime_t preferredLifetime, bool_t permanent)
Set IPv6 address and address state.
Definition: ipv6_misc.c:96
void ipv6AddAddr(NetInterface *interface, const Ipv6Addr *addr, uint32_t validLifetime, uint32_t preferredLifetime)
Add a new entry to the list of IPv6 addresses.
Definition: ipv6_misc.c:221
void dhcpv6ClientStateConfirm(Dhcpv6ClientContext *context)
CONFIRM state.
Definition: dhcpv6_client_fsm.c:316
DHCPv6 client finite state machine.
error_t dhcpv6ClientGenerateDuid(Dhcpv6ClientContext *context)
Generate client's DUID.
Definition: dhcpv6_client_misc.c:1381
error_t dhcpv6DumpMessage(const void *message, size_t length)
Dump DHCPv6 message for debugging purpose.
Definition: dhcpv6_debug.c:123
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
Definition: os_port_chibios.c:396
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
Definition: os_port_chibios.c:408
Dhcpv6Option * dhcpv6AddOption(void *message, size_t *messageLen, uint16_t optionCode, const void *optionValue, size_t optionLen)
Add an option to a DHCPv6 message.
Definition: dhcpv6_common.c:114
void ipv6GenerateLinkLocalAddr(const Eui64 *interfaceId, Ipv6Addr *ipAddr)
Generate a IPv6 link-local address from an interface identifier.
Definition: ipv6_misc.c:1402
void dhcpv6ClientStateSolicit(Dhcpv6ClientContext *context)
SOLICIT state.
Definition: dhcpv6_client_fsm.c:106
error_t netBufferSetLength(NetBuffer *buffer, size_t length)
Adjust the length of a multi-part buffer.
Definition: net_mem.c:322
error_t dhcpv6ClientGenerateLinkLocalAddr(Dhcpv6ClientContext *context)
Generate a link-local address.
Definition: dhcpv6_client_misc.c:1424
void dhcpv6ClientStateRelease(Dhcpv6ClientContext *context)
RELEASE state.
Definition: dhcpv6_client_fsm.c:692
void dhcpv6ClientStateBound(Dhcpv6ClientContext *context)
BOUND state.
Definition: dhcpv6_client_fsm.c:459
void * netBufferAt(const NetBuffer *buffer, size_t offset, size_t length)
Returns a pointer to a data segment.
Definition: net_mem.c:418
@ IPV6_ADDR_STATE_PREFERRED
An address assigned to an interface whose use is unrestricted.
Definition: ipv6.h:175
error_t dhcpv6ClientParseIaAddrOption(Dhcpv6ClientContext *context, const Dhcpv6Option *option)
Parse IA Address option.
Definition: dhcpv6_client_misc.c:1188
TCP/IP stack core.
NetInterface * nicGetLogicalInterface(NetInterface *interface)
Retrieve logical interface.
Definition: nic.c:53
Common DNS routines.
void dhcpv6ClientChangeState(Dhcpv6ClientContext *context, Dhcpv6State newState, systime_t delay)
Update DHCPv6 FSM state.
Definition: dhcpv6_client_misc.c:1575
void dhcpv6ClientParseReply(Dhcpv6ClientContext *context, const Dhcpv6Message *message, size_t length)
Parse Reply message.
Definition: dhcpv6_client_misc.c:694
Debugging facilities.
Data logging functions for debugging purpose (DHCPv6)