TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeHttpLib.c File Reference
#include "DxeHttpLib.h"

Go to the source code of this file.

Data Structures

struct  HTTP_BODY_PARSER
 

Enumerations

enum  HTTP_BODY_PARSE_STATE {
  BodyParserBodyStart , BodyParserBodyIdentity , BodyParserChunkSizeStart , BodyParserChunkSize ,
  BodyParserChunkSizeEndCR , BodyParserChunkExtStart , BodyParserChunkDataStart , BodyParserChunkDataEnd ,
  BodyParserChunkDataEndCR , BodyParserTrailer , BodyParserLastCRLF , BodyParserLastCRLFEnd ,
  BodyParserComplete , BodyParserStateMax
}
 

Functions

EFI_STATUS EFIAPI UriPercentDecode (IN CHAR8 *Buffer, IN UINT32 BufferLength, OUT CHAR8 *ResultBuffer, OUT UINT32 *ResultLength)
 
HTTP_URL_PARSE_STATE NetHttpParseAuthorityChar (IN CHAR8 Char, IN HTTP_URL_PARSE_STATE State, IN BOOLEAN *IsRightBracket)
 
EFI_STATUS NetHttpParseAuthority (IN CHAR8 *Url, IN BOOLEAN FoundAt, IN OUT HTTP_URL_PARSER *UrlParser)
 
HTTP_URL_PARSE_STATE NetHttpParseUrlChar (IN CHAR8 Char, IN HTTP_URL_PARSE_STATE State)
 
EFI_STATUS EFIAPI HttpParseUrl (IN CHAR8 *Url, IN UINT32 Length, IN BOOLEAN IsConnectMethod, OUT VOID **UrlParser)
 
EFI_STATUS EFIAPI HttpUrlGetHostName (IN CHAR8 *Url, IN VOID *UrlParser, OUT CHAR8 **HostName)
 
EFI_STATUS EFIAPI HttpUrlGetIp4 (IN CHAR8 *Url, IN VOID *UrlParser, OUT EFI_IPv4_ADDRESS *Ip4Address)
 
EFI_STATUS EFIAPI HttpUrlGetIp6 (IN CHAR8 *Url, IN VOID *UrlParser, OUT EFI_IPv6_ADDRESS *Ip6Address)
 
EFI_STATUS EFIAPI HttpUrlGetPort (IN CHAR8 *Url, IN VOID *UrlParser, OUT UINT16 *Port)
 
EFI_STATUS EFIAPI HttpUrlGetPath (IN CHAR8 *Url, IN VOID *UrlParser, OUT CHAR8 **Path)
 
VOID EFIAPI HttpUrlFreeParser (IN VOID *UrlParser)
 
EFI_HTTP_HEADER *EFIAPI HttpFindHeader (IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, IN CHAR8 *FieldName)
 
UINTN HttpIoHexCharToUintn (IN CHAR8 Char)
 
EFI_STATUS HttpIoParseContentLengthHeader (IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, OUT UINTN *ContentLength)
 
BOOLEAN HttpIoIsChunked (IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers)
 
BOOLEAN HttpIoNoMessageBody (IN EFI_HTTP_METHOD Method, IN EFI_HTTP_STATUS_CODE StatusCode)
 
EFI_STATUS EFIAPI HttpInitMsgParser (IN EFI_HTTP_METHOD Method, IN EFI_HTTP_STATUS_CODE StatusCode, IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, IN HTTP_BODY_PARSER_CALLBACK Callback, IN VOID *Context, OUT VOID **MsgParser)
 
EFI_STATUS EFIAPI HttpParseMessageBody (IN OUT VOID *MsgParser, IN UINTN BodyLength, IN CHAR8 *Body)
 
BOOLEAN EFIAPI HttpIsMessageComplete (IN VOID *MsgParser)
 
EFI_STATUS EFIAPI HttpGetEntityLength (IN VOID *MsgParser, OUT UINTN *ContentLength)
 
