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

Go to the source code of this file.

Functions

EFI_STATUS UpdateSessionToken (IN REDFISH_SERVICE_PRIVATE *Service, IN CHAR8 *Token)
 
EFI_STATUS ReleaseRedfishService (IN REDFISH_SERVICE_PRIVATE *Service)
 
REDFISH_SERVICE_PRIVATECreateRedfishService (IN CHAR8 *Host, IN CHAR8 *HostName, IN CHAR8 *BasicAuth OPTIONAL, IN CHAR8 *SessionToken OPTIONAL, IN EFI_REST_EX_PROTOCOL *RestEx)
 
EFI_STATUS ReleaseRedfishPayload (IN REDFISH_PAYLOAD_PRIVATE *Payload)
 
REDFISH_PAYLOAD_PRIVATECreateRedfishPayload (IN REDFISH_SERVICE_PRIVATE *Service, IN EDKII_JSON_VALUE JsonValue)
 
EFI_STATUS CopyRedfishResponse (IN REDFISH_RESPONSE *SrcResponse, OUT REDFISH_RESPONSE *DstResponse)
 
REDFISH_RESPONSECloneRedfishResponse (IN REDFISH_RESPONSE *Response)
 
EFI_STATUS ReleaseHttpCacheData (IN REDFISH_HTTP_CACHE_DATA *Data)
 
REDFISH_HTTP_CACHE_DATANewHttpCacheData (IN EFI_STRING Uri, IN REDFISH_RESPONSE *Response)
 
REDFISH_HTTP_CACHE_DATAFindHttpCacheData (IN LIST_ENTRY *ListHeader, IN EFI_STRING Uri)
 
REDFISH_HTTP_CACHE_DATAFindUnusedHttpCacheData (IN LIST_ENTRY *ListHeader)
 
EFI_STATUS DeleteHttpCacheData (IN REDFISH_HTTP_CACHE_LIST *List, IN REDFISH_HTTP_CACHE_DATA *Data)
 
EFI_STATUS AddHttpCacheData (IN REDFISH_HTTP_CACHE_LIST *List, IN EFI_STRING Uri, IN REDFISH_RESPONSE *Response)
 
EFI_STATUS ReleaseCacheList (IN REDFISH_HTTP_CACHE_LIST *CacheList)
 

Detailed Description

RedfishHttpData handles internal data to support Redfish HTTP protocol.

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

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

Definition in file RedfishHttpData.c.

Function Documentation

◆ AddHttpCacheData()

EFI_STATUS AddHttpCacheData ( IN REDFISH_HTTP_CACHE_LIST List,
IN EFI_STRING  Uri,
IN REDFISH_RESPONSE Response 
)

Add new cache by given URI and HTTP response to specify List.

Parameters
[in]ListTarget cache list to add.
[in]UriThe URI string matching to this cache data.
[in]ResponseHTTP response.
Return values
EFI_SUCCESSCache data is added.
OthersFail to add cache data.

Definition at line 571 of file RedfishHttpData.c.

◆ CloneRedfishResponse()

REDFISH_RESPONSE * CloneRedfishResponse ( IN REDFISH_RESPONSE Response)

This function clone input response and return to caller

Parameters
[in]ResponseResponse to clone.
Return values
REDFISH_RESPONSE* Response is cloned.
NULLErrors occur.

Definition at line 336 of file RedfishHttpData.c.

◆ CopyRedfishResponse()

EFI_STATUS CopyRedfishResponse ( IN REDFISH_RESPONSE SrcResponse,
OUT REDFISH_RESPONSE DstResponse 
)

This function copy the data in SrcResponse to DstResponse.

Parameters
[in]SrcResponseSource Response to copy.
[out]DstResponseDestination Response.
Return values
EFI_SUCCESSResponse is copied successfully.
OthersError occurs.

Definition at line 250 of file RedfishHttpData.c.

◆ CreateRedfishPayload()

REDFISH_PAYLOAD_PRIVATE * CreateRedfishPayload ( IN REDFISH_SERVICE_PRIVATE Service,
IN EDKII_JSON_VALUE  JsonValue 
)

This function creat new payload. Server and JsonObj are copied to newly created payload.

Parameters
[in]ServicePointer to Service instance.
[in]JsonValuePointer to JSON value.
Return values
REDFISH_PAYLOAD_PRIVATENewly created payload.
NULLError occurs.

Definition at line 203 of file RedfishHttpData.c.

◆ CreateRedfishService()

REDFISH_SERVICE_PRIVATE * CreateRedfishService ( IN CHAR8 *  Host,
IN CHAR8 *  HostName,
IN CHAR8 *BasicAuth  OPTIONAL,
IN CHAR8 *SessionToken  OPTIONAL,
IN EFI_REST_EX_PROTOCOL RestEx 
)

This function creat new service. Host and HostName are copied to newly created service instance.

Parameters
[in]HostHost string.
[in]HostNameHostname string.
[in]BasicAuthBasic Authorization string.
[in]SessionTokenSession token string.
[in]RestExRest EX protocol instance.
Return values
REDFISH_PAYLOAD_PRIVATENewly created service.
NULLError occurs.

Definition at line 101 of file RedfishHttpData.c.

◆ DeleteHttpCacheData()

EFI_STATUS DeleteHttpCacheData ( IN REDFISH_HTTP_CACHE_LIST List,
IN REDFISH_HTTP_CACHE_DATA Data 
)

Delete a cache data by given cache instance.

Parameters
[in]ListTarget cache list to be removed.
[in]DataPointer to the instance to be deleted.
Return values
EFI_SUCCESSCache data is removed.
OthersFail to remove cache data.

Definition at line 542 of file RedfishHttpData.c.

◆ FindHttpCacheData()

REDFISH_HTTP_CACHE_DATA * FindHttpCacheData ( IN LIST_ENTRY ListHeader,
IN EFI_STRING  Uri 
)

Search on given ListHeader for given URI string.

Parameters
[in]ListHeaderTarget list to search.
[in]UriTarget URI to search.
Return values
REDFISH_HTTP_CACHE_DATATarget cache data is found.
NULLNo cache data with given URI is found.

Definition at line 453 of file RedfishHttpData.c.

◆ FindUnusedHttpCacheData()

REDFISH_HTTP_CACHE_DATA * FindUnusedHttpCacheData ( IN LIST_ENTRY ListHeader)

Search on given ListHeader and return cache data with minimum hit count.

Parameters
[in]ListHeaderTarget list to search.
Return values
REDFISH_HTTP_CACHE_DATATarget cache data is returned.
NULLNo cache data is found.

Definition at line 494 of file RedfishHttpData.c.

◆ NewHttpCacheData()

REDFISH_HTTP_CACHE_DATA * NewHttpCacheData ( IN EFI_STRING  Uri,
IN REDFISH_RESPONSE Response 
)

Create new cache data.

Parameters
[in]UriThe URI string matching to this cache data.
[in]ResponseHTTP response.
Return values
REDFISH_HTTP_CACHE_DATA* Pointer to newly created cache data.
NULLNo memory available.

Definition at line 404 of file RedfishHttpData.c.

◆ ReleaseCacheList()

EFI_STATUS ReleaseCacheList ( IN REDFISH_HTTP_CACHE_LIST CacheList)

Release all cache from list.

Parameters
[in]CacheListThe list to be released.
Return values
EFI_SUCCESSAll cache data are released.
EFI_INVALID_PARAMETERCacheList is NULL.

Definition at line 638 of file RedfishHttpData.c.

◆ ReleaseHttpCacheData()

EFI_STATUS ReleaseHttpCacheData ( IN REDFISH_HTTP_CACHE_DATA Data)

Release REDFISH_HTTP_CACHE_DATA resource

Parameters
[in]DataPointer to REDFISH_HTTP_CACHE_DATA instance
Return values
EFI_SUCCESSREDFISH_HTTP_CACHE_DATA is released successfully.
EFI_INVALID_PARAMETERData is NULL

Definition at line 371 of file RedfishHttpData.c.

◆ ReleaseRedfishPayload()

EFI_STATUS ReleaseRedfishPayload ( IN REDFISH_PAYLOAD_PRIVATE Payload)

This function release Redfish Payload.

Parameters
[in]PayloadPointer to payload instance.
Return values
EFI_SUCCESSPayload is released.
OthersError occurs.

Definition at line 170 of file RedfishHttpData.c.

◆ ReleaseRedfishService()

EFI_STATUS ReleaseRedfishService ( IN REDFISH_SERVICE_PRIVATE Service)

This function release Redfish Service.

Parameters
[in]ServicePointer to service instance.
Return values
EFI_SUCCESSService is released.
OthersError occurs.

Definition at line 55 of file RedfishHttpData.c.

◆ UpdateSessionToken()

EFI_STATUS UpdateSessionToken ( IN REDFISH_SERVICE_PRIVATE Service,
IN CHAR8 *  Token 
)

This function update session token in Redfish Service.

Parameters
[in]ServicePointer to service instance.
[in]TokenSession token.
Return values
EFI_SUCCESSSession token is updated.
OthersError occurs.

Definition at line 24 of file RedfishHttpData.c.