From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.51]) by mx.groups.io with SMTP id smtpd.web10.21544.1658936907352338259 for ; Wed, 27 Jul 2022 08:48:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=t3fm1JlO; 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.223.51, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SP+q6YeMREkMjCQz8OJxWX5YKcPzSTX8RvzDykI9wmHd8n0zQlylnCszhtAU2QoJmbarueHTm+qQADWU6s4E8NdQLpDXSHFSULDMfp9xrWW9+OiHdWCdyJTQiy6jN18InKhN6vwF/HNhG9VjaAeBjyweqqiVYIPfqgMSuLgwscr+8dyVc1wV9a8gJc7gIUm1ZY/bB0j/aEx+1Cmuk7D5RDFYBbZO46tP5QOp4lSlgFSW/ypiaqwPV/oOXxNgBBlhvI8munNq4pLVH4WkvCVH5sKJHtEbhZM4VTn4C1M9L5oiHby5RBFwt85Ogpe39dPajLqDQpekeicx4fQz8EnyYQ== 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=zTm5ms7otuYQTQ9Wrf8s15GcvIW553DXnL0n2i5onZQ=; b=jOEyxpHEdVRb8V+ihiCH/0fVUKrZ2n3oWvPv9LsvGf5exvNh6VuNbRlMC81KC/DFKBib7WbhZ7ce6eY5c43qqlHwiv9KHqLmh58OMRbW/zacY/KpnzyOarfAzmUsADailE3XK/gm8ODUwLk/jVkpz1o5yQP33EKw0dglkYanCmfs4F+lqPqWnNKhejMGV9Oh77spZvv8x918Mc8v34Od7OM4YHtPoZvLm4rNewDuvfMt3cpW0JTWHYmHeyD4j2yoYOdiscowm51tY0qO2ySR0hXaLr9RKJfITXbA7eFvoE0ZhTGo71Yr0RexOmMxONdoAuGl0oDhXjelt1RieR/KxA== 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=zTm5ms7otuYQTQ9Wrf8s15GcvIW553DXnL0n2i5onZQ=; b=t3fm1JlO3kifJXA4PQ1IzUSb0FLj0Hw/3MewHQ8hAhqnY986vc/R/G4c6QvtSXcwFRGMFggeyigzw123fxfz6EQuN2XdwcqSZrZysQgRiUkDqlI9bxIIjasu7NuWvm5zwxbbL6F4W8Lp5Vqj/u2TZAYXdP7gZXAFRdSt4PVholI= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by BYAPR12MB3159.namprd12.prod.outlook.com (2603:10b6:a03:134::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.6; Wed, 27 Jul 2022 15:48:24 +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.025; Wed, 27 Jul 2022 15:48:24 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: "Yang, Atom" , Nick Ramirez Subject: Re: [edk2-staging][PATCH v3 05/15] edk2-staging/RedfishClientPkg: Introduce resource identify library Thread-Topic: [edk2-staging][PATCH v3 05/15] edk2-staging/RedfishClientPkg: Introduce resource identify library Thread-Index: AQHYoVmLB0slBmGjNU6T3Tg/67xq2a2SXcxA Date: Wed, 27 Jul 2022 15:48:24 +0000 Message-ID: References: <20220727013802.247-1-nickle.wang@hpe.com> <20220727013802.247-6-nickle.wang@hpe.com> In-Reply-To: <20220727013802.247-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-27T15:48:21Z; 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=b52171ea-e64b-4ffe-b806-7ff02186b89c; 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: f006a03f-42c4-4814-3ff6-08da6fe7709b x-ms-traffictypediagnostic: BYAPR12MB3159:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: D9Q5NJGco5yGK/BJrcPyMtl1GBUBPCsRX//2CIEsVkExcK2KKlEnKmuoStShYJbWkAuznxDFxlmEikKW++PtyKrKRzuRxhgGCSj/WpQB8sxqiCnmx1u8ymS86Mr13dh860W5ZifuE+OyVpi4bsYU1iqp2xe+oWecKZwHZ5CKzngTjHCJhUnGFx0k0ImIX7TtEMcd/JCpEsMAV1zusoklWS2c6xdVKY+rujQuV1KlyuhJi8hCCOculA66LyrWQcjMZGrooAYcBoeI0hNJzvsMIKgVi8CQPjNqByNS+ZSepgHZUcTRPzS1ybSoUlbSVHB1QW7Ap/1RvjXXqj9rrtXIKWsUQSArA0ZKJzIgs9I3Nu15D3lzS0uQETR2bYUfWWo13UinV40Ig7jEs95+qHdHmsRxge3sz80QIF+dRLABnNnPlCUvG3Ewhx9rQCjXWlKFyQlYkNcvn0HEYQVg7Q7pdz4gGQZDxEf5YhKxMvwJP4+wX5Q8C+OMmQAhnJZbA7pvNR5LyHur2tMKOUe25ubf8SJK48sN32vDkQhXZ+bVOYhO4xW/Uk7gTEDl+Vo6dPkV3JUindFDnR6FkQeF1Cnn1Gjnpec7P6mX0Ans6WKyjmChkU5tXLjLjP6J5+r8kY0cmjwzW1OGhygZgCMfQZO8q/yF4dfEb1W+ae6xybuE/+getFlXMG7q1+fvBil7j4laa5oA8MLIy8g5WuHZba7McCYW3FnCvzkOrXFDpchBY+49bPOK6qbSyOUDscexPR97uWocz0GtjQ3mRI789VB33ak6E3UuEMD2zSE1g1nRlc9wqm69bBHVLKMey6xhK9p1 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)(136003)(396003)(376002)(39860400002)(366004)(346002)(38070700005)(122000001)(38100700002)(478600001)(53546011)(186003)(316002)(9686003)(6506007)(7696005)(41300700001)(296002)(19627235002)(54906003)(110136005)(66446008)(66556008)(66476007)(55016003)(86362001)(71200400001)(8936002)(52536014)(8676002)(30864003)(4326008)(66946007)(5660300002)(76116006)(83380400001)(2906002)(33656002)(64756008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?YZopJ7tDl9Jt8I4IjdISOjPPwxiMHbHoTL+PswTukqWUAXiTir5LiKP9jRBy?= =?us-ascii?Q?30kRMxa3zuMZOzmUzxRSlX2j5SBp3bouyqVG0yvEK7LVAszL5rYFEj0sDDJy?= =?us-ascii?Q?+sbQmmub0Wpii5mdHW5ZYgwtR0JfaoKmieEvt8GgsUrCAsZh9TTSPScr1pP1?= =?us-ascii?Q?ssraL1NA/WSa3s1AvAOW9ybG7L52zvwkNDGC8Jnvpr5yD4QYCu/ug9Y5HqQx?= =?us-ascii?Q?B9MuIg55KTUYsiX9RmYIwZYVbYnXuo3Qn8CdFuS0rL2DRJwlfJame5FlJhV/?= =?us-ascii?Q?t84t78e4kazjRe7u1I+0QzEKlv4mwNmeRb1k6a2JDyL0KyptbmCcHrknbTbO?= =?us-ascii?Q?5VCdh6+ew1yERVg7M2oJa654A+WlwwzbszZuRwh9W2aBhf1tOKmkzHSfxE/M?= =?us-ascii?Q?XHeGI8o8t1SAouOeL0HAAY5+4C3T/U/8crttrUtdnCrUcmy4xzZaNPD2q6dZ?= =?us-ascii?Q?2sVl/kJSyGAelMuhIZrjsKGYHUfWKJsjPlQOYJBfXijqCFOLGHf+GBjGpGR/?= =?us-ascii?Q?Crs9awOpJI/tMN1scjjosG0WHOVl4q6cf2/mtHyWh8XIyTvIy5ThYyhkuONS?= =?us-ascii?Q?yCyGNUCxyXUOBoW1cD0mLBqnwhP0CLDIrSDeg5R3pn83HjxO0GiKUr1+65OS?= =?us-ascii?Q?TVif7P1+Z+DXrNJnO8R+Y7OyctJknzPKq94+e+G0IeVV0t6hupwSpfyNNpOn?= =?us-ascii?Q?fZfpGCdY8Lp5Lym4mqG+wzDDLC+dl9QJBzt8uI674/LKXJ/82DvaqJkyRezt?= =?us-ascii?Q?kCQBVsz2rj3ATLSaYdp/6EkZCT4kbR6Y5yP/e86DY67p7/lCpWdfd85FqXWN?= =?us-ascii?Q?lg74PUwcUEV7ikkjJI+776v1YdmnvwfshdUdl3PtjFYSfnL7kpr1LeIfY5gj?= =?us-ascii?Q?jsZKpIYmrgMCYK7up2En29D8Kabcy8DMINT9E7wYJ12+w35joalPx7AEOSQF?= =?us-ascii?Q?oSja1BgxE2tORv2Bq4j5yjlk+wla1+XvGnIFnsRQw/7eIqaGRZlSHvl22GaZ?= =?us-ascii?Q?5rtZRuSA8AB0PdHtzycgsqbvxiIVCnsKZcGHxNscHcN6YEKRy2jrlLdLVOhH?= =?us-ascii?Q?4dMMdHPRNH9ABVLbIrC4/5noYF134C3miOvahVU+IssMfgpGz1+rGsnIFcD/?= =?us-ascii?Q?ZhrsRvfrT3xhD9FVOXOotAbf1TzfG7GlLYmZFH37Q3b32QAk5C0sJHEEMsu1?= =?us-ascii?Q?+T9QxDE/3d9y4VyV6StmpsyxWcsYxzf8KaRdhtDHV2HsH8FsvBVQr6Tx5NSc?= =?us-ascii?Q?DFa6iLj7iRHTrfwAofi7EGPl8HlNsRTPVtsRzrPkR20VzlqU3H2UecavlY/g?= =?us-ascii?Q?NG50uOTL2Kn+FfAQ9DJgPPltJ2PDD/ho8tNf7c+rDTVawFEYoE41wFOXeL74?= =?us-ascii?Q?C/dfwh3p/PFyMpRaaZsmO8qnOYpEjmiecwUiB7mWisfnPj9PIEf3sWdW0jhh?= =?us-ascii?Q?Yuuckeie1VuCYUlKZFbCYnL/UrRjIRVYY6JooJyv5Mih4XzRGQwbVLRm5/AE?= =?us-ascii?Q?J8ENZOh4zpXLKn0FU5W4QA2PVP5K/1WDilD0+5p4XmNOFcMnwASGOnhI+1Ox?= =?us-ascii?Q?A4McYkL2AZ0KXxfPyr0abZAr0NGmLUU6UOc5Z7qtmTkAhAjoCSNLjh9beDCd?= =?us-ascii?Q?RD1ugaUtVsiwV9rzZ+yVJo0=3D?= 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: f006a03f-42c4-4814-3ff6-08da6fe7709b X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2022 15:48:24.3385 (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: UFXsBIPYhmKS9CO6LU0fAVQP1CAl8F/7uHMH2U7a9bip7hOidOnhKuFjD3RNEEwRyiC37sYPxOjA4zA906D3kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3159 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Wednesday, July 27, 2022 9:38 AM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Yang, Atom > ; Nick Ramirez > Subject: [edk2-staging][PATCH v3 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 | 39 > +++++ > .../RedfishResourceIdentifyLibNull.c | 37 ++++ > .../RedfishResourceIdentifyLibNull.inf | 32 ++++ > RedfishClientPkg/RedfishClientLibs.dsc.inc | 2 +- > RedfishClientPkg/RedfishClientPkg.dec | 1 + > 7 files changed, 303 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..ae269b5849 > --- /dev/null > +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v > +++ 1_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 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 > 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..9164b229ba > --- /dev/null > +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishRes > +++ ourceIdentifyLibNull.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-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 > 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