VOID EFIAPI HttpFreeMsgParser (IN VOID *MsgParser)
 
CHAR8 * AsciiStrGetNextToken (IN CONST CHAR8 *String, IN CHAR8 Separator)
 
EFI_STATUS EFIAPI HttpSetFieldNameAndValue (IN OUT EFI_HTTP_HEADER *HttpHeader, IN CONST CHAR8 *FieldName, IN CONST CHAR8 *FieldValue)
 
CHAR8 *EFIAPI HttpGetFieldNameAndValue (IN CHAR8 *String, OUT CHAR8 **FieldName, OUT CHAR8 **FieldValue)
 
VOID EFIAPI HttpFreeHeaderFields (IN EFI_HTTP_HEADER *HeaderFields, IN UINTN FieldCount)
 
EFI_STATUS EFIAPI HttpGenRequestMessage (IN CONST EFI_HTTP_MESSAGE *Message, IN CONST CHAR8 *Url, OUT CHAR8 **RequestMsg, OUT UINTN *RequestMsgSize)
 
EFI_HTTP_STATUS_CODE EFIAPI HttpMappingToStatusCode (IN UINTN StatusCode)
 
BOOLEAN EFIAPI HttpIsValidHttpHeader (IN CHAR8 *DeleteList[], IN UINTN DeleteCount, IN CHAR8 *FieldName)
 
HTTP_IO_HEADERHttpIoCreateHeader (UINTN MaxHeaderCount)
 
VOID HttpIoFreeHeader (IN HTTP_IO_HEADER *HttpIoHeader)
 
EFI_STATUS HttpIoSetHeader (IN HTTP_IO_HEADER *HttpIoHeader, IN CHAR8 *FieldName, IN CHAR8 *FieldValue)
 

Detailed Description

This library is used to share code between UEFI network stack modules. It provides the helper routines to parse the HTTP message byte stream.

Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DxeHttpLib.c.

Enumeration Type Documentation

◆ HTTP_BODY_PARSE_STATE

enum HTTP_BODY_PARSE_STATE

Definition at line 879 of file DxeHttpLib.c.

Function Documentation

◆ AsciiStrGetNextToken()

CHAR8 * AsciiStrGetNextToken ( IN CONST CHAR8 *  String,
IN CHAR8  Separator 
)

Get the next string, which is distinguished by specified separator.

Parameters
[in]StringPointer to the string.
[in]SeparatorSpecified separator used to distinguish where is the beginning of next string.
Returns
Pointer to the next string.
NULL if not find or String is NULL.

Definition at line 1493 of file DxeHttpLib.c.

◆ HttpFindHeader()

EFI_HTTP_HEADER *EFIAPI HttpFindHeader ( IN UINTN  HeaderCount,
IN EFI_HTTP_HEADER Headers,
IN CHAR8 *  FieldName 
)

Find a specified header field according to the field name.

Parameters
[in]HeaderCountNumber of HTTP header structures in Headers list.
[in]HeadersArray containing list of HTTP headers.
[in]FieldNameNull terminated string which describes a field name.
Returns
Pointer to the found header or NULL.

Definition at line 855 of file DxeHttpLib.c.

◆ HttpFreeHeaderFields()

VOID EFIAPI HttpFreeHeaderFields ( IN EFI_HTTP_HEADER HeaderFields,
IN UINTN  FieldCount 
)

Free existing HeaderFields.

Parameters
[in]HeaderFieldsPointer to array of key/value header pairs waiting for free.
[in]FieldCountThe number of header pairs in HeaderFields.

Definition at line 1730 of file DxeHttpLib.c.

◆ HttpFreeMsgParser()

VOID EFIAPI HttpFreeMsgParser ( IN VOID *  MsgParser)

Release the resource of the message parser.

Parameters
[in]MsgParserPointer to the message parser.

