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