]>
Commit | Line | Data |
---|---|---|
ab796d3e HL |
1 | /** @file\r |
2 | This file defines the EDKII HTTP Callback Protocol interface.\r | |
3 | \r | |
4 | Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | **/\r | |
7 | \r | |
8 | #ifndef EDKII_HTTP_CALLBACK_H_\r | |
9 | #define EDKII_HTTP_CALLBACK_H_\r | |
10 | \r | |
11 | #define EDKII_HTTP_CALLBACK_PROTOCOL_GUID \\r | |
12 | { \\r | |
13 | 0x611114f1, 0xa37b, 0x4468, {0xa4, 0x36, 0x5b, 0xdd, 0xa1, 0x6a, 0xa2, 0x40} \\r | |
14 | }\r | |
15 | \r | |
d1050b9d | 16 | typedef struct _EDKII_HTTP_CALLBACK_PROTOCOL EDKII_HTTP_CALLBACK_PROTOCOL;\r |
ab796d3e HL |
17 | \r |
18 | ///\r | |
19 | /// EDKII_HTTP_CALLBACK_EVENT\r | |
20 | ///\r | |
21 | typedef enum {\r | |
22 | ///\r | |
23 | /// The Status of DNS Event to retrieve the host address.\r | |
24 | /// EventStatus:\r | |
25 | /// EFI_SUCCESS Operation succeeded.\r | |
26 | /// EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r | |
27 | /// EFI_DEVICE_ERROR An unexpected network error occurred.\r | |
28 | /// Others Other errors as indicated.\r | |
29 | ///\r | |
30 | HttpEventDns,\r | |
31 | \r | |
32 | ///\r | |
33 | /// The Status of Event to initiate a nonblocking TCP connection request.\r | |
34 | /// EventStatus:\r | |
35 | /// EFI_SUCCESS The connection request is successfully initiated.\r | |
36 | /// EFI_NOT_STARTED This EFI TCP Protocol instance has not been configured.\r | |
37 | /// EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
38 | /// Others Other errors as indicated.\r | |
39 | ///\r | |
40 | HttpEventConnectTcp,\r | |
41 | \r | |
42 | ///\r | |
43 | /// The Status of Event to connect one TLS session by finishing the TLS handshake process.\r | |
44 | /// EventStatus:\r | |
45 | /// EFI_SUCCESS The TLS session is established.\r | |
46 | /// EFI_OUT_OF_RESOURCES Can't allocate memory resources.\r | |
47 | /// EFI_ABORTED TLS session state is incorrect.\r | |
48 | /// Others Other error as indicated.\r | |
49 | ///\r | |
50 | HttpEventTlsConnectSession,\r | |
51 | \r | |
52 | ///\r | |
53 | /// The Status of Event to initialize Http session\r | |
54 | /// EventStatus:\r | |
55 | /// EFI_SUCCESS The initialization of session is done.\r | |
56 | /// Others Other error as indicated.\r | |
57 | ///\r | |
58 | HttpEventInitSession\r | |
59 | } EDKII_HTTP_CALLBACK_EVENT;\r | |
60 | \r | |
61 | /**\r | |
62 | Callback function that is invoked when HTTP event occurs.\r | |
63 | \r | |
64 | @param[in] This Pointer to the EDKII_HTTP_CALLBACK_PROTOCOL instance.\r | |
65 | @param[in] Event The event that occurs in the current state.\r | |
66 | @param[in] EventStatus The Status of Event, EFI_SUCCESS or other errors.\r | |
67 | **/\r | |
68 | typedef\r | |
69 | VOID\r | |
d1050b9d | 70 | (EFIAPI *EDKII_HTTP_CALLBACK)(\r |
ab796d3e HL |
71 | IN EDKII_HTTP_CALLBACK_PROTOCOL *This,\r |
72 | IN EDKII_HTTP_CALLBACK_EVENT Event,\r | |
73 | IN EFI_STATUS EventStatus\r | |
d1050b9d | 74 | );\r |
ab796d3e HL |
75 | \r |
76 | ///\r | |
77 | /// EFI HTTP Callback Protocol is invoked when HTTP event occurs.\r | |
78 | ///\r | |
79 | struct _EDKII_HTTP_CALLBACK_PROTOCOL {\r | |
d1050b9d | 80 | EDKII_HTTP_CALLBACK Callback;\r |
ab796d3e HL |
81 | };\r |
82 | \r | |
d1050b9d | 83 | extern EFI_GUID gEdkiiHttpCallbackProtocolGuid;\r |
ab796d3e HL |
84 | \r |
85 | #endif /* EDKII_HTTP_CALLBACK_H_ */\r |