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