]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/HttpBootCallback.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[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
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 @par Revision Reference:\r
14 This Protocol is introduced in UEFI Specification 2.7\r
15\r
16**/\r
17\r
18#ifndef __EFI_HTTP_BOOT_CALLBACK_H__\r
19#define __EFI_HTTP_BOOT_CALLBACK_H__\r
20\r
21#define EFI_HTTP_BOOT_CALLBACK_PROTOCOL_GUID \\r
22 { \\r
23 0xba23b311, 0x343d, 0x11e6, {0x91, 0x85, 0x58, 0x20, 0xb1, 0xd6, 0x52, 0x99} \\r
24 }\r
25\r
26typedef struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL EFI_HTTP_BOOT_CALLBACK_PROTOCOL;\r
27\r
28///\r
29/// EFI_HTTP_BOOT_CALLBACK_DATA_TYPE\r
30///\r
31typedef enum {\r
32 ///\r
33 /// Data points to a DHCP4 packet which is about to transmit or has received.\r
34 ///\r
35 HttpBootDhcp4,\r
36 ///\r
37 /// Data points to a DHCP6 packet which is about to be transmit or has received.\r
38 ///\r
39 HttpBootDhcp6,\r
40 ///\r
41 /// Data points to an EFI_HTTP_MESSAGE structure, whichcontians a HTTP request message\r
42 /// to be transmitted.\r
43 ///\r
44 HttpBootHttpRequest,\r
45 ///\r
46 /// Data points to an EFI_HTTP_MESSAGE structure, which contians a received HTTP \r
47 /// response message.\r
48 ///\r
49 HttpBootHttpResponse,\r
50 ///\r
51 /// Part of the entity body has been received from the HTTP server. Data points to the\r
52 /// buffer of the entity body data.\r
53 ///\r
54 HttpBootHttpEntityBody,\r
55 HttpBootTypeMax\r
56} EFI_HTTP_BOOT_CALLBACK_DATA_TYPE;\r
57\r
58/**\r
59 Callback function that is invoked when the HTTP Boot driver is about to transmit or has received a\r
60 packet.\r
61\r
62 This function is invoked when the HTTP Boot driver is about to transmit or has received packet.\r
63 Parameters DataType and Received specify the type of event and the format of the buffer pointed\r
64 to by Data. Due to the polling nature of UEFI device drivers, this callback function should not\r
65 execute for more than 5 ms.\r
66 The returned status code determines the behavior of the HTTP Boot driver.\r
67\r
68 @param[in] This Pointer to the EFI_HTTP_BOOT_CALLBACK_PROTOCOL instance.\r
69 @param[in] DataType The event that occurs in the current state.\r
70 @param[in] Received TRUE if the callback is being invoked due to a receive event.\r
71 FALSE if the callback is being invoked due to a transmit event.\r
72 @param[in] DataLength The length in bytes of the buffer pointed to by Data.\r
73 @param[in] Data A pointer to the buffer of data, the data type is specified by\r
74 DataType.\r
75 \r
76 @retval EFI_SUCCESS Tells the HTTP Boot driver to continue the HTTP Boot process.\r
77 @retval EFI_ABORTED Tells the HTTP Boot driver to abort the current HTTP Boot process.\r
78**/\r
79typedef\r
80EFI_STATUS\r
81(EFIAPI * EFI_HTTP_BOOT_CALLBACK) (\r
82 IN EFI_HTTP_BOOT_CALLBACK_PROTOCOL *This,\r
83 IN EFI_HTTP_BOOT_CALLBACK_DATA_TYPE DataType,\r
84 IN BOOLEAN Received,\r
85 IN UINT32 DataLength,\r
86 IN VOID *Data OPTIONAL\r
87 );\r
88\r
89///\r
90/// EFI HTTP Boot Callback Protocol is invoked when the HTTP Boot driver is about to transmit or \r
91/// has received a packet. The EFI HTTP Boot Callback Protocol must be installed on the same handle\r
92/// as the Load File Protocol for the HTTP Boot.\r
93///\r
94struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL {\r
95 EFI_HTTP_BOOT_CALLBACK Callback;\r
96};\r
97\r
98extern EFI_GUID gEfiHttpBootCallbackProtocolGuid;\r
99\r
100#endif\r