Definition at line 1474 of file DxeHttpLib.c.

◆ HttpGenRequestMessage()

EFI_STATUS EFIAPI HttpGenRequestMessage ( IN CONST EFI_HTTP_MESSAGE Message,
IN CONST CHAR8 *  Url,
OUT CHAR8 **  RequestMsg,
OUT UINTN RequestMsgSize 
)

Generate HTTP request message.

This function will allocate memory for the whole HTTP message and generate a well formatted HTTP Request message in it, include the Request-Line, header fields and also the message body. It is the caller's responsibility to free the buffer returned in *RequestMsg.

Parameters
[in]MessagePointer to the EFI_HTTP_MESSAGE structure which contains the required information to generate the HTTP request message.
[in]UrlThe URL of a remote host.
[out]RequestMsgPointer to the created HTTP request message. NULL if any error occurred.
[out]RequestMsgSizeSize of the RequestMsg (in bytes).
Return values
EFI_SUCCESSIf HTTP request string was created successfully.
EFI_OUT_OF_RESOURCESFailed to allocate resources.
EFI_INVALID_PARAMETERThe input arguments are invalid.

Definition at line 1775 of file DxeHttpLib.c.

◆ HttpGetEntityLength()

EFI_STATUS EFIAPI HttpGetEntityLength ( IN VOID *  MsgParser,
OUT UINTN ContentLength 
)

Get the content length of the entity.

Note that in trunk transfer, the entity length is not valid until the whole message body is received.

Parameters
[in]MsgParserPointer to the message parser.
[out]ContentLengthPointer to store the length of the entity.
Return values
EFI_SUCCESSSuccessfully to get the entity length.
EFI_NOT_READYEntity length is not valid yet.
EFI_INVALID_PARAMETERMsgParser is NULL or ContentLength is NULL.

Definition at line 1445 of file DxeHttpLib.c.

◆ HttpGetFieldNameAndValue()

CHAR8 *EFIAPI HttpGetFieldNameAndValue ( IN CHAR8 *  String,
OUT CHAR8 **  FieldName,
OUT CHAR8 **  FieldValue 
)

Get one key/value header pair from the raw string.

Parameters
[in]StringPointer to the raw string.
[out]FieldNamePoints directly to field name within 'HttpHeader'.
[out]FieldValuePoints directly to field value within 'HttpHeader'.
Returns
Pointer to the next raw string.
NULL if no key/value header pair from this raw string.

Definition at line 1585 of file DxeHttpLib.c.

◆ HttpInitMsgParser()

EFI_STATUS EFIAPI HttpInitMsgParser ( IN EFI_HTTP_METHOD  Method,
IN EFI_HTTP_STATUS_CODE  StatusCode,
IN UINTN  HeaderCount,
IN EFI_HTTP_HEADER Headers,
IN HTTP_BODY_PARSER_CALLBACK  Callback,
IN VOID *  Context,
OUT VOID **  MsgParser 
)

Initialize a HTTP message-body parser.

This function will create and initialize a HTTP message parser according to caller provided HTTP message header information. It is the caller's responsibility to free the buffer returned in *UrlParser by HttpFreeMsgParser().

Parameters
[in]MethodThe HTTP method (e.g. GET, POST) for this HTTP message.
[in]StatusCodeResponse status code returned by the remote host.
[in]HeaderCountNumber of HTTP header structures in Headers.
[in]HeadersArray containing list of HTTP headers.
[in]CallbackCallback function that is invoked when parsing the HTTP message-body, set to NULL to ignore all events.
[in]ContextPointer to the context that will be passed to Callback.
[out]MsgParserPointer to the returned buffer to store the message parser.
Return values
EFI_SUCCESSSuccessfully initialized the parser.
EFI_OUT_OF_RESOURCESCould not allocate needed resources.
EFI_INVALID_PARAMETERMsgParser is NULL or HeaderCount is not NULL but Headers is NULL.
OthersFailed to initialize the parser.

