]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
2 | EFI_DHCP4_PROTOCOL as defined in UEFI 2.0.\r | |
3 | EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.\r | |
305a1279 | 4 | These protocols are used to collect configuration information for the EFI IPv4 Protocol\r |
d1f95000 | 5 | drivers and to provide DHCPv4 server and PXE boot server discovery services.\r |
6 | \r | |
4ca9b6c4 | 7 | Copyright (c) 2006 - 2008, Intel Corporation\r |
305a1279 | 8 | All rights reserved. This program and the accompanying materials\r |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
d1f95000 | 12 | \r |
305a1279 | 13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
d1f95000 | 15 | \r |
d1f95000 | 16 | **/\r |
17 | \r | |
18 | #ifndef __EFI_DHCP4_PROTOCOL_H__\r | |
19 | #define __EFI_DHCP4_PROTOCOL_H__\r | |
20 | \r | |
21 | #define EFI_DHCP4_PROTOCOL_GUID \\r | |
22 | { \\r | |
23 | 0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } \\r | |
24 | }\r | |
25 | \r | |
26 | #define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \\r | |
27 | { \\r | |
28 | 0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } \\r | |
29 | }\r | |
305a1279 | 30 | \r |
d1f95000 | 31 | typedef struct _EFI_DHCP4_PROTOCOL EFI_DHCP4_PROTOCOL;\r |
32 | \r | |
33 | \r | |
34 | #pragma pack(1)\r | |
35 | typedef struct {\r | |
36 | UINT8 OpCode;\r | |
37 | UINT8 Length;\r | |
38 | UINT8 Data[1];\r | |
39 | } EFI_DHCP4_PACKET_OPTION;\r | |
40 | #pragma pack()\r | |
41 | \r | |
42 | \r | |
43 | #pragma pack(1)\r | |
44 | typedef struct {\r | |
45 | UINT8 OpCode;\r | |
46 | UINT8 HwType;\r | |
47 | UINT8 HwAddrLen;\r | |
48 | UINT8 Hops;\r | |
49 | UINT32 Xid;\r | |
50 | UINT16 Seconds;\r | |
51 | UINT16 Reserved;\r | |
3354353d | 52 | EFI_IPv4_ADDRESS ClientAddr; ///< Client IP address from client\r |
53 | EFI_IPv4_ADDRESS YourAddr; ///< Client IP address from server\r | |
54 | EFI_IPv4_ADDRESS ServerAddr; ///< IP address of next server in bootstrap\r | |
55 | EFI_IPv4_ADDRESS GatewayAddr; ///< Relay agent IP address\r | |
56 | UINT8 ClientHwAddr[16]; ///< Client hardware address\r | |
305a1279 | 57 | CHAR8 ServerName[64];\r |
d1f95000 | 58 | CHAR8 BootFileName[128];\r |
59 | }EFI_DHCP4_HEADER;\r | |
60 | #pragma pack()\r | |
61 | \r | |
62 | \r | |
63 | #pragma pack(1)\r | |
64 | typedef struct {\r | |
65 | UINT32 Size;\r | |
66 | UINT32 Length;\r | |
67 | \r | |
68 | struct {\r | |
69 | EFI_DHCP4_HEADER Header;\r | |
70 | UINT32 Magik;\r | |
71 | UINT8 Option[1];\r | |
72 | } Dhcp4;\r | |
73 | } EFI_DHCP4_PACKET;\r | |
74 | #pragma pack()\r | |
75 | \r | |
76 | \r | |
77 | typedef enum {\r | |
78 | Dhcp4Stopped = 0x0,\r | |
79 | Dhcp4Init = 0x1,\r | |
80 | Dhcp4Selecting = 0x2,\r | |
81 | Dhcp4Requesting = 0x3,\r | |
82 | Dhcp4Bound = 0x4,\r | |
83 | Dhcp4Renewing = 0x5,\r | |
84 | Dhcp4Rebinding = 0x6,\r | |
85 | Dhcp4InitReboot = 0x7,\r | |
86 | Dhcp4Rebooting = 0x8\r | |
87 | } EFI_DHCP4_STATE;\r | |
88 | \r | |
89 | \r | |
90 | typedef enum{\r | |
91 | Dhcp4SendDiscover = 0x01,\r | |
92 | Dhcp4RcvdOffer = 0x02,\r | |
93 | Dhcp4SelectOffer = 0x03,\r | |
94 | Dhcp4SendRequest = 0x04,\r | |
95 | Dhcp4RcvdAck = 0x05,\r | |
96 | Dhcp4RcvdNak = 0x06,\r | |
97 | Dhcp4SendDecline = 0x07,\r | |
98 | Dhcp4BoundCompleted = 0x08,\r | |
99 | Dhcp4EnterRenewing = 0x09,\r | |
100 | Dhcp4EnterRebinding = 0x0a,\r | |
101 | Dhcp4AddressLost = 0x0b,\r | |
102 | Dhcp4Fail = 0x0c\r | |
103 | } EFI_DHCP4_EVENT;\r | |
104 | \r | |
305a1279 | 105 | /**\r |
faac3f0c | 106 | Callback routine.\r |
107 | \r | |
108 | EFI_DHCP4_CALLBACK is provided by the consumer of the EFI DHCPv4 Protocol driver\r | |
109 | to intercept events that occurred in the configuration process. This structure\r | |
110 | provides advanced control of each state transition of the DHCP process. The\r | |
111 | returned status code determines the behavior of the EFI DHCPv4 Protocol driver.\r | |
112 | There are three possible returned values, which are described in the following\r | |
113 | table.\r | |
305a1279 | 114 | \r |
d1f95000 | 115 | @param This Pointer to the EFI DHCPv4 Protocol instance that is used to\r |
305a1279 | 116 | configure this callback function.\r |
d1f95000 | 117 | @param Context Pointer to the context that is initialized by\r |
305a1279 | 118 | EFI_DHCP4_PROTOCOL.Configure().\r |
d1f95000 | 119 | @param CurrentState The current operational state of the EFI DHCPv4 Protocol\r |
305a1279 | 120 | driver.\r |
d1f95000 | 121 | @param Dhcp4Event The event that occurs in the current state, which usually means a\r |
305a1279 | 122 | state transition.\r |
123 | @param Packet The DHCP packet that is going to be sent or already received.\r | |
d1f95000 | 124 | @param NewPacket The packet that is used to replace the above Packet.\r |
305a1279 | 125 | \r |
d1f95000 | 126 | @retval EFI_SUCCESS Tells the EFI DHCPv4 Protocol driver to continue the DHCP process.\r |
305a1279 | 127 | @retval EFI_NOT_READY Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol\r |
d1f95000 | 128 | driver will continue to wait for more DHCPOFFER packets until the retry\r |
305a1279 | 129 | timeout expires.\r |
d1f95000 | 130 | @retval EFI_ABORTED Tells the EFI DHCPv4 Protocol driver to abort the current process and\r |
305a1279 | 131 | return to the Dhcp4Init or Dhcp4InitReboot state.\r |
132 | \r | |
d1f95000 | 133 | **/\r |
305a1279 | 134 | typedef\r |
135 | EFI_STATUS\r | |
8b13229b | 136 | (EFIAPI *EFI_DHCP4_CALLBACK)(\r |
d1f95000 | 137 | IN EFI_DHCP4_PROTOCOL *This,\r |
138 | IN VOID *Context,\r | |
139 | IN EFI_DHCP4_STATE CurrentState,\r | |
140 | IN EFI_DHCP4_EVENT Dhcp4Event,\r | |
305a1279 | 141 | IN EFI_DHCP4_PACKET *Packet OPTIONAL,\r |
d1f95000 | 142 | OUT EFI_DHCP4_PACKET **NewPacket OPTIONAL\r |
143 | );\r | |
144 | \r | |
145 | \r | |
146 | typedef struct {\r | |
305a1279 | 147 | UINT32 DiscoverTryCount;\r |
d1f95000 | 148 | UINT32 *DiscoverTimeout;\r |
149 | UINT32 RequestTryCount;\r | |
150 | UINT32 *RequestTimeout;\r | |
151 | EFI_IPv4_ADDRESS ClientAddress;\r | |
152 | EFI_DHCP4_CALLBACK Dhcp4Callback;\r | |
153 | void *CallbackContext;\r | |
154 | UINT32 OptionCount;\r | |
155 | EFI_DHCP4_PACKET_OPTION **OptionList;\r | |
156 | } EFI_DHCP4_CONFIG_DATA;\r | |
157 | \r | |
158 | \r | |
159 | typedef struct {\r | |
160 | EFI_DHCP4_STATE State;\r | |
161 | EFI_DHCP4_CONFIG_DATA ConfigData;\r | |
162 | EFI_IPv4_ADDRESS ClientAddress;\r | |
163 | EFI_MAC_ADDRESS ClientMacAddress;\r | |
164 | EFI_IPv4_ADDRESS ServerAddress;\r | |
165 | EFI_IPv4_ADDRESS RouterAddress;\r | |
166 | EFI_IPv4_ADDRESS SubnetMask;\r | |
167 | UINT32 LeaseTime;\r | |
168 | EFI_DHCP4_PACKET *ReplyPacket;\r | |
169 | } EFI_DHCP4_MODE_DATA;\r | |
170 | \r | |
171 | \r | |
172 | typedef struct {\r | |
173 | EFI_IPv4_ADDRESS ListenAddress;\r | |
174 | EFI_IPv4_ADDRESS SubnetMask;\r | |
175 | UINT16 ListenPort;\r | |
176 | } EFI_DHCP4_LISTEN_POINT;\r | |
177 | \r | |
178 | \r | |
179 | typedef struct {\r | |
305a1279 | 180 | EFI_STATUS Status;\r |
181 | EFI_EVENT CompletionEvent;\r | |
182 | EFI_IPv4_ADDRESS RemoteAddress;\r | |
183 | UINT16 RemotePort;\r | |
184 | EFI_IPv4_ADDRESS GatewayAddress;\r | |
185 | UINT32 ListenPointCount;\r | |
186 | EFI_DHCP4_LISTEN_POINT *ListenPoints;\r | |
187 | UINT32 TimeoutValue;\r | |
188 | EFI_DHCP4_PACKET *Packet;\r | |
189 | UINT32 ResponseCount;\r | |
190 | EFI_DHCP4_PACKET *ResponseList;\r | |
d1f95000 | 191 | } EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;\r |
192 | \r | |
193 | \r | |
194 | /**\r | |
195 | Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.\r | |
faac3f0c | 196 | \r |
197 | The GetModeData() function returns the current operating mode and cached data\r | |
198 | packet for the EFI DHCPv4 Protocol driver.\r | |
d1f95000 | 199 | \r |
200 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r | |
201 | @param Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.\r | |
202 | \r | |
203 | @retval EFI_SUCCESS The mode data was returned.\r | |
204 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
205 | \r | |
206 | **/\r | |
305a1279 | 207 | typedef\r |
208 | EFI_STATUS\r | |
8b13229b | 209 | (EFIAPI *EFI_DHCP4_GET_MODE_DATA)(\r |
d1f95000 | 210 | IN EFI_DHCP4_PROTOCOL *This,\r |
211 | OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData\r | |
ed66e1bc | 212 | );\r |
d1f95000 | 213 | \r |
214 | /**\r | |
215 | Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.\r | |
216 | \r | |
faac3f0c | 217 | The Configure() function is used to initialize, change, or reset the operational\r |
218 | settings of the EFI DHCPv4 Protocol driver for the communication device on which\r | |
219 | the EFI DHCPv4 Service Binding Protocol is installed. This function can be\r | |
220 | successfully called only if both of the following are true:\r | |
221 | * This instance of the EFI DHCPv4 Protocol driver is in the Dhcp4Stopped, Dhcp4Init,\r | |
222 | Dhcp4InitReboot, or Dhcp4Bound states.\r | |
223 | * No other EFI DHCPv4 Protocol driver instance that is controlled by this EFI\r | |
224 | DHCPv4 Service Binding Protocol driver instance has configured this EFI DHCPv4\r | |
225 | Protocol driver.\r | |
226 | When this driver is in the Dhcp4Stopped state, it can transfer into one of the\r | |
227 | following two possible initial states:\r | |
228 | * Dhcp4Init\r | |
229 | * Dhcp4InitReboot\r | |
230 | The driver can transfer into these states by calling Configure() with a non-NULL\r | |
231 | Dhcp4CfgData. The driver will transfer into the appropriate state based on the\r | |
232 | supplied client network address in the ClientAddress parameter and DHCP options\r | |
233 | in the OptionList parameter as described in RFC 2131.\r | |
234 | When Configure() is called successfully while Dhcp4CfgData is set to NULL, the\r | |
235 | default configuring data will be reset in the EFI DHCPv4 Protocol driver and\r | |
236 | the state of the EFI DHCPv4 Protocol driver will not be changed. If one instance\r | |
237 | wants to make it possible for another instance to configure the EFI DHCPv4 Protocol\r | |
238 | driver, it must call this function with Dhcp4CfgData set to NULL.\r | |
239 | \r | |
d1f95000 | 240 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r |
241 | @param Dhcp4CfgData Pointer to the EFI_DHCP4_CONFIG_DATA.\r | |
242 | \r | |
243 | @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or\r | |
244 | Dhcp4InitReboot state, if the original state of this driver\r | |
245 | was Dhcp4Stopped and the value of Dhcp4CfgData was\r | |
246 | not NULL. Otherwise, the state was left unchanged.\r | |
247 | @retval EFI_ACCESS_DENIED This instance of the EFI DHCPv4 Protocol driver was not in the\r | |
248 | Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state;\r | |
249 | Or onother instance of this EFI DHCPv4 Protocol driver is already\r | |
250 | in a valid configured state.\r | |
251 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r | |
252 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
253 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
254 | \r | |
255 | **/\r | |
305a1279 | 256 | typedef\r |
d1f95000 | 257 | EFI_STATUS\r |
8b13229b | 258 | (EFIAPI *EFI_DHCP4_CONFIGURE)(\r |
d1f95000 | 259 | IN EFI_DHCP4_PROTOCOL *This,\r |
260 | IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL\r | |
ed66e1bc | 261 | );\r |
d1f95000 | 262 | \r |
263 | \r | |
264 | /**\r | |
265 | Starts the DHCP configuration process.\r | |
266 | \r | |
faac3f0c | 267 | The Start() function starts the DHCP configuration process. This function can\r |
268 | be called only when the EFI DHCPv4 Protocol driver is in the Dhcp4Init or\r | |
269 | Dhcp4InitReboot state.\r | |
270 | If the DHCP process completes successfully, the state of the EFI DHCPv4 Protocol\r | |
271 | driver will be transferred through Dhcp4Selecting and Dhcp4Requesting to the\r | |
272 | Dhcp4Bound state. The CompletionEvent will then be signaled if it is not NULL.\r | |
273 | If the process aborts, either by the user or by some unexpected network error,\r | |
274 | the state is restored to the Dhcp4Init state. The Start() function can be called\r | |
275 | again to restart the process.\r | |
276 | Refer to RFC 2131 for precise state transitions during this process. At the\r | |
277 | time when each event occurs in this process, the callback function that was set\r | |
278 | by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this\r | |
279 | opportunity to control the process.\r | |
280 | \r | |
d1f95000 | 281 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r |
282 | @param CompletionEvent If not NULL, indicates the event that will be signaled when the\r | |
283 | EFI DHCPv4 Protocol driver is transferred into the\r | |
284 | Dhcp4Bound state or when the DHCP process is aborted.\r | |
285 | EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r | |
286 | check the completion status. If NULL,\r | |
287 | EFI_DHCP4_PROTOCOL.Start() will wait until the driver\r | |
288 | is transferred into the Dhcp4Bound state or the process fails.\r | |
289 | \r | |
290 | @retval EFI_SUCCESS The DHCP configuration process has started, or it has completed\r | |
291 | when CompletionEvent is NULL.\r | |
292 | @retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped\r | |
293 | state. EFI_DHCP4_PROTOCOL. Configure() needs to be called.\r | |
294 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
295 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
296 | @retval EFI_TIMEOUT The DHCP configuration process failed because no response was\r | |
297 | received from the server within the specified timeout value.\r | |
298 | @retval EFI_ABORTED The user aborted the DHCP process.\r | |
299 | @retval EFI_ALREADY_STARTED Some other EFI DHCPv4 Protocol instance already started the\r | |
300 | DHCP process.\r | |
301 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
302 | \r | |
303 | **/\r | |
305a1279 | 304 | typedef\r |
d1f95000 | 305 | EFI_STATUS\r |
8b13229b | 306 | (EFIAPI *EFI_DHCP4_START)(\r |
d1f95000 | 307 | IN EFI_DHCP4_PROTOCOL *This,\r |
308 | IN EFI_EVENT CompletionEvent OPTIONAL\r | |
ed66e1bc | 309 | );\r |
d1f95000 | 310 | \r |
311 | /**\r | |
312 | Extends the lease time by sending a request packet.\r | |
faac3f0c | 313 | \r |
314 | The RenewRebind() function is used to manually extend the lease time when the\r | |
315 | EFI DHCPv4 Protocol driver is in the Dhcp4Bound state and the lease time has\r | |
316 | not expired yet. This function will send a request packet to the previously\r | |
317 | found server (or to any server when RebindRequest is TRUE) and transfer the\r | |
318 | state into the Dhcp4Renewing state (or Dhcp4Rebinding when RebindingRequest is\r | |
319 | TRUE). When a response is received, the state is returned to Dhcp4Bound.\r | |
320 | If no response is received before the try count is exceeded (the RequestTryCount\r | |
321 | field that is specified in EFI_DHCP4_CONFIG_DATA) but before the lease time that\r | |
322 | was issued by the previous server expires, the driver will return to the Dhcp4Bound\r | |
323 | state and the previous configuration is restored. The outgoing and incoming packets\r | |
324 | can be captured by the EFI_DHCP4_CALLBACK function.\r | |
d1f95000 | 325 | \r |
326 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r | |
327 | @param RebindRequest If TRUE, this function broadcasts the request packets and enters\r | |
328 | the Dhcp4Rebinding state. Otherwise, it sends a unicast\r | |
329 | request packet and enters the Dhcp4Renewing state.\r | |
330 | @param CompletionEvent If not NULL, this event is signaled when the renew/rebind phase\r | |
331 | completes or some error occurs.\r | |
332 | EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r | |
333 | check the completion status. If NULL,\r | |
334 | EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait\r | |
335 | until the DHCP process finishes.\r | |
336 | \r | |
337 | @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the\r | |
338 | Dhcp4Renewing state or is back to the Dhcp4Bound state.\r | |
339 | @retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped\r | |
340 | state. EFI_DHCP4_PROTOCOL.Configure() needs to\r | |
341 | be called.\r | |
342 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
343 | @retval EFI_TIMEOUT There was no response from the server when the try count was\r | |
344 | exceeded.\r | |
345 | @retval EFI_ACCESS_DENIED The driver is not in the Dhcp4Bound state.\r | |
346 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
347 | \r | |
348 | **/\r | |
349 | typedef\r | |
350 | EFI_STATUS\r | |
8b13229b | 351 | (EFIAPI *EFI_DHCP4_RENEW_REBIND)(\r |
d1f95000 | 352 | IN EFI_DHCP4_PROTOCOL *This,\r |
353 | IN BOOLEAN RebindRequest,\r | |
354 | IN EFI_EVENT CompletionEvent OPTIONAL\r | |
ed66e1bc | 355 | );\r |
d1f95000 | 356 | \r |
357 | /**\r | |
358 | Releases the current address configuration.\r | |
359 | \r | |
faac3f0c | 360 | The Release() function releases the current configured IP address by doing either\r |
361 | of the following:\r | |
362 | * Sending a DHCPRELEASE packet when the EFI DHCPv4 Protocol driver is in the\r | |
363 | Dhcp4Bound state\r | |
364 | * Setting the previously assigned IP address that was provided with the\r | |
365 | EFI_DHCP4_PROTOCOL.Configure() function to 0.0.0.0 when the driver is in\r | |
366 | Dhcp4InitReboot state\r | |
367 | After a successful call to this function, the EFI DHCPv4 Protocol driver returns\r | |
368 | to the Dhcp4Init state and any subsequent incoming packets will be discarded silently.\r | |
369 | \r | |
d1f95000 | 370 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r |
371 | \r | |
372 | @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.\r | |
373 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
374 | @retval EFI_ACCESS_DENIED The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state.\r | |
375 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
376 | \r | |
377 | **/\r | |
305a1279 | 378 | typedef\r |
d1f95000 | 379 | EFI_STATUS\r |
8b13229b | 380 | (EFIAPI *EFI_DHCP4_RELEASE)(\r |
d1f95000 | 381 | IN EFI_DHCP4_PROTOCOL *This\r |
ed66e1bc | 382 | );\r |
d1f95000 | 383 | \r |
384 | /**\r | |
385 | Stops the current address configuration.\r | |
faac3f0c | 386 | \r |
387 | The Stop() function is used to stop the DHCP configuration process. After this\r | |
388 | function is called successfully, the EFI DHCPv4 Protocol driver is transferred\r | |
389 | into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called\r | |
390 | before DHCP configuration process can be started again. This function can be\r | |
391 | called when the EFI DHCPv4 Protocol driver is in any state.\r | |
d1f95000 | 392 | \r |
393 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r | |
305a1279 | 394 | \r |
d1f95000 | 395 | @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.\r |
396 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
397 | \r | |
398 | **/\r | |
305a1279 | 399 | typedef\r |
d1f95000 | 400 | EFI_STATUS\r |
8b13229b | 401 | (EFIAPI *EFI_DHCP4_STOP)(\r |
d1f95000 | 402 | IN EFI_DHCP4_PROTOCOL *This\r |
ed66e1bc | 403 | );\r |
d1f95000 | 404 | \r |
405 | /**\r | |
406 | Builds a DHCP packet, given the options to be appended or deleted or replaced.\r | |
407 | \r | |
faac3f0c | 408 | The Build() function is used to assemble a new packet from the original packet\r |
409 | by replacing or deleting existing options or appending new options. This function\r | |
410 | does not change any state of the EFI DHCPv4 Protocol driver and can be used at\r | |
411 | any time.\r | |
412 | \r | |
d1f95000 | 413 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r |
eecd469b | 414 | @param SeedPacket Initial packet to be used as a base for building new packet.\r |
d1f95000 | 415 | @param DeleteCount Number of opcodes in the DeleteList.\r |
416 | @param DeleteList List of opcodes to be deleted from the seed packet.\r | |
417 | Ignored if DeleteCount is zero.\r | |
418 | @param AppendCount Number of entries in the OptionList.\r | |
419 | @param AppendList Pointer to a DHCP option list to be appended to SeedPacket.\r | |
420 | If SeedPacket also contains options in this list, they are\r | |
421 | replaced by new options (except pad option). Ignored if\r | |
422 | AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION\r | |
423 | @param NewPacket Pointer to storage for the pointer to the new allocated packet.\r | |
424 | Use the EFI Boot Service FreePool() on the resulting pointer\r | |
425 | when done with the packet.\r | |
426 | \r | |
427 | @retval EFI_SUCCESS The new packet was built.\r | |
428 | @retval EFI_OUT_OF_RESOURCES Storage for the new packet could not be allocated.\r | |
429 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r | |
430 | \r | |
431 | **/\r | |
432 | typedef\r | |
433 | EFI_STATUS\r | |
8b13229b | 434 | (EFIAPI *EFI_DHCP4_BUILD)(\r |
d1f95000 | 435 | IN EFI_DHCP4_PROTOCOL *This,\r |
436 | IN EFI_DHCP4_PACKET *SeedPacket,\r | |
437 | IN UINT32 DeleteCount,\r | |
438 | IN UINT8 *DeleteList OPTIONAL,\r | |
439 | IN UINT32 AppendCount,\r | |
440 | IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL,\r | |
441 | OUT EFI_DHCP4_PACKET **NewPacket\r | |
ed66e1bc | 442 | );\r |
faac3f0c | 443 | \r |
444 | \r | |
d1f95000 | 445 | /**\r |
446 | Transmits a DHCP formatted packet and optionally waits for responses.\r | |
faac3f0c | 447 | \r |
448 | The TransmitReceive() function is used to transmit a DHCP packet and optionally\r | |
449 | wait for the response from servers. This function does not change the state of\r | |
450 | the EFI DHCPv4 Protocol driver and thus can be used at any time.\r | |
d1f95000 | 451 | \r |
452 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r | |
453 | @param Token Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r | |
454 | \r | |
455 | @retval EFI_SUCCESS The packet was successfully queued for transmission.\r | |
456 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r | |
457 | @retval EFI_NOT_READY The previous call to this function has not finished yet. Try to call\r | |
458 | this function after collection process completes.\r | |
459 | @retval EFI_NO_MAPPING The default station address is not available yet.\r | |
460 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
461 | @retval Others Some other unexpected error occurred.\r | |
462 | \r | |
463 | **/\r | |
305a1279 | 464 | typedef\r |
d1f95000 | 465 | EFI_STATUS\r |
8b13229b | 466 | (EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE)(\r |
d1f95000 | 467 | IN EFI_DHCP4_PROTOCOL *This,\r |
468 | IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token\r | |
ed66e1bc | 469 | );\r |
d1f95000 | 470 | \r |
471 | \r | |
472 | /**\r | |
473 | Parses the packed DHCP option data.\r | |
faac3f0c | 474 | \r |
475 | The Parse() function is used to retrieve the option list from a DHCP packet.\r | |
476 | If *OptionCount isn’t zero, and there is enough space for all the DHCP options\r | |
477 | in the Packet, each element of PacketOptionList is set to point to somewhere in\r | |
478 | the Packet->Dhcp4.Option where a new DHCP option begins. If RFC3396 is supported,\r | |
479 | the caller should reassemble the parsed DHCP options to get the finial result.\r | |
480 | If *OptionCount is zero or there isn’t enough space for all of them, the number\r | |
481 | of DHCP options in the Packet is returned in OptionCount.\r | |
d1f95000 | 482 | \r |
483 | @param This Pointer to the EFI_DHCP4_PROTOCOL instance.\r | |
484 | @param Packet Pointer to packet to be parsed.\r | |
485 | @param OptionCount On input, the number of entries in the PacketOptionList.\r | |
486 | On output, the number of entries that were written into the\r | |
487 | PacketOptionList.\r | |
488 | @param PacketOptionList List of packet option entries to be filled in. End option or pad\r | |
489 | options are not included.\r | |
490 | \r | |
491 | @retval EFI_SUCCESS The packet was successfully parsed.\r | |
492 | @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r | |
493 | @retval EFI_BUFFER_TOO_SMALL One or more of the following conditions is TRUE:\r | |
494 | 1) *OptionCount is smaller than the number of options that\r | |
495 | were found in the Packet.\r | |
496 | 2) PacketOptionList is NULL.\r | |
497 | \r | |
498 | **/\r | |
499 | typedef\r | |
500 | EFI_STATUS\r | |
8b13229b | 501 | (EFIAPI *EFI_DHCP4_PARSE)(\r |
d1f95000 | 502 | IN EFI_DHCP4_PROTOCOL *This,\r |
503 | IN EFI_DHCP4_PACKET *Packet,\r | |
504 | IN OUT UINT32 *OptionCount,\r | |
505 | OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL\r | |
ed66e1bc | 506 | );\r |
d1f95000 | 507 | \r |
44717a39 | 508 | ///\r |
509 | /// This protocol is used to collect configuration information for the EFI IPv4 Protocol drivers\r | |
510 | /// and to provide DHCPv4 server and PXE boot server discovery services.\r | |
511 | ///\r | |
d1f95000 | 512 | struct _EFI_DHCP4_PROTOCOL {\r |
513 | EFI_DHCP4_GET_MODE_DATA GetModeData;\r | |
514 | EFI_DHCP4_CONFIGURE Configure;\r | |
515 | EFI_DHCP4_START Start;\r | |
516 | EFI_DHCP4_RENEW_REBIND RenewRebind;\r | |
517 | EFI_DHCP4_RELEASE Release;\r | |
518 | EFI_DHCP4_STOP Stop;\r | |
519 | EFI_DHCP4_BUILD Build;\r | |
520 | EFI_DHCP4_TRANSMIT_RECEIVE TransmitReceive;\r | |
521 | EFI_DHCP4_PARSE Parse;\r | |
522 | };\r | |
523 | \r | |
524 | extern EFI_GUID gEfiDhcp4ProtocolGuid;\r | |
525 | extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;\r | |
526 | \r | |
527 | #endif\r |