Go to the documentation of this file.
31 #ifndef _DHCPV6_CLIENT_H
32 #define _DHCPV6_CLIENT_H
39 #ifndef DHCPV6_CLIENT_SUPPORT
40 #define DHCPV6_CLIENT_SUPPORT DISABLED
41 #elif (DHCPV6_CLIENT_SUPPORT != ENABLED && DHCPV6_CLIENT_SUPPORT != DISABLED)
42 #error DHCPV6_CLIENT_SUPPORT parameter is not valid
46 #ifndef DHCPV6_CLIENT_TICK_INTERVAL
47 #define DHCPV6_CLIENT_TICK_INTERVAL 200
48 #elif (DHCPV6_CLIENT_TICK_INTERVAL < 10)
49 #error DHCPV6_CLIENT_TICK_INTERVAL parameter is not valid
53 #ifndef DHCPV6_CLIENT_ADDR_LIST_SIZE
54 #define DHCPV6_CLIENT_ADDR_LIST_SIZE 2
55 #elif (DHCPV6_CLIENT_ADDR_LIST_SIZE < 1)
56 #error DHCPV6_CLIENT_ADDR_LIST_SIZE parameter is not valid
60 #ifndef DHCPV6_CLIENT_SOL_MAX_DELAY
61 #define DHCPV6_CLIENT_SOL_MAX_DELAY 1000
62 #elif (DHCPV6_CLIENT_SOL_MAX_DELAY < 100)
63 #error DHCPV6_CLIENT_SOL_MAX_DELAY parameter is not valid
67 #ifndef DHCPV6_CLIENT_SOL_TIMEOUT
68 #define DHCPV6_CLIENT_SOL_TIMEOUT 1000
69 #elif (DHCPV6_CLIENT_SOL_TIMEOUT < 100)
70 #error DHCPV6_CLIENT_SOL_TIMEOUT parameter is not valid
74 #ifndef DHCPV6_CLIENT_SOL_MAX_RT
75 #define DHCPV6_CLIENT_SOL_MAX_RT 120000
76 #elif (DHCPV6_CLIENT_SOL_MAX_RT < 100)
77 #error DHCPV6_CLIENT_SOL_MAX_RT parameter is not valid
81 #ifndef DHCPV6_CLIENT_REQ_TIMEOUT
82 #define DHCPV6_CLIENT_REQ_TIMEOUT 1000
83 #elif (DHCPV6_CLIENT_REQ_TIMEOUT < 100)
84 #error DHCPV6_CLIENT_REQ_TIMEOUT parameter is not valid
88 #ifndef DHCPV6_CLIENT_REQ_MAX_RT
89 #define DHCPV6_CLIENT_REQ_MAX_RT 30000
90 #elif (DHCPV6_CLIENT_REQ_MAX_RT < 100)
91 #error DHCPV6_CLIENT_REQ_MAX_RT parameter is not valid
95 #ifndef DHCPV6_CLIENT_REQ_MAX_RC
96 #define DHCPV6_CLIENT_REQ_MAX_RC 10
97 #elif (DHCPV6_CLIENT_REQ_MAX_RC < 1)
98 #error DHCPV6_CLIENT_REQ_MAX_RC parameter is not valid
102 #ifndef DHCPV6_CLIENT_CNF_MAX_DELAY
103 #define DHCPV6_CLIENT_CNF_MAX_DELAY 1000
104 #elif (DHCPV6_CLIENT_CNF_MAX_DELAY < 100)
105 #error DHCPV6_CLIENT_CNF_MAX_DELAY parameter is not valid
109 #ifndef DHCPV6_CLIENT_CNF_TIMEOUT
110 #define DHCPV6_CLIENT_CNF_TIMEOUT 1000
111 #elif (DHCPV6_CLIENT_CNF_TIMEOUT < 100)
112 #error DHCPV6_CLIENT_CNF_TIMEOUT parameter is not valid
116 #ifndef DHCPV6_CLIENT_CNF_MAX_RT
117 #define DHCPV6_CLIENT_CNF_MAX_RT 4000
118 #elif (DHCPV6_CLIENT_CNF_MAX_RT < 100)
119 #error DHCPV6_CLIENT_CNF_MAX_RT parameter is not valid
123 #ifndef DHCPV6_CLIENT_CNF_MAX_RD
124 #define DHCPV6_CLIENT_CNF_MAX_RD 10000
125 #elif (DHCPV6_CLIENT_CNF_MAX_RD < 100)
126 #error DHCPV6_CLIENT_CNF_MAX_RD parameter is not valid
130 #ifndef DHCPV6_CLIENT_REN_TIMEOUT
131 #define DHCPV6_CLIENT_REN_TIMEOUT 10000
132 #elif (DHCPV6_CLIENT_REN_TIMEOUT < 100)
133 #error DHCPV6_CLIENT_REN_TIMEOUT parameter is not valid
137 #ifndef DHCPV6_CLIENT_REN_MAX_RT
138 #define DHCPV6_CLIENT_REN_MAX_RT 600000
139 #elif (DHCPV6_CLIENT_REN_MAX_RT < 100)
140 #error DHCPV6_CLIENT_REN_MAX_RT parameter is not valid
144 #ifndef DHCPV6_CLIENT_REB_TIMEOUT
145 #define DHCPV6_CLIENT_REB_TIMEOUT 10000
146 #elif (DHCPV6_CLIENT_REB_TIMEOUT < 100)
147 #error DHCPV6_CLIENT_REB_TIMEOUT parameter is not valid
151 #ifndef DHCPV6_CLIENT_REB_MAX_RT
152 #define DHCPV6_CLIENT_REB_MAX_RT 600000
153 #elif (DHCPV6_CLIENT_REB_MAX_RT < 100)
154 #error DHCPV6_CLIENT_REB_MAX_RT parameter is not valid
158 #ifndef DHCPV6_CLIENT_INF_MAX_DELAY
159 #define DHCPV6_CLIENT_INF_MAX_DELAY 1000
160 #elif (DHCPV6_CLIENT_INF_MAX_DELAY < 100)
161 #error DHCPV6_CLIENT_INF_MAX_DELAY parameter is not valid
165 #ifndef DHCPV6_CLIENT_INF_TIMEOUT
166 #define DHCPV6_CLIENT_INF_TIMEOUT 1000
167 #elif (DHCPV6_CLIENT_INF_TIMEOUT < 100)
168 #error DHCPV6_CLIENT_INF_TIMEOUT parameter is not valid
172 #ifndef DHCPV6_CLIENT_INF_MAX_RT
173 #define DHCPV6_CLIENT_INF_MAX_RT 120000
174 #elif (DHCPV6_CLIENT_INF_MAX_RT < 1000)
175 #error DHCPV6_CLIENT_INF_MAX_RT parameter is not valid
179 #ifndef DHCPV6_CLIENT_REL_TIMEOUT
180 #define DHCPV6_CLIENT_REL_TIMEOUT 1000
181 #elif (DHCPV6_CLIENT_REL_TIMEOUT < 100)
182 #error DHCPV6_CLIENT_REL_TIMEOUT parameter is not valid
186 #ifndef DHCPV6_CLIENT_REL_MAX_RC
187 #define DHCPV6_CLIENT_REL_MAX_RC 5
188 #elif (DHCPV6_CLIENT_REL_MAX_RC < 1)
189 #error DHCPV6_CLIENT_REL_MAX_RC parameter is not valid
193 #ifndef DHCPV6_CLIENT_DEC_TIMEOUT
194 #define DHCPV6_CLIENT_DEC_TIMEOUT 1000
195 #elif (DHCPV6_CLIENT_DEC_TIMEOUT < 100)
196 #error DHCPV6_CLIENT_DEC_TIMEOUT parameter is not valid
200 #ifndef DHCPV6_CLIENT_DEC_MAX_RC
201 #define DHCPV6_CLIENT_DEC_MAX_RC 5
202 #elif (DHCPV6_CLIENT_DEC_MAX_RC < 1)
203 #error DHCPV6_CLIENT_DEC_MAX_RC parameter is not valid
207 #ifndef DHCPV6_CLIENT_REC_TIMEOUT
208 #define DHCPV6_CLIENT_REC_TIMEOUT 2000
209 #elif (DHCPV6_CLIENT_REC_TIMEOUT < 100)
210 #error DHCPV6_CLIENT_REC_TIMEOUT parameter is not valid
214 #ifndef DHCPV6_CLIENT_REC_MAX_RC
215 #define DHCPV6_CLIENT_REC_MAX_RC 8
216 #elif (DHCPV6_CLIENT_REC_MAX_RC < 1)
217 #error DHCPV6_CLIENT_REC_MAX_RC parameter is not valid
221 #ifndef DHCPV6_CLIENT_PRIVATE_CONTEXT
222 #define DHCPV6_CLIENT_PRIVATE_CONTEXT
227 #define Dhcpv6ClientContext struct _Dhcpv6ClientContext
systime_t configStartTime
Address acquisition or renewal process start time.
bool_t rapidCommit
Quick configuration using rapid commit.
Dhcpv6ParseOptionsCallback parseOptionsCallback
Parse DHCPv6 options callback.
Dhcpv6State dhcpv6ClientGetState(Dhcpv6ClientContext *context)
Retrieve current state.
Dhcpv6StateChangeCallback stateChangeEvent
FSM state change event.
systime_t timeout
Timeout value.
Dhcpv6ClientSettings settings
DHCPv6 client settings.
uint32_t transactionId
Value to match requests with replies.
systime_t exchangeStartTime
Time at which the client sent the first message.
Definitions common to DHCPv6 client, server and relay agent.
bool_t timeoutEventDone
Timeout callback function has been called.
#define DHCPV6_CLIENT_ADDR_LIST_SIZE
systime_t leaseStartTime
Lease start time.
Ipv6Addr addr
IPv6 address.
void(* Dhcpv6TimeoutCallback)(Dhcpv6ClientContext *context, NetInterface *interface)
DHCPv6 configuration timeout callback.
size_t serverIdLen
Length of the server DUID.
bool_t manualDnsConfig
Force manual DNS configuration.
void(* Dhcpv6StateChangeCallback)(Dhcpv6ClientContext *context, NetInterface *interface, Dhcpv6State state)
FSM state change callback.
NetInterface * interface
Network interface to configure.
#define DHCPV6_MAX_DUID_SIZE
systime_t timestamp
Timestamp to manage retransmissions.
void dhcpv6ClientGetDefaultSettings(Dhcpv6ClientSettings *settings)
Initialize settings with default values.
uint32_t validLifetime
Valid lifetime.
Client's IA (Identity Association)
Dhcpv6TimeoutCallback timeoutEvent
DHCPv6 configuration timeout event.
#define Dhcpv6ClientContext
uint_t retransmitCount
Retransmission counter.
systime_t timeout
DHCPv6 configuration timeout.
Dhcpv6ClientIa ia
Identity association.
Dhcpv6State
DHCPv6 client FSM states.
void(* Dhcpv6ParseOptionsCallback)(Dhcpv6ClientContext *context, const Dhcpv6Message *message, size_t length)
Parse DHCPv6 options callback.
error_t dhcpv6ClientStop(Dhcpv6ClientContext *context)
Stop DHCPv6 client.
int_t serverPreference
Preference value for the server.
error_t dhcpv6ClientStart(Dhcpv6ClientContext *context)
Start DHCPv6 client.
uint32_t systime_t
System time.
void(* Dhcpv6AddOptionsCallback)(Dhcpv6ClientContext *context, Dhcpv6Message *message, size_t *length)
Add DHCPv6 options callback.
uint8_t serverId[DHCPV6_MAX_DUID_SIZE]
Server DUID.
void(* Dhcpv6LinkChangeCallback)(Dhcpv6ClientContext *context, NetInterface *interface, bool_t linkState)
Link state change callback.
Dhcpv6LinkChangeCallback linkChangeEvent
Link state change event.
bool_t running
This flag tells whether the DHCP client is running or not.
Dhcpv6State state
Current state of the FSM.
Dhcpv6AddOptionsCallback addOptionsCallback
Add DHCPv6 options callback.
uint32_t preferredLifetime
Preferred lifetime.
size_t clientIdLen
Length of the client DUID.
error_t dhcpv6ClientRelease(Dhcpv6ClientContext *context)
Release DHCPv6 lease.
error_t dhcpv6ClientInit(Dhcpv6ClientContext *context, const Dhcpv6ClientSettings *settings)
DHCPv6 client initialization.
@ DHCPV6_STATE_INIT_CONFIRM
uint8_t clientId[DHCPV6_MAX_DUID_SIZE]
Client DUID.
#define DHCPV6_CLIENT_PRIVATE_CONTEXT