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