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