]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | UEFI Dynamic Host Configuration Protocol 6 Definition, which is used to get IPv6\r | |
3 | addresses and other configuration parameters from DHCPv6 servers.\r | |
4 | \r | |
5 | Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
7 | \r | |
8 | @par Revision Reference:\r | |
9 | This Protocol is introduced in UEFI Specification 2.2\r | |
10 | \r | |
11 | **/\r | |
12 | \r | |
13 | #ifndef __EFI_DHCP6_PROTOCOL_H__\r | |
14 | #define __EFI_DHCP6_PROTOCOL_H__\r | |
15 | \r | |
16 | #define EFI_DHCP6_PROTOCOL_GUID \\r | |
17 | { \\r | |
18 | 0x87c8bad7, 0x595, 0x4053, {0x82, 0x97, 0xde, 0xde, 0x39, 0x5f, 0x5d, 0x5b } \\r | |
19 | }\r | |
20 | \r | |
21 | #define EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID \\r | |
22 | { \\r | |
23 | 0x9fb9a8a1, 0x2f4a, 0x43a6, {0x88, 0x9c, 0xd0, 0xf7, 0xb6, 0xc4, 0x7a, 0xd5 } \\r | |
24 | }\r | |
25 | \r | |
26 | typedef struct _EFI_DHCP6_PROTOCOL EFI_DHCP6_PROTOCOL;\r | |
27 | \r | |
28 | typedef enum {\r | |
29 | ///\r | |
30 | /// The EFI DHCPv6 Protocol instance is configured, and start() needs\r | |
31 | /// to be called\r | |
32 | ///\r | |
33 | Dhcp6Init = 0x0,\r | |
34 | ///\r | |
35 | /// A Solicit packet is sent out to discover DHCPv6 server, and the EFI\r | |
36 | /// DHCPv6 Protocol instance is collecting Advertise packets.\r | |
37 | ///\r | |
38 | Dhcp6Selecting = 0x1,\r | |
39 | ///\r | |
40 | /// A Request is sent out to the DHCPv6 server, and the EFI DHCPv6\r | |
41 | /// Protocol instance is waiting for Reply packet.\r | |
42 | ///\r | |
43 | Dhcp6Requesting = 0x2,\r | |
44 | ///\r | |
45 | /// A Decline packet is sent out to indicate one or more addresses of the\r | |
46 | /// configured IA are in use by another node, and the EFI DHCPv6.\r | |
47 | /// Protocol instance is waiting for Reply packet.\r | |
48 | ///\r | |
49 | Dhcp6Declining = 0x3,\r | |
50 | ///\r | |
51 | /// A Confirm packet is sent out to confirm the IPv6 addresses of the\r | |
52 | /// configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet.\r | |
53 | ///\r | |
54 | Dhcp6Confirming = 0x4,\r | |
55 | ///\r | |
56 | /// A Release packet is sent out to release one or more IPv6 addresses of\r | |
57 | /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet.\r | |
58 | ///\r | |
59 | Dhcp6Releasing = 0x5,\r | |
60 | ///\r | |
61 | /// The DHCPv6 S.A.R.R process is completed for the configured IA.\r | |
62 | ///\r | |
63 | Dhcp6Bound = 0x6,\r | |
64 | ///\r | |
65 | /// A Renew packet is sent out to extend lifetime for the IPv6 addresses of\r | |
66 | /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet.\r | |
67 | ///\r | |
68 | Dhcp6Renewing = 0x7,\r | |
69 | ///\r | |
70 | /// A Rebind packet is sent out to extend lifetime for the IPv6 addresses of\r | |
71 | /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet.\r | |
72 | ///\r | |
73 | Dhcp6Rebinding = 0x8\r | |
74 | } EFI_DHCP6_STATE;\r | |
75 | \r | |
76 | typedef enum {\r | |
77 | ///\r | |
78 | /// A Solicit packet is about to be sent. The packet is passed to Dhcp6Callback and\r | |
79 | /// can be modified or replaced in Dhcp6Callback.\r | |
80 | ///\r | |
81 | Dhcp6SendSolicit = 0x0,\r | |
82 | ///\r | |
83 | /// An Advertise packet is received and will be passed to Dhcp6Callback.\r | |
84 | ///\r | |
85 | Dhcp6RcvdAdvertise = 0x1,\r | |
86 | ///\r | |
87 | /// It is time for Dhcp6Callback to determine whether select the default Advertise\r | |
88 | /// packet by RFC 3315 policy, or overwrite it by specific user policy.\r | |
89 | ///\r | |
90 | Dhcp6SelectAdvertise = 0x2,\r | |
91 | ///\r | |
92 | /// A Request packet is about to be sent. The packet is passed to Dhcp6Callback and\r | |
93 | /// can be modified or replaced in Dhcp6Callback.\r | |
94 | ///\r | |
95 | Dhcp6SendRequest = 0x3,\r | |
96 | ///\r | |
97 | /// A Reply packet is received and will be passed to Dhcp6Callback.\r | |
98 | ///\r | |
99 | Dhcp6RcvdReply = 0x4,\r | |
100 | ///\r | |
101 | /// A Reconfigure packet is received and will be passed to Dhcp6Callback.\r | |
102 | ///\r | |
103 | Dhcp6RcvdReconfigure = 0x5,\r | |
104 | ///\r | |
105 | /// A Decline packet is about to be sent. The packet is passed to Dhcp6Callback and\r | |
106 | /// can be modified or replaced in Dhcp6Callback.\r | |
107 | ///\r | |
108 | Dhcp6SendDecline = 0x6,\r | |
109 | ///\r | |
110 | /// A Confirm packet is about to be sent. The packet is passed to Dhcp6Callback and\r | |
111 | /// can be modified or replaced in Dhcp6Callback.\r | |
112 | ///\r | |
113 | Dhcp6SendConfirm = 0x7,\r | |
114 | ///\r | |
115 | /// A Release packet is about to be sent. The packet is passed to Dhcp6Callback and\r | |
116 | /// can be modified or replaced in Dhcp6Callback.\r | |
117 | ///\r | |
118 | Dhcp6SendRelease = 0x8,\r | |
119 | ///\r | |
120 | /// A Renew packet is about to be sent. The packet is passed to Dhcp6Callback and\r | |
121 | /// can be modified or replaced in Dhcp6Callback.\r | |
122 | ///\r | |
123 | Dhcp6EnterRenewing = 0x9,\r | |
124 | ///\r | |
125 | /// A Rebind packet is about to be sent. The packet is passed to Dhcp6Callback and\r | |
126 | /// can be modified or replaced in Dhcp6Callback.\r | |
127 | ///\r | |
128 | Dhcp6EnterRebinding = 0xa\r | |
129 | } EFI_DHCP6_EVENT;\r | |
130 | \r | |
131 | ///\r | |
132 | /// An IA which carries assigned not temporary address.\r | |
133 | ///\r | |
134 | #define EFI_DHCP6_IA_TYPE_NA 3\r | |
135 | ///\r | |
136 | /// An IA which carries assigned temporary address.\r | |
137 | ///\r | |
138 | #define EFI_DHCP6_IA_TYPE_TA 4\r | |
139 | \r | |
140 | #pragma pack(1)\r | |
141 | ///\r | |
142 | /// EFI_DHCP6_PACKET_OPTION\r | |
143 | /// defines the format of the DHCPv6 option, See RFC 3315 for more information.\r | |
144 | /// This data structure is used to reference option data that is packed in the DHCPv6 packet.\r | |
145 | ///\r | |
146 | typedef struct {\r | |
147 | ///\r | |
148 | /// The DHCPv6 option code, stored in network order.\r | |
149 | ///\r | |
150 | UINT16 OpCode;\r | |
151 | ///\r | |
152 | /// Length of the DHCPv6 option data, stored in network order.\r | |
153 | /// From the first byte to the last byte of the Data field.\r | |
154 | ///\r | |
155 | UINT16 OpLen;\r | |
156 | ///\r | |
157 | /// The data for the DHCPv6 option, stored in network order.\r | |
158 | ///\r | |
159 | UINT8 Data[1];\r | |
160 | } EFI_DHCP6_PACKET_OPTION;\r | |
161 | \r | |
162 | ///\r | |
163 | /// EFI_DHCP6_HEADER\r | |
164 | /// defines the format of the DHCPv6 header. See RFC 3315 for more information.\r | |
165 | ///\r | |
166 | typedef struct {\r | |
167 | ///\r | |
168 | /// The DHCPv6 transaction ID.\r | |
169 | ///\r | |
170 | UINT32 MessageType : 8;\r | |
171 | ///\r | |
172 | /// The DHCPv6 message type.\r | |
173 | ///\r | |
174 | UINT32 TransactionId : 24;\r | |
175 | } EFI_DHCP6_HEADER;\r | |
176 | \r | |
177 | ///\r | |
178 | /// EFI_DHCP6_PACKET\r | |
179 | /// defines the format of the DHCPv6 packet. See RFC 3315 for more information.\r | |
180 | ///\r | |
181 | typedef struct {\r | |
182 | ///\r | |
183 | /// Size of the EFI_DHCP6_PACKET buffer.\r | |
184 | ///\r | |
185 | UINT32 Size;\r | |
186 | ///\r | |
187 | /// Length of the EFI_DHCP6_PACKET from the first byte of the Header field to the last\r | |
188 | /// byte of the Option[] field.\r | |
189 | ///\r | |
190 | UINT32 Length;\r | |
191 | struct {\r | |
192 | ///\r | |
193 | /// The DHCPv6 packet header.\r | |
194 | ///\r | |
195 | EFI_DHCP6_HEADER Header;\r | |
196 | ///\r | |
197 | /// Start of the DHCPv6 packed option data.\r | |
198 | ///\r | |
199 | UINT8 Option[1];\r | |
200 | } Dhcp6;\r | |
201 | } EFI_DHCP6_PACKET;\r | |
202 | \r | |
203 | #pragma pack()\r | |
204 | \r | |
205 | typedef struct {\r | |
206 | ///\r | |
207 | /// Length of DUID in octects.\r | |
208 | ///\r | |
209 | UINT16 Length;\r | |
210 | ///\r | |
211 | /// Array of DUID octects.\r | |
212 | ///\r | |
213 | UINT8 Duid[1];\r | |
214 | } EFI_DHCP6_DUID;\r | |
215 | \r | |
216 | typedef struct {\r | |
217 | ///\r | |
218 | /// Initial retransmission timeout.\r | |
219 | ///\r | |
220 | UINT32 Irt;\r | |
221 | ///\r | |
222 | /// Maximum retransmission count for one packet. If Mrc is zero, there's no upper limit\r | |
223 | /// for retransmission count.\r | |
224 | ///\r | |
225 | UINT32 Mrc;\r | |
226 | ///\r | |
227 | /// Maximum retransmission timeout for each retry. It's the upper bound of the number of\r | |
228 | /// retransmission timeout. If Mrt is zero, there is no upper limit for retransmission\r | |
229 | /// timeout.\r | |
230 | ///\r | |
231 | UINT32 Mrt;\r | |
232 | ///\r | |
233 | /// Maximum retransmission duration for one packet. It's the upper bound of the numbers\r | |
234 | /// the client may retransmit a message. If Mrd is zero, there's no upper limit for\r | |
235 | /// retransmission duration.\r | |
236 | ///\r | |
237 | UINT32 Mrd;\r | |
238 | } EFI_DHCP6_RETRANSMISSION;\r | |
239 | \r | |
240 | typedef struct {\r | |
241 | ///\r | |
242 | /// The IPv6 address.\r | |
243 | ///\r | |
244 | EFI_IPv6_ADDRESS IpAddress;\r | |
245 | ///\r | |
246 | /// The preferred lifetime in unit of seconds for the IPv6 address.\r | |
247 | ///\r | |
248 | UINT32 PreferredLifetime;\r | |
249 | ///\r | |
250 | /// The valid lifetime in unit of seconds for the IPv6 address.\r | |
251 | ///\r | |
252 | UINT32 ValidLifetime;\r | |
253 | } EFI_DHCP6_IA_ADDRESS;\r | |
254 | \r | |
255 | typedef struct {\r | |
256 | UINT16 Type; ///< Type for an IA.\r | |
257 | UINT32 IaId; ///< The identifier for an IA.\r | |
258 | } EFI_DHCP6_IA_DESCRIPTOR;\r | |
259 | \r | |
260 | typedef struct {\r | |
261 | ///\r | |
262 | /// The descriptor for IA.\r | |
263 | ///\r | |
264 | EFI_DHCP6_IA_DESCRIPTOR Descriptor;\r | |
265 | ///\r | |
266 | /// The state of the configured IA.\r | |
267 | ///\r | |
268 | EFI_DHCP6_STATE State;\r | |
269 | ///\r | |
270 | /// Pointer to the cached latest Reply packet. May be NULL if no packet is cached.\r | |
271 | ///\r | |
272 | EFI_DHCP6_PACKET *ReplyPacket;\r | |
273 | ///\r | |
274 | /// Number of IPv6 addresses of the configured IA.\r | |
275 | ///\r | |
276 | UINT32 IaAddressCount;\r | |
277 | ///\r | |
278 | /// List of the IPv6 addresses of the configured IA. When the state of the configured IA is\r | |
279 | /// in Dhcp6Bound, Dhcp6Renewing and Dhcp6Rebinding, the IPv6 addresses are usable.\r | |
280 | ///\r | |
281 | EFI_DHCP6_IA_ADDRESS IaAddress[1];\r | |
282 | } EFI_DHCP6_IA;\r | |
283 | \r | |
284 | typedef struct {\r | |
285 | ///\r | |
286 | /// Pointer to the DHCPv6 unique identifier. The caller is responsible for freeing this buffer.\r | |
287 | ///\r | |
288 | EFI_DHCP6_DUID *ClientId;\r | |
289 | ///\r | |
290 | /// Pointer to the configured IA of current instance. The caller can free this buffer after\r | |
291 | /// using it.\r | |
292 | ///\r | |
293 | EFI_DHCP6_IA *Ia;\r | |
294 | } EFI_DHCP6_MODE_DATA;\r | |
295 | \r | |
296 | /**\r | |
297 | EFI_DHCP6_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol instance to\r | |
298 | intercept events that occurs in the DHCPv6 S.A.R.R process.\r | |
299 | \r | |
300 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance that is used to configure this\r | |
301 | callback function.\r | |
302 | @param[in] Context Pointer to the context that is initialized by EFI_DHCP6_PROTOCOL.Configure().\r | |
303 | @param[in] CurrentState The current state of the configured IA.\r | |
304 | @param[in] Dhcp6Event The event that occurs in the current state, which usually means a state transition.\r | |
305 | @param[in] Packet Pointer to the DHCPv6 packet that is about to be sent or has been received.\r | |
306 | The EFI DHCPv6 Protocol instance is responsible for freeing the buffer.\r | |
307 | @param[out] NewPacket Pointer to the new DHCPv6 packet to overwrite the Packet. NewPacket can not\r | |
308 | share the buffer with Packet. If *NewPacket is not NULL, the EFI DHCPv6\r | |
309 | Protocol instance is responsible for freeing the buffer.\r | |
310 | \r | |
311 | @retval EFI_SUCCESS Tell the EFI DHCPv6 Protocol instance to continue the DHCPv6 S.A.R.R process.\r | |
312 | @retval EFI_ABORTED Tell the EFI DHCPv6 Protocol instance to abort the DHCPv6 S.A.R.R process,\r | |
313 | and the state of the configured IA will be transferred to Dhcp6Init.\r | |
314 | \r | |
315 | **/\r | |
316 | typedef\r | |
317 | EFI_STATUS\r | |
318 | (EFIAPI *EFI_DHCP6_CALLBACK)(\r | |
319 | IN EFI_DHCP6_PROTOCOL *This,\r | |
320 | IN VOID *Context,\r | |
321 | IN EFI_DHCP6_STATE CurrentState,\r | |
322 | IN EFI_DHCP6_EVENT Dhcp6Event,\r | |
323 | IN EFI_DHCP6_PACKET *Packet,\r | |
324 | OUT EFI_DHCP6_PACKET **NewPacket OPTIONAL\r | |
325 | );\r | |
326 | \r | |
327 | typedef struct {\r | |
328 | ///\r | |
329 | /// The callback function is to intercept various events that occur in the DHCPv6 S.A.R.R\r | |
330 | /// process. Set to NULL to ignore all those events.\r | |
331 | ///\r | |
332 | EFI_DHCP6_CALLBACK Dhcp6Callback;\r | |
333 | ///\r | |
334 | /// Pointer to the context that will be passed to Dhcp6Callback.\r | |
335 | ///\r | |
336 | VOID *CallbackContext;\r | |
337 | ///\r | |
338 | /// Number of the DHCPv6 options in the OptionList.\r | |
339 | ///\r | |
340 | UINT32 OptionCount;\r | |
341 | ///\r | |
342 | /// List of the DHCPv6 options to be included in Solicit and Request packet. The buffer\r | |
343 | /// can be freed after EFI_DHCP6_PROTOCOL.Configure() returns. Ignored if\r | |
344 | /// OptionCount is zero. OptionList should not contain Client Identifier option\r | |
345 | /// and any IA option, which will be appended by EFI DHCPv6 Protocol instance\r | |
346 | /// automatically.\r | |
347 | ///\r | |
348 | EFI_DHCP6_PACKET_OPTION **OptionList;\r | |
349 | ///\r | |
350 | /// The descriptor for the IA of the EFI DHCPv6 Protocol instance.\r | |
351 | ///\r | |
352 | EFI_DHCP6_IA_DESCRIPTOR IaDescriptor;\r | |
353 | ///\r | |
354 | /// If not NULL, the event will be signaled when any IPv6 address information of the\r | |
355 | /// configured IA is updated, including IPv6 address, preferred lifetime and valid\r | |
356 | /// lifetime, or the DHCPv6 S.A.R.R process fails. Otherwise, Start(),\r | |
357 | /// renewrebind(), decline(), release() and stop() will be blocking\r | |
358 | /// operations, and they will wait for the exchange process completion or failure.\r | |
359 | ///\r | |
360 | EFI_EVENT IaInfoEvent;\r | |
361 | ///\r | |
362 | /// If TRUE, the EFI DHCPv6 Protocol instance is willing to accept Reconfigure packet.\r | |
363 | /// Otherwise, it will ignore it. Reconfigure Accept option can not be specified through\r | |
364 | /// OptionList parameter.\r | |
365 | ///\r | |
366 | BOOLEAN ReconfigureAccept;\r | |
367 | ///\r | |
368 | /// If TRUE, the EFI DHCPv6 Protocol instance will send Solicit packet with Rapid\r | |
369 | /// Commit option. Otherwise, Rapid Commit option will not be included in Solicit\r | |
370 | /// packet. Rapid Commit option can not be specified through OptionList parameter.\r | |
371 | ///\r | |
372 | BOOLEAN RapidCommit;\r | |
373 | ///\r | |
374 | /// Parameter to control Solicit packet retransmission behavior. The\r | |
375 | /// buffer can be freed after EFI_DHCP6_PROTOCOL.Configure() returns.\r | |
376 | ///\r | |
377 | EFI_DHCP6_RETRANSMISSION *SolicitRetransmission;\r | |
378 | } EFI_DHCP6_CONFIG_DATA;\r | |
379 | \r | |
380 | /**\r | |
381 | EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol\r | |
382 | instance to intercept events that occurs in the DHCPv6 Information Request exchange process.\r | |
383 | \r | |
384 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance that is used to configure this\r | |
385 | callback function.\r | |
386 | @param[in] Context Pointer to the context that is initialized in the EFI_DHCP6_PROTOCOL.InfoRequest().\r | |
387 | @param[in] Packet Pointer to Reply packet that has been received. The EFI DHCPv6 Protocol instance is\r | |
388 | responsible for freeing the buffer.\r | |
389 | \r | |
390 | @retval EFI_SUCCESS Tell the EFI DHCPv6 Protocol instance to finish Information Request exchange process.\r | |
391 | @retval EFI_NOT_READY Tell the EFI DHCPv6 Protocol instance to continue Information Request exchange process.\r | |
392 | @retval EFI_ABORTED Tell the EFI DHCPv6 Protocol instance to abort the Information Request exchange process.\r | |
393 | \r | |
394 | **/\r | |
395 | typedef\r | |
396 | EFI_STATUS\r | |
397 | (EFIAPI *EFI_DHCP6_INFO_CALLBACK)(\r | |
398 | IN EFI_DHCP6_PROTOCOL *This,\r | |
399 | IN VOID *Context,\r | |
400 | IN EFI_DHCP6_PACKET *Packet\r | |
401 | );\r | |
402 | \r | |
403 | /**\r | |
404 | Retrieve the current operating mode data and configuration data for the EFI DHCPv6 Protocol instance.\r | |
405 | \r | |
406 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.\r | |
407 | @param[out] Dhcp6ModeData Pointer to the DHCPv6 mode data structure. The caller is responsible for freeing this\r | |
408 | structure and each reference buffer.\r | |
409 | @param[out] Dhcp6ConfigData Pointer to the DHCPv6 configuration data structure. The caller is responsible for\r | |
410 | freeing this structure and each reference buffer.\r | |
411 | \r | |
412 | @retval EFI_SUCCESS The mode data was returned.\r | |
413 | @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has not been configured when Dhcp6ConfigData is not NULL.\r | |
414 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r | |
415 | - This is NULL.\r | |
416 | - Both Dhcp6ConfigData and Dhcp6ModeData are NULL.\r | |
417 | \r | |
418 | **/\r | |
419 | typedef\r | |
420 | EFI_STATUS\r | |
421 | (EFIAPI *EFI_DHCP6_GET_MODE_DATA)(\r | |
422 | IN EFI_DHCP6_PROTOCOL *This,\r | |
423 | OUT EFI_DHCP6_MODE_DATA *Dhcp6ModeData OPTIONAL,\r | |
424 | OUT EFI_DHCP6_CONFIG_DATA *Dhcp6ConfigData OPTIONAL\r | |
425 | );\r | |
426 | \r | |
427 | /**\r | |
428 | Initialize or clean up the configuration data for the EFI DHCPv6 Protocol instance.\r | |
429 | \r | |
430 | The Configure() function is used to initialize or clean up the configuration data of the EFI\r | |
431 | DHCPv6 Protocol instance.\r | |
432 | - When Dhcp6CfgData is not NULL and Configure() is called successfully, the\r | |
433 | configuration data will be initialized in the EFI DHCPv6 Protocol instance and the state of the\r | |
434 | configured IA will be transferred into Dhcp6Init.\r | |
435 | - When Dhcp6CfgData is NULL and Configure() is called successfully, the configuration\r | |
436 | data will be cleaned up and no IA will be associated with the EFI DHCPv6 Protocol instance.\r | |
437 | \r | |
438 | To update the configuration data for an EFI DCHPv6 Protocol instance, the original data must be\r | |
439 | cleaned up before setting the new configuration data.\r | |
440 | \r | |
441 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.\r | |
442 | @param[in] Dhcp6CfgData Pointer to the DHCPv6 configuration data structure.\r | |
443 | \r | |
444 | @retval EFI_SUCCESS The mode data was returned.\r | |
445 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE\r | |
446 | - This is NULL.\r | |
447 | - OptionCount > 0 and OptionList is NULL.\r | |
448 | - OptionList is not NULL, and Client Id option, Reconfigure Accept option,\r | |
449 | Rapid Commit option or any IA option is specified in the OptionList.\r | |
450 | - IaDescriptor.Type is neither EFI_DHCP6_IA_TYPE_NA nor EFI_DHCP6_IA_TYPE_NA.\r | |
451 | - IaDescriptor is not unique.\r | |
452 | - Both IaInfoEvent and SolicitRetransimssion are NULL.\r | |
453 | - SolicitRetransmission is not NULL, and both SolicitRetransimssion->Mrc and\r | |
454 | SolicitRetransmission->Mrd are zero.\r | |
455 | @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has been already configured\r | |
456 | when Dhcp6CfgData is not NULL.\r | |
457 | The EFI DHCPv6 Protocol instance has already started the\r | |
458 | DHCPv6 S.A.R.R when Dhcp6CfgData is NULL.\r | |
459 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
460 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
461 | \r | |
462 | **/\r | |
463 | typedef\r | |
464 | EFI_STATUS\r | |
465 | (EFIAPI *EFI_DHCP6_CONFIGURE)(\r | |
466 | IN EFI_DHCP6_PROTOCOL *This,\r | |
467 | IN EFI_DHCP6_CONFIG_DATA *Dhcp6CfgData OPTIONAL\r | |
468 | );\r | |
469 | \r | |
470 | /**\r | |
471 | Start the DHCPv6 S.A.R.R process.\r | |
472 | \r | |
473 | The Start() function starts the DHCPv6 S.A.R.R process. This function can be called only when\r | |
474 | the state of the configured IA is in the Dhcp6Init state. If the DHCPv6 S.A.R.R process completes\r | |
475 | successfully, the state of the configured IA will be transferred through Dhcp6Selecting and\r | |
476 | Dhcp6Requesting to Dhcp6Bound state. The update of the IPv6 addresses will be notified through\r | |
477 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent. At the time when each event occurs in this process, the\r | |
478 | callback function set by EFI_DHCP6_PROTOCOL.Configure() will be called and the user can take\r | |
479 | this opportunity to control the process. If EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the\r | |
480 | Start() function call is a blocking operation. It will return after the DHCPv6 S.A.R.R process\r | |
481 | completes or aborted by users. If the process is aborted by system or network error, the state of\r | |
482 | the configured IA will be transferred to Dhcp6Init. The Start() function can be called again to\r | |
483 | restart the process.\r | |
484 | \r | |
485 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.\r | |
486 | \r | |
487 | @retval EFI_SUCCESS The DHCPv6 S.A.R.R process is completed and at least one IPv6\r | |
488 | address has been bound to the configured IA when\r | |
489 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.\r | |
490 | The DHCPv6 S.A.R.R process is started when\r | |
491 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.\r | |
492 | @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured.\r | |
493 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
494 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
495 | @retval EFI_ALREADY_STARTED The DHCPv6 S.A.R.R process has already started.\r | |
496 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
497 | @retval EFI_NO_RESPONSE The DHCPv6 S.A.R.R process failed because of no response.\r | |
498 | @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured IA after the\r | |
499 | DHCPv6 S.A.R.R process.\r | |
500 | @retval EFI_ABORTED The DHCPv6 S.A.R.R process aborted by user.\r | |
501 | @retval EFI_NO_MEDIA There was a media error.\r | |
502 | \r | |
503 | **/\r | |
504 | typedef\r | |
505 | EFI_STATUS\r | |
506 | (EFIAPI *EFI_DHCP6_START)(\r | |
507 | IN EFI_DHCP6_PROTOCOL *This\r | |
508 | );\r | |
509 | \r | |
510 | /**\r | |
511 | Request configuration information without the assignment of any IA addresses of the client.\r | |
512 | \r | |
513 | The InfoRequest() function is used to request configuration information without the assignment\r | |
514 | of any IPv6 address of the client. Client sends out Information Request packet to obtain\r | |
515 | the required configuration information, and DHCPv6 server responds with Reply packet containing\r | |
516 | the information for the client. The received Reply packet will be passed to the user by\r | |
517 | ReplyCallback function. If user returns EFI_NOT_READY from ReplyCallback, the EFI DHCPv6\r | |
518 | Protocol instance will continue to receive other Reply packets unless timeout according to\r | |
519 | the Retransmission parameter. Otherwise, the Information Request exchange process will be\r | |
520 | finished successfully if user returns EFI_SUCCESS from ReplyCallback.\r | |
521 | \r | |
522 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.\r | |
523 | @param[in] SendClientId If TRUE, the EFI DHCPv6 Protocol instance will build Client\r | |
524 | Identifier option and include it into Information Request\r | |
525 | packet. If FALSE, Client Identifier option will not be included.\r | |
526 | Client Identifier option can not be specified through OptionList\r | |
527 | parameter.\r | |
528 | @param[in] OptionRequest Pointer to the Option Request option in the Information Request\r | |
529 | packet. Option Request option can not be specified through\r | |
530 | OptionList parameter.\r | |
531 | @param[in] OptionCount Number of options in OptionList.\r | |
532 | @param[in] OptionList List of other DHCPv6 options. These options will be appended\r | |
533 | to the Option Request option. The caller is responsible for\r | |
534 | freeing this buffer. Type is defined in EFI_DHCP6_PROTOCOL.GetModeData().\r | |
535 | @param[in] Retransmission Parameter to control Information Request packet retransmission\r | |
536 | behavior. The buffer can be freed after EFI_DHCP6_PROTOCOL.InfoRequest()\r | |
537 | returns.\r | |
538 | @param[in] TimeoutEvent If not NULL, this event is signaled when the information request\r | |
539 | exchange aborted because of no response. If NULL, the function\r | |
540 | call is a blocking operation; and it will return after the\r | |
541 | information-request exchange process finish or aborted by users.\r | |
542 | @param[in] ReplyCallback The callback function is to intercept various events that occur\r | |
543 | in the Information Request exchange process. It should not be\r | |
544 | set to NULL.\r | |
545 | @param[in] CallbackContext Pointer to the context that will be passed to ReplyCallback.\r | |
546 | \r | |
547 | @retval EFI_SUCCESS The DHCPv6 S.A.R.R process is completed and at least one IPv6\r | |
548 | @retval EFI_SUCCESS The DHCPv6 information request exchange process completed\r | |
549 | when TimeoutEvent is NULL. Information Request packet has been\r | |
550 | sent to DHCPv6 server when TimeoutEvent is not NULL.\r | |
551 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r | |
552 | - This is NULL.\r | |
553 | - OptionRequest is NULL or OptionRequest->OpCode is invalid.\r | |
554 | - OptionCount > 0 and OptionList is NULL.\r | |
555 | - OptionList is not NULL, and Client Identify option or\r | |
556 | Option Request option is specified in the OptionList.\r | |
557 | - Retransimssion is NULL.\r | |
558 | - Both Retransimssion->Mrc and Retransmission->Mrd are zero.\r | |
559 | - ReplyCallback is NULL.\r | |
560 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
561 | @retval EFI_NO_RESPONSE The DHCPv6 information request exchange process failed\r | |
562 | because of no response, or not all requested-options are\r | |
563 | responded by DHCPv6 servers when Timeout happened.\r | |
564 | @retval EFI_ABORTED The DHCPv6 information request exchange process aborted by user.\r | |
565 | \r | |
566 | **/\r | |
567 | typedef\r | |
568 | EFI_STATUS\r | |
569 | (EFIAPI *EFI_DHCP6_INFO_REQUEST)(\r | |
570 | IN EFI_DHCP6_PROTOCOL *This,\r | |
571 | IN BOOLEAN SendClientId,\r | |
572 | IN EFI_DHCP6_PACKET_OPTION *OptionRequest,\r | |
573 | IN UINT32 OptionCount,\r | |
574 | IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL,\r | |
575 | IN EFI_DHCP6_RETRANSMISSION *Retransmission,\r | |
576 | IN EFI_EVENT TimeoutEvent OPTIONAL,\r | |
577 | IN EFI_DHCP6_INFO_CALLBACK ReplyCallback,\r | |
578 | IN VOID *CallbackContext OPTIONAL\r | |
579 | );\r | |
580 | \r | |
581 | /**\r | |
582 | Manually extend the valid and preferred lifetimes for the IPv6 addresses of the configured\r | |
583 | IA and update other configuration parameters by sending Renew or Rebind packet.\r | |
584 | \r | |
585 | The RenewRebind() function is used to manually extend the valid and preferred lifetimes for the\r | |
586 | IPv6 addresses of the configured IA and update other configuration parameters by sending Renew or\r | |
587 | Rebind packet.\r | |
588 | - When RebindRequest is FALSE and the state of the configured IA is Dhcp6Bound, it\r | |
589 | will send Renew packet to the previously DHCPv6 server and transfer the state of the configured\r | |
590 | IA to Dhcp6Renewing. If valid Reply packet received, the state transfers to Dhcp6Bound\r | |
591 | and the valid and preferred timer restarts. If fails, the state transfers to Dhcp6Bound but the\r | |
592 | timer continues.\r | |
593 | - When RebindRequest is TRUE and the state of the configured IA is Dhcp6Bound, it will\r | |
594 | send Rebind packet. If valid Reply packet received, the state transfers to Dhcp6Bound and the\r | |
595 | valid and preferred timer restarts. If fails, the state transfers to Dhcp6Init and the IA can't\r | |
596 | be used.\r | |
597 | \r | |
598 | @param[in] This Pointer to the EFI_DHCP4_PROTOCOL instance.\r | |
599 | @param[in] RebindRequest If TRUE, it will send Rebind packet and enter the Dhcp6Rebinding state.\r | |
600 | Otherwise, it will send Renew packet and enter the Dhcp6Renewing state.\r | |
601 | \r | |
602 | @retval EFI_SUCCESS The DHCPv6 renew/rebind exchange process has completed and at\r | |
603 | least one IPv6 address of the configured IA has been bound again\r | |
604 | when EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.\r | |
605 | The EFI DHCPv6 Protocol instance has sent Renew or Rebind packet\r | |
606 | when EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.\r | |
607 | @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the state\r | |
608 | of the configured IA is not in Dhcp6Bound.\r | |
609 | @retval EFI_ALREADY_STARTED The state of the configured IA has already entered Dhcp6Renewing\r | |
610 | when RebindRequest is FALSE.\r | |
611 | The state of the configured IA has already entered Dhcp6Rebinding\r | |
612 | when RebindRequest is TRUE.\r | |
613 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
614 | @retval EFI_DEVICE_ERROR An unexpected system or system error occurred.\r | |
615 | @retval EFI_NO_RESPONSE The DHCPv6 renew/rebind exchange process failed because of no response.\r | |
616 | @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured IA after the DHCPv6\r | |
617 | renew/rebind exchange process.\r | |
618 | @retval EFI_ABORTED The DHCPv6 renew/rebind exchange process aborted by user.\r | |
619 | \r | |
620 | **/\r | |
621 | typedef\r | |
622 | EFI_STATUS\r | |
623 | (EFIAPI *EFI_DHCP6_RENEW_REBIND)(\r | |
624 | IN EFI_DHCP6_PROTOCOL *This,\r | |
625 | IN BOOLEAN RebindRequest\r | |
626 | );\r | |
627 | \r | |
628 | /**\r | |
629 | Inform that one or more IPv6 addresses assigned by a server are already in use by\r | |
630 | another node.\r | |
631 | \r | |
632 | The Decline() function is used to manually decline the assignment of IPv6 addresses, which\r | |
633 | have been already used by another node. If all IPv6 addresses of the configured IA are declined\r | |
634 | through this function, the state of the IA will switch through Dhcp6Declining to Dhcp6Init,\r | |
635 | otherwise, the state of the IA will restore to Dhcp6Bound after the declining process. The\r | |
636 | Decline() can only be called when the IA is in Dhcp6Bound state. If the\r | |
637 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, this function is a blocking operation. It\r | |
638 | will return after the declining process finishes, or aborted by user.\r | |
639 | \r | |
640 | @param[in] This Pointer to the EFI_DHCP4_PROTOCOL instance.\r | |
641 | @param[in] AddressCount Number of declining IPv6 addresses.\r | |
642 | @param[in] Addresses Pointer to the buffer stored all the declining IPv6 addresses.\r | |
643 | \r | |
644 | @retval EFI_SUCCESS The DHCPv6 decline exchange process has completed when\r | |
645 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.\r | |
646 | The EFI DHCPv6 Protocol instance has sent Decline packet when\r | |
647 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.\r | |
648 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE\r | |
649 | - This is NULL.\r | |
650 | - AddressCount is zero or Addresses is NULL.\r | |
651 | @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with the configured IA\r | |
652 | for this instance.\r | |
653 | @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the\r | |
654 | state of the configured IA is not in Dhcp6Bound.\r | |
655 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
656 | @retval EFI_ABORTED The DHCPv6 decline exchange process aborted by user.\r | |
657 | \r | |
658 | **/\r | |
659 | typedef\r | |
660 | EFI_STATUS\r | |
661 | (EFIAPI *EFI_DHCP6_DECLINE)(\r | |
662 | IN EFI_DHCP6_PROTOCOL *This,\r | |
663 | IN UINT32 AddressCount,\r | |
664 | IN EFI_IPv6_ADDRESS *Addresses\r | |
665 | );\r | |
666 | \r | |
667 | /**\r | |
668 | Release one or more IPv6 addresses associated with the configured IA for current instance.\r | |
669 | \r | |
670 | The Release() function is used to manually release the one or more IPv6 address. If AddressCount\r | |
671 | is zero, it will release all IPv6 addresses of the configured IA. If all IPv6 addresses of the IA\r | |
672 | are released through this function, the state of the IA will switch through Dhcp6Releasing to\r | |
673 | Dhcp6Init, otherwise, the state of the IA will restore to Dhcp6Bound after the releasing process.\r | |
674 | The Release() can only be called when the IA is in Dhcp6Bound state. If the\r | |
675 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the function is a blocking operation. It will return\r | |
676 | after the releasing process finishes, or aborted by user.\r | |
677 | \r | |
678 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.\r | |
679 | @param[in] AddressCount Number of releasing IPv6 addresses.\r | |
680 | @param[in] Addresses Pointer to the buffer stored all the releasing IPv6 addresses.\r | |
681 | Ignored if AddressCount is zero.\r | |
682 | @retval EFI_SUCCESS The DHCPv6 release exchange process has completed when\r | |
683 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.\r | |
684 | The EFI DHCPv6 Protocol instance has sent Release packet when\r | |
685 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.\r | |
686 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE\r | |
687 | - This is NULL.\r | |
688 | - AddressCount is not zero or Addresses is NULL.\r | |
689 | @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with the configured\r | |
690 | IA for this instance.\r | |
691 | @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the\r | |
692 | state of the configured IA is not in Dhcp6Bound.\r | |
693 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
694 | @retval EFI_ABORTED The DHCPv6 release exchange process aborted by user.\r | |
695 | \r | |
696 | **/\r | |
697 | typedef\r | |
698 | EFI_STATUS\r | |
699 | (EFIAPI *EFI_DHCP6_RELEASE)(\r | |
700 | IN EFI_DHCP6_PROTOCOL *This,\r | |
701 | IN UINT32 AddressCount,\r | |
702 | IN EFI_IPv6_ADDRESS *Addresses\r | |
703 | );\r | |
704 | \r | |
705 | /**\r | |
706 | Stop the DHCPv6 S.A.R.R process.\r | |
707 | \r | |
708 | The Stop() function is used to stop the DHCPv6 S.A.R.R process. If this function is called\r | |
709 | successfully, all the IPv6 addresses of the configured IA will be released and the state of\r | |
710 | the configured IA will be transferred to Dhcp6Init.\r | |
711 | \r | |
712 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.\r | |
713 | \r | |
714 | @retval EFI_SUCCESS The DHCPv6 S.A.R.R process has been stopped when\r | |
715 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL.\r | |
716 | The EFI DHCPv6 Protocol instance has sent Release packet if\r | |
717 | need release or has been stopped if needn't, when\r | |
718 | EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.\r | |
719 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
720 | \r | |
721 | **/\r | |
722 | typedef\r | |
723 | EFI_STATUS\r | |
724 | (EFIAPI *EFI_DHCP6_STOP)(\r | |
725 | IN EFI_DHCP6_PROTOCOL *This\r | |
726 | );\r | |
727 | \r | |
728 | /**\r | |
729 | Parse the option data in the DHCPv6 packet.\r | |
730 | \r | |
731 | The Parse() function is used to retrieve the option list in the DHCPv6 packet.\r | |
732 | \r | |
733 | @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance.\r | |
734 | \r | |
735 | @param[in] Packet Pointer to packet to be parsed.\r | |
736 | @param[in] OptionCount On input, the number of entries in the PacketOptionList.\r | |
737 | On output, the number of DHCPv6 options in the Packet.\r | |
738 | @param[in] PacketOptionList List of pointers to the DHCPv6 options in the Packet.\r | |
739 | The OpCode and OpLen in EFI_DHCP6_PACKET_OPTION are\r | |
740 | both stored in network byte order.\r | |
741 | @retval EFI_SUCCESS The packet was successfully parsed.\r | |
742 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE\r | |
743 | - This is NULL.\r | |
744 | - Packet is NULL.\r | |
745 | - Packet is not a well-formed DHCPv6 packet.\r | |
746 | - OptionCount is NULL.\r | |
747 | - *OptionCount is not zero and PacketOptionList is NULL.\r | |
748 | @retval EFI_BUFFER_TOO_SMALL *OptionCount is smaller than the number of options that were\r | |
749 | found in the Packet.\r | |
750 | \r | |
751 | **/\r | |
752 | typedef\r | |
753 | EFI_STATUS\r | |
754 | (EFIAPI *EFI_DHCP6_PARSE)(\r | |
755 | IN EFI_DHCP6_PROTOCOL *This,\r | |
756 | IN EFI_DHCP6_PACKET *Packet,\r | |
757 | IN OUT UINT32 *OptionCount,\r | |
758 | OUT EFI_DHCP6_PACKET_OPTION *PacketOptionList[] OPTIONAL\r | |
759 | );\r | |
760 | \r | |
761 | ///\r | |
762 | /// The EFI DHCPv6 Protocol is used to get IPv6 addresses and other configuration parameters\r | |
763 | /// from DHCPv6 servers.\r | |
764 | ///\r | |
765 | struct _EFI_DHCP6_PROTOCOL {\r | |
766 | EFI_DHCP6_GET_MODE_DATA GetModeData;\r | |
767 | EFI_DHCP6_CONFIGURE Configure;\r | |
768 | EFI_DHCP6_START Start;\r | |
769 | EFI_DHCP6_INFO_REQUEST InfoRequest;\r | |
770 | EFI_DHCP6_RENEW_REBIND RenewRebind;\r | |
771 | EFI_DHCP6_DECLINE Decline;\r | |
772 | EFI_DHCP6_RELEASE Release;\r | |
773 | EFI_DHCP6_STOP Stop;\r | |
774 | EFI_DHCP6_PARSE Parse;\r | |
775 | };\r | |
776 | \r | |
777 | extern EFI_GUID gEfiDhcp6ProtocolGuid;\r | |
778 | extern EFI_GUID gEfiDhcp6ServiceBindingProtocolGuid;\r | |
779 | \r | |
780 | #endif\r |