TianoCore EDK2 master
|
Go to the source code of this file.
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.
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.
[in] | List | Target cache list to add. |
[in] | Uri | The URI string matching to this cache data. |
[in] | Response | HTTP response. |
EFI_SUCCESS | Cache data is added. |
Others | Fail to add cache data. |
Definition at line 571 of file RedfishHttpData.c.
REDFISH_RESPONSE * CloneRedfishResponse | ( | IN REDFISH_RESPONSE * | Response | ) |
This function clone input response and return to caller
[in] | Response | Response to clone. |
REDFISH_RESPONSE | * Response is cloned. |
NULL | Errors occur. |
Definition at line 336 of file RedfishHttpData.c.
EFI_STATUS CopyRedfishResponse | ( | IN REDFISH_RESPONSE * | SrcResponse, |
OUT REDFISH_RESPONSE * | DstResponse | ||
) |
This function copy the data in SrcResponse to DstResponse.
[in] | SrcResponse | Source Response to copy. |
[out] | DstResponse | Destination Response. |
EFI_SUCCESS | Response is copied successfully. |
Others | Error occurs. |
Definition at line 250 of file RedfishHttpData.c.
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.
[in] | Service | Pointer to Service instance. |
[in] | JsonValue | Pointer to JSON value. |
REDFISH_PAYLOAD_PRIVATE | Newly created payload. |
NULL | Error occurs. |
Definition at line 203 of file RedfishHttpData.c.
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.
[in] | Host | Host string. |
[in] | HostName | Hostname string. |
[in] | BasicAuth | Basic Authorization string. |
[in] | SessionToken | Session token string. |
[in] | RestEx | Rest EX protocol instance. |
REDFISH_PAYLOAD_PRIVATE | Newly created service. |
NULL | Error occurs. |
Definition at line 101 of file RedfishHttpData.c.
EFI_STATUS DeleteHttpCacheData | ( | IN REDFISH_HTTP_CACHE_LIST * | List, |
IN REDFISH_HTTP_CACHE_DATA * | Data | ||
) |
Delete a cache data by given cache instance.
[in] | List | Target cache list to be removed. |
[in] | Data | Pointer to the instance to be deleted. |
EFI_SUCCESS | Cache data is removed. |
Others | Fail to remove cache data. |
Definition at line 542 of file RedfishHttpData.c.
REDFISH_HTTP_CACHE_DATA * FindHttpCacheData | ( | IN LIST_ENTRY * | ListHeader, |
IN EFI_STRING | Uri | ||
) |
Search on given ListHeader for given URI string.
[in] | ListHeader | Target list to search. |
[in] | Uri | Target URI to search. |
REDFISH_HTTP_CACHE_DATA | Target cache data is found. |
NULL | No cache data with given URI is found. |
Definition at line 453 of file RedfishHttpData.c.
REDFISH_HTTP_CACHE_DATA * FindUnusedHttpCacheData | ( | IN LIST_ENTRY * | ListHeader | ) |
Search on given ListHeader and return cache data with minimum hit count.
[in] | ListHeader | Target list to search. |
REDFISH_HTTP_CACHE_DATA | Target cache data is returned. |
NULL | No cache data is found. |
Definition at line 494 of file RedfishHttpData.c.
REDFISH_HTTP_CACHE_DATA * NewHttpCacheData | ( | IN EFI_STRING | Uri, |
IN REDFISH_RESPONSE * | Response | ||
) |
Create new cache data.
[in] | Uri | The URI string matching to this cache data. |
[in] | Response | HTTP response. |
REDFISH_HTTP_CACHE_DATA | * Pointer to newly created cache data. |
NULL | No memory available. |
Definition at line 404 of file RedfishHttpData.c.
EFI_STATUS ReleaseCacheList | ( | IN REDFISH_HTTP_CACHE_LIST * | CacheList | ) |
Release all cache from list.
[in] | CacheList | The list to be released. |
EFI_SUCCESS | All cache data are released. |
EFI_INVALID_PARAMETER | CacheList is NULL. |
Definition at line 638 of file RedfishHttpData.c.
EFI_STATUS ReleaseHttpCacheData | ( | IN REDFISH_HTTP_CACHE_DATA * | Data | ) |
Release REDFISH_HTTP_CACHE_DATA resource
[in] | Data | Pointer to REDFISH_HTTP_CACHE_DATA instance |
EFI_SUCCESS | REDFISH_HTTP_CACHE_DATA is released successfully. |
EFI_INVALID_PARAMETER | Data is NULL |
Definition at line 371 of file RedfishHttpData.c.
EFI_STATUS ReleaseRedfishPayload | ( | IN REDFISH_PAYLOAD_PRIVATE * | Payload | ) |
This function release Redfish Payload.
[in] | Payload | Pointer to payload instance. |
EFI_SUCCESS | Payload is released. |
Others | Error occurs. |
Definition at line 170 of file RedfishHttpData.c.
EFI_STATUS ReleaseRedfishService | ( | IN REDFISH_SERVICE_PRIVATE * | Service | ) |
This function release Redfish Service.
[in] | Service | Pointer to service instance. |
EFI_SUCCESS | Service is released. |
Others | Error occurs. |
Definition at line 55 of file RedfishHttpData.c.
EFI_STATUS UpdateSessionToken | ( | IN REDFISH_SERVICE_PRIVATE * | Service, |
IN CHAR8 * | Token | ||
) |
This function update session token in Redfish Service.
[in] | Service | Pointer to service instance. |
[in] | Token | Session token. |
EFI_SUCCESS | Session token is updated. |
Others | Error occurs. |
Definition at line 24 of file RedfishHttpData.c.