TianoCore EDK2 master
Loading...
Searching...
No Matches
RedfishHttpOperation.c File Reference

Go to the source code of this file.

Functions

EFI_STATUS CopyHttpHeaders (IN EFI_HTTP_HEADER *SrcHeaders, IN UINTN SrcHeaderCount, OUT EFI_HTTP_HEADER **DstHeaders, OUT UINTN *DstHeaderCount)
 
EFI_STATUS ReleaseRedfishRequest (IN REDFISH_REQUEST *Request)
 
EFI_STATUS ReleaseRedfishResponse (IN REDFISH_RESPONSE *Response)
 
EFI_STATUS ReleaseHttpMessage (IN EFI_HTTP_MESSAGE *HttpMessage, IN BOOLEAN IsRequest)
 
EFI_HTTP_MESSAGEBuildRequestMessage (IN REDFISH_SERVICE_PRIVATE *ServicePrivate, IN EFI_STRING Uri, IN EFI_HTTP_METHOD Method, IN REDFISH_REQUEST *Request OPTIONAL, IN CHAR8 *ContentEncoding OPTIONAL)
 
EFI_STATUS ParseResponseMessage (IN REDFISH_SERVICE_PRIVATE *ServicePrivate, IN EFI_HTTP_MESSAGE *ResponseMsg, OUT REDFISH_RESPONSE *RedfishResponse)
 
EFI_STATUS HttpSendReceive (IN REDFISH_SERVICE Service, IN EFI_STRING Uri, IN EFI_HTTP_METHOD Method, IN REDFISH_REQUEST *Request OPTIONAL, OUT REDFISH_RESPONSE *Response)
 

Detailed Description

RedfishHttpOperation handles HTTP operations.

Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file RedfishHttpOperation.c.

Function Documentation

◆ BuildRequestMessage()

EFI_HTTP_MESSAGE * BuildRequestMessage ( IN REDFISH_SERVICE_PRIVATE ServicePrivate,
IN EFI_STRING  Uri,
IN EFI_HTTP_METHOD  Method,
IN REDFISH_REQUEST *Request  OPTIONAL,
IN CHAR8 *ContentEncoding  OPTIONAL 
)

This function build Redfish message for sending data to Redfish service. It's call responsibility to properly release returned HTTP message by calling ReleaseHttpMessage.

Parameters
[in]ServicePrivatePointer to Redfish service private data.
[in]UriRedfish service URI.
[in]MethodHTTP method.
[in]RequestAdditional data to send to Redfish service. This is optional.
[in]ContentEncodingContent encoding method to compress HTTP context. This is optional. When ContentEncoding is NULL, No compress method will be performed.
Return values
EFI_HTTP_MESSAGE* Pointer to newly created HTTP message.
NULLError occurred.

Definition at line 209 of file RedfishHttpOperation.c.

◆ CopyHttpHeaders()

EFI_STATUS CopyHttpHeaders ( IN EFI_HTTP_HEADER SrcHeaders,
IN UINTN  SrcHeaderCount,
OUT EFI_HTTP_HEADER **  DstHeaders,
OUT UINTN DstHeaderCount 
)

This function copies all headers in SrcHeaders to DstHeaders. It's call responsibility to release returned DstHeaders.

Parameters
[in]SrcHeadersSource headers.
[in]SrcHeaderCountNumber of header in source headers.
[out]DstHeadersDestination headers.
[out]DstHeaderCountNumber of header in designation headers.
Return values
EFI_SUCCESSHeaders are copied successfully.
OthersErrors occur.

Definition at line 27 of file RedfishHttpOperation.c.

◆ HttpSendReceive()

EFI_STATUS HttpSendReceive ( IN REDFISH_SERVICE  Service,
IN EFI_STRING  Uri,
IN EFI_HTTP_METHOD  Method,
IN REDFISH_REQUEST *Request  OPTIONAL,
OUT REDFISH_RESPONSE Response 
)

This function send Redfish request to Redfish service by calling Rest Ex protocol.

Parameters
[in]ServicePointer to Redfish service.
[in]UriUri of Redfish service.
[in]MethodHTTP method.
[in]RequestRequest data. This is optional.
[out]ResponseRedfish response data.
Return values
EFI_SUCCESSRequest is sent and received successfully.
OthersErrors occur.

Definition at line 624 of file RedfishHttpOperation.c.

◆ ParseResponseMessage()

EFI_STATUS ParseResponseMessage ( IN REDFISH_SERVICE_PRIVATE ServicePrivate,
IN EFI_HTTP_MESSAGE ResponseMsg,
OUT REDFISH_RESPONSE RedfishResponse 
)

This function parse response message from Redfish service, and build Redfish response for caller. It's call responsibility to properly release Redfish response by calling ReleaseRedfishResponse.

Parameters
[in]ServicePrivatePointer to Redfish service private data.
[in]ResponseMsgResponse message from Redfish service.
[out]RedfishResponseRedfish response data.
Return values
EFI_SUCCESSRedfish response is returned successfully.
OthersErrors occur.

Definition at line 487 of file RedfishHttpOperation.c.

◆ ReleaseHttpMessage()

EFI_STATUS ReleaseHttpMessage ( IN EFI_HTTP_MESSAGE HttpMessage,
IN BOOLEAN  IsRequest 
)

This function free resources in given HTTP message.

Parameters
[in]HttpMessageHTTP message to be released.
[in]IsRequestTRUE if this is request type of HTTP message. FALSE if this is response type of HTTP message.
Return values
EFI_SUCCESSResource is released successfully.
OthersErrors occur.

Definition at line 151 of file RedfishHttpOperation.c.

◆ ReleaseRedfishRequest()

EFI_STATUS ReleaseRedfishRequest ( IN REDFISH_REQUEST Request)

This function free resources in Request. Request is no longer available after this function returns successfully.

Parameters
[in]RequestHTTP request to be released.
Return values
EFI_SUCCESSResource is released successfully.
OthersErrors occur.

Definition at line 73 of file RedfishHttpOperation.c.

◆ ReleaseRedfishResponse()

EFI_STATUS ReleaseRedfishResponse ( IN REDFISH_RESPONSE Response)

This function free resources in given Response.

Parameters
[in]ResponseHTTP response to be released.
Return values
EFI_SUCCESSResource is released successfully.
OthersErrors occur.

Definition at line 112 of file RedfishHttpOperation.c.