Definition at line 1050 of file DxeHttpLib.c.

◆ HttpIoCreateHeader()

HTTP_IO_HEADER * HttpIoCreateHeader ( UINTN  MaxHeaderCount)

Create a HTTP_IO_HEADER to hold the HTTP header items.

Parameters
[in]MaxHeaderCountThe maximun number of HTTP header in this holder.
Returns
A pointer of the HTTP header holder or NULL if failed.

Definition at line 2150 of file DxeHttpLib.c.

◆ HttpIoFreeHeader()

VOID HttpIoFreeHeader ( IN HTTP_IO_HEADER HttpIoHeader)

Destroy the HTTP_IO_HEADER and release the resources.

Parameters
[in]HttpIoHeaderPoint to the HTTP header holder to be destroyed.

Definition at line 2178 of file DxeHttpLib.c.

◆ HttpIoHexCharToUintn()

UINTN HttpIoHexCharToUintn ( IN CHAR8  Char)

Convert an hexadecimal char to a value of type UINTN.

Parameters
[in]CharAscii character.
Returns
Value translated from Char.

Definition at line 919 of file DxeHttpLib.c.

◆ HttpIoIsChunked()

BOOLEAN HttpIoIsChunked ( IN UINTN  HeaderCount,
IN EFI_HTTP_HEADER Headers 
)

Check whether the HTTP message is using the "chunked" transfer-coding.

Parameters
[in]HeaderCountNumber of HTTP header structures in Headers.
[in]HeadersArray containing list of HTTP headers.
Returns
The message is "chunked" transfer-coding (TRUE) or not (FALSE).

Definition at line 969 of file DxeHttpLib.c.

◆ HttpIoNoMessageBody()

BOOLEAN HttpIoNoMessageBody ( IN EFI_HTTP_METHOD  Method,
IN EFI_HTTP_STATUS_CODE  StatusCode 
)

Check whether the HTTP message should have a message-body.

Parameters
[in]MethodThe HTTP method (e.g. GET, POST) for this HTTP message.
[in]StatusCodeResponse status code returned by the remote host.
Returns
The message should have a message-body (FALSE) or not (TRUE).

Definition at line 998 of file DxeHttpLib.c.

◆ HttpIoParseContentLengthHeader()

EFI_STATUS HttpIoParseContentLengthHeader ( IN UINTN  HeaderCount,
IN EFI_HTTP_HEADER Headers,
OUT UINTN ContentLength 
)

Get the value of the content length if there is a "Content-Length" header.

Parameters
[in]HeaderCountNumber of HTTP header structures in Headers.
[in]HeadersArray containing list of HTTP headers.
[out]ContentLengthPointer to save the value of the content length.
Return values
EFI_SUCCESSSuccessfully get the content length.
EFI_NOT_FOUNDNo "Content-Length" header in the Headers.

Definition at line 942 of file DxeHttpLib.c.

◆ HttpIoSetHeader()

EFI_STATUS HttpIoSetHeader ( IN HTTP_IO_HEADER HttpIoHeader,
IN CHAR8 *  FieldName,
IN CHAR8 *  FieldValue 
)

Set or update a HTTP header with the field name and corresponding value.

Parameters
[in]HttpIoHeaderPoint to the HTTP header holder.
[in]FieldNameNull terminated string which describes a field name.
[in]FieldValueNull terminated string which describes the corresponding field value.
Return values
EFI_SUCCESSThe HTTP header has been set or updated.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_OUT_OF_RESOURCESInsufficient resource to complete the operation.
OtherUnexpected error happened.

Definition at line 2211 of file DxeHttpLib.c.

◆ HttpIsMessageComplete()

BOOLEAN EFIAPI HttpIsMessageComplete ( IN VOID *  MsgParser)

Check whether the message-body is complete or not.

