NetworkPkg/DxeHttpLib: Migrate HTTP header manipulation APIs
Move HTTP header manipulation functions to DxeHttpLib from HttpBootSupport.c. These general functions are used by both Http BOOT and RedfishLib (patches will be sent later). Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Fan Wang <fan.wang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Nickle Wang <nickle.wang@hpe.com> Cc: Peter O'Hanley <peter.ohanley@hpe.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
536a3e6726
commit
40c4cd5421
@@ -87,59 +87,6 @@ HttpBootPrintErrorMessage (
|
||||
EFI_HTTP_STATUS_CODE StatusCode
|
||||
);
|
||||
|
||||
//
|
||||
// A wrapper structure to hold the HTTP headers.
|
||||
//
|
||||
typedef struct {
|
||||
UINTN MaxHeaderCount;
|
||||
UINTN HeaderCount;
|
||||
EFI_HTTP_HEADER *Headers;
|
||||
} HTTP_IO_HEADER;
|
||||
|
||||
/**
|
||||
Create a HTTP_IO_HEADER to hold the HTTP header items.
|
||||
|
||||
@param[in] MaxHeaderCount The maximum number of HTTP header in this holder.
|
||||
|
||||
@return A pointer of the HTTP header holder or NULL if failed.
|
||||
|
||||
**/
|
||||
HTTP_IO_HEADER *
|
||||
HttpBootCreateHeader (
|
||||
IN UINTN MaxHeaderCount
|
||||
);
|
||||
|
||||
/**
|
||||
Destroy the HTTP_IO_HEADER and release the resources.
|
||||
|
||||
@param[in] HttpIoHeader Point to the HTTP header holder to be destroyed.
|
||||
|
||||
**/
|
||||
VOID
|
||||
HttpBootFreeHeader (
|
||||
IN HTTP_IO_HEADER *HttpIoHeader
|
||||
);
|
||||
|
||||
/**
|
||||
Set or update a HTTP header with the field name and corresponding value.
|
||||
|
||||
@param[in] HttpIoHeader Point to the HTTP header holder.
|
||||
@param[in] FieldName Null terminated string which describes a field name.
|
||||
@param[in] FieldValue Null terminated string which describes the corresponding field value.
|
||||
|
||||
@retval EFI_SUCCESS The HTTP header has been set or updated.
|
||||
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.
|
||||
@retval EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation.
|
||||
@retval Other Unexpected error happened.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
HttpBootSetHeader (
|
||||
IN HTTP_IO_HEADER *HttpIoHeader,
|
||||
IN CHAR8 *FieldName,
|
||||
IN CHAR8 *FieldValue
|
||||
);
|
||||
|
||||
/**
|
||||
Retrieve the host address using the EFI_DNS6_PROTOCOL.
|
||||
|
||||
|
Reference in New Issue
Block a user