]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootSupport.h
NetworkPkg: Use Http11 definitions in HttpDxe and HttpBootDxe
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootSupport.h
index bef80e81d874930f51956037a6ed22a4bae48611..8e0fc37fdd8fe5b8cccb615db64f5471bb8def50 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support functions declaration for UEFI HTTP boot driver.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -29,6 +29,20 @@ HttpBootGetNicByIp4Children (
   IN EFI_HANDLE                 ControllerHandle\r
   );\r
 \r
+/**\r
+  Get the Nic handle using any child handle in the IPv6 stack.\r
+\r
+  @param[in]  ControllerHandle    Pointer to child handle over IPv6.\r
+\r
+  @return NicHandle               The pointer to the Nic handle.\r
+  @return NULL                    Can't find the Nic handle.\r
+\r
+**/\r
+EFI_HANDLE\r
+HttpBootGetNicByIp6Children (\r
+  IN EFI_HANDLE                 ControllerHandle\r
+  );\r
+\r
 /**\r
   This function is to convert UINTN to ASCII string with the required formatting.\r
 \r
@@ -56,6 +70,28 @@ HttpBootShowIp4Addr (
   IN EFI_IPv4_ADDRESS   *Ip\r
   );\r
 \r
+/**\r
+  This function is to display the IPv6 address.\r
+\r
+  @param[in]  Ip        The pointer to the IPv6 address.\r
+\r
+**/\r
+VOID\r
+HttpBootShowIp6Addr (\r
+  IN EFI_IPv6_ADDRESS   *Ip\r
+  );\r
+\r
+/**\r
+  This function is to display the HTTP error status.\r
+\r
+  @param[in]      StatusCode      The status code value in HTTP message.\r
+\r
+**/\r
+VOID\r
+HttpBootPrintErrorMessage (\r
+  EFI_HTTP_STATUS_CODE            StatusCode\r
+  );\r
+\r
 //\r
 // A wrapper structure to hold the HTTP headers.\r
 //\r
@@ -122,15 +158,28 @@ typedef struct {
   UINT16                    LocalPort;\r
 } HTTP4_IO_CONFIG_DATA;\r
 \r
+//\r
+// HTTP_IO configuration data for IPv6\r
+//\r
+typedef struct {\r
+  EFI_HTTP_VERSION          HttpVersion;\r
+  UINT32                    RequestTimeOut;  // In milliseconds.\r
+  BOOLEAN                   UseDefaultAddress;\r
+  EFI_IPv6_ADDRESS          LocalIp;\r
+  UINT16                    LocalPort;\r
+} HTTP6_IO_CONFIG_DATA;\r
+\r
+\r
 //\r
 // HTTP_IO configuration\r
 //\r
 typedef union {\r
   HTTP4_IO_CONFIG_DATA       Config4;\r
+  HTTP6_IO_CONFIG_DATA       Config6;\r
 } HTTP_IO_CONFIG_DATA;\r
 \r
 //\r
-// HTTO_IO wrapper of the EFI HTTP service.\r
+// HTTP_IO wrapper of the EFI HTTP service.\r
 //\r
 typedef struct {\r
   UINT8                     IpVersion;\r
@@ -158,7 +207,40 @@ typedef struct {
   EFI_HTTP_HEADER             *Headers;\r
   UINTN                       BodyLength;\r
   CHAR8                       *Body;\r
-} HTTP_IO_RESOPNSE_DATA;\r
+  EFI_STATUS                  Status;\r
+} HTTP_IO_RESPONSE_DATA;\r
+\r
+/**\r
+  Retrieve the host address using the EFI_DNS6_PROTOCOL.\r
+\r
+  @param[in]  Private             The pointer to the driver's private data.\r
+  @param[in]  HostName            Pointer to buffer containing hostname.\r
+  @param[out] IpAddress           On output, pointer to buffer containing IPv6 address.\r
+\r
+  @retval EFI_SUCCESS             Operation succeeded.\r
+  @retval EFI_DEVICE_ERROR        An unexpected network error occurred.\r
+  @retval Others                  Other errors as indicated.  \r
+**/\r
+EFI_STATUS\r
+HttpBootDns (\r
+  IN     HTTP_BOOT_PRIVATE_DATA   *Private,\r
+  IN     CHAR16                   *HostName,\r
+     OUT EFI_IPv6_ADDRESS         *IpAddress \r
+  );\r
+\r
+/**\r
+  Notify the callback function when an event is triggered.\r
+\r
+  @param[in]  Event           The triggered event.\r
+  @param[in]  Context         The opaque parameter to the function.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+HttpBootCommonNotify (\r
+  IN EFI_EVENT           Event,\r
+  IN VOID                *Context\r
+  );\r
 \r
 /**\r
   Create a HTTP_IO to access the HTTP service. It will create and configure\r
@@ -233,7 +315,7 @@ HttpIoSendRequest (
                                 FALSE to continue receive the previous response message.\r
   @param[out]  ResponseData     Point to a wrapper of the received response data.\r
   \r
-  @retval EFI_SUCCESS            The HTTP resopnse is received.\r
+  @retval EFI_SUCCESS            The HTTP response is received.\r
   @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
   @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
   @retval EFI_DEVICE_ERROR       An unexpected network or system error occurred.\r
@@ -244,7 +326,7 @@ EFI_STATUS
 HttpIoRecvResponse (\r
   IN      HTTP_IO                  *HttpIo,\r
   IN      BOOLEAN                  RecvMsgHeader,\r
-     OUT  HTTP_IO_RESOPNSE_DATA    *ResponseData\r
+     OUT  HTTP_IO_RESPONSE_DATA    *ResponseData\r
   );\r
 \r
 #endif\r