From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.77]) by mx.groups.io with SMTP id smtpd.web08.1890.1658801056808897122 for ; Mon, 25 Jul 2022 19:04:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=1SLyEzEy; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.243.77, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i1srzKhcTFI8rsuYvavqzaaSVai1I/a+yNIsnm3h3s14N660GdRKQrQVlRoBF2POgZxsb5L1baFgRsS0GoAiOcqRn8m8p8hia/qWe8OeFOo1X24QcSueEsmUB0Zhd8swZDOi3b89WvboEGFhEuyJbkMfouFZjkHRU7xZjqOVmYzmsfspAHFsO5Pxi9DF7eakaVidjKut740pty+q/OTnzvi57Pu410nAMyynyHEB2qJf8oj3JCpt/DMzi4pNi4yDh3IJSfIpX8cuy2JdR/dNBnVGc82WEqWhEEkNbKmrUkS1oj/U8pPjLwk1M+L6FyBx2113OIHP96v2m8XDz8jtHA== 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=nGT0qqpn/ws6eq2j141gQl7goBsJ7v/wpXahFfxdsC8=; b=SXLQSWXFJeyftXu9CnDSBLGquu4y8hprxiGvEn2/NOsYdLjltQMd2MezHcCXaX6eRwb63UvKcrYTTpt8g2Xw3Wv6WKMI+FV58O+1LCDIWfWFSazZ511/Wv+P31X6uOgtHDxE0td7Op+U8REJaot88he1B3gBGHU45s5mvGVuzm1tCAz3mI6btHLlQHAzbdf1o4fSzC89CMfqP/9RaW544dr11V+98PjVnZAd40AQKYJ1jVYhx7lJxq1gPZ2T63KgrV/5+ilzU0XiHCwdqFRvj3chAip/PsanfOublX6H/TK6M/9BFl/zyOMDu6t2vpnHZClZ9h7Txio57H5laTi3dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nGT0qqpn/ws6eq2j141gQl7goBsJ7v/wpXahFfxdsC8=; b=1SLyEzEycY9nSmAzKgJhR4zM1qqMNLZEuE/Y6l6mQwwkgFJPXqJqpiyvkRstE2BwjE6vkfpeAIlpdaN4uWFmBwg3zBu5TYSsfnsVpTpfGo9LlAtvsHg6ehPSndOf3Hu1+PXBxb+Fo+JtkoqYlSt47PfuhvDmrndB2ui+M+6zYQI= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by BYAPR12MB4981.namprd12.prod.outlook.com (2603:10b6:a03:10d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.21; Tue, 26 Jul 2022 02:04:12 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::605a:11f4:fc16:8b06]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::605a:11f4:fc16:8b06%5]) with mapi id 15.20.5458.024; Tue, 26 Jul 2022 02:04:12 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: "Yang, Atom" , Nick Ramirez Subject: Re: [edk2-staging][PATCH v2 05/15] edk2-staging/RedfishClientPkg: Introduce resource identify library Thread-Topic: [edk2-staging][PATCH v2 05/15] edk2-staging/RedfishClientPkg: Introduce resource identify library Thread-Index: AQHYn8bq7pHlN9qBZkGOaBfB6VU6/q2P574w Date: Tue, 26 Jul 2022 02:04:12 +0000 Message-ID: References: <20220725013555.926-1-nickle.wang@hpe.com> <20220725013555.926-6-nickle.wang@hpe.com> In-Reply-To: <20220725013555.926-6-nickle.wang@hpe.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-07-26T02:04:09Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=60e5eafa-2196-4e58-8182-b849ac3de49c; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 26482bb4-26a2-4284-136b-08da6eab22b4 x-ms-traffictypediagnostic: BYAPR12MB4981:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w6sxjC/+Fq0y2s89zQxBpsVdH/8BOx0xZrHMQqU0Dh4ixOvyNr+mzBgyrWtktnLjfGB7y6j7qlc93WL/1TNtY0K7zaLmcbPY7U37tX1JnzrzqBYPRrQxNNpQEkaH2zwiNZKT9BXPs50PjYArRMLckAL5B6NJoB34wmQlhPy4fL8wQlnt9tDwBzUeQi/tVineDcAyEO5CHQghCPbENLlJx/EAj3W7gzdGCQL0Zk9yogT1J+xEfr3bc5WJTVKzuhZOfG4+08jYevnYi2sxph85yaZYosdcdpum0Ip8G74aOd4Dd/+GI3vgPlTnaRecL52WvOF2bLdmt2p6XrA174vjoHiHvPWCEhF3aR6CNOi3xRhUyRFI7CYLzhkdR7/2bWrUDNbQTDsQKjDz4dld1AiSZmZxZg8AQ25pR+JqoVyoe2G7d1QqeYJdV2UFAldOoHFCW+SNeQ9Rn10iYc9RX94n3fgPgvqtR4WOGuozpnQH4LMj4T7hYJkNWdgF+Qyj/pKtFU7pv2vunH1F9DomzkcMnZWzc19O741ArO8eIW5eEeNcSeY7drG61/7zm/Wz6awYp3WQbjsXrsI721cj/fQOiUVnNZasi59QC73sj7ASBHeELCOZwgyCouFXZrnF/SWO8QX6GC/sKKB6n90taemsBvaXD2uNCk6CdB6PtYfVat9CWi41LDNzQp6QnXzmLX6LbTBpv3O5eN7FktNE2N6wPqpTUsmFqOt1Hzm/Kl/5jpP++TKzjn2tR4L9ybn0Z3IgEuAchfhrX+JsAjj1hTU0Hdd1jpPxrPy0kNjCxk1lS+BaJ3tAdBZ5zR6J5o90mRlK x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(136003)(39860400002)(396003)(376002)(366004)(66446008)(186003)(66476007)(54906003)(110136005)(4326008)(76116006)(64756008)(66946007)(8676002)(66556008)(6506007)(7696005)(9686003)(53546011)(2906002)(83380400001)(30864003)(41300700001)(55016003)(38070700005)(86362001)(38100700002)(71200400001)(33656002)(52536014)(122000001)(5660300002)(296002)(316002)(19627235002)(478600001)(8936002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iGDP5VvNIgogXxVm6sT/yXG110HGsdeLTMQJkikJHuIUnPGo8rRpcH3jkHSi?= =?us-ascii?Q?U861Tr6Ko6jcKtJ9fahhYXtBrhro64Uo6z9pVRdRkWWVW3S07P09nzanPW+i?= =?us-ascii?Q?dpFeLylt3E4OOOt6hmF+qTiGieJLBDf047wdzyRp4s0MAT01m96qaTw45mAT?= =?us-ascii?Q?eEnoaC5kPXNBe2h/nfySD0wIcXw2yjf/v/Atx7mDxYGAupprQB2Z++OZp8RD?= =?us-ascii?Q?+dPo4GoU1K/ssQLuxYQxGua9mmfUWeJCzexSS4j+wPjGf4byUZ9fP9HM/6tI?= =?us-ascii?Q?qNjKi21ApV6FaD9w3ikIOxNcfeTzJAWbNMJ6qXSpK8+dTB3mVA4nwsEJc/VB?= =?us-ascii?Q?3y8CpK4qB91LmOiMKDPK3axin1UT9ZyTCXq+CxR2AKQoLSzxicMRoSfIn4wT?= =?us-ascii?Q?Mv5SDOR3G0wu4jx7SR/Ih3lfLAQKt8CFGd7uiKh8euDqAdZVHmSCg9U8qSgM?= =?us-ascii?Q?hTDDRWPC1y3d1WrUwBbD4ztizFPPf0lBYa7Ekbmr9UN0Rd4X5hHsXPLdiixn?= =?us-ascii?Q?uiRjqNGqKsQuN2cd/O3D81E7DmbNNlkBJoSZmDaROAnIXCoFYNjKDksBSIhN?= =?us-ascii?Q?8DCLbQPf+Fj5CIok3JrVyACdR3PlqBBCv4FHmjJkfpL7A96oBkfFYLyOhK1S?= =?us-ascii?Q?WExkrj6R6AP+WgLYnU2VTp+5kGlpDSlB1eg6MLfNe6T1HSGALiP4fyorkIwq?= =?us-ascii?Q?b2tv/du8El5mSEWlpXBZGFjHxgjdPq9gb1QCZ060YmB4AHLmtYcwqMMLyBfO?= =?us-ascii?Q?8QElDKBXv2NwfKzUDCYMLlb2Ygiv05FyZWdeiSGAILqVV6rW+bX6KZ3T7Ag4?= =?us-ascii?Q?SRKmdYGUuy6e3tQ4omv1NHjXz7h0N01HE7kaUO/NBIiMUd3fqYpWV8PS4Eem?= =?us-ascii?Q?HA89LimDOvl0ObasCu77jlVd0ZniTWGWVhyZX4rQ4FWlfjfkb5a3odSE3HiY?= =?us-ascii?Q?U9QVH9wu8UKRHaXiv/EEwZJzICIaB4yPPuYUU+x36ec1XRba2USBxZvHcH9Y?= =?us-ascii?Q?2wWmWw0gEA2S6l8zsIo6Ot4q/y/3dhfHVUADlze64YfmaFfoUIphbAwSXxgq?= =?us-ascii?Q?LraSJkjiDUBDhN2Qb6lTSVyRWsxSPl7EWpb3LXAoBimN0MWhxZSWjD08mAmn?= =?us-ascii?Q?v9AbmXGD0xr6YdVITcLDJiKntcSGFt4K/nFEqd8kLYVg71p7RZOs/gYKPLpS?= =?us-ascii?Q?7OBeDZp174Goa+vKuJeBC5N4DrvYl41s3BwfiU3rOMaPevoVZlOaEizVUuqV?= =?us-ascii?Q?QlKUpbUcpZsMW4ON3IZCFvoVMeg/zKWAr56Qj38ib8YDmuiwm8dPmUwKyPU1?= =?us-ascii?Q?MmnJL3iqCwTkugakTHF8qo1nS5uiyvETZB6Ka6ejicdRO2x6o/ucNcb6NIfO?= =?us-ascii?Q?kDpgAS1FkrCbKUcNjjBV0D86snKkRR0AYAmvnCN2GVy45WIEFX/HlRVGHNvJ?= =?us-ascii?Q?Sh14RtlHl7vCFE68FLZnjdslQq50umMWxs29kqhmNCERVOuoYCid90zLND9O?= =?us-ascii?Q?FUm2upaeOC+LRFtdYcKZVMPgUaLeNy45DGjKjrkSD4sX3reKZb480UBW55j3?= =?us-ascii?Q?Z9D9eNx9yVaLdYHp3zo8ftbmga0cFtQ4g2rCi7Nx6d3b1gsaDLmwdqCvBzUz?= =?us-ascii?Q?L/UptA21Ef8EtZYss8uYV2lUWWKY2QOQ/vgmaViS2Ymo?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26482bb4-26a2-4284-136b-08da6eab22b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2022 02:04:12.6723 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vxlZWsKKZDzcYvApYbxRZMZlop9hMW8dN2sRAH/sJXKY8NQAyT8fd4HgawvOH1CwmTzyPLR9IJa7P52ssOw4RA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB4981 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Comment in-line. You can search [Chang, Abner] for the comment. > -----Original Message----- > From: Nickle Wang > Sent: Monday, July 25, 2022 9:36 AM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Yang, Atom > ; Nick Ramirez > Subject: [edk2-staging][PATCH v2 05/15] edk2-staging/RedfishClientPkg: > Introduce resource identify library >=20 > [CAUTION: External Email] >=20 > Introduce resource identify library which works with resource config prot= ocol to > identify Redfish resource. This library provides the flexibility for plat= form to > implement its own policy and identify resource. Two library implementatio= n are > provided as demonstration code. NULL version of library accepts all Redfi= sh > resource and another implementation to computer system resource uses UUID > to identify Redfish resource. >=20 > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Yang Atom > Cc: Nick Ramirez > --- > .../Library/RedfishResourceIdentifyLib.h | 29 ++++ > .../RedfishResourceIdentifyLibComuterSystem.c | 164 > ++++++++++++++++++ ...edfishResourceIdentifyLibComuterSystem.inf | 42 > +++++ > .../RedfishResourceIdentifyLibNull.c | 37 ++++ > .../RedfishResourceIdentifyLibNull.inf | 37 ++++ > RedfishClientPkg/RedfishClientLibs.dsc.inc | 2 +- > RedfishClientPkg/RedfishClientPkg.dec | 1 + > 7 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 > RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h > create mode 100644 > RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0/R= e > dfishResourceIdentifyLibComuterSystem.c > create mode 100644 > RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0/R= e > dfishResourceIdentifyLibComuterSystem.inf > create mode 100644 > RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResourceId= enti > fyLibNull.c > create mode 100644 > RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResourceId= enti > fyLibNull.inf >=20 > diff --git a/RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.= h > b/RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h > new file mode 100644 > index 0000000000..91d01b7d68 > --- /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 handl= e. > + @retval FALSE We don't handle this Redfish resource. > + > +**/ > +BOOLEAN > +RedfishIdentifyResource ( > + IN EFI_STRING Uri, > + IN CHAR8 *Json > + ); > + > +#endif > diff --git > a/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0= / > RedfishResourceIdentifyLibComuterSystem.c > b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0= / > RedfishResourceIdentifyLibComuterSystem.c > new file mode 100644 > index 0000000000..e5699f194c > --- /dev/null > +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v > +++ 1_5_0/RedfishResourceIdentifyLibComuterSystem.c > @@ -0,0 +1,164 @@ > +/** @file > + Redfish resource identify library implementation for computer system > +version 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 handl= e. > + @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 > **)&ComputerSystem > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __FUNCTION__, > Status)); > + 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 > + gEfiRestJsonStructureProtocolGuid: %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/RedfishResourceIdentifyLibComuterSystem/v1_5_0= / > RedfishResourceIdentifyLibComuterSystem.inf > b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0= / > RedfishResourceIdentifyLibComuterSystem.inf > new file mode 100644 > index 0000000000..862522cdf6 > --- /dev/null > +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v > +++ 1_5_0/RedfishResourceIdentifyLibComuterSystem.inf > @@ -0,0 +1,42 @@ > +## @file > +# > +# (C) Copyright 2022 Hewlett Packard Enterprise Development LP
# # > +SPDX-License-Identifier: BSD-2-Clause-Patent # ## > + > +[Defines] > + INF_VERSION =3D 0x00010006 > + BASE_NAME =3D RedfishResourceIdentifyLibComuterSy= stem > + FILE_GUID =3D 2AEE2C80-126A-44A6-877E-642F20510D1= 3 > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D RedfishResourceIdentifyLib| DXE_DRI= VER > + CONSTRUCTOR =3D > RedfishResourceIdentifyComuterSystemConstructor > + > +# > +# 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 > + > +[Pcd] > + > diff --git > a/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResource= Ide > ntifyLibNull.c > b/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResource= Ide > ntifyLibNull.c > new file mode 100644 > index 0000000000..98eb8fde47 > --- /dev/null > +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishRes > +++ ourceIdentifyLibNull.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 handl= e. > + @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; > +} > diff --git > a/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResource= Ide > ntifyLibNull.inf > b/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResource= Ide > ntifyLibNull.inf > new file mode 100644 > index 0000000000..092e180305 > --- /dev/null > +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishRes > +++ ourceIdentifyLibNull.inf > @@ -0,0 +1,37 @@ > +## @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-CFAB407316E= 1 > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D RedfishResourceIdentifyLib| DXE_DRI= VER > + > +# > +# 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 > + > +[Protocols] > + > +[Pcd] [Chang, Abner]=20 We can remove Protocol and Pcd section if we don need anything for them. Thanks. Abner > + > diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc > b/RedfishClientPkg/RedfishClientLibs.dsc.inc > index 8acb479170..413b83a732 100644 > --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc > +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc > @@ -27,7 +27,7 @@ >=20 > RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/Redf= ish > PlatformConfigLib.inf >=20 > RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/Re= d > fishContentCodingLibNull.inf >=20 > ConverterCommonLib|RedfishClientPkg/ConverterLib/edk2library/ConverterCo > mmonLib/ConverterCommonLib.inf > - > + > + RedfishResourceIdentifyLib|RedfishClientPkg/Library/RedfishResourceIde > + ntifyLibNull/RedfishResourceIdentifyLibNull.inf >=20 > EdkIIRedfishResourceConfigLib|RedfishClientPkg/Library/EdkIIRedfishResour= ce > ConfigLib/EdkIIRedfishResourceConfigLib.inf > RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventL= ib.inf >=20 > RedfishVersionLib|RedfishClientPkg/Library/RedfishVersionLib/RedfishVersi= onLi > b.inf > diff --git a/RedfishClientPkg/RedfishClientPkg.dec > b/RedfishClientPkg/RedfishClientPkg.dec > index 9d18c42c24..c61c581213 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 >=20 > EdkIIRedfishResourceConfigLib|Include/Library/EdkIIRedfishResourceConfigL= ib. > h > RedfishEventLib|Include/Library/RedfishEventLib.h > RedfishVersionLib|Include/Library/RedfishVersionLib.h > -- > 2.32.0.windows.2