]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/HttpLib.h
MdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.h
[mirror_edk2.git] / MdeModulePkg / Include / Library / HttpLib.h
index ce5a839c9b6009c86bc32dfe0a03744d88099624..cd97b644f1e9a975c3da58c62e519e42c0a958cb 100644 (file)
@@ -2,7 +2,7 @@
   This library is used to share code between UEFI network stack modules.\r
   It provides the helper routines to parse the HTTP message byte stream.\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\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at<BR>\r
@@ -163,6 +163,30 @@ HttpUrlGetPort (
      OUT  UINT16             *Port\r
   );\r
 \r
+/**\r
+  Get the Path from a HTTP URL.\r
+\r
+  This function will return the Path according to the Url and previous parse result,and\r
+  it is the caller's responsibility to free the buffer returned in *Path.\r
+\r
+  @param[in]    Url                The pointer to a HTTP URL string.\r
+  @param[in]    UrlParser          URL Parse result returned by NetHttpParseUrl().\r
+  @param[out]   Path               Pointer to a buffer to store the Path.\r
+\r
+  @retval EFI_SUCCESS              Successfully get the required component.\r
+  @retval EFI_INVALID_PARAMETER    Uri is NULL or HostName is NULL or UrlParser is invalid.\r
+  @retval EFI_NOT_FOUND            No hostName component in the URL.\r
+  @retval EFI_OUT_OF_RESOURCES     Could not allocate needed resources.\r
+  \r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HttpUrlGetPath (\r
+  IN      CHAR8              *Url,\r
+  IN      VOID               *UrlParser,\r
+     OUT  CHAR8              **Path\r
+  );\r
+\r
 /**\r
   Release the resource of the URL parser.\r
 \r