TianoCore EDK2 master
Loading...
Searching...
No Matches
RedfishHttpData.h File Reference
#include "RedfishHttpDxe.h"

Go to the source code of this file.

Data Structures

struct  REDFISH_SERVICE_PRIVATE
 
struct  REDFISH_PAYLOAD_PRIVATE
 
struct  REDFISH_HTTP_CACHE_DATA
 
struct  REDFISH_HTTP_CACHE_LIST
 
struct  REDFISH_HTTP_RETRY_SETTING
 
struct  REDFISH_HTTP_CACHE_PRIVATE
 

Macros

#define REDFISH_HTTP_DRIVER_SIGNATURE   SIGNATURE_32 ('r', 'f', 'h', 'p')
 
#define REDFISH_HTTP_CACHE_SIGNATURE   SIGNATURE_32 ('r', 'f', 'c', 'h')
 
#define REDFISH_HTTP_SERVICE_SIGNATURE   SIGNATURE_32 ('r', 'f', 's', 'v')
 
#define REDFISH_HTTP_PAYLOAD_SIGNATURE   SIGNATURE_32 ('r', 'f', 'p', 'l')
 
#define REDFISH_HTTP_BASIC_AUTH_STR   "Basic "
 
#define REDFISH_HTTP_CACHE_FROM_LIST(a)   CR (a, REDFISH_HTTP_CACHE_DATA, List, REDFISH_HTTP_CACHE_SIGNATURE)
 
#define REDFISH_HTTP_CACHE_PRIVATE_FROM_THIS(a)   CR (a, REDFISH_HTTP_CACHE_PRIVATE, Protocol, REDFISH_HTTP_DRIVER_SIGNATURE)
 

Functions

REDFISH_HTTP_CACHE_DATAFindHttpCacheData (IN LIST_ENTRY *ListHeader, IN EFI_STRING Uri)
 
EFI_STATUS CopyRedfishResponse (IN REDFISH_RESPONSE *SrcResponse, OUT REDFISH_RESPONSE *DstResponse)
 
EFI_STATUS ReleaseCacheList (IN REDFISH_HTTP_CACHE_LIST *CacheList)
 
EFI_STATUS AddHttpCacheData (IN REDFISH_HTTP_CACHE_LIST *List, IN EFI_STRING Uri, IN REDFISH_RESPONSE *Response)
 
EFI_STATUS DeleteHttpCacheData (IN REDFISH_HTTP_CACHE_LIST *List, IN REDFISH_HTTP_CACHE_DATA *Data)
 
EFI_STATUS ReleaseRedfishPayload (IN REDFISH_PAYLOAD_PRIVATE *Payload)
 
REDFISH_PAYLOAD_PRIVATECreateRedfishPayload (IN REDFISH_SERVICE_PRIVATE *Service, IN EDKII_JSON_VALUE JsonValue)
 
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 UpdateSessionToken (IN REDFISH_SERVICE_PRIVATE *Service, IN CHAR8 *Token)
 

Detailed Description

Definitions of RedfishHttpData

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

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

Definition in file RedfishHttpData.h.

Macro Definition Documentation

◆ REDFISH_HTTP_BASIC_AUTH_STR

#define REDFISH_HTTP_BASIC_AUTH_STR   "Basic "

Definition at line 19 of file RedfishHttpData.h.

◆ REDFISH_HTTP_CACHE_FROM_LIST

#define REDFISH_HTTP_CACHE_FROM_LIST (   a)    CR (a, REDFISH_HTTP_CACHE_DATA, List, REDFISH_HTTP_CACHE_SIGNATURE)

Definition at line 53 of file RedfishHttpData.h.

◆ REDFISH_HTTP_CACHE_PRIVATE_FROM_THIS

#define REDFISH_HTTP_CACHE_PRIVATE_FROM_THIS (   a)    CR (a, REDFISH_HTTP_CACHE_PRIVATE, Protocol, REDFISH_HTTP_DRIVER_SIGNATURE)

Definition at line 90 of file RedfishHttpData.h.

◆ REDFISH_HTTP_CACHE_SIGNATURE

#define REDFISH_HTTP_CACHE_SIGNATURE   SIGNATURE_32 ('r', 'f', 'c', 'h')

Definition at line 16 of file RedfishHttpData.h.

◆ REDFISH_HTTP_DRIVER_SIGNATURE

#define REDFISH_HTTP_DRIVER_SIGNATURE   SIGNATURE_32 ('r', 'f', 'h', 'p')

Definition at line 15 of file RedfishHttpData.h.

◆ REDFISH_HTTP_PAYLOAD_SIGNATURE

#define REDFISH_HTTP_PAYLOAD_SIGNATURE   SIGNATURE_32 ('r', 'f', 'p', 'l')

Definition at line 18 of file RedfishHttpData.h.

◆ REDFISH_HTTP_SERVICE_SIGNATURE

#define REDFISH_HTTP_SERVICE_SIGNATURE   SIGNATURE_32 ('r', 'f', 's', 'v')

Definition at line 17 of file RedfishHttpData.h.

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.

◆ 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]JsonObjPointer to JSON object.
Return values
REDFISH_PAYLOAD_PRIVATENewly created payload.
NULLError occurs.

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.

◆ 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.

◆ 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.