Parameters
[in]MsgParserPointer to the message parser.
Return values
TRUEMessage-body is complete.
FALSEMessage-body is not complete.

Definition at line 1411 of file DxeHttpLib.c.

◆ HttpIsValidHttpHeader()

BOOLEAN EFIAPI HttpIsValidHttpHeader ( IN CHAR8 *  DeleteList[],
IN UINTN  DeleteCount,
IN CHAR8 *  FieldName 
)

Check whether header field called FieldName is in DeleteList.

Parameters
[in]DeleteListPointer to array of key/value header pairs.
[in]DeleteCountThe number of header pairs.
[in]FieldNamePointer to header field's name.
Returns
TRUE if FieldName is not in DeleteList, that means this header field is valid.
FALSE if FieldName is in DeleteList, that means this header field is invalid.

Definition at line 2116 of file DxeHttpLib.c.

◆ HttpMappingToStatusCode()

EFI_HTTP_STATUS_CODE EFIAPI HttpMappingToStatusCode ( IN UINTN  StatusCode)

Translate the status code in HTTP message to EFI_HTTP_STATUS_CODE defined in UEFI 2.5 specification.

The official HTTP status codes can be found here: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

Parameters
[in]StatusCodeThe status code value in HTTP message.
Returns
Value defined in EFI_HTTP_STATUS_CODE .

Definition at line 2008 of file DxeHttpLib.c.

◆ HttpParseMessageBody()

EFI_STATUS EFIAPI HttpParseMessageBody ( IN OUT VOID *  MsgParser,
IN UINTN  BodyLength,
IN CHAR8 *  Body 
)

Parse message body.

Parse BodyLength of message-body. This function can be called repeatedly to parse the message-body partially.

Parameters
[in,out]MsgParserPointer to the message parser.
[in]BodyLengthLength in bytes of the Body.
[in]BodyPointer to the buffer of the message-body to be parsed.
Return values
EFI_SUCCESSSuccessfully parse the message-body.
EFI_INVALID_PARAMETERMsgParser is NULL or Body is NULL or BodyLength is 0.
EFI_ABORTEDOperation aborted.
OtherError happened while parsing message body.

Definition at line 1131 of file DxeHttpLib.c.

◆ HttpParseUrl()

EFI_STATUS EFIAPI HttpParseUrl ( IN CHAR8 *  Url,
IN UINT32  Length,
IN BOOLEAN  IsConnectMethod,
OUT VOID **  UrlParser 
)

Create a URL parser for the input URL string.

This function will parse and dereference the input HTTP URL into it components. The original content of the URL won't be modified and the result will be returned in UrlParser, which can be used in other functions like NetHttpUrlGetHostName().

Parameters
[in]UrlThe pointer to a HTTP URL string.
[in]LengthLength of Url in bytes.
[in]IsConnectMethodWhether the Url is used in HTTP CONNECT method or not.
[out]UrlParserPointer to the returned buffer to store the parse result.
Return values
EFI_SUCCESSSuccessfully dereferenced the HTTP URL.
EFI_INVALID_PARAMETERUrlParser is NULL or Url is not a valid HTTP URL.
EFI_OUT_OF_RESOURCESCould not allocate needed resources.

Definition at line 370 of file DxeHttpLib.c.

◆ HttpSetFieldNameAndValue()

EFI_STATUS EFIAPI HttpSetFieldNameAndValue ( IN OUT EFI_HTTP_HEADER HttpHeader,
IN CONST CHAR8 *  FieldName,
IN CONST CHAR8 *  FieldValue 
)

Set FieldName and FieldValue into specified HttpHeader.

Parameters
[in,out]HttpHeaderSpecified HttpHeader.
[in]FieldNameFieldName of this HttpHeader, a NULL terminated ASCII string.
[in]FieldValueFieldValue of this HttpHeader, a NULL terminated ASCII string.
Return values
EFI_SUCCESSThe FieldName and FieldValue are set into HttpHeader successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_OUT_OF_RESOURCESFailed to allocate resources.

Definition at line 1529 of file DxeHttpLib.c.

◆ HttpUrlFreeParser()

VOID EFIAPI HttpUrlFreeParser ( IN VOID *  UrlParser)

Release the resource of the URL parser.

Parameters
[in]UrlParserPointer to the parser.

Definition at line 836 of file DxeHttpLib.c.

◆ HttpUrlGetHostName()

EFI_STATUS EFIAPI HttpUrlGetHostName ( IN CHAR8 *  Url,
IN VOID *  UrlParser,
OUT CHAR8 **  HostName 
)

Get the Hostname from a HTTP URL.

This function will return the HostName according to the Url and previous parse result ,and it is the caller's responsibility to free the buffer returned in *HostName.

Parameters
[in]UrlThe pointer to a HTTP URL string.
[in]UrlParserURL Parse result returned by NetHttpParseUrl().
[out]HostNamePointer to a buffer to store the HostName.
Return values
EFI_SUCCESSSuccessfully get the required component.
EFI_INVALID_PARAMETERUri is NULL or HostName is NULL or UrlParser is invalid.
EFI_NOT_FOUNDNo hostName component in the URL.
EFI_OUT_OF_RESOURCESCould not allocate needed resources.

Definition at line 506 of file DxeHttpLib.c.

◆ HttpUrlGetIp4()

EFI_STATUS EFIAPI HttpUrlGetIp4 ( IN CHAR8 *  Url,
IN VOID *  UrlParser,
OUT EFI_IPv4_ADDRESS Ip4Address 
)

Get the IPv4 address from a HTTP URL.

This function will return the IPv4 address according to the Url and previous parse result.

Parameters
[in]UrlThe pointer to a HTTP URL string.
[in]UrlParserURL Parse result returned by NetHttpParseUrl().
[out]Ip4AddressPointer to a buffer to store the IP address.
Return values
EFI_SUCCESSSuccessfully get the required component.
EFI_INVALID_PARAMETERUri is NULL or Ip4Address is NULL or UrlParser is invalid.
EFI_NOT_FOUNDNo IPv4 address component in the URL.
EFI_OUT_OF_RESOURCESCould not allocate needed resources.

Definition at line 565 of file DxeHttpLib.c.

◆ HttpUrlGetIp6()

EFI_STATUS EFIAPI HttpUrlGetIp6 ( IN CHAR8 *  Url,
IN VOID *  UrlParser,
OUT EFI_IPv6_ADDRESS Ip6Address 
)

Get the IPv6 address from a HTTP URL.

This function will return the IPv6 address according to the Url and previous parse result.

Parameters
[in]UrlThe pointer to a HTTP URL string.
[in]UrlParserURL Parse result returned by NetHttpParseUrl().
[out]Ip6AddressPointer to a buffer to store the IP address.
Return values
EFI_SUCCESSSuccessfully get the required component.
EFI_INVALID_PARAMETERUri is NULL or Ip6Address is NULL or UrlParser is invalid.
EFI_NOT_FOUNDNo IPv6 address component in the URL.
EFI_OUT_OF_RESOURCESCould not allocate needed resources.

Definition at line 626 of file DxeHttpLib.c.

◆ HttpUrlGetPath()

EFI_STATUS EFIAPI HttpUrlGetPath ( IN CHAR8 *  Url,
IN VOID *  UrlParser,
OUT CHAR8 **  Path 
)

Get the Path from a HTTP URL.

This function will return the Path according to the Url and previous parse result,and it is the caller's responsibility to free the buffer returned in *Path.

Parameters
[in]UrlThe pointer to a HTTP URL string.
[in]UrlParserURL Parse result returned by NetHttpParseUrl().
[out]PathPointer to a buffer to store the Path.
Return values
EFI_SUCCESSSuccessfully get the required component.
EFI_INVALID_PARAMETERUri is NULL or HostName is NULL or UrlParser is invalid.
EFI_NOT_FOUNDNo hostName component in the URL.
EFI_OUT_OF_RESOURCESCould not allocate needed resources.

Definition at line 786 of file DxeHttpLib.c.

◆ HttpUrlGetPort()

EFI_STATUS EFIAPI HttpUrlGetPort ( IN CHAR8 *  Url,
IN VOID *  UrlParser,
OUT UINT16 *  Port 
)

Get the port number from a HTTP URL.

This function will return the port number according to the Url and previous parse result.

Parameters
[in]UrlThe pointer to a HTTP URL string.
[in]UrlParserURL Parse result returned by NetHttpParseUrl().
[out]PortPointer to a buffer to store the port number.
Return values
EFI_SUCCESSSuccessfully get the required component.
EFI_INVALID_PARAMETERUri is NULL or Port is NULL or UrlParser is invalid.
EFI_NOT_FOUNDNo port number in the URL.
EFI_OUT_OF_RESOURCESCould not allocate needed resources.

Definition at line 702 of file DxeHttpLib.c.

◆ NetHttpParseAuthority()

EFI_STATUS NetHttpParseAuthority ( IN CHAR8 *  Url,
IN BOOLEAN  FoundAt,
IN OUT HTTP_URL_PARSER UrlParser 
)

This function parse the authority component of the input URL and update the parser.

Parameters
[in]UrlThe pointer to a HTTP URL string.
[in]FoundAtTRUE if there is an at sign ('@') in the authority component.
[in,out]UrlParserPointer to the buffer of the parse result.
Return values
EFI_SUCCESSSuccessfully parse the authority.
EFI_INVALID_PARAMETERThe Url is invalid to parse the authority component.

Definition at line 159 of file DxeHttpLib.c.

◆ NetHttpParseAuthorityChar()

HTTP_URL_PARSE_STATE NetHttpParseAuthorityChar ( IN CHAR8  Char,
IN HTTP_URL_PARSE_STATE  State,
IN BOOLEAN *  IsRightBracket 
)

This function return the updated state according to the input state and next character of the authority.

Parameters
[in]CharNext character.
[in]StateCurrent value of the parser state machine.
[in]IsRightBracketTRUE if there is an sign ']' in the authority component and indicates the next part is ':' before Port.
Returns
Updated state value.

Definition at line 86 of file DxeHttpLib.c.

◆ NetHttpParseUrlChar()

HTTP_URL_PARSE_STATE NetHttpParseUrlChar ( IN CHAR8  Char,
IN HTTP_URL_PARSE_STATE  State 
)

This function return the updated state according to the input state and next character of a URL.

Parameters
[in]CharNext character.
[in]StateCurrent value of the parser state machine.
Returns
Updated state value.

Definition at line 250 of file DxeHttpLib.c.

◆ UriPercentDecode()

EFI_STATUS EFIAPI UriPercentDecode ( IN CHAR8 *  Buffer,
IN UINT32  BufferLength,
OUT CHAR8 *  ResultBuffer,
OUT UINT32 *  ResultLength 
)

Decode a percent-encoded URI component to the ASCII character.

Decode the input component in Buffer according to RFC 3986. The caller is responsible to make sure ResultBuffer points to a buffer with size equal or greater than ((AsciiStrSize (Buffer)) in bytes.

Parameters
[in]BufferThe pointer to a percent-encoded URI component.
[in]BufferLengthLength of Buffer in bytes.
[out]ResultBufferPoint to the buffer to store the decode result.
[out]ResultLengthLength of decoded string in ResultBuffer in bytes.
Return values
EFI_SUCCESSSuccessfully decoded the URI.
EFI_INVALID_PARAMETERBuffer is not a valid percent-encoded string.

Definition at line 31 of file DxeHttpLib.c.