]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Include/Protocol/HttpCallback.h
NetworkPkg: Add HTTP Additional Event Notifications
[mirror_edk2.git] / NetworkPkg / Include / Protocol / HttpCallback.h
diff --git a/NetworkPkg/Include/Protocol/HttpCallback.h b/NetworkPkg/Include/Protocol/HttpCallback.h
new file mode 100644 (file)
index 0000000..7e3f82a
--- /dev/null
@@ -0,0 +1,85 @@
+/** @file\r
+  This file defines the EDKII HTTP Callback Protocol interface.\r
+\r
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+**/\r
+\r
+#ifndef EDKII_HTTP_CALLBACK_H_\r
+#define EDKII_HTTP_CALLBACK_H_\r
+\r
+#define EDKII_HTTP_CALLBACK_PROTOCOL_GUID \\r
+  { \\r
+    0x611114f1, 0xa37b, 0x4468, {0xa4, 0x36, 0x5b, 0xdd, 0xa1, 0x6a, 0xa2, 0x40} \\r
+  }\r
+\r
+typedef struct _EDKII_HTTP_CALLBACK_PROTOCOL  EDKII_HTTP_CALLBACK_PROTOCOL;\r
+\r
+///\r
+/// EDKII_HTTP_CALLBACK_EVENT\r
+///\r
+typedef enum {\r
+  ///\r
+  /// The Status of DNS Event to retrieve the host address.\r
+  /// EventStatus:\r
+  /// EFI_SUCCESS             Operation succeeded.\r
+  /// EFI_OUT_OF_RESOURCES    Failed to allocate needed resources.\r
+  /// EFI_DEVICE_ERROR        An unexpected network error occurred.\r
+  /// Others                  Other errors as indicated.\r
+  ///\r
+  HttpEventDns,\r
+\r
+  ///\r
+  /// The Status of Event to initiate a nonblocking TCP connection request.\r
+  /// EventStatus:\r
+  /// EFI_SUCCESS            The connection request is successfully initiated.\r
+  /// EFI_NOT_STARTED        This EFI TCP Protocol instance has not been configured.\r
+  /// EFI_DEVICE_ERROR       An unexpected system or network error occurred.\r
+  /// Others                 Other errors as indicated.\r
+  ///\r
+  HttpEventConnectTcp,\r
+\r
+  ///\r
+  /// The Status of Event to connect one TLS session by finishing the TLS handshake process.\r
+  /// EventStatus:\r
+  /// EFI_SUCCESS            The TLS session is established.\r
+  /// EFI_OUT_OF_RESOURCES   Can't allocate memory resources.\r
+  /// EFI_ABORTED            TLS session state is incorrect.\r
+  /// Others                 Other error as indicated.\r
+  ///\r
+  HttpEventTlsConnectSession,\r
+\r
+  ///\r
+  /// The Status of Event to initialize Http session\r
+  /// EventStatus:\r
+  /// EFI_SUCCESS            The initialization of session is done.\r
+  /// Others                 Other error as indicated.\r
+  ///\r
+  HttpEventInitSession\r
+} EDKII_HTTP_CALLBACK_EVENT;\r
+\r
+/**\r
+  Callback function that is invoked when HTTP event occurs.\r
+\r
+  @param[in]  This                Pointer to the EDKII_HTTP_CALLBACK_PROTOCOL instance.\r
+  @param[in]  Event               The event that occurs in the current state.\r
+  @param[in]  EventStatus         The Status of Event, EFI_SUCCESS or other errors.\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI * EDKII_HTTP_CALLBACK) (\r
+  IN EDKII_HTTP_CALLBACK_PROTOCOL     *This,\r
+  IN EDKII_HTTP_CALLBACK_EVENT        Event,\r
+  IN EFI_STATUS                       EventStatus\r
+ );\r
+\r
+///\r
+/// EFI HTTP Callback Protocol is invoked when HTTP event occurs.\r
+///\r
+struct _EDKII_HTTP_CALLBACK_PROTOCOL {\r
+  EDKII_HTTP_CALLBACK Callback;\r
+};\r
+\r
+extern EFI_GUID gEdkiiHttpCallbackProtocolGuid;\r
+\r
+#endif /* EDKII_HTTP_CALLBACK_H_ */\r