From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web10.33283.1683640763615819058 for ; Tue, 09 May 2023 06:59:23 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=UaK+zwlU; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.236.41, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VE0CrVOL0s38RBsxuYfS3Z+q7vhl9E6g7oPDvCtDejpi05i/dQqKy9eC8WsLJufvlzivBu1/M35Y1gBcfwyVN/pMfSQ/OLhetbvRKYgH89ZiZeLCnR/1n0gDdth6FRWNXqs1hfn8AdPgvbXFI09mo9eUCi5TTiaVQtEyWFJjUjyWnXFqkO1zm7glTaJFHh79AMJdqbFl6tuapMLjNKRXt0PT2Mhmm/213lhhKPYv5LElwuzsbxxM2kUDztTuH9yD8XfTezIpqd2SekNR0qTyaGdocDWKPfnHQtLDz3HvV45lVSF+7Njs+Y8yKy8pZ8+aZNMNauLSDTF2Qu3OtCkB6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I7ArCpkdk3jINR/9xZZlFY9F44RirsnlPrKnj96O4mM=; b=n6Wn4jxLMppwC5NI4xoxzUJfiJyUnY+Gler50bjKTZkkyejWrVdXMxbxW6VxjEVxf57wHEliJ1s8GlO+U73/AsoSDmg+a3fVeXbDw2rrGBODj/SsSUMW1UDQ2bziuIK3t6XGJ+8lHODjBDX7mAFaAhNErubTTTES7xIWzZVFKu4R/F6alfyTGZyvo77rIagg6y5J97pY8S5fhs/bodQlD1Wd77+0TjlmZ3yQOpVF7LBRm9dC10dDFnM3TjrwgRRD7oNYc45H4aG8tbaMtEb2/zudEBY0df41LU0MxBiP+g4jJiqeKkDZENon1OO+oYEkvtxmL1vHaKbPSmeIwHsQXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I7ArCpkdk3jINR/9xZZlFY9F44RirsnlPrKnj96O4mM=; b=UaK+zwlUeh5GKL3l8Tzfwtj+QxS23r5jqE3dBhFvBWccRzwP6sMESqmYnlhIXE0zdEssEGrGjq6M5J8APFVYhjo/trC3D+PUuxzV+ZrRvhmI80QzBs8RmprsFHXBgjm+0YFcwwrv9p1vcbBLA2MSIZ3MFRRCeR0ol8UzEFGYFPzM8T3psiR/wY/ZCvCbzh48yLxMmfrBj5mBqIouTN5hTdB+F5mOMpYD4aw5sZtw8vgLakQIsHhlGXz4RO5qcfFcddHlrbab+UYHLFMhe0JYhdP9De3bSVb1wGp9Mm3cTRK5ZySsClxJ9tz8bItLOg1uV9J3wSaKqii9WkIAkiPSOQ== Received: from BN6PR17CA0048.namprd17.prod.outlook.com (2603:10b6:405:75::37) by MN2PR12MB4438.namprd12.prod.outlook.com (2603:10b6:208:267::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Tue, 9 May 2023 13:59:19 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:405:75:cafe::c8) by BN6PR17CA0048.outlook.office365.com (2603:10b6:405:75::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 13:59:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.18 via Frontend Transport; Tue, 9 May 2023 13:59:18 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 9 May 2023 06:59:11 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 9 May 2023 06:59:10 -0700 Received: from NV-CL38DL3.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 9 May 2023 06:59:10 -0700 From: "Nickle Wang" To: CC: Abner Chang , Igor Kulchytskyy Subject: [edk2-redfish-client][PATCH 5/6] RedfishClientPkg: Introduce resource identify library Date: Tue, 9 May 2023 21:59:09 +0800 Message-ID: <20230509135909.7223-1-nicklew@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Return-Path: nicklew@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT013:EE_|MN2PR12MB4438:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f550c3a-0789-4fa8-ab52-08db50959562 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SHOTBoEKK2LXTbevuUvhsxXe5fSHzmx6q4HLtWPmc6ye0hJCEsjnd47YJw2DrO4bHznkt4I8LMqKi/ttUcqgU9TD3bVtTqBTm2aLlZ+hb/MD9OJwYC0CggC+43k9e1Vk2a5dD9E176v8l9Dp3gtQRV9BdBavnVTfZXqI7p4wgPCT6cHJRYedcsk65YA9Aqd9bKrNij4+cIsgGt+P/N8Z1pagGkM/urvDCw8mwyeqL7a1bnTDIakzGhYVYRwuFLiJF4JGtq4RxRZ5kOwawY+sAnKbtkEnCI+KiuTtugNs01wa0Ry205VXas/9i2SmnExlerOKvO35Q/IvjDTcvDN/ciTog2Fo4PEC4TTcKRSBO8tK99794nBnVfnEYoueAmb24VVAb+zuoll8cmlVyibKrLgJ3y1yMHhJomqe2wS84ze32SOVvTi46hj5unPXKU/O0+rdSN3kt+OqBfsnJwYbIanJ1T4+N9tFcpprCYXsQkexxgashev8KPygQk6bixOnUECaQXAf8T2K9F8Mu0nQjIQp6X6MxOEtYKu+WQyDDucD53fxXEEp7AUXmPR7YVhURZJSnKstV6YbJPKVFMiWJQv0IG1QSMwgNSgMJcYlSDN0JvfSASH/be7PafXrkUDZLVIq8xZoR/dvrBna578dBn0gXMtgNIjTKRfBzfg/r8MyDVTqHbbxG6oVY2XFCWk+fPkeW+KtFshbyzVI/TWdlQ== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199021)(36840700001)(40470700004)(46966006)(83380400001)(47076005)(2616005)(426003)(336012)(478600001)(36860700001)(86362001)(40480700001)(1076003)(26005)(7696005)(82740400003)(356005)(316002)(7636003)(54906003)(4326008)(70586007)(70206006)(6916009)(186003)(41300700001)(8676002)(8936002)(5660300002)(2906002)(30864003)(40460700003)(82310400005)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2023 13:59:18.7803 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f550c3a-0789-4fa8-ab52-08db50959562 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4438 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Introduce resource identify library which works with resource config protocol to identify Redfish resource. This library provides the flexibility for platform to implement its own policy and identify resource. Two library implementation are provided as demonstration code. NULL version of library accepts all Redfish resource and another implementation to computer system resource uses UUID to identify Redfish resource. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy --- RedfishClientPkg/RedfishClientPkg.dec | 1 + RedfishClientPkg/RedfishClientLibs.dsc.inc | 2 +- ...edfishResourceIdentifyLibComuterSystem.inf | 39 +++++ .../RedfishResourceIdentifyLibNull.inf | 32 ++++ .../Library/RedfishResourceIdentifyLib.h | 29 ++++ .../RedfishResourceIdentifyLibComuterSystem.c | 163 ++++++++++++++++++ .../RedfishResourceIdentifyLibNull.c | 37 ++++ 7 files changed, 302 insertions(+), 1 deletion(-) create mode 100644 RedfishClientPkg/Library/RedfishResourceIdentifyLibComu= terSystem/v1_5_0/RedfishResourceIdentifyLibComuterSystem.inf create mode 100644 RedfishClientPkg/Library/RedfishResourceIdentifyLibNull= /RedfishResourceIdentifyLibNull.inf create mode 100644 RedfishClientPkg/Include/Library/RedfishResourceIdentif= yLib.h create mode 100644 RedfishClientPkg/Library/RedfishResourceIdentifyLibComu= terSystem/v1_5_0/RedfishResourceIdentifyLibComuterSystem.c create mode 100644 RedfishClientPkg/Library/RedfishResourceIdentifyLibNull= /RedfishResourceIdentifyLibNull.c diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/Redfi= shClientPkg.dec index 9d18c42c..c61c5812 100644 --- a/RedfishClientPkg/RedfishClientPkg.dec +++ b/RedfishClientPkg/RedfishClientPkg.dec @@ -21,6 +21,7 @@ =20 [LibraryClasses] RedfishFeatureUtilityLib|Include/Library/RedfishFeatureUtilityLib.h + RedfishResourceIdentifyLib|Include/Library/RedfishResourceIdentifyLib.h EdkIIRedfishResourceConfigLib|Include/Library/EdkIIRedfishResourceConfig= Lib.h RedfishEventLib|Include/Library/RedfishEventLib.h RedfishVersionLib|Include/Library/RedfishVersionLib.h diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc b/RedfishClientPkg/= RedfishClientLibs.dsc.inc index 8acb4791..413b83a7 100644 --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc @@ -27,7 +27,7 @@ RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/Red= fishPlatformConfigLib.inf RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/R= edfishContentCodingLibNull.inf ConverterCommonLib|RedfishClientPkg/ConverterLib/edk2library/ConverterCo= mmonLib/ConverterCommonLib.inf - + RedfishResourceIdentifyLib|RedfishClientPkg/Library/RedfishResourceIdent= ifyLibNull/RedfishResourceIdentifyLibNull.inf EdkIIRedfishResourceConfigLib|RedfishClientPkg/Library/EdkIIRedfishResou= rceConfigLib/EdkIIRedfishResourceConfigLib.inf RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib= .inf RedfishVersionLib|RedfishClientPkg/Library/RedfishVersionLib/RedfishVers= ionLib.inf diff --git a/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSyst= em/v1_5_0/RedfishResourceIdentifyLibComuterSystem.inf b/RedfishClientPkg/Li= brary/RedfishResourceIdentifyLibComuterSystem/v1_5_0/RedfishResourceIdentif= yLibComuterSystem.inf new file mode 100644 index 00000000..ae269b58 --- /dev/null +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5= _0/RedfishResourceIdentifyLibComuterSystem.inf @@ -0,0 +1,39 @@ +## @file +# +# (C) Copyright 2022 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010006 + BASE_NAME =3D RedfishResourceIdentifyLibComuterSyst= em + FILE_GUID =3D 2AEE2C80-126A-44A6-877E-642F20510D13 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D RedfishResourceIdentifyLib| DXE_DRIVE= R + CONSTRUCTOR =3D RedfishResourceIdentifyComuterSystemC= onstructor + +# +# VALID_ARCHITECTURES =3D IA32 X64 EBC +# + +[Sources] + RedfishResourceIdentifyLibComuterSystem.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + NetworkPkg/NetworkPkg.dec + RedfishPkg/RedfishPkg.dec + RedfishClientPkg/RedfishClientPkg.dec + +[LibraryClasses] + BaseLib + DebugLib + UefiBootServicesTableLib + UefiLib + +[Protocols] + gEfiRestJsonStructureProtocolGuid ## CONSUMES diff --git a/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/Redfis= hResourceIdentifyLibNull.inf b/RedfishClientPkg/Library/RedfishResourceIden= tifyLibNull/RedfishResourceIdentifyLibNull.inf new file mode 100644 index 00000000..9164b229 --- /dev/null +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResour= ceIdentifyLibNull.inf @@ -0,0 +1,32 @@ +## @file +# +# (C) Copyright 2022 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010006 + BASE_NAME =3D RedfishResourceIdentifyLibNull + FILE_GUID =3D 6FFD4E25-48F8-4CB6-B194-CFAB407316E1 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D RedfishResourceIdentifyLib| DXE_DRIVE= R + +# +# VALID_ARCHITECTURES =3D IA32 X64 EBC +# + +[Sources] + RedfishResourceIdentifyLibNull.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishPkg/RedfishPkg.dec + RedfishClientPkg/RedfishClientPkg.dec + +[LibraryClasses] + BaseLib + DebugLib diff --git a/RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h = b/RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h new file mode 100644 index 00000000..254f9be3 --- /dev/null +++ b/RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h @@ -0,0 +1,29 @@ +/** @file + This file defines the Redfish resource identify Library interface. + + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef REDFISH_RESOURCE_IDENTIFY_LIB_H_ +#define REDFISH_RESOURCE_IDENTIFY_LIB_H_ + +/** + Identify resource from given URI and context in JSON format + + @param[in] Uri URI of given Redfish resource + @param[in] Json Context in JSON format of give Redfish resource + + @retval TRUE This is the Redfish resource that we have to handle. + @retval FALSE We don't handle this Redfish resource. + +**/ +BOOLEAN +RedfishIdentifyResource ( + IN EFI_STRING Uri, + IN CHAR8 *Json + ); + +#endif diff --git a/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSyst= em/v1_5_0/RedfishResourceIdentifyLibComuterSystem.c b/RedfishClientPkg/Libr= ary/RedfishResourceIdentifyLibComuterSystem/v1_5_0/RedfishResourceIdentifyL= ibComuterSystem.c new file mode 100644 index 00000000..a15809ef --- /dev/null +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5= _0/RedfishResourceIdentifyLibComuterSystem.c @@ -0,0 +1,163 @@ +/** @file + Redfish resource identify library implementation for computer system ver= sion 1.5.0 + + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +EFI_REST_JSON_STRUCTURE_PROTOCOL *mJsonStructProtocol =3D NULL; + +/** + Identify resource from given URI and context in JSON format + + @param[in] Uri URI of given Redfish resource + @param[in] Json Context in JSON format of give Redfish resource + + @retval TRUE This is the Redfish resource that we have to handle. + @retval FALSE We don't handle this Redfish resource. + +**/ +BOOLEAN +RedfishIdentifyResource ( + IN EFI_STRING Uri, + IN CHAR8 *Json + ) +{ + EFI_STATUS Status; + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0 *ComputerSystem; + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0_CS *ComputerSystemCs; + EFI_GUID SystemUuid; + EFI_GUID ResourceUuid; + + if (IS_EMPTY_STRING (Uri) || IS_EMPTY_STRING (Json)) { + return FALSE; + } + + if (mJsonStructProtocol =3D=3D NULL) { + return FALSE; + } + + ComputerSystem =3D NULL; + ComputerSystemCs =3D NULL; + + Status =3D mJsonStructProtocol->ToStructure ( + mJsonStructProtocol, + NULL, + Json, + (EFI_REST_JSON_STRUCTURE_HEADER **)&Comp= uterSystem + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __FUNCTION__, S= tatus)); + return FALSE; + } + + ComputerSystemCs =3D ComputerSystem->ComputerSystem; + + if (IS_EMPTY_STRING (ComputerSystemCs->UUID)) { + return FALSE; + } + + Status =3D AsciiStrToGuid (ComputerSystemCs->UUID, &ResourceUuid); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a, fail to get resource UUID: %r\n", __FUNCTION= __, Status)); + return FALSE; + } + + Status =3D NetLibGetSystemGuid (&SystemUuid); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a, fail to get system UUID from SMBIOS: %r\n", = __FUNCTION__, Status)); + return FALSE; + } + + DEBUG ((REDFISH_DEBUG_TRACE, "%a, Identify: System: %g Resource: %g\n", = __FUNCTION__, &SystemUuid, &ResourceUuid)); + if (CompareGuid (&ResourceUuid, &SystemUuid)) { + Status =3D EFI_SUCCESS; + } else { + Status =3D EFI_UNSUPPORTED; + } + + mJsonStructProtocol->DestoryStructure ( + mJsonStructProtocol, + (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem + ); + + return (Status =3D=3D EFI_SUCCESS ? TRUE : FALSE); +} + +/** + Callback function when gEfiRestJsonStructureProtocolGuid is installed. + + @param[in] Event Event whose notification function is being invoked. + @param[in] Context Pointer to the notification function's context. +**/ +VOID +EFIAPI +RestJasonStructureProtocolIsReady ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + + if (mJsonStructProtocol !=3D NULL) { + return; + } + + Status =3D gBS->LocateProtocol ( + &gEfiRestJsonStructureProtocolGuid, + NULL, + (VOID **)&mJsonStructProtocol + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a, failed to locate gEfiRestJsonStructureProtoc= olGuid: %r\n", __FUNCTION__, Status)); + } + + gBS->CloseEvent (Event); +} + +/** + + Install JSON protocol notification + + @param[in] ImageHandle The image handle. + @param[in] SystemTable The system table. + + @retval EFI_SUCEESS Install Boot manager menu success. + @retval Other Return error status. + +**/ +EFI_STATUS +EFIAPI +RedfishResourceIdentifyComuterSystemConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + VOID *Registration; + + EfiCreateProtocolNotifyEvent ( + &gEfiRestJsonStructureProtocolGuid, + TPL_CALLBACK, + RestJasonStructureProtocolIsReady, + NULL, + &Registration + ); + + return EFI_SUCCESS; +} diff --git a/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/Redfis= hResourceIdentifyLibNull.c b/RedfishClientPkg/Library/RedfishResourceIdenti= fyLibNull/RedfishResourceIdentifyLibNull.c new file mode 100644 index 00000000..42ee1a15 --- /dev/null +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResour= ceIdentifyLibNull.c @@ -0,0 +1,37 @@ +/** @file + Redfish resource identify NULL library implementation + + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include + +/** + Identify resource from given URI and context in JSON format + + @param[in] Uri URI of given Redfish resource + @param[in] Json Context in JSON format of give Redfish resource + + @retval TRUE This is the Redfish resource that we have to handle. + @retval FALSE We don't handle this Redfish resource. + +**/ +BOOLEAN +RedfishIdentifyResource ( + IN EFI_STRING Uri, + IN CHAR8 *Json + ) +{ + if (!IS_EMPTY_STRING (Uri)) { + DEBUG ((DEBUG_VERBOSE, "%a, accept resource: %s\n", __FUNCTION__, Uri)= ); + } + + return TRUE; +} --=20 2.17.1