]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/HttpBootCallback.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / HttpBootCallback.h
CommitLineData
a77d109f
FS
1/** @file\r
2 This file defines the EFI HTTP Boot Callback Protocol interface.\r
3\r
9095d37b 4 Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
a77d109f
FS
6\r
7 @par Revision Reference:\r
8 This Protocol is introduced in UEFI Specification 2.7\r
9\r
10**/\r
11\r
12#ifndef __EFI_HTTP_BOOT_CALLBACK_H__\r
13#define __EFI_HTTP_BOOT_CALLBACK_H__\r
14\r
15#define EFI_HTTP_BOOT_CALLBACK_PROTOCOL_GUID \\r
16 { \\r
17 0xba23b311, 0x343d, 0x11e6, {0x91, 0x85, 0x58, 0x20, 0xb1, 0xd6, 0x52, 0x99} \\r
18 }\r
19\r
20typedef struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL EFI_HTTP_BOOT_CALLBACK_PROTOCOL;\r
21\r
22///\r
23/// EFI_HTTP_BOOT_CALLBACK_DATA_TYPE\r
24///\r
25typedef enum {\r
26 ///\r
27 /// Data points to a DHCP4 packet which is about to transmit or has received.\r
28 ///\r
29 HttpBootDhcp4,\r
30 ///\r
31 /// Data points to a DHCP6 packet which is about to be transmit or has received.\r
32 ///\r
33 HttpBootDhcp6,\r
34 ///\r
35 /// Data points to an EFI_HTTP_MESSAGE structure, whichcontians a HTTP request message\r
36 /// to be transmitted.\r
37 ///\r
38 HttpBootHttpRequest,\r
39 ///\r
9095d37b 40 /// Data points to an EFI_HTTP_MESSAGE structure, which contians a received HTTP\r
a77d109f
FS
41 /// response message.\r
42 ///\r
43 HttpBootHttpResponse,\r
44 ///\r
45 /// Part of the entity body has been received from the HTTP server. Data points to the\r
46 /// buffer of the entity body data.\r
47 ///\r
48 HttpBootHttpEntityBody,\r
49 HttpBootTypeMax\r
50} EFI_HTTP_BOOT_CALLBACK_DATA_TYPE;\r
51\r
52/**\r
53 Callback function that is invoked when the HTTP Boot driver is about to transmit or has received a\r
54 packet.\r
55\r
56 This function is invoked when the HTTP Boot driver is about to transmit or has received packet.\r
57 Parameters DataType and Received specify the type of event and the format of the buffer pointed\r
58 to by Data. Due to the polling nature of UEFI device drivers, this callback function should not\r
59 execute for more than 5 ms.\r
60 The returned status code determines the behavior of the HTTP Boot driver.\r
61\r
62 @param[in] This Pointer to the EFI_HTTP_BOOT_CALLBACK_PROTOCOL instance.\r
63 @param[in] DataType The event that occurs in the current state.\r
64 @param[in] Received TRUE if the callback is being invoked due to a receive event.\r
65 FALSE if the callback is being invoked due to a transmit event.\r
66 @param[in] DataLength The length in bytes of the buffer pointed to by Data.\r
67 @param[in] Data A pointer to the buffer of data, the data type is specified by\r
68 DataType.\r
9095d37b 69\r
a77d109f
FS
70 @retval EFI_SUCCESS Tells the HTTP Boot driver to continue the HTTP Boot process.\r
71 @retval EFI_ABORTED Tells the HTTP Boot driver to abort the current HTTP Boot process.\r
72**/\r
73typedef\r
74EFI_STATUS\r
75(EFIAPI * EFI_HTTP_BOOT_CALLBACK) (\r
76 IN EFI_HTTP_BOOT_CALLBACK_PROTOCOL *This,\r
77 IN EFI_HTTP_BOOT_CALLBACK_DATA_TYPE DataType,\r
78 IN BOOLEAN Received,\r
79 IN UINT32 DataLength,\r
80 IN VOID *Data OPTIONAL\r
81 );\r
82\r
83///\r
9095d37b 84/// EFI HTTP Boot Callback Protocol is invoked when the HTTP Boot driver is about to transmit or\r
a77d109f
FS
85/// has received a packet. The EFI HTTP Boot Callback Protocol must be installed on the same handle\r
86/// as the Load File Protocol for the HTTP Boot.\r
87///\r
88struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL {\r
89 EFI_HTTP_BOOT_CALLBACK Callback;\r
90};\r
91\r
92extern EFI_GUID gEfiHttpBootCallbackProtocolGuid;\r
93\r
94#endif\r