summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/Include/Protocol
diff options
context:
space:
mode:
authorHeng Luo <heng.luo@intel.com>2021-07-28 19:58:05 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-07-28 16:19:19 +0000
commitab796d3e2ab41bde3a0bdd932cdcd09fd641e00c (patch)
tree75704d5b3b7bcd2016ac0b86a6789d29d320cae8 /NetworkPkg/Include/Protocol
parentac70e71b1ffc823e5eec80b0cba04750860728b7 (diff)
downloadedk2-ab796d3e2ab41bde3a0bdd932cdcd09fd641e00c.tar.gz
edk2-ab796d3e2ab41bde3a0bdd932cdcd09fd641e00c.tar.bz2
edk2-ab796d3e2ab41bde3a0bdd932cdcd09fd641e00c.zip
NetworkPkg: Add HTTP Additional Event Notifications
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3496 Add new EDKII_HTTP_CALLBACK_PROTOCOL in NetworkPkg, Send HTTP Events via EDKII_HTTP_CALLBACK_PROTOCOL when Dns/ConnectTcp/TlsConnectSession/InitSession occurs. Signed-off-by: Heng Luo <heng.luo@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/Include/Protocol')
-rw-r--r--NetworkPkg/Include/Protocol/HttpCallback.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/NetworkPkg/Include/Protocol/HttpCallback.h b/NetworkPkg/Include/Protocol/HttpCallback.h
new file mode 100644
index 0000000000..7e3f82ae75
--- /dev/null
+++ b/NetworkPkg/Include/Protocol/HttpCallback.h
@@ -0,0 +1,85 @@
+/** @file
+ This file defines the EDKII HTTP Callback Protocol interface.
+
+ Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef EDKII_HTTP_CALLBACK_H_
+#define EDKII_HTTP_CALLBACK_H_
+
+#define EDKII_HTTP_CALLBACK_PROTOCOL_GUID \
+ { \
+ 0x611114f1, 0xa37b, 0x4468, {0xa4, 0x36, 0x5b, 0xdd, 0xa1, 0x6a, 0xa2, 0x40} \
+ }
+
+typedef struct _EDKII_HTTP_CALLBACK_PROTOCOL EDKII_HTTP_CALLBACK_PROTOCOL;
+
+///
+/// EDKII_HTTP_CALLBACK_EVENT
+///
+typedef enum {
+ ///
+ /// The Status of DNS Event to retrieve the host address.
+ /// EventStatus:
+ /// EFI_SUCCESS Operation succeeded.
+ /// EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
+ /// EFI_DEVICE_ERROR An unexpected network error occurred.
+ /// Others Other errors as indicated.
+ ///
+ HttpEventDns,
+
+ ///
+ /// The Status of Event to initiate a nonblocking TCP connection request.
+ /// EventStatus:
+ /// EFI_SUCCESS The connection request is successfully initiated.
+ /// EFI_NOT_STARTED This EFI TCP Protocol instance has not been configured.
+ /// EFI_DEVICE_ERROR An unexpected system or network error occurred.
+ /// Others Other errors as indicated.
+ ///
+ HttpEventConnectTcp,
+
+ ///
+ /// The Status of Event to connect one TLS session by finishing the TLS handshake process.
+ /// EventStatus:
+ /// EFI_SUCCESS The TLS session is established.
+ /// EFI_OUT_OF_RESOURCES Can't allocate memory resources.
+ /// EFI_ABORTED TLS session state is incorrect.
+ /// Others Other error as indicated.
+ ///
+ HttpEventTlsConnectSession,
+
+ ///
+ /// The Status of Event to initialize Http session
+ /// EventStatus:
+ /// EFI_SUCCESS The initialization of session is done.
+ /// Others Other error as indicated.
+ ///
+ HttpEventInitSession
+} EDKII_HTTP_CALLBACK_EVENT;
+
+/**
+ Callback function that is invoked when HTTP event occurs.
+
+ @param[in] This Pointer to the EDKII_HTTP_CALLBACK_PROTOCOL instance.
+ @param[in] Event The event that occurs in the current state.
+ @param[in] EventStatus The Status of Event, EFI_SUCCESS or other errors.
+**/
+typedef
+VOID
+(EFIAPI * EDKII_HTTP_CALLBACK) (
+ IN EDKII_HTTP_CALLBACK_PROTOCOL *This,
+ IN EDKII_HTTP_CALLBACK_EVENT Event,
+ IN EFI_STATUS EventStatus
+ );
+
+///
+/// EFI HTTP Callback Protocol is invoked when HTTP event occurs.
+///
+struct _EDKII_HTTP_CALLBACK_PROTOCOL {
+ EDKII_HTTP_CALLBACK Callback;
+};
+
+extern EFI_GUID gEdkiiHttpCallbackProtocolGuid;
+
+#endif /* EDKII_HTTP_CALLBACK_H_ */