1 | /** @file
|
---|
2 | This file defines the Redfish debug library interface.
|
---|
3 |
|
---|
4 | Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
---|
5 |
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 |
|
---|
8 | **/
|
---|
9 |
|
---|
10 | #ifndef REDFISH_DEBUG_LIB_H_
|
---|
11 | #define REDFISH_DEBUG_LIB_H_
|
---|
12 |
|
---|
13 | #include <Uefi.h>
|
---|
14 | #include <Library/HiiUtilityLib.h>
|
---|
15 | #include <Library/JsonLib.h>
|
---|
16 | #include <Library/RedfishLib.h>
|
---|
17 |
|
---|
18 | #include <Protocol/EdkIIRedfishPlatformConfig.h>
|
---|
19 |
|
---|
20 | #define DEBUG_REDFISH_NETWORK DEBUG_MANAGEABILITY ///< Debug error level for Redfish networking function
|
---|
21 | #define DEBUG_REDFISH_HOST_INTERFACE DEBUG_MANAGEABILITY ///< Debug error level for Redfish networking function
|
---|
22 |
|
---|
23 | /**
|
---|
24 | Debug print the value of StatementValue.
|
---|
25 |
|
---|
26 | @param[in] ErrorLevel DEBUG macro error level.
|
---|
27 | @param[in] StatementValue The statement value to print.
|
---|
28 |
|
---|
29 | @retval EFI_SUCCESS StatementValue is printed.
|
---|
30 | @retval EFI_INVALID_PARAMETER StatementValue is NULL.
|
---|
31 | **/
|
---|
32 | EFI_STATUS
|
---|
33 | DumpHiiStatementValue (
|
---|
34 | IN UINTN ErrorLevel,
|
---|
35 | IN HII_STATEMENT_VALUE *StatementValue
|
---|
36 | );
|
---|
37 |
|
---|
38 | /**
|
---|
39 | Debug print the value of RedfishValue.
|
---|
40 |
|
---|
41 | @param[in] ErrorLevel DEBUG macro error level.
|
---|
42 | @param[in] RedfishValue The statement value to print.
|
---|
43 |
|
---|
44 | @retval EFI_SUCCESS RedfishValue is printed.
|
---|
45 | @retval EFI_INVALID_PARAMETER RedfishValue is NULL.
|
---|
46 | **/
|
---|
47 | EFI_STATUS
|
---|
48 | DumpRedfishValue (
|
---|
49 | IN UINTN ErrorLevel,
|
---|
50 | IN EDKII_REDFISH_VALUE *RedfishValue
|
---|
51 | );
|
---|
52 |
|
---|
53 | /**
|
---|
54 |
|
---|
55 | This function dump the Json string in given error level.
|
---|
56 |
|
---|
57 | @param[in] ErrorLevel DEBUG macro error level
|
---|
58 | @param[in] JsonValue Json value to dump.
|
---|
59 |
|
---|
60 | @retval EFI_SUCCESS Json string is printed.
|
---|
61 | @retval Others Errors occur.
|
---|
62 |
|
---|
63 | **/
|
---|
64 | EFI_STATUS
|
---|
65 | DumpJsonValue (
|
---|
66 | IN UINTN ErrorLevel,
|
---|
67 | IN EDKII_JSON_VALUE JsonValue
|
---|
68 | );
|
---|
69 |
|
---|
70 | /**
|
---|
71 |
|
---|
72 | This function dump the status code, header and body in given
|
---|
73 | Redfish payload.
|
---|
74 |
|
---|
75 | @param[in] ErrorLevel DEBUG macro error level
|
---|
76 | @param[in] Payload Redfish payload to dump
|
---|
77 |
|
---|
78 | @retval EFI_SUCCESS Redfish payload is printed.
|
---|
79 | @retval Others Errors occur.
|
---|
80 |
|
---|
81 | **/
|
---|
82 | EFI_STATUS
|
---|
83 | DumpRedfishPayload (
|
---|
84 | IN UINTN ErrorLevel,
|
---|
85 | IN REDFISH_PAYLOAD Payload
|
---|
86 | );
|
---|
87 |
|
---|
88 | /**
|
---|
89 |
|
---|
90 | This function dump the status code, header and body in given
|
---|
91 | Redfish response.
|
---|
92 |
|
---|
93 | @param[in] Message Message string
|
---|
94 | @param[in] ErrorLevel DEBUG macro error level
|
---|
95 | @param[in] Response Redfish response to dump
|
---|
96 |
|
---|
97 | @retval EFI_SUCCESS Redfish response is printed.
|
---|
98 | @retval Others Errors occur.
|
---|
99 |
|
---|
100 | **/
|
---|
101 | EFI_STATUS
|
---|
102 | DumpRedfishResponse (
|
---|
103 | IN CONST CHAR8 *Message,
|
---|
104 | IN UINTN ErrorLevel,
|
---|
105 | IN REDFISH_RESPONSE *Response
|
---|
106 | );
|
---|
107 |
|
---|
108 | /**
|
---|
109 |
|
---|
110 | This function dump the HTTP status code.
|
---|
111 |
|
---|
112 | @param[in] ErrorLevel DEBUG macro error level
|
---|
113 | @param[in] HttpStatusCode HTTP status code
|
---|
114 |
|
---|
115 | @retval EFI_SUCCESS HTTP status code is printed
|
---|
116 |
|
---|
117 | **/
|
---|
118 | EFI_STATUS
|
---|
119 | DumpHttpStatusCode (
|
---|
120 | IN UINTN ErrorLevel,
|
---|
121 | IN EFI_HTTP_STATUS_CODE HttpStatusCode
|
---|
122 | );
|
---|
123 |
|
---|
124 | /**
|
---|
125 |
|
---|
126 | This function dump the IPv4 address in given error level.
|
---|
127 |
|
---|
128 | @param[in] ErrorLevel DEBUG macro error level
|
---|
129 | @param[in] Ipv4Address IPv4 address to dump
|
---|
130 |
|
---|
131 | @retval EFI_SUCCESS IPv4 address string is printed.
|
---|
132 | @retval Others Errors occur.
|
---|
133 |
|
---|
134 | **/
|
---|
135 | EFI_STATUS
|
---|
136 | DumpIpv4Address (
|
---|
137 | IN UINTN ErrorLevel,
|
---|
138 | IN EFI_IPv4_ADDRESS *Ipv4Address
|
---|
139 | );
|
---|
140 |
|
---|
141 | #endif
|
---|