summaryrefslogtreecommitdiffstats
path: root/RedfishPkg/Include
diff options
context:
space:
mode:
authorNickle Wang <nicklew@nvidia.com>2023-07-24 21:03:04 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-07-26 00:49:45 +0000
commit25a6745fe886e88fe175a50dcab4562c65b7cea3 (patch)
tree6676bd04e95b6cbed85f7a7ce19c76a767ae9e3d /RedfishPkg/Include
parentdcf05f958eb409095bf330cf8b8f12fe4c940880 (diff)
downloadedk2-25a6745fe886e88fe175a50dcab4562c65b7cea3.tar.gz
edk2-25a6745fe886e88fe175a50dcab4562c65b7cea3.tar.bz2
edk2-25a6745fe886e88fe175a50dcab4562c65b7cea3.zip
RedfishPkg/RedfishDiscoverDxe: fix netmask check issue
- Add NTOHL() for coverting IP address from EFI_IPv4_ADDRESS to IP4_ADDR so that IP4_IS_VALID_NETMASK() return correct value. - Add DumpIpv4Address() in RedfishDebugLib and print IP address when invalid IP or subnet mask address is detected. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Igor Kulchytskyy <igork@ami.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
Diffstat (limited to 'RedfishPkg/Include')
-rw-r--r--RedfishPkg/Include/Library/RedfishDebugLib.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h b/RedfishPkg/Include/Library/RedfishDebugLib.h
index da7e0d0bc9..5f75bad12a 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -121,4 +121,21 @@ DumpHttpStatusCode (
IN EFI_HTTP_STATUS_CODE HttpStatusCode
);
+/**
+
+ This function dump the IPv4 address in given error level.
+
+ @param[in] ErrorLevel DEBUG macro error level
+ @param[in] Ipv4Address IPv4 address to dump
+
+ @retval EFI_SUCCESS IPv4 address string is printed.
+ @retval Others Errors occur.
+
+**/
+EFI_STATUS
+DumpIpv4Address (
+ IN UINTN ErrorLevel,
+ IN EFI_IPv4_ADDRESS *Ipv4Address
+ );
+
#endif