1 | /** @file
|
---|
2 | Dhcp6 internal data structure and definition declaration.
|
---|
3 |
|
---|
4 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
---|
5 |
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 |
|
---|
8 | **/
|
---|
9 |
|
---|
10 | #ifndef __EFI_DHCP6_IMPL_H__
|
---|
11 | #define __EFI_DHCP6_IMPL_H__
|
---|
12 |
|
---|
13 | #include <Uefi.h>
|
---|
14 |
|
---|
15 | #include <IndustryStandard/Dhcp.h>
|
---|
16 |
|
---|
17 | #include <Protocol/Dhcp6.h>
|
---|
18 | #include <Protocol/Udp6.h>
|
---|
19 | #include <Protocol/Ip6Config.h>
|
---|
20 | #include <Protocol/ServiceBinding.h>
|
---|
21 | #include <Protocol/DriverBinding.h>
|
---|
22 |
|
---|
23 | #include <Library/UdpIoLib.h>
|
---|
24 | #include <Library/DebugLib.h>
|
---|
25 | #include <Library/BaseMemoryLib.h>
|
---|
26 | #include <Library/MemoryAllocationLib.h>
|
---|
27 | #include <Library/UefiBootServicesTableLib.h>
|
---|
28 | #include <Library/UefiRuntimeServicesTableLib.h>
|
---|
29 | #include <Library/UefiLib.h>
|
---|
30 | #include <Library/BaseLib.h>
|
---|
31 | #include <Library/NetLib.h>
|
---|
32 | #include <Library/PrintLib.h>
|
---|
33 | #include <Guid/ZeroGuid.h>
|
---|
34 |
|
---|
35 | typedef struct _DHCP6_IA_CB DHCP6_IA_CB;
|
---|
36 | typedef struct _DHCP6_INF_CB DHCP6_INF_CB;
|
---|
37 | typedef struct _DHCP6_TX_CB DHCP6_TX_CB;
|
---|
38 | typedef struct _DHCP6_SERVICE DHCP6_SERVICE;
|
---|
39 | typedef struct _DHCP6_INSTANCE DHCP6_INSTANCE;
|
---|
40 |
|
---|
41 | #include "Dhcp6Utility.h"
|
---|
42 | #include "Dhcp6Io.h"
|
---|
43 | #include "Dhcp6Driver.h"
|
---|
44 |
|
---|
45 | #define DHCP6_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'H', '6', 'S')
|
---|
46 | #define DHCP6_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'H', '6', 'I')
|
---|
47 |
|
---|
48 | #define DHCP6_PACKET_ALL 0
|
---|
49 | #define DHCP6_PACKET_STATEFUL 1
|
---|
50 | #define DHCP6_PACKET_STATELESS 2
|
---|
51 |
|
---|
52 | #define DHCP6_BASE_PACKET_SIZE 1024
|
---|
53 |
|
---|
54 | #define DHCP6_PORT_CLIENT 546
|
---|
55 | #define DHCP6_PORT_SERVER 547
|
---|
56 |
|
---|
57 | #define DHCP_CHECK_MEDIA_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20)
|
---|
58 |
|
---|
59 | #define DHCP6_INSTANCE_FROM_THIS(Instance) CR ((Instance), DHCP6_INSTANCE, Dhcp6, DHCP6_INSTANCE_SIGNATURE)
|
---|
60 | #define DHCP6_SERVICE_FROM_THIS(Service) CR ((Service), DHCP6_SERVICE, ServiceBinding, DHCP6_SERVICE_SIGNATURE)
|
---|
61 |
|
---|
62 | //
|
---|
63 | // For more information on DHCP options see RFC 8415, Section 21.1
|
---|
64 | //
|
---|
65 | // The format of DHCP options is:
|
---|
66 | //
|
---|
67 | // 0 1 2 3
|
---|
68 | // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
---|
69 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
70 | // | option-code | option-len |
|
---|
71 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
72 | // | option-data |
|
---|
73 | // | (option-len octets) |
|
---|
74 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
75 | //
|
---|
76 | #define DHCP6_SIZE_OF_OPT_CODE (sizeof (((EFI_DHCP6_PACKET_OPTION *)0)->OpCode))
|
---|
77 | #define DHCP6_SIZE_OF_OPT_LEN (sizeof (((EFI_DHCP6_PACKET_OPTION *)0)->OpLen))
|
---|
78 |
|
---|
79 | // Combined size of Code and Length
|
---|
80 | #define DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN (DHCP6_SIZE_OF_OPT_CODE + \
|
---|
81 | DHCP6_SIZE_OF_OPT_LEN)
|
---|
82 |
|
---|
83 | STATIC_ASSERT (
|
---|
84 | DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN == 4,
|
---|
85 | "Combined size of Code and Length must be 4 per RFC 8415"
|
---|
86 | );
|
---|
87 |
|
---|
88 | // Offset to the length is just past the code
|
---|
89 | #define DHCP6_OFFSET_OF_OPT_LEN(a) (a + DHCP6_SIZE_OF_OPT_CODE)
|
---|
90 | STATIC_ASSERT (
|
---|
91 | DHCP6_OFFSET_OF_OPT_LEN (0) == 2,
|
---|
92 | "Offset of length is + 2 past start of option"
|
---|
93 | );
|
---|
94 |
|
---|
95 | #define DHCP6_OFFSET_OF_OPT_DATA(a) (a + DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN)
|
---|
96 | STATIC_ASSERT (
|
---|
97 | DHCP6_OFFSET_OF_OPT_DATA (0) == 4,
|
---|
98 | "Offset to option data should be +4 from start of option"
|
---|
99 | );
|
---|
100 | //
|
---|
101 | // Identity Association options (both NA (Non-Temporary) and TA (Temporary Association))
|
---|
102 | // are defined in RFC 8415 and are a deriviation of a TLV stucture
|
---|
103 | // For more information on IA_NA see Section 21.4
|
---|
104 | // For more information on IA_TA see Section 21.5
|
---|
105 | //
|
---|
106 | //
|
---|
107 | // The format of IA_NA and IA_TA option:
|
---|
108 | //
|
---|
109 | // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
---|
110 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
111 | // | OPTION_IA_NA | option-len |
|
---|
112 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
113 | // | IAID (4 octets) |
|
---|
114 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
115 | // | T1 (only for IA_NA) |
|
---|
116 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
117 | // | T2 (only for IA_NA) |
|
---|
118 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
119 | // | |
|
---|
120 | // . IA_NA-options/IA_TA-options .
|
---|
121 | // . .
|
---|
122 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
123 | //
|
---|
124 | #define DHCP6_SIZE_OF_IAID (sizeof(UINT32))
|
---|
125 | #define DHCP6_SIZE_OF_TIME_INTERVAL (sizeof(UINT32))
|
---|
126 |
|
---|
127 | // Combined size of IAID, T1, and T2
|
---|
128 | #define DHCP6_SIZE_OF_COMBINED_IAID_T1_T2 (DHCP6_SIZE_OF_IAID + \
|
---|
129 | DHCP6_SIZE_OF_TIME_INTERVAL + \
|
---|
130 | DHCP6_SIZE_OF_TIME_INTERVAL)
|
---|
131 | STATIC_ASSERT (
|
---|
132 | DHCP6_SIZE_OF_COMBINED_IAID_T1_T2 == 12,
|
---|
133 | "Combined size of IAID, T1, T2 must be 12 per RFC 8415"
|
---|
134 | );
|
---|
135 |
|
---|
136 | // This is the size of IA_TA without options
|
---|
137 | #define DHCP6_MIN_SIZE_OF_IA_TA (DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN + \
|
---|
138 | DHCP6_SIZE_OF_IAID)
|
---|
139 | STATIC_ASSERT (
|
---|
140 | DHCP6_MIN_SIZE_OF_IA_TA == 8,
|
---|
141 | "Minimum combined size of IA_TA per RFC 8415"
|
---|
142 | );
|
---|
143 |
|
---|
144 | // Offset to a IA_TA inner option
|
---|
145 | #define DHCP6_OFFSET_OF_IA_TA_INNER_OPT(a) (a + DHCP6_MIN_SIZE_OF_IA_TA)
|
---|
146 | STATIC_ASSERT (
|
---|
147 | DHCP6_OFFSET_OF_IA_TA_INNER_OPT (0) == 8,
|
---|
148 | "Offset of IA_TA Inner option is + 8 past start of option"
|
---|
149 | );
|
---|
150 |
|
---|
151 | // This is the size of IA_NA without options (16)
|
---|
152 | #define DHCP6_MIN_SIZE_OF_IA_NA DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN + \
|
---|
153 | DHCP6_SIZE_OF_COMBINED_IAID_T1_T2
|
---|
154 | STATIC_ASSERT (
|
---|
155 | DHCP6_MIN_SIZE_OF_IA_NA == 16,
|
---|
156 | "Minimum combined size of IA_TA per RFC 8415"
|
---|
157 | );
|
---|
158 |
|
---|
159 | #define DHCP6_OFFSET_OF_IA_NA_INNER_OPT(a) (a + DHCP6_MIN_SIZE_OF_IA_NA)
|
---|
160 | STATIC_ASSERT (
|
---|
161 | DHCP6_OFFSET_OF_IA_NA_INNER_OPT (0) == 16,
|
---|
162 | "Offset of IA_NA Inner option is + 16 past start of option"
|
---|
163 | );
|
---|
164 |
|
---|
165 | #define DHCP6_OFFSET_OF_IA_NA_T1(a) (a + \
|
---|
166 | DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN + \
|
---|
167 | DHCP6_SIZE_OF_IAID)
|
---|
168 | STATIC_ASSERT (
|
---|
169 | DHCP6_OFFSET_OF_IA_NA_T1 (0) == 8,
|
---|
170 | "Offset of IA_NA Inner option is + 8 past start of option"
|
---|
171 | );
|
---|
172 |
|
---|
173 | #define DHCP6_OFFSET_OF_IA_NA_T2(a) (a + \
|
---|
174 | DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN +\
|
---|
175 | DHCP6_SIZE_OF_IAID + \
|
---|
176 | DHCP6_SIZE_OF_TIME_INTERVAL)
|
---|
177 | STATIC_ASSERT (
|
---|
178 | DHCP6_OFFSET_OF_IA_NA_T2 (0) == 12,
|
---|
179 | "Offset of IA_NA Inner option is + 12 past start of option"
|
---|
180 | );
|
---|
181 |
|
---|
182 | //
|
---|
183 | // For more information see RFC 8415 Section 21.13
|
---|
184 | //
|
---|
185 | // The format of the Status Code Option:
|
---|
186 | //
|
---|
187 | // 0 1 2 3
|
---|
188 | // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
---|
189 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
190 | // | OPTION_STATUS_CODE | option-len |
|
---|
191 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
192 | // | status-code | |
|
---|
193 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|
---|
194 | // . .
|
---|
195 | // . status-message .
|
---|
196 | // . .
|
---|
197 | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
---|
198 | //
|
---|
199 | #define DHCP6_OFFSET_OF_STATUS_CODE(a) (a + DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN)
|
---|
200 | STATIC_ASSERT (
|
---|
201 | DHCP6_OFFSET_OF_STATUS_CODE (0) == 4,
|
---|
202 | "Offset of status is + 4 past start of option"
|
---|
203 | );
|
---|
204 |
|
---|
205 | extern EFI_IPv6_ADDRESS mAllDhcpRelayAndServersAddress;
|
---|
206 | extern EFI_DHCP6_PROTOCOL gDhcp6ProtocolTemplate;
|
---|
207 |
|
---|
208 | //
|
---|
209 | // Control block for each IA.
|
---|
210 | //
|
---|
211 | struct _DHCP6_IA_CB {
|
---|
212 | EFI_DHCP6_IA *Ia;
|
---|
213 | UINT32 T1;
|
---|
214 | UINT32 T2;
|
---|
215 | UINT32 AllExpireTime;
|
---|
216 | UINT32 LeaseTime;
|
---|
217 | };
|
---|
218 |
|
---|
219 | //
|
---|
220 | // Control block for each transmitted message.
|
---|
221 | //
|
---|
222 | struct _DHCP6_TX_CB {
|
---|
223 | LIST_ENTRY Link;
|
---|
224 | UINT32 Xid;
|
---|
225 | EFI_DHCP6_PACKET *TxPacket;
|
---|
226 | EFI_DHCP6_RETRANSMISSION RetryCtl;
|
---|
227 | UINT32 RetryCnt;
|
---|
228 | UINT32 RetryExp;
|
---|
229 | UINT32 RetryLos;
|
---|
230 | UINT32 TickTime;
|
---|
231 | UINT16 *Elapsed;
|
---|
232 | BOOLEAN SolicitRetry;
|
---|
233 | };
|
---|
234 |
|
---|
235 | //
|
---|
236 | // Control block for each info-request message.
|
---|
237 | //
|
---|
238 | struct _DHCP6_INF_CB {
|
---|
239 | LIST_ENTRY Link;
|
---|
240 | UINT32 Xid;
|
---|
241 | EFI_DHCP6_INFO_CALLBACK ReplyCallback;
|
---|
242 | VOID *CallbackContext;
|
---|
243 | EFI_EVENT TimeoutEvent;
|
---|
244 | };
|
---|
245 |
|
---|
246 | //
|
---|
247 | // Control block for Dhcp6 instance, it's per configuration data.
|
---|
248 | //
|
---|
249 | struct _DHCP6_INSTANCE {
|
---|
250 | UINT32 Signature;
|
---|
251 | EFI_HANDLE Handle;
|
---|
252 | DHCP6_SERVICE *Service;
|
---|
253 | LIST_ENTRY Link;
|
---|
254 | EFI_DHCP6_PROTOCOL Dhcp6;
|
---|
255 | EFI_EVENT Timer;
|
---|
256 | EFI_DHCP6_CONFIG_DATA *Config;
|
---|
257 | EFI_DHCP6_IA *CacheIa;
|
---|
258 | DHCP6_IA_CB IaCb;
|
---|
259 | LIST_ENTRY TxList;
|
---|
260 | LIST_ENTRY InfList;
|
---|
261 | EFI_DHCP6_PACKET *AdSelect;
|
---|
262 | UINT8 AdPref;
|
---|
263 | EFI_IPv6_ADDRESS *Unicast;
|
---|
264 | volatile EFI_STATUS UdpSts;
|
---|
265 | BOOLEAN InDestroy;
|
---|
266 | BOOLEAN MediaPresent;
|
---|
267 | //
|
---|
268 | // StartTime is used to calculate the 'elapsed-time' option. Refer to RFC3315,
|
---|
269 | // the elapsed-time is amount of time since the client began its current DHCP transaction.
|
---|
270 | //
|
---|
271 | UINT64 StartTime;
|
---|
272 | };
|
---|
273 |
|
---|
274 | //
|
---|
275 | // Control block for Dhcp6 service, it's per Nic handle.
|
---|
276 | //
|
---|
277 | struct _DHCP6_SERVICE {
|
---|
278 | UINT32 Signature;
|
---|
279 | EFI_HANDLE Controller;
|
---|
280 | EFI_HANDLE Image;
|
---|
281 | EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
|
---|
282 | EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
---|
283 | EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg;
|
---|
284 | EFI_DHCP6_DUID *ClientId;
|
---|
285 | UDP_IO *UdpIo;
|
---|
286 | UINT32 Xid;
|
---|
287 | LIST_ENTRY Child;
|
---|
288 | UINTN NumOfChild;
|
---|
289 | };
|
---|
290 |
|
---|
291 | /**
|
---|
292 | Starts the DHCPv6 standard S.A.R.R. process.
|
---|
293 |
|
---|
294 | The Start() function starts the DHCPv6 standard process. This function can
|
---|
295 | be called only when the state of Dhcp6 instance is in the Dhcp6Init state.
|
---|
296 | If the DHCP process completes successfully, the state of the Dhcp6 instance
|
---|
297 | will be transferred through Dhcp6Selecting and Dhcp6Requesting to the
|
---|
298 | Dhcp6Bound state.
|
---|
299 | Refer to rfc-3315 for precise state transitions during this process. At the
|
---|
300 | time when each event occurs in this process, the callback function that was set
|
---|
301 | by EFI_DHCP6_PROTOCOL.Configure() will be called and the user can take this
|
---|
302 | opportunity to control the process.
|
---|
303 |
|
---|
304 | @param[in] This The pointer to Dhcp6 protocol.
|
---|
305 |
|
---|
306 | @retval EFI_SUCCESS The DHCPv6 standard process has started, or it
|
---|
307 | completed when CompletionEvent was NULL.
|
---|
308 | @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured.
|
---|
309 | @retval EFI_INVALID_PARAMETER This is NULL.
|
---|
310 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
---|
311 | @retval EFI_TIMEOUT The DHCPv6 configuration process failed because no
|
---|
312 | response was received from the server within the
|
---|
313 | specified timeout value.
|
---|
314 | @retval EFI_ABORTED The user aborted the DHCPv6 process.
|
---|
315 | @retval EFI_ALREADY_STARTED Some other Dhcp6 instance already started the DHCPv6
|
---|
316 | standard process.
|
---|
317 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
---|
318 |
|
---|
319 | **/
|
---|
320 | EFI_STATUS
|
---|
321 | EFIAPI
|
---|
322 | EfiDhcp6Start (
|
---|
323 | IN EFI_DHCP6_PROTOCOL *This
|
---|
324 | );
|
---|
325 |
|
---|
326 | /**
|
---|
327 | Stops the DHCPv6 standard S.A.R.R. process.
|
---|
328 |
|
---|
329 | The Stop() function is used to stop the DHCPv6 standard process. After this
|
---|
330 | function is called successfully, the state of Dhcp6 instance is transferred
|
---|
331 | into the Dhcp6Init. EFI_DHCP6_PROTOCOL.Configure() needs to be called
|
---|
332 | before DHCPv6 standard process can be started again. This function can be
|
---|
333 | called when the Dhcp6 instance is in any state.
|
---|
334 |
|
---|
335 | @param[in] This The pointer to the Dhcp6 protocol.
|
---|
336 |
|
---|
337 | @retval EFI_SUCCESS The Dhcp6 instance is now in the Dhcp6Init state.
|
---|
338 | @retval EFI_INVALID_PARAMETER This is NULL.
|
---|
339 |
|
---|
340 | **/
|
---|
341 | EFI_STATUS
|
---|
342 | EFIAPI
|
---|
343 | EfiDhcp6Stop (
|
---|
344 | IN EFI_DHCP6_PROTOCOL *This
|
---|
345 | );
|
---|
346 |
|
---|
347 | /**
|
---|
348 | Returns the current operating mode data for the Dhcp6 instance.
|
---|
349 |
|
---|
350 | The GetModeData() function returns the current operating mode and
|
---|
351 | cached data packet for the Dhcp6 instance.
|
---|
352 |
|
---|
353 | @param[in] This The pointer to the Dhcp6 protocol.
|
---|
354 | @param[out] Dhcp6ModeData The pointer to the Dhcp6 mode data.
|
---|
355 | @param[out] Dhcp6ConfigData The pointer to the Dhcp6 configure data.
|
---|
356 |
|
---|
357 | @retval EFI_SUCCESS The mode data was returned.
|
---|
358 | @retval EFI_INVALID_PARAMETER This is NULL.
|
---|
359 | @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has not
|
---|
360 | been configured when Dhcp6ConfigData is
|
---|
361 | not NULL.
|
---|
362 | **/
|
---|
363 | EFI_STATUS
|
---|
364 | EFIAPI
|
---|
365 | EfiDhcp6GetModeData (
|
---|
366 | IN EFI_DHCP6_PROTOCOL *This,
|
---|
367 | OUT EFI_DHCP6_MODE_DATA *Dhcp6ModeData OPTIONAL,
|
---|
368 | OUT EFI_DHCP6_CONFIG_DATA *Dhcp6ConfigData OPTIONAL
|
---|
369 | );
|
---|
370 |
|
---|
371 | /**
|
---|
372 | Initializes, changes, or resets the operational settings for the Dhcp6 instance.
|
---|
373 |
|
---|
374 | The Configure() function is used to initialize or clean up the configuration
|
---|
375 | data of the Dhcp6 instance:
|
---|
376 | - When Dhcp6CfgData is not NULL and Configure() is called successfully, the
|
---|
377 | configuration data will be initialized in the Dhcp6 instance and the state
|
---|
378 | of the configured IA will be transferred into Dhcp6Init.
|
---|
379 | - When Dhcp6CfgData is NULL and Configure() is called successfully, the
|
---|
380 | configuration data will be cleaned up and no IA will be associated with
|
---|
381 | the Dhcp6 instance.
|
---|
382 | To update the configuration data for an Dhcp6 instance, the original data
|
---|
383 | must be cleaned up before setting the new configuration data.
|
---|
384 |
|
---|
385 | @param[in] This The pointer to the Dhcp6 protocol
|
---|
386 | @param[in] Dhcp6CfgData The pointer to the EFI_DHCP6_CONFIG_DATA.
|
---|
387 |
|
---|
388 | @retval EFI_SUCCESS The Dhcp6 is configured successfully with the
|
---|
389 | Dhcp6Init state, or cleaned up the original
|
---|
390 | configuration setting.
|
---|
391 | @retval EFI_ACCESS_DENIED The Dhcp6 instance has been already configured
|
---|
392 | when Dhcp6CfgData is not NULL.
|
---|
393 | The Dhcp6 instance has already started the
|
---|
394 | DHCPv6 S.A.R.R when Dhcp6CfgData is NULL.
|
---|
395 | @retval EFI_INVALID_PARAMETER Some of the parameter is invalid.
|
---|
396 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
---|
397 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
---|
398 |
|
---|
399 | **/
|
---|
400 | EFI_STATUS
|
---|
401 | EFIAPI
|
---|
402 | EfiDhcp6Configure (
|
---|
403 | IN EFI_DHCP6_PROTOCOL *This,
|
---|
404 | IN EFI_DHCP6_CONFIG_DATA *Dhcp6CfgData OPTIONAL
|
---|
405 | );
|
---|
406 |
|
---|
407 | /**
|
---|
408 | Request configuration information without the assignment of any
|
---|
409 | Ia addresses of the client.
|
---|
410 |
|
---|
411 | The InfoRequest() function is used to request configuration information
|
---|
412 | without the assignment of any IPv6 address of the client. Client sends
|
---|
413 | out Information Request packet to obtain the required configuration
|
---|
414 | information, and DHCPv6 server responds with Reply packet containing
|
---|
415 | the information for the client. The received Reply packet will be passed
|
---|
416 | to the user by ReplyCallback function. If user returns EFI_NOT_READY from
|
---|
417 | ReplyCallback, the Dhcp6 instance will continue to receive other Reply
|
---|
418 | packets unless timeout according to the Retransmission parameter.
|
---|
419 | Otherwise, the Information Request exchange process will be finished
|
---|
420 | successfully if user returns EFI_SUCCESS from ReplyCallback.
|
---|
421 |
|
---|
422 | @param[in] This The pointer to the Dhcp6 protocol.
|
---|
423 | @param[in] SendClientId If TRUE, the DHCPv6 protocol instance will build Client
|
---|
424 | Identifier option and include it into Information Request
|
---|
425 | packet. Otherwise, Client Identifier option will not be included.
|
---|
426 | @param[in] OptionRequest The pointer to the buffer of option request options.
|
---|
427 | @param[in] OptionCount The option number in the OptionList.
|
---|
428 | @param[in] OptionList The list of appended options.
|
---|
429 | @param[in] Retransmission The pointer to the retransmission of the message.
|
---|
430 | @param[in] TimeoutEvent The event of timeout.
|
---|
431 | @param[in] ReplyCallback The callback function when a reply was received.
|
---|
432 | @param[in] CallbackContext The pointer to the parameter passed to the callback.
|
---|
433 |
|
---|
434 | @retval EFI_SUCCESS The DHCPv6 information request exchange process
|
---|
435 | completed when TimeoutEvent is NULL. Information
|
---|
436 | Request packet has been sent to DHCPv6 server when
|
---|
437 | TimeoutEvent is not NULL.
|
---|
438 | @retval EFI_NO_RESPONSE The DHCPv6 information request exchange process failed
|
---|
439 | because of no response, or not all requested-options
|
---|
440 | are responded to by DHCPv6 servers when Timeout happened.
|
---|
441 | @retval EFI_ABORTED The DHCPv6 information request exchange process was aborted
|
---|
442 | by the user.
|
---|
443 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.
|
---|
444 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
---|
445 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
---|
446 |
|
---|
447 | **/
|
---|
448 | EFI_STATUS
|
---|
449 | EFIAPI
|
---|
450 | EfiDhcp6InfoRequest (
|
---|
451 | IN EFI_DHCP6_PROTOCOL *This,
|
---|
452 | IN BOOLEAN SendClientId,
|
---|
453 | IN EFI_DHCP6_PACKET_OPTION *OptionRequest,
|
---|
454 | IN UINT32 OptionCount,
|
---|
455 | IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL,
|
---|
456 | IN EFI_DHCP6_RETRANSMISSION *Retransmission,
|
---|
457 | IN EFI_EVENT TimeoutEvent OPTIONAL,
|
---|
458 | IN EFI_DHCP6_INFO_CALLBACK ReplyCallback,
|
---|
459 | IN VOID *CallbackContext OPTIONAL
|
---|
460 | );
|
---|
461 |
|
---|
462 | /**
|
---|
463 | Manually extend the valid and preferred lifetimes for the IPv6 addresses
|
---|
464 | of the configured IA and update other configuration parameters by sending
|
---|
465 | Renew or Rebind packet.
|
---|
466 |
|
---|
467 | The RenewRebind() function is used to manually extend the valid and preferred
|
---|
468 | lifetimes for the IPv6 addresses of the configured IA and update other
|
---|
469 | configuration parameters by sending a Renew or Rebind packet.
|
---|
470 | - When RebindRequest is FALSE and the state of the configured IA is Dhcp6Bound,
|
---|
471 | it will send Renew packet to the previously DHCPv6 server and transfer the
|
---|
472 | state of the configured IA to Dhcp6Renewing. If valid Reply packet received,
|
---|
473 | the state transfers to Dhcp6Bound and the valid and preferred timer restarts.
|
---|
474 | If fails, the state transfers to Dhcp6Bound but the timer continues.
|
---|
475 | - When RebindRequest is TRUE and the state of the configured IA is Dhcp6Bound,
|
---|
476 | it will send a Rebind packet. If a valid Reply packet is received, the state transfers
|
---|
477 | to Dhcp6Bound, and the valid and preferred timer restarts. If it fails, the state
|
---|
478 | transfers to Dhcp6Init, and the IA can't be used.
|
---|
479 |
|
---|
480 | @param[in] This The pointer to the Dhcp6 protocol.
|
---|
481 | @param[in] RebindRequest If TRUE, Rebind packet will be sent and enter Dhcp6Rebinding state.
|
---|
482 | Otherwise, Renew packet will be sent and enter Dhcp6Renewing state.
|
---|
483 |
|
---|
484 | @retval EFI_SUCCESS The DHCPv6 renew/rebind exchange process
|
---|
485 | completed and at least one IPv6 address of the
|
---|
486 | configured IA was bound again when
|
---|
487 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent was NULL.
|
---|
488 | The EFI DHCPv6 Protocol instance has sent Renew
|
---|
489 | or Rebind packet when
|
---|
490 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
|
---|
491 | @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the
|
---|
492 | state of the configured IA is not in Dhcp6Bound.
|
---|
493 | @retval EFI_ALREADY_STARTED The state of the configured IA has already entered
|
---|
494 | Dhcp6Renewing when RebindRequest is FALSE.
|
---|
495 | The state of the configured IA has already entered
|
---|
496 | Dhcp6Rebinding when RebindRequest is TRUE.
|
---|
497 | @retval EFI_ABORTED The DHCPv6 renew/rebind exchange process aborted
|
---|
498 | by user.
|
---|
499 | @retval EFI_NO_RESPONSE The DHCPv6 renew/rebind exchange process failed
|
---|
500 | because of no response.
|
---|
501 | @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured
|
---|
502 | IA after the DHCPv6 renew/rebind exchange process.
|
---|
503 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.
|
---|
504 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
---|
505 |
|
---|
506 | **/
|
---|
507 | EFI_STATUS
|
---|
508 | EFIAPI
|
---|
509 | EfiDhcp6RenewRebind (
|
---|
510 | IN EFI_DHCP6_PROTOCOL *This,
|
---|
511 | IN BOOLEAN RebindRequest
|
---|
512 | );
|
---|
513 |
|
---|
514 | /**
|
---|
515 | Inform that one or more addresses assigned by a server are already
|
---|
516 | in use by another node.
|
---|
517 |
|
---|
518 | The Decline() function is used to manually decline the assignment of
|
---|
519 | IPv6 addresses, which have been already used by another node. If all
|
---|
520 | IPv6 addresses of the configured IA are declined through this function,
|
---|
521 | the state of the IA will switch through Dhcp6Declining to Dhcp6Init.
|
---|
522 | Otherwise, the state of the IA will restore to Dhcp6Bound after the
|
---|
523 | declining process. The Decline() can only be called when the IA is in
|
---|
524 | Dhcp6Bound state. If the EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL,
|
---|
525 | this function is a blocking operation. It will return after the
|
---|
526 | declining process finishes, or aborted by user.
|
---|
527 |
|
---|
528 | @param[in] This The pointer to the Dhcp6 protocol.
|
---|
529 | @param[in] AddressCount The number of declining addresses.
|
---|
530 | @param[in] Addresses The pointer to the buffer stored the declining
|
---|
531 | addresses.
|
---|
532 |
|
---|
533 | @retval EFI_SUCCESS The DHCPv6 decline exchange process completed
|
---|
534 | when EFI_DHCP6_CONFIG_DATA.IaInfoEvent was NULL.
|
---|
535 | The Dhcp6 instance has sent Decline packet when
|
---|
536 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
|
---|
537 | @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the
|
---|
538 | state of the configured IA is not in Dhcp6Bound.
|
---|
539 | @retval EFI_ABORTED The DHCPv6 decline exchange process was aborted by the user.
|
---|
540 | @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with
|
---|
541 | the configured IA for this instance.
|
---|
542 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.
|
---|
543 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
---|
544 |
|
---|
545 | **/
|
---|
546 | EFI_STATUS
|
---|
547 | EFIAPI
|
---|
548 | EfiDhcp6Decline (
|
---|
549 | IN EFI_DHCP6_PROTOCOL *This,
|
---|
550 | IN UINT32 AddressCount,
|
---|
551 | IN EFI_IPv6_ADDRESS *Addresses
|
---|
552 | );
|
---|
553 |
|
---|
554 | /**
|
---|
555 | Release one or more addresses associated with the configured Ia
|
---|
556 | for the current instance.
|
---|
557 |
|
---|
558 | The Release() function is used to manually release the one or more
|
---|
559 | IPv6 address. If AddressCount is zero, it will release all IPv6
|
---|
560 | addresses of the configured IA. If all IPv6 addresses of the IA are
|
---|
561 | released through this function, the state of the IA will switch
|
---|
562 | through Dhcp6Releasing to Dhcp6Init, otherwise, the state of the
|
---|
563 | IA will restore to Dhcp6Bound after the releasing process.
|
---|
564 | The Release() can only be called when the IA is in a Dhcp6Bound state.
|
---|
565 | If the EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the function is
|
---|
566 | a blocking operation. It will return after the releasing process
|
---|
567 | finishes, or aborted by user.
|
---|
568 |
|
---|
569 | @param[in] This The pointer to the Dhcp6 protocol.
|
---|
570 | @param[in] AddressCount The number of releasing addresses.
|
---|
571 | @param[in] Addresses The pointer to the buffer stored the releasing
|
---|
572 | addresses.
|
---|
573 | @retval EFI_SUCCESS The DHCPv6 release exchange process has
|
---|
574 | completed when EFI_DHCP6_CONFIG_DATA.IaInfoEvent
|
---|
575 | is NULL. The Dhcp6 instance has sent Release
|
---|
576 | packet when EFI_DHCP6_CONFIG_DATA.IaInfoEvent
|
---|
577 | is not NULL.
|
---|
578 | @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the
|
---|
579 | state of the configured IA is not in Dhcp6Bound.
|
---|
580 | @retval EFI_ABORTED The DHCPv6 release exchange process was aborted by the user.
|
---|
581 | @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with
|
---|
582 | the configured IA for this instance.
|
---|
583 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.
|
---|
584 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
---|
585 |
|
---|
586 | **/
|
---|
587 | EFI_STATUS
|
---|
588 | EFIAPI
|
---|
589 | EfiDhcp6Release (
|
---|
590 | IN EFI_DHCP6_PROTOCOL *This,
|
---|
591 | IN UINT32 AddressCount,
|
---|
592 | IN EFI_IPv6_ADDRESS *Addresses
|
---|
593 | );
|
---|
594 |
|
---|
595 | /**
|
---|
596 | Parse the option data in the Dhcp6 packet.
|
---|
597 |
|
---|
598 | The Parse() function is used to retrieve the option list in the DHCPv6 packet.
|
---|
599 |
|
---|
600 | @param[in] This The pointer to the Dhcp6 protocol.
|
---|
601 | @param[in] Packet The pointer to the Dhcp6 packet.
|
---|
602 | @param[in, out] OptionCount The number of option in the packet.
|
---|
603 | @param[out] PacketOptionList The array of pointers to the each option in the packet.
|
---|
604 |
|
---|
605 | @retval EFI_SUCCESS The packet was successfully parsed.
|
---|
606 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.
|
---|
607 | @retval EFI_BUFFER_TOO_SMALL *OptionCount is smaller than the number of options
|
---|
608 | that were found in the Packet.
|
---|
609 |
|
---|
610 | **/
|
---|
611 | EFI_STATUS
|
---|
612 | EFIAPI
|
---|
613 | EfiDhcp6Parse (
|
---|
614 | IN EFI_DHCP6_PROTOCOL *This,
|
---|
615 | IN EFI_DHCP6_PACKET *Packet,
|
---|
616 | IN OUT UINT32 *OptionCount,
|
---|
617 | OUT EFI_DHCP6_PACKET_OPTION *PacketOptionList[] OPTIONAL
|
---|
618 | );
|
---|
619 |
|
---|
620 | #endif
|
---|