]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootSupport.h
NetworkPkg/HttpBootDxe: Add HTTP Boot Callback protocol support.
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootSupport.h
index 65302d2be203abb12424f5f88d8adf57084b9724..f2b1846c056c250c3b56ac27479ebdc12c97d55c 100644 (file)
@@ -145,6 +145,32 @@ HttpBootSetHeader (
   IN  CHAR8                *FieldValue\r
   );\r
 \r
+///\r
+/// HTTP_IO_CALLBACK_EVENT\r
+///\r
+typedef enum {\r
+  HttpIoRequest,\r
+  HttpIoResponse\r
+} HTTP_IO_CALLBACK_EVENT;\r
+\r
+/**\r
+  HttpIo Callback function which will be invoked when specified HTTP_IO_CALLBACK_EVENT happened.\r
+\r
+  @param[in]    EventType      Indicate the Event type that occurs in the current callback.\r
+  @param[in]    Message        HTTP message which will be send to, or just received from HTTP server.\r
+  @param[in]    Context        The Callback Context pointer.\r
+  \r
+  @retval EFI_SUCCESS          Tells the HttpIo to continue the HTTP process.\r
+  @retval Others               Tells the HttpIo to abort the current HTTP process.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * HTTP_IO_CALLBACK) (\r
+  IN  HTTP_IO_CALLBACK_EVENT    EventType,\r
+  IN  EFI_HTTP_MESSAGE          *Message,\r
+  IN  VOID                      *Context\r
+  );\r
+\r
 //\r
 // HTTP_IO configuration data for IPv4\r
 //\r
@@ -189,6 +215,9 @@ typedef struct {
   \r
   EFI_HTTP_PROTOCOL         *Http;\r
 \r
+  HTTP_IO_CALLBACK          Callback;\r
+  VOID                      *Context;\r
+\r
   EFI_HTTP_TOKEN            ReqToken;\r
   EFI_HTTP_MESSAGE          ReqMessage;\r
   EFI_HTTP_TOKEN            RspToken;\r
@@ -252,6 +281,9 @@ HttpBootCommonNotify (
   @param[in]  Controller     The handle of the controller.\r
   @param[in]  IpVersion      IP_VERSION_4 or IP_VERSION_6.\r
   @param[in]  ConfigData     The HTTP_IO configuration data.\r
+  @param[in]  Callback       Callback function which will be invoked when specified\r
+                             HTTP_IO_CALLBACK_EVENT happened.\r
+  @param[in]  Context        The Context data which will be passed to the Callback function.\r
   @param[out] HttpIo         The HTTP_IO.\r
   \r
   @retval EFI_SUCCESS            The HTTP_IO is created and configured.\r
@@ -268,6 +300,8 @@ HttpIoCreateIo (
   IN EFI_HANDLE             Controller,\r
   IN UINT8                  IpVersion,\r
   IN HTTP_IO_CONFIG_DATA    *ConfigData,\r
+  IN HTTP_IO_CALLBACK       Callback,\r
+  IN VOID                   *Context,\r
   OUT HTTP_IO               *HttpIo\r
   );\r
 \r