NetworkPkg: Remove unused EFI_HTTP_PROTOCOL definition
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpDriver.h
CommitLineData
47f51a06
YT
1/** @file\r
2 The header files of the driver binding and service binding protocol for HttpDxe driver.\r
3\r
4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
5\r
6 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**/\r
15\r
16#ifndef __EFI_HTTP_DRIVER_H__\r
17#define __EFI_HTTP_DRIVER_H__\r
18\r
19#include <Uefi.h>\r
20\r
21//\r
22// Libraries\r
23//\r
24#include <Library/UefiBootServicesTableLib.h>\r
25#include <Library/MemoryAllocationLib.h>\r
26#include <Library/BaseLib.h>\r
27#include <Library/UefiLib.h>\r
28#include <Library/DebugLib.h>\r
29#include <Library/NetLib.h>\r
30#include <Library/HttpLib.h>\r
49c9f74c 31#include <Library/DpcLib.h>\r
47f51a06
YT
32\r
33//\r
34// UEFI Driver Model Protocols\r
35//\r
36#include <Protocol/DriverBinding.h>\r
37#include <Protocol/ServiceBinding.h>\r
38#include <Protocol/ComponentName2.h>\r
39#include <Protocol/ComponentName.h>\r
40\r
41//\r
42// Consumed Protocols\r
43//\r
5ca29abe 44#include <Protocol/HttpUtilities.h>\r
47f51a06 45#include <Protocol/Tcp4.h>\r
b659408b 46#include <Protocol/Tcp6.h>\r
47f51a06 47#include <Protocol/Dns4.h>\r
b659408b 48#include <Protocol/Dns6.h>\r
47f51a06 49#include <Protocol/Ip4Config2.h>\r
b659408b
ZL
50#include <Protocol/Ip6Config.h>\r
51\r
47f51a06
YT
52\r
53//\r
54// Produced Protocols\r
55//\r
56#include <Protocol/Http.h>\r
57\r
58//\r
59// Driver Version\r
60//\r
61#define HTTP_DRIVER_VERSION 0xa\r
62\r
63//\r
64// Protocol instances\r
65//\r
b659408b
ZL
66extern EFI_DRIVER_BINDING_PROTOCOL gHttpDxeIp4DriverBinding;\r
67extern EFI_DRIVER_BINDING_PROTOCOL gHttpDxeIp6DriverBinding;\r
68\r
47f51a06
YT
69extern EFI_COMPONENT_NAME2_PROTOCOL gHttpDxeComponentName2;\r
70extern EFI_COMPONENT_NAME_PROTOCOL gHttpDxeComponentName;\r
71\r
5ca29abe
JW
72extern EFI_HTTP_UTILITIES_PROTOCOL *mHttpUtilities;\r
73\r
47f51a06
YT
74//\r
75// Include files with function prototypes\r
76//\r
77#include "ComponentName.h"\r
78#include "HttpImpl.h"\r
79#include "HttpProto.h"\r
80#include "HttpDns.h"\r
47f51a06
YT
81\r
82typedef struct {\r
83 EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;\r
84 UINTN NumberOfChildren;\r
85 EFI_HANDLE *ChildHandleBuffer;\r
86} HTTP_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;\r
87\r
88/**\r
89 Tests to see if this driver supports a given controller. If a child device is provided, \r
90 it further tests to see if this driver supports creating a handle for the specified child device.\r
91\r
92 This function checks to see if the driver specified by This supports the device specified by \r
93 ControllerHandle. Drivers will typically use the device path attached to \r
94 ControllerHandle and/or the services from the bus I/O abstraction attached to \r
95 ControllerHandle to determine if the driver supports ControllerHandle. This function \r
96 may be called many times during platform initialization. In order to reduce boot times, the tests \r
97 performed by this function must be very small, and take as little time as possible to execute. This \r
98 function must not change the state of any hardware devices, and this function must be aware that the \r
99 device specified by ControllerHandle may already be managed by the same driver or a \r
100 different driver. This function must match its calls to AllocatePages() with FreePages(), \r
101 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). \r
102 Because ControllerHandle may have been previously started by the same driver, if a protocol is \r
103 already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
104 to guarantee the state of ControllerHandle is not modified by this function.\r
105\r
106 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
107 @param[in] ControllerHandle The handle of the controller to test. This handle \r
108 must support a protocol interface that supplies \r
109 an I/O abstraction to the driver.\r
110 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
111 parameter is ignored by device drivers, and is optional for bus \r
112 drivers. For bus drivers, if this parameter is not NULL, then \r
113 the bus driver must determine if the bus controller specified \r
114 by ControllerHandle and the child controller specified \r
115 by RemainingDevicePath are both supported by this \r
116 bus driver.\r
117\r
118 @retval EFI_SUCCESS The device specified by ControllerHandle and\r
119 RemainingDevicePath is supported by the driver specified by This.\r
120 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r
121 RemainingDevicePath is already being managed by the driver\r
122 specified by This.\r
123 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r
124 RemainingDevicePath is already being managed by a different\r
125 driver or an application that requires exclusive access.\r
126 Currently not implemented.\r
127 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r
128 RemainingDevicePath is not supported by the driver specified by This.\r
129**/\r
130EFI_STATUS\r
131EFIAPI\r
b659408b 132HttpDxeIp4DriverBindingSupported (\r
47f51a06
YT
133 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
134 IN EFI_HANDLE ControllerHandle,\r
135 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
136 );\r
137\r
138/**\r
139 Starts a device controller or a bus controller.\r
140\r
141 The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
142 As a result, much of the error checking on the parameters to Start() has been moved into this \r
143 common boot service. It is legal to call Start() from other locations, \r
144 but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
145 1. ControllerHandle must be a valid EFI_HANDLE.\r
146 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
147 EFI_DEVICE_PATH_PROTOCOL.\r
148 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
149 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. \r
150\r
151 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
152 @param[in] ControllerHandle The handle of the controller to start. This handle \r
153 must support a protocol interface that supplies \r
154 an I/O abstraction to the driver.\r
155 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
156 parameter is ignored by device drivers, and is optional for bus \r
157 drivers. For a bus driver, if this parameter is NULL, then handles \r
158 for all the children of Controller are created by this driver. \r
159 If this parameter is not NULL and the first Device Path Node is \r
160 not the End of Device Path Node, then only the handle for the \r
161 child device specified by the first Device Path Node of \r
162 RemainingDevicePath is created by this driver.\r
163 If the first Device Path Node of RemainingDevicePath is \r
164 the End of Device Path Node, no child handle is created by this\r
165 driver.\r
166\r
167 @retval EFI_SUCCESS The device was started.\r
168 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r
169 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
170 @retval Others The driver failded to start the device.\r
171\r
172**/\r
173EFI_STATUS\r
174EFIAPI\r
b659408b 175HttpDxeIp4DriverBindingStart (\r
47f51a06
YT
176 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
177 IN EFI_HANDLE ControllerHandle,\r
178 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
179 );\r
180\r
181/**\r
182 Stops a device controller or a bus controller.\r
183 \r
184 The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
185 As a result, much of the error checking on the parameters to Stop() has been moved \r
186 into this common boot service. It is legal to call Stop() from other locations, \r
187 but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
188 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
189 same driver's Start() function.\r
190 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
191 EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
192 Start() function, and the Start() function must have called OpenProtocol() on\r
193 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
194 \r
195 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
196 @param[in] ControllerHandle A handle to the device being stopped. The handle must \r
197 support a bus specific I/O protocol for the driver \r
198 to use to stop the device.\r
199 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
200 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL \r
201 if NumberOfChildren is 0.\r
202\r
203 @retval EFI_SUCCESS The device was stopped.\r
204 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
205\r
206**/\r
207EFI_STATUS\r
208EFIAPI\r
b659408b 209HttpDxeIp4DriverBindingStop (\r
47f51a06
YT
210 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
211 IN EFI_HANDLE ControllerHandle,\r
212 IN UINTN NumberOfChildren,\r
213 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
214 );\r
215\r
b659408b
ZL
216/**\r
217 Tests to see if this driver supports a given controller. If a child device is provided, \r
218 it further tests to see if this driver supports creating a handle for the specified child device.\r
219\r
220 This function checks to see if the driver specified by This supports the device specified by \r
221 ControllerHandle. Drivers will typically use the device path attached to \r
222 ControllerHandle and/or the services from the bus I/O abstraction attached to \r
223 ControllerHandle to determine if the driver supports ControllerHandle. This function \r
224 may be called many times during platform initialization. In order to reduce boot times, the tests \r
225 performed by this function must be very small, and take as little time as possible to execute. This \r
226 function must not change the state of any hardware devices, and this function must be aware that the \r
227 device specified by ControllerHandle may already be managed by the same driver or a \r
228 different driver. This function must match its calls to AllocatePages() with FreePages(), \r
229 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). \r
230 Because ControllerHandle may have been previously started by the same driver, if a protocol is \r
231 already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
232 to guarantee the state of ControllerHandle is not modified by this function.\r
233\r
234 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
235 @param[in] ControllerHandle The handle of the controller to test. This handle \r
236 must support a protocol interface that supplies \r
237 an I/O abstraction to the driver.\r
238 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
239 parameter is ignored by device drivers, and is optional for bus \r
240 drivers. For bus drivers, if this parameter is not NULL, then \r
241 the bus driver must determine if the bus controller specified \r
242 by ControllerHandle and the child controller specified \r
243 by RemainingDevicePath are both supported by this \r
244 bus driver.\r
245\r
246 @retval EFI_SUCCESS The device specified by ControllerHandle and\r
247 RemainingDevicePath is supported by the driver specified by This.\r
248 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r
249 RemainingDevicePath is already being managed by the driver\r
250 specified by This.\r
251 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r
252 RemainingDevicePath is already being managed by a different\r
253 driver or an application that requires exclusive access.\r
254 Currently not implemented.\r
255 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r
256 RemainingDevicePath is not supported by the driver specified by This.\r
257**/\r
258EFI_STATUS\r
259EFIAPI\r
260HttpDxeIp6DriverBindingSupported (\r
261 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
262 IN EFI_HANDLE ControllerHandle,\r
263 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
264 );\r
265\r
266/**\r
267 Starts a device controller or a bus controller.\r
268\r
269 The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
270 As a result, much of the error checking on the parameters to Start() has been moved into this \r
271 common boot service. It is legal to call Start() from other locations, \r
272 but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
273 1. ControllerHandle must be a valid EFI_HANDLE.\r
274 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
275 EFI_DEVICE_PATH_PROTOCOL.\r
276 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
277 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. \r
278\r
279 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
280 @param[in] ControllerHandle The handle of the controller to start. This handle \r
281 must support a protocol interface that supplies \r
282 an I/O abstraction to the driver.\r
283 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
284 parameter is ignored by device drivers, and is optional for bus \r
285 drivers. For a bus driver, if this parameter is NULL, then handles \r
286 for all the children of Controller are created by this driver. \r
287 If this parameter is not NULL and the first Device Path Node is \r
288 not the End of Device Path Node, then only the handle for the \r
289 child device specified by the first Device Path Node of \r
290 RemainingDevicePath is created by this driver.\r
291 If the first Device Path Node of RemainingDevicePath is \r
292 the End of Device Path Node, no child handle is created by this\r
293 driver.\r
294\r
295 @retval EFI_SUCCESS The device was started.\r
296 @retval EFI_ALREADY_STARTED This device is already running on ControllerHandle.\r
297 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r
298 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
299 @retval Others The driver failded to start the device.\r
300\r
301**/\r
302EFI_STATUS\r
303EFIAPI\r
304HttpDxeIp6DriverBindingStart (\r
305 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
306 IN EFI_HANDLE ControllerHandle,\r
307 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
308 );\r
309\r
310/**\r
311 Stops a device controller or a bus controller.\r
312 \r
313 The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
314 As a result, much of the error checking on the parameters to Stop() has been moved \r
315 into this common boot service. It is legal to call Stop() from other locations, \r
316 but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
317 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
318 same driver's Start() function.\r
319 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
320 EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
321 Start() function, and the Start() function must have called OpenProtocol() on\r
322 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
323 \r
324 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
325 @param[in] ControllerHandle A handle to the device being stopped. The handle must \r
326 support a bus specific I/O protocol for the driver \r
327 to use to stop the device.\r
328 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
329 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL \r
330 if NumberOfChildren is 0.\r
331\r
332 @retval EFI_SUCCESS The device was stopped.\r
333 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
334\r
335**/\r
336EFI_STATUS\r
337EFIAPI\r
338HttpDxeIp6DriverBindingStop (\r
339 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
340 IN EFI_HANDLE ControllerHandle,\r
341 IN UINTN NumberOfChildren,\r
342 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
343 );\r
344\r
47f51a06
YT
345/**\r
346 Creates a child handle and installs a protocol.\r
347\r
348 The CreateChild() function installs a protocol on ChildHandle.\r
349 If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
350 If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
351\r
352 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
353 @param ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
354 then a new handle is created. If it is a pointer to an existing UEFI handle,\r
355 then the protocol is added to the existing UEFI handle.\r
356\r
357 @retval EFI_SUCCES The protocol was added to ChildHandle.\r
358 @retval EFI_INVALID_PARAMETER This is NULL, or ChildHandle is NULL.\r
359 @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create\r
360 the child.\r
361 @retval other The child handle was not created.\r
362\r
363**/\r
364EFI_STATUS\r
365EFIAPI\r
366HttpServiceBindingCreateChild (\r
367 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
368 IN OUT EFI_HANDLE *ChildHandle\r
369 );\r
370\r
371/**\r
372 Destroys a child handle with a protocol installed on it.\r
373\r
374 The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
375 that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
376 last protocol on ChildHandle, then ChildHandle is destroyed.\r
377\r
378 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
379 @param ChildHandle Handle of the child to destroy\r
380\r
381 @retval EFI_SUCCES The protocol was removed from ChildHandle.\r
382 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.\r
383 @retval EFI_INVALID_PARAMETER Child handle is NULL.\r
384 @retval other The child handle was not destroyed\r
385\r
386**/\r
387EFI_STATUS\r
388EFIAPI\r
389HttpServiceBindingDestroyChild (\r
390 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
391 IN EFI_HANDLE ChildHandle\r
392 );\r
393\r
47f51a06 394#endif\r