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

Go to the source code of this file.

Macros

#define REDFISH_JSON_STRING_LENGTH   200
 
#define REDFISH_JSON_OUTPUT_FORMAT   (EDKII_JSON_COMPACT | EDKII_JSON_INDENT(2))
 
#define REDFISH_PRINT_BUFFER_BYTES_PER_ROW   16
 

Functions

BOOLEAN DebugRedfishComponentEnabled (IN UINT64 RedfishDebugCategory)
 
EFI_STATUS DumpRedfishValue (IN UINTN ErrorLevel, IN EDKII_REDFISH_VALUE *RedfishValue)
 
EFI_STATUS DumpJsonValue (IN UINTN ErrorLevel, IN EDKII_JSON_VALUE JsonValue)
 
EFI_STATUS DumpRedfishPayload (IN UINTN ErrorLevel, IN REDFISH_PAYLOAD Payload)
 
EFI_STATUS DumpHttpStatusCode (IN UINTN ErrorLevel, IN EFI_HTTP_STATUS_CODE HttpStatusCode)
 
EFI_STATUS DumpRedfishResponse (IN CONST CHAR8 *Message, IN UINTN ErrorLevel, IN REDFISH_RESPONSE *Response)
 
EFI_STATUS DumpIpv4Address (IN UINTN ErrorLevel, IN EFI_IPv4_ADDRESS *Ipv4Address)
 
EFI_STATUS DumpBuffer (IN UINTN ErrorLevel, IN UINT8 *Buffer, IN UINTN BufferSize)
 

Detailed Description

Redfish debug library to debug Redfish application.

Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.

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

Definition in file RedfishDebugLib.c.

Macro Definition Documentation

◆ REDFISH_JSON_OUTPUT_FORMAT

#define REDFISH_JSON_OUTPUT_FORMAT   (EDKII_JSON_COMPACT | EDKII_JSON_INDENT(2))

Definition at line 21 of file RedfishDebugLib.c.

◆ REDFISH_JSON_STRING_LENGTH

#define REDFISH_JSON_STRING_LENGTH   200

Definition at line 20 of file RedfishDebugLib.c.

◆ REDFISH_PRINT_BUFFER_BYTES_PER_ROW

#define REDFISH_PRINT_BUFFER_BYTES_PER_ROW   16

Definition at line 22 of file RedfishDebugLib.c.

Function Documentation

◆ DebugRedfishComponentEnabled()

BOOLEAN DebugRedfishComponentEnabled ( IN UINT64  RedfishDebugCategory)

Determine whether the Redfish debug category is enabled in gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory.

Parameters
[in]RedfishDebugCategoryRedfish debug category.
Return values
TRUEThis debug category is enabled.
FALSEThis debug category is disabled..

Definition at line 34 of file RedfishDebugLib.c.

◆ DumpBuffer()

EFI_STATUS DumpBuffer ( IN UINTN  ErrorLevel,
IN UINT8 *  Buffer,
IN UINTN  BufferSize 
)

Debug output raw data buffer.

Parameters
[in]ErrorLevelDEBUG macro error level
[in]BufferDebug output data buffer.
[in]BufferSizeThe size of Buffer in byte.
Return values
EFI_SUCCESSDebug dump finished.
EFI_INVALID_PARAMETERBuffer is NULL.

Definition at line 349 of file RedfishDebugLib.c.

◆ DumpHttpStatusCode()

EFI_STATUS DumpHttpStatusCode ( IN UINTN  ErrorLevel,
IN EFI_HTTP_STATUS_CODE  HttpStatusCode 
)

This function dump the HTTP status code.

Parameters
[in]ErrorLevelDEBUG macro error level
[in]HttpStatusCodeHTTP status code
Return values
EFI_SUCCESSHTTP status code is printed

Definition at line 207 of file RedfishDebugLib.c.

◆ DumpIpv4Address()

EFI_STATUS DumpIpv4Address ( IN UINTN  ErrorLevel,
IN EFI_IPv4_ADDRESS Ipv4Address 
)

This function dump the IPv4 address in given error level.

Parameters
[in]ErrorLevelDEBUG macro error level
[in]Ipv4AddressIPv4 address to dump
Return values
EFI_SUCCESSIPv4 address string is printed.
OthersErrors occur.

Definition at line 323 of file RedfishDebugLib.c.

◆ DumpJsonValue()

EFI_STATUS DumpJsonValue ( IN UINTN  ErrorLevel,
IN EDKII_JSON_VALUE  JsonValue 
)

This function dump the Json string in given error level.

Parameters
[in]ErrorLevelDEBUG macro error level
[in]JsonValueJson value to dump.
Return values
EFI_SUCCESSJson string is printed.
OthersErrors occur.

Definition at line 117 of file RedfishDebugLib.c.

◆ DumpRedfishPayload()

EFI_STATUS DumpRedfishPayload ( IN UINTN  ErrorLevel,
IN REDFISH_PAYLOAD  Payload 
)

This function dump the status code, header and body in given Redfish payload.

Parameters
[in]ErrorLevelDEBUG macro error level
[in]PayloadRedfish payload to dump
Return values
EFI_SUCCESSRedfish payload is printed.
OthersErrors occur.

Definition at line 176 of file RedfishDebugLib.c.

◆ DumpRedfishResponse()

EFI_STATUS DumpRedfishResponse ( IN CONST CHAR8 *  Message,
IN UINTN  ErrorLevel,
IN REDFISH_RESPONSE Response 
)

This function dump the status code, header and body in given Redfish response.

Parameters
[in]MessageMessage string
[in]ErrorLevelDEBUG macro error level
[in]ResponseRedfish response to dump
Return values
EFI_SUCCESSRedfish response is printed.
OthersErrors occur.

Definition at line 268 of file RedfishDebugLib.c.

◆ DumpRedfishValue()

EFI_STATUS DumpRedfishValue ( IN UINTN  ErrorLevel,
IN EDKII_REDFISH_VALUE RedfishValue 
)

Debug print the value of RedfishValue.

Parameters
[in]ErrorLevelDEBUG macro error level.
[in]RedfishValueThe statement value to print.
Return values
EFI_SUCCESSRedfishValue is printed.
EFI_INVALID_PARAMETERRedfishValue is NULL.

Definition at line 54 of file RedfishDebugLib.c.