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

Go to the source code of this file.

Macros

#define DEBUG_REDFISH_NETWORK   DEBUG_MANAGEABILITY
 Debug error level for Redfish networking function.
 
#define DEBUG_REDFISH_HOST_INTERFACE   DEBUG_MANAGEABILITY
 Debug error level for Redfish Host INterface.
 
#define DEBUG_REDFISH_PLATFORM_CONFIG   DEBUG_MANAGEABILITY
 Debug error level for Redfish Platform Configure Driver.
 
#define DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE   0x00000001
 
#define DEBUG_REDFISH(DebugCategory, ...)
 

Functions

BOOLEAN DebugRedfishComponentEnabled (IN UINT64 DebugCategory)
 
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 DumpRedfishResponse (IN CONST CHAR8 *Message, IN UINTN ErrorLevel, IN REDFISH_RESPONSE *Response)
 
EFI_STATUS DumpHttpStatusCode (IN UINTN ErrorLevel, IN EFI_HTTP_STATUS_CODE HttpStatusCode)
 
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

This file defines the Redfish debug library interface.

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

Macro Definition Documentation

◆ DEBUG_REDFISH

#define DEBUG_REDFISH (   DebugCategory,
  ... 
)
Value:
do { \
if (!DebugPrintEnabled()) { \
break; \
} \
if (!DebugRedfishComponentEnabled (DebugCategory)) { \
break; \
} \
DEBUG ((DEBUG_MANAGEABILITY, ##__VA_ARGS__)); \
} while (FALSE)
BOOLEAN EFIAPI DebugPrintEnabled(VOID)
Definition: DebugLib.c:281
#define FALSE
Definition: Base.h:307
BOOLEAN DebugRedfishComponentEnabled(IN UINT64 DebugCategory)

Definition at line 34 of file RedfishDebugLib.h.

◆ DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE

#define DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE   0x00000001

Definition at line 32 of file RedfishDebugLib.h.

◆ DEBUG_REDFISH_HOST_INTERFACE

#define DEBUG_REDFISH_HOST_INTERFACE   DEBUG_MANAGEABILITY

Debug error level for Redfish Host INterface.

Definition at line 24 of file RedfishDebugLib.h.

◆ DEBUG_REDFISH_NETWORK

#define DEBUG_REDFISH_NETWORK   DEBUG_MANAGEABILITY

Debug error level for Redfish networking function.

Definition at line 23 of file RedfishDebugLib.h.

◆ DEBUG_REDFISH_PLATFORM_CONFIG

#define DEBUG_REDFISH_PLATFORM_CONFIG   DEBUG_MANAGEABILITY

Debug error level for Redfish Platform Configure Driver.

Definition at line 25 of file RedfishDebugLib.h.

Function Documentation

◆ DebugRedfishComponentEnabled()

BOOLEAN DebugRedfishComponentEnabled ( IN UINT64  RedfishDebugCategory)

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

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

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.