From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.76]) by mx.groups.io with SMTP id smtpd.web11.16735.1683248129829541477 for ; Thu, 04 May 2023 17:55:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=LoOPCTCC; 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.100.76, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D1kCvj/xEGxYZFJDQTbtO3/H6pKyFbkJLsMdv9+Cqmt9cIurdjdEWkvOTh3nGwcBQIQHvYyR/V9jzyOyqRrCPYybkyCjklSGe1h0/wnTxHLRGJiCnq9Ew+iQ/R8gmowY+Hsyi/1/dlPOib4w+W8g8t8lyG5XP1WnqTFOAsWBkiSwrFtb8cGCFVM+MGfjYAPmYCFce6oiJoTOWsHXQuXfPUre7yhmCVYknNqgWxEuHV7G0ElMx9us0Ws46liamWC7rD9vyMifKMKkKKhol9hggNLEH62b4qsYKnoppwMu0WRI4hNRhV5rWiLvNYyRAKWVZ0xSyYpwQBdBBcZFSuWMaA== 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=uFk4zTlAlwj3n0u2nchEdiJIOODhHn9iSCEGwOBSy1g=; b=mgbk94PZUbGs4EFVrkU5YB6IU7VfJ3d+Qlrsnk/+v6Ttr93NlteNZU9TH7PUzVedw3Uzacg9u3U54DJ2mKUs7mk2Ghd80VHOIa6n/GVOkdLqXHmB2BnLGMyydye84Ljq0MAB1Ac0tyPco05HqhuGjMvCGDTHvHud1CSN/pMuyZ2d9NyGy7gG1xpBj/3Bak7SkmTvvKFaOqbfLfWAJ9yBlqvqRWAXHGzS2JZv5YiB8n+O9HxJPybhSr+Yxlz3QHENKqg0Ovs1R+5Ps8/c60gQ2OwQm0zOgV5wpsAjqLeu5ZW2yV92pNnJwAtDi4xkwhy2WNMYPSYAm/KYsKJ7A25OBg== 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=uFk4zTlAlwj3n0u2nchEdiJIOODhHn9iSCEGwOBSy1g=; b=LoOPCTCC2WkePnFhjpi/k9GZYhLyKcKHKFaeaM2etYAwzy6vvQHaysiTM4h6Fvtc5walXiW8wUi9V1VsSzfmeldS/vtQa1/wN5nWyDbiy6Je9z+fgIGrKzYNZRJSqjwHfmII9thgBQSohQO6gLo2kPoy0oKX3kC0cw68N4lOOsc= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by BL1PR12MB5207.namprd12.prod.outlook.com (2603:10b6:208:318::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.26; Fri, 5 May 2023 00:55:24 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::46f1:bdce:a4bc:29e3]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::46f1:bdce:a4bc:29e3%3]) with mapi id 15.20.6363.027; Fri, 5 May 2023 00:55:24 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-redfish-client][PATCH 1/8] RedfishClientPkg: Facilities of EDK2 Redfish Feature driver Env. Thread-Topic: [edk2-redfish-client][PATCH 1/8] RedfishClientPkg: Facilities of EDK2 Redfish Feature driver Env. Thread-Index: AQHZfpPNEt02sTzTcUWc1vCt6amhJ69K21ww Date: Fri, 5 May 2023 00:55:23 +0000 Message-ID: References: <20230504142144.16012-1-nicklew@nvidia.com> In-Reply-To: <20230504142144.16012-1-nicklew@nvidia.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=2023-05-05T00:55: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=a0b91f42-9630-4b96-b712-1741c751a931; 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-traffictypediagnostic: MN2PR12MB3966:EE_|BL1PR12MB5207:EE_ x-ms-office365-filtering-correlation-id: 8b4adad6-3309-40c4-6843-08db4d036886 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bCJzFNav7WYtHh9oDsZb2dxx5CGfFFudLyzMNzOCa5+aG76nCOGLfw7Mh+0VMOQfzR/YQ6x7ZiQKko+ahl4/IUwxFQ4Al9nfZGzKU+r+NrWu77kr6Bx4ZGeprvkA0eAV3sVJyXa5dfLe1mnBRrB90E+vJT6QinAC8S7hRq7ikowt701xAQVSKPUgWkzhWMTIwXEKBfgRy1oQoAoS4P260dvfh52xIlbsyt+V2e1PYjKQNrS2JYPyZpw1Gvo62OuV2bzBZZgMl2kWPxFC4girZk23Hpa0i31LS+QoI8S5qCe4jGf7COnsek3rSMOATHFeP1t6pu7Vwv2HIMG+qfLre0PpN9Tn53dzWUZ42K7qP6ilFvzFWT9dznV977pSZqkUCzWwBNORNEblBNxyUXjOMOckbKD5BCO1ykd/FImKp51iC6NBuitSKekTGJlYSIQUQYLvSdvBjmWfId7aDp79IiQEfEjyIbmoHa4EeKmW6A0wQpo35hpyB496PDeOGw0hWV9ejkXLMlg47HqOXu7DEAMcOW+n8OfUMrpkguDDSsVH0CEF9qz3f+mQrerEpumXSTU5Z/i2aZaH48SaizMPp+XA7dBaz9PN2EpeEiYSTV9N1XMu/hBsV8NiRWYQ/1FA 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:(13230028)(4636009)(376002)(136003)(39860400002)(396003)(346002)(366004)(451199021)(26005)(6506007)(53546011)(9686003)(186003)(110136005)(83380400001)(71200400001)(7696005)(316002)(55016003)(52536014)(5660300002)(33656002)(478600001)(30864003)(2906002)(4326008)(38100700002)(86362001)(41300700001)(38070700005)(8676002)(66476007)(122000001)(64756008)(8936002)(66946007)(76116006)(66446008)(66556008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?/Q5f2AtvKBQJ5yKVEb7xP9NYlq/j1pYenfUy2UsRztYuzI6F2x376PFMEIbm?= =?us-ascii?Q?kOJGlxpITF1xRobeKCPvnML1RS1XdZ4+HfgezDaSrrEG2PI8uD+50L61o6ay?= =?us-ascii?Q?dqxp6WVGDlTpbGsfzxYabyw23jB2c2yiStgJHc92L5EvEHwjdR1dVDIK/ktM?= =?us-ascii?Q?7drIxYRwdPAIfAiu4jFMhXwts/VKpIZtYZ4vETPP2e0yYbCo2KgfqQh+x4de?= =?us-ascii?Q?RwzKGGxlcOHeln1L6g28/QnxBk9QMCg3bTwDocy94kjBXImNIwrbPkdudUSq?= =?us-ascii?Q?dBR2wb23jEOG4QTFqlRIAF9UHIdLSeghrwss/qHOPJryOmSU/gaDQwrczxx/?= =?us-ascii?Q?oIJwmhUzLS+n7aOejvjQfdt9oRBx5bRSlGfrOz5vfcJM6xWcpn3w23Q58lrn?= =?us-ascii?Q?QIycDb6GOXvAjIm728EnWPIKhcp6Xpfxr0eex1KD2Fq3hA2KGc7o/SxaP0fz?= =?us-ascii?Q?7c+cDCyb/uScAvFidJjryzq3+zvMb8xxu7cmEkYcacfZWBXaDDI0XY6NgEpf?= =?us-ascii?Q?7jPk78JEXXxYo4HKz3A3E7eCCshWHLw9etjuvi/ETbTX5j2FBM5ZQhXcY24x?= =?us-ascii?Q?G5u/0VL7tT5a4B0F0CghMckfLEh1aknrUwlBCJbKP5A5XMwdMfw9m+WzP3K6?= =?us-ascii?Q?FcmMic3mBdbjvU3THYNb3Ce08L9JbMbWmFmA9UfQ3ZKjp2uOA3p4BTG3fJIS?= =?us-ascii?Q?alRxP7Z8IXnXe/bVb/S9+/vUo+TUmW/BrT/OfDHSPaNm2Ov3g6jyTBn071IE?= =?us-ascii?Q?BNTcfmiq5uNYc98jsnDoTBeDGHJPC0fbtxykhkVwkbOfFgBOh9M8DZLgBYZ1?= =?us-ascii?Q?hNYXisVPD/nVi+WoB6usEV1f4FWVF+t1RlVpATYrfJlZ/0zthW2jbGprNlBw?= =?us-ascii?Q?zyVK9nOGVXzSNyy5r5NJjxFo/lbJ++5CLT6M2zrcGVBbCkFH1ulddhMjIzr0?= =?us-ascii?Q?rnEq+WbR5fktaG9+a20RSRKQkXF5+bFKvfTZzwqPbDdrbcxX2ny3hsvTt8VX?= =?us-ascii?Q?CyfiF4uJlWE+g8nQP8TuQtrirBSe9S6tvRSBgUty3DSkEeegvJEjn/69DsyC?= =?us-ascii?Q?YNrcDDpZyBBLqPPWN7aYqGKyHXZ+FHwqHkITGNYYXwsEF/u3+47TFPD1IZ1f?= =?us-ascii?Q?E2kSy9nU/an9uUMN9kDCEXrhnXPe1e6y2A7nFhEIkueE4YDazFi8A3vsozkU?= =?us-ascii?Q?PfTAC90MY0hOIRR5Olx1v3KnX1DiVxzzP22i80ZXoQDfuPKPFG7AxZEscj3r?= =?us-ascii?Q?3H33PRglZjwMMDzGvnqj0s6UFzuDqEUCui1n/hWRVFOtepPE7stv5orX3sSj?= =?us-ascii?Q?Wdp6okI2QJaHgx8h6xEmEY9TSd1n27YalR27DWtfFmCc0KVI67t54fmzhwFC?= =?us-ascii?Q?ZKTqlxUSw+ND5IjNtC/Jh7MOSlDCc7WmaCEmsW3MwQEkt2vN2t/z4+355Thc?= =?us-ascii?Q?RgehH7qXQsOqKBBU9mBgJ2ObYM+gJaPfWBcWEXeXNiR6ZDayj5igcPDJqXXu?= =?us-ascii?Q?0Jkx4e32YCOrCVF1oBDP4TySdz6hYkb4XdYgHmQ730nlI+HFaH51qr5BeG95?= =?us-ascii?Q?2FnhyiF5JPr7HkjSDg4=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: 8b4adad6-3309-40c4-6843-08db4d036886 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2023 00:55:23.6426 (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: Fibt4UG84v0wPZx/sbi+YFvOVjM4nLgPb1XPH6yUmfHNQroegFyg7Cz2OC50DxUUvOe2q4UyuEu5mHArGlPl3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5207 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: Thursday, May 4, 2023 10:22 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > > Subject: [edk2-redfish-client][PATCH 1/8] RedfishClientPkg: Facilities of= EDK2 > Redfish Feature driver Env. >=20 > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. >=20 >=20 > Initial common header file and meta files for feature drivers. >=20 > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > --- > RedfishClientPkg/RedfishClientPkg.dec | 5 +- > .../Include/Guid/RedfishClientPkgTokenSpace.h | 20 +++ > .../EdkIIRedfishResourceConfigProtocol.h | 127 ++++++++++++++++++ > .../Include/RedfishCollectionCommon.h | 53 ++++++++ > .../Include/RedfishResourceCommon.h | 121 +++++++++++++++++ > 5 files changed, 325 insertions(+), 1 deletion(-) create mode 100644 > RedfishClientPkg/Include/Guid/RedfishClientPkgTokenSpace.h > create mode 100644 > RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfigProtocol.h > create mode 100644 RedfishClientPkg/Include/RedfishCollectionCommon.h > create mode 100644 RedfishClientPkg/Include/RedfishResourceCommon.h >=20 > diff --git a/RedfishClientPkg/RedfishClientPkg.dec > b/RedfishClientPkg/RedfishClientPkg.dec > index 8fa92d5b..11eab386 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dec > +++ b/RedfishClientPkg/RedfishClientPkg.dec > @@ -21,9 +21,12 @@ >=20 > [Protocols] > ## Include/Protocol/EdkIIRedfishFeature.h > - gEdkIIRedfishFeatureProtocolGuid =3D { 0x785CC694, 0x4930, 0xEFBF, { 0= x2A, > 0xCB, 0xA4, 0xB6, 0xA1, 0xCC, 0xAA, 0x34 } } > + gEdkIIRedfishFeatureProtocolGuid =3D { 0x785CC694, 0x4930, 0xEF= BF, > { 0x2A, 0xCB, 0xA4, 0xB6, 0xA1, 0xCC, 0xAA, 0x34 } } > + ## Include/Protocol/EdkIIRedfishResourceConfigProtocol.h > + gEdkIIRedfishResourceConfigProtocolGuid =3D { 0x6f164c68, 0xfb09, > + 0x4646, { 0xa8, 0xd3, 0x24, 0x11, 0x5d, 0xab, 0x3e, 0xe7 } } >=20 > [Guids] > + ## Include/Guid/RedfishClientPkgTokenSpace.h > gEfiRedfishClientPkgTokenSpaceGuid =3D { 0x8c444dae, 0x728b, 0x48ee= , > { 0x9e, 0x19, 0x8f, 0x0a, 0x3d, 0x4e, 0x9c, 0xc8 } } >=20 > [PcdsFixedAtBuild] > diff --git a/RedfishClientPkg/Include/Guid/RedfishClientPkgTokenSpace.h > b/RedfishClientPkg/Include/Guid/RedfishClientPkgTokenSpace.h > new file mode 100644 > index 00000000..7928e1a2 > --- /dev/null > +++ b/RedfishClientPkg/Include/Guid/RedfishClientPkgTokenSpace.h > @@ -0,0 +1,20 @@ > +/** @file > + GUID for RedfishClientPkg PCD Token Space > + > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef REDFISHCLIENTPKG_TOKEN_SPACE_GUID_H_ > +#define REDFISHCLIENTPKG_TOKEN_SPACE_GUID_H_ > + > +#define REDFISHCLIENTPKG_TOKEN_SPACE_GUID \ > + { \ > + 0x8c444dae, 0x728b, 0x48ee, { 0x9e, 0x19, 0x8f, 0x0a, 0x3d, 0x4e, > +0x9c, 0xc8 } \ > + } > + > +extern EFI_GUID gEfiRedfishClientPkgTokenSpaceGuid; > + > +#endif > diff --git > a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfigProtocol.h > b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfigProtocol.h > new file mode 100644 > index 00000000..814fa9f9 > --- /dev/null > +++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfigProtoc > +++ ol.h > @@ -0,0 +1,127 @@ > +/** @file > + This file defines the EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL > interface. > + > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef EDKII_REDFISH_RESOURCE_CONFIG_H_ #define > +EDKII_REDFISH_RESOURCE_CONFIG_H_ > + > +typedef struct _EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL > +EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL; > + > +/** > + Provising redfish resource by given URI. > + > + @param[in] This Pointer to > EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance. > + @param[in] Uri Target URI to create resource. > + @param[in] HttpPostMode TRUE if resource does not exist, HTTP > POST method is used. > + FALSE if the resource exist but some = of properties are > missing, > + HTTP PUT method is used. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI > *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_PROVISIONING)( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN CHAR8 *Uri, > + IN BOOLEAN HttpPostMode > + ); > + > +/** > + Consume resource from given URI. > + > + @param[in] This Pointer to > EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance. > + @param[in] Uri The target URI to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_CONSUME)( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN CHAR8 *Uri > + ); > + > +/** > + Update resource to given URI. > + > + @param[in] This Pointer to > EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance. > + @param[in] Uri The target URI to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_UPDATE)( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN CHAR8 *Uri > + ); > + > +/** > + Check resource on given URI. > + > + @param[in] This Pointer to > EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance. > + @param[in] Uri The target URI to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_CHECK)( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN CHAR8 *Uri > + ); > + > +// > +// definition of REDFISH_SCHEMA_INFO > +// > +#define REDFISH_SCHEMA_STRING_SIZE (FixedPcdGet32 > (PcdMaxRedfishSchemaStringSize)) > +#define REDFISH_SCHEMA_VERSION_SIZE (FixedPcdGet32 > +(PcdMaxRedfishSchemaVersionSize)) > + > +typedef struct _SCHEMA_INFO { > + CHAR8 Schema[REDFISH_SCHEMA_STRING_SIZE]; > + CHAR8 Major[REDFISH_SCHEMA_VERSION_SIZE]; > + CHAR8 Minor[REDFISH_SCHEMA_VERSION_SIZE]; > + CHAR8 Errata[REDFISH_SCHEMA_VERSION_SIZE]; > +} REDFISH_SCHEMA_INFO; > + > +/** > + Get information about this protocol. > + > + @param[in] This Pointer to > EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance. > + @param[out] Info The schema information. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_GET_INFO)( > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + OUT REDFISH_SCHEMA_INFO *Info > + ); > + > +struct _EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL { > + EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_PROVISIONING > Provisioning; > + EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_CONSUME Consume; > + EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_UPDATE Update; > + EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_CHECK Check; > + EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_GET_INFO GetInfo; > +}; > + > +extern EFI_GUID gEdkIIRedfishResourceConfigProtocolGuid; > + > +#endif > diff --git a/RedfishClientPkg/Include/RedfishCollectionCommon.h > b/RedfishClientPkg/Include/RedfishCollectionCommon.h > new file mode 100644 > index 00000000..b5735741 > --- /dev/null > +++ b/RedfishClientPkg/Include/RedfishCollectionCommon.h > @@ -0,0 +1,53 @@ > +/** @file > + Redfish feature driver collection common header file. > + > + (C) Copyright 2020-2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef EFI_REDFISH_COLLECTION_COMMON_H_ #define > +EFI_REDFISH_COLLECTION_COMMON_H_ > + > +// > +// Libraries > +// > +#include > +#include > +#include #include > +#include #include #include > + > +#include > +#include > + > +// > +// Protocols > +// > +#include > +#include > +#include #include > + #include > + > +#define IS_EMPTY_STRING(a) ((a) =3D=3D NULL || (a)[0] =3D=3D '\0') #def= ine > +REDFISH_DEBUG_TRACE DEBUG_INFO > + > +typedef struct _REDFISH_COLLECTION_PRIVATE { > + EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol; > + EDKII_REDFISH_FEATURE_PROTOCOL *FeatureProtocol; > + REDFISH_SERVICE RedfishService; > + EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL ConfigHandler; > + EFI_EVENT Event; > + CHAR8 *CollectionPath; > + CHAR8 *CollectionJson; > + REDFISH_PAYLOAD CollectionPayload; > + REDFISH_RESPONSE RedResponse; > +} REDFISH_COLLECTION_PRIVATE; > + > +#define REDFISH_COLLECTION_PRIVATE_DATA_FROM_PROTOCOL(This) \ > + BASE_CR ((This), REDFISH_COLLECTION_PRIVATE, ConfigHandler) > + > +#endif > diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h > b/RedfishClientPkg/Include/RedfishResourceCommon.h > new file mode 100644 > index 00000000..95e8004d > --- /dev/null > +++ b/RedfishClientPkg/Include/RedfishResourceCommon.h > @@ -0,0 +1,121 @@ > +/** @file > + Redfish feature driver common header file. > + > + (C) Copyright 2020-2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef EFI_REDFISH_RESOURCE_COMMON_H_ > +#define EFI_REDFISH_RESOURCE_COMMON_H_ > + > +#define MAX_RED_PATH_LEN 128 > +#define IS_EMPTY_STRING(a) ((a) =3D=3D NULL || (a)[0] =3D=3D '\0') #def= ine > +REDFISH_DEBUG_TRACE DEBUG_INFO > + > +// > +// Libraries > +// > +#include > +#include > +#include #include > +#include #include #include > + > +#include > +#include > +#include > + > +// > +// Protocols > +// > +#include > +#include > +#include #include > + > +typedef struct _REDFISH_RESOURCE_COMMON_PRIVATE { > + REDFISH_SERVICE RedfishService; > + EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol; > + EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL RedfishResourceConfig; > + EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL ConfigHandler; > + EFI_EVENT Event; > + CHAR8 *Uri; > + CHAR8 *Json; > + REDFISH_PAYLOAD Payload; > +} REDFISH_RESOURCE_COMMON_PRIVATE; > + > +#define > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCO > L(This) \ > + BASE_CR ((This), REDFISH_RESOURCE_COMMON_PRIVATE, > +ConfigHandler) > + > +#define > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTO > COL(This) \ > + BASE_CR ((This), REDFISH_RESOURCE_COMMON_PRIVATE, > +RedfishResourceConfig) > + > +/** > + Consume resource from given URI. > + > + @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > + @param[in] Json The JSON to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishConsumeResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN CHAR8 *Json > + ); > + > +/** > + Provisioning redfish resource by given URI. > + > + @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCO= L > instance. > + @param[in] ResourceExist TRUE if resource exists, PUT method w= ill be > used. > + FALSE if resource does not exist POST= method is used. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishProvisioningResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN BOOLEAN ResourceExist > + ); > + > +/** > + Check resource from given URI. > + > + @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > + @param[in] Json The JSON to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishCheckResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN CHAR8 *Json > + ); > + > +/** > + Update resource to given URI. > + > + @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > + @param[in] Json The JSON to consume. > + > + @retval EFI_SUCCESS Value is returned successfully. > + @retval Others Some error happened. > + > +**/ > +EFI_STATUS > +RedfishUpdateResourceCommon ( > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN CHAR8 *Json > + ); > + > +#endif > -- > 2.17.1