From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 42CB6740034 for ; Wed, 21 Feb 2024 01:42:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=FqVIik6DBu1uKGIWI/gbp22Q88sSPSe2OywOxWs4iYI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1708479743; v=1; b=daRzocS7XVZ1+n4YJbJGMCI1nrEiI0Nx2oSQhD8VAuU49Bk/vTJxWiQeMtKvM4OpeQVFcfsF h8Fxn8D6ZyRtWCDYOozaKDHCFXdvd3EAYhUmHImH7MqAcQlfmSYo8eyRk0qCDz2i1i8u+owVCOh g4vIL5gY0S4HNHzCC5w5zLQQ= X-Received: by 127.0.0.2 with SMTP id TiIfYY7687511xnTrT5vEsai; Tue, 20 Feb 2024 17:42:23 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.67]) by mx.groups.io with SMTP id smtpd.web10.3661.1708479742724103611 for ; Tue, 20 Feb 2024 17:42:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iNxbXU9cvPFTu2UwsOVO7OfZqi5ze2ge/NfV49ZO/9AFI3Hi7QZr/dhORH2kp384OODiz2OBrdSyutHad6P89YtNPX1Xj7tK6MvXfZDRar9gx+Hupk2MZ6577sPuusyv4KYvpkcYbtQLD5Z50MG7ttP0vxXG/TKI3C+gL4MoiGNc4dgEfPaSrZ1jNrLebKyZBT/2bE0xkuELNGAnAj+zDZnycSP7zwOElmUwW6h5ZOfrlJynaWHiDv1YqXyvjM1ijpeQQM3Qf4nShSf+Xxw5BG2ULumJoXECpYDECh6sqguEb/45y9Je+ey/rL6ouL+5Uf0OhLO8I1jYdSPfTo6Erg== 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=yOVWsQDB0MhQ1B9TGag5lMLWMHxvdnnhVG/o8fulCH4=; b=adpWQLblndn4CCxMhXfMuH8KKE0rrQt8pNEWZTFG62glxXlaktsMJPF93tVweEX1P6u6SgM4v0OXLIuzBs7pWii33FjZPzSx4y01Gr+YxcAIpBEoe05l9FpiTsrNNl8o2RZ2GigcNwYshBRUeweTz5FG9S0xVXuY00WmMNohK7cGSXk40R4Cli/y2YtG8Y3CuTiegfcoSEmUayZeyOkVOB6CNROffXWgZG08kLF7KOX7Y6ChQkxY3qAiIq8ggWFH9OYwsojWSbL/1HWkYPvIJSVGWQ6oixLmg1/CAtZwnJZWx0c0GpxnvtozeXHhxDVp1dXL5Xo4Y/eFixMgg1fTVA== 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 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com (2603:10b6:408:200::8) by BN9PR12MB5179.namprd12.prod.outlook.com (2603:10b6:408:11c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.20; Wed, 21 Feb 2024 01:42:19 +0000 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::bf3e:6aec:43a1:5ae1]) by LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::bf3e:6aec:43a1:5ae1%4]) with mapi id 15.20.7316.018; Wed, 21 Feb 2024 01:42:19 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [PATCH 1/6] RedfishPkg: introduce Redfish HTTP protocol Thread-Topic: [PATCH 1/6] RedfishPkg: introduce Redfish HTTP protocol Thread-Index: AQHaY8fX9TYOD+P490yEB6c9cxiwjrEUBmlw Date: Wed, 21 Feb 2024 01:42:19 +0000 Message-ID: References: <20240220064112.28271-1-nicklew@nvidia.com> In-Reply-To: <20240220064112.28271-1-nicklew@nvidia.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=563ba4ad-7cea-4951-93cd-4acca32825f0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;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_SetDate=2024-02-21T01:40:44Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR12MB9452:EE_|BN9PR12MB5179:EE_ x-ms-office365-filtering-correlation-id: 5dd931e5-a81b-49f8-a6f9-08dc327e5771 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: OpulAtq49/yijubxBr0zKd4MFyopuXrcBd4anAeNwJZFCe3cen0zLI08XHX5ArTK97luhvPjqQ3V3pv142utZ/ykAIYZ+ZlumGdWcgkVe00yRiLE4Yys6PZajalOoBJJ2xRKw1jYkWII9BvehV3+khpgyZUovBvlev5VCi3iX+EgZx2n2G8cpQZETKg20tT5LH7eGUay8rRLXyjYQQC+WuQLO0OW+Gaom5OtpYtQpao2tf2xq5ULHL0TTrivpLTYCGsJoTadtxxXCqM/gTmJsCuVX0+oktRA4AJMANHFkZnunOflNIh97kaYFytkBPc1FjDegVsChQuCTw+9QSEDKFeJYyQqkK+Q9Ql6EC+KCFVNkfFTfJuUEnwSltgDj++p9hkiD4VR47OCoIBjI+4nIXeCozs3RS5T7NhHH1vB0FxPz9YtD62fqdveLQlVt0N5sDGyXIbKqzNNOAdncSLO861P2EP0EWL3TzVUa73pplVryNKFaIKEl4DEqC8W8H8Jxr4lXs+w/cO+uzakSYmrcaY/GoVAeVImDFhEv3j0uIBYBeldP2HAKWaKi9AvrkVNnV8KNPGkFYxi2t6dlIiXfsNLbWZBcn5b0AxseaATJI2J8nggnlsDRiECmVaLxuP9 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IcEVqKbmB78criGM4yRvyOFvdf/MVbuAbDhneWsSzqoSpYav1RZhcZzDh5dN?= =?us-ascii?Q?GZmjrNfDkKNXzZqD5aUdi/0Bt819c9hpLZpwe1/lOGboHaIGBp2NZB+rc2ph?= =?us-ascii?Q?2XqFS3itXqloKFcgBYso0FaOVgGvIzyzMTKmNtZ7waqodr9fG9UcjI8+Ms/N?= =?us-ascii?Q?voKwaAnF3BRLUZF04QbZwx4ODVHbWX8/NZoazU9KAkZueRkvrUz/KJ0WvQv+?= =?us-ascii?Q?+BuJB5oXEdQV0+UplygCLwFeh/CsNw5kJBDwZufxJBDHa8XlHZmIXICBeYVI?= =?us-ascii?Q?/g4jnKhYwdpdGrfvUVHQZtAl2K//oA7UjDaWoTcrHxiDTbFRo1MJZwvCoxnh?= =?us-ascii?Q?SHH1FX4Z4QozaNYELUHT43XjS0mQK94BflV9s8Vbh7XAq6Ue9JGj6agVxigN?= =?us-ascii?Q?LlYDqTa7InloakK6bY+0DCnuUokptQsftLrBNy7HMw5/UGvYx1x4ImUTXB57?= =?us-ascii?Q?+8QeOE0Mlmr545fOh+RM0STYtYMm8M9//xZIhoxXJ/mMF+j8Vt1i/n73LTkO?= =?us-ascii?Q?0LxOQ3RSVNONvyX09cgQ3epEYhS6zJviwM8B0kyHCOta3whni3tEUhPQMVYJ?= =?us-ascii?Q?yI9BiDS6DgoasVQVyWs6yBsfBqMFCaqicBddTN7z1b8ZDjJ9B60sP4GNp1Kl?= =?us-ascii?Q?PAqhmtXrxtZkQ9mSRVKEaPQEZP2+7dqNFE4OZgJ1NxkkTfw/TBKU0LUqYnVE?= =?us-ascii?Q?neB848AXajYBcyXZe0iaKOUK7bsz/rIcscwpKwlqW6Xsl6hyHyg+DtOER8Gu?= =?us-ascii?Q?MQZAQgtV01sYQXyH/XHyjO0yzqnVWY3dT7lXpHE7Ud6QeipbmqN4AtDczg1g?= =?us-ascii?Q?VHPOMdI/kN01ha/MLjBAHvNiJXlL6MzmO4TdM2xNOLA9YCpixO0I6msCYiXU?= =?us-ascii?Q?WLxJIvZTj5fzaqd8Tm+itRzPsN/7vRy0AF6gQUF+o4H+qd/A8eWR1dNYCZmf?= =?us-ascii?Q?TfR6Ll7Jqb+MaN30ZQE50etFr5ZiHcL8XAvhFGvzDCaUfP3UDTyPtUobV34V?= =?us-ascii?Q?R5n+AsXbVcijp9vGht33Xrd1pM31Yy47dxS7Pl76GjpDHr1vjVCBCWOxrYAR?= =?us-ascii?Q?/XPGzLPTUsDaCCNvjFiC0B2FCPMXSe9Ss/sn7JsnlquKRZ6pt0zFVeQQSYdU?= =?us-ascii?Q?M8eRwRV98m+3Vmv2kkM8R7jBsxmUeeMKtcNvFi8H06wlLO/miHNTMAN25gbE?= =?us-ascii?Q?pcNzyd2zzLVPu+lk/mnu1yzJdyGHgIXFOFlAgd/NEVRUglsamUfO6R5WjM6G?= =?us-ascii?Q?/PHZqGqfeyEuhdgqejFFgoW8Kjp2RKPkoyHbZN5gKwD72889frRJCfggdCxC?= =?us-ascii?Q?kRz6O2dDIeVEoe3FbSkE+hxcatEnJiTqA+D3kFxnL0WkfxZINqKRPdgnFSdl?= =?us-ascii?Q?rG4AIpLrEQEXGmfgqcPSr1DTD+3KsTg6bagzxFAVsRHZTStDeNcSu/ydJEKy?= =?us-ascii?Q?Dp9TYjVgEFi5juE3+2AbXVWnrxYmOql2buJP4ykpTb/sOo9SKrK+ZTn+MWxw?= =?us-ascii?Q?Vcgv5e73+b/+M2KduXusMgkhIXLG0ElstDg6ucSu1R01McoDnUSQc82oOiUz?= =?us-ascii?Q?hSKvFk6Mbcckd8vr/rE=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9452.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5dd931e5-a81b-49f8-a6f9-08dc327e5771 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2024 01:42:19.3913 (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: vBnLeBp9Ew/xVcHYIopQCA3I7hawZ0IOgUXPTGeH+xz1L9NQd/X8NNxnb8JBoAhuqmp8s4vKE5FLQrV9LzO9HQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5179 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 31ltJuj0W0Ndgse8pWWlC6oVx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=daRzocS7; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") [AMD Official Use Only - General] As I already reviewed offline on Nickle's personal Git repo, Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Tuesday, February 20, 2024 2:41 PM > To: devel@edk2.groups.io > Cc: Igor Kulchytskyy ; Chang, Abner > ; Nick Ramirez > Subject: [PATCH 1/6] RedfishPkg: introduce Redfish HTTP protocol > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Introduce Redfish HTTP protocol to improve Redfish performance > and communication stability between BIOS and Redfish service. > - Feature drivers often query same Redfish resource multiple > times for different purpose. Implement HTTP cache mechanism to > improve HTTP GET performance. "UseCache" parameter is provided > if application likes to send HTTP GET request to Redfish service > without using cache data. > - This driver will retire stale cache data automatically when > application modify Redfish resource at service side. > - PCD PcdHttpCacheDisabled is used to disable cache mechanism in > this driver for debugging purpose. > - PCD PcdRedfishServiceContentEncoding is used to enable content > encoding while sending data to Redfish service. > - Redfish HTTP protocol also implement retry mechanism to retry > HTTP request when BIOS receive unexpected response from Redfish service. > This function helps BIOS Redfish to finish its job as much as possible. > - PCDs are defined to control how many times BIOS will retry the > request and how many time BIOS will wait between retries. > > Signed-off-by: Nickle Wang > Co-authored-by: Igor Kulchytskyy > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > RedfishPkg/RedfishPkg.dec | 24 +- > .../Protocol/EdkIIRedfishHttpProtocol.h | 308 ++++++++++++++++++ > RedfishPkg/Include/RedfishServiceData.h | 43 +++ > 3 files changed, 374 insertions(+), 1 deletion(-) > create mode 100644 > RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h > create mode 100644 RedfishPkg/Include/RedfishServiceData.h > > diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec > index 3ea9ff3ef7..9b424efdf3 100644 > --- a/RedfishPkg/RedfishPkg.dec > +++ b/RedfishPkg/RedfishPkg.dec > @@ -4,7 +4,7 @@ > # Copyright (c) 2019, Intel Corporation. All rights reserved.
> # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> # Copyright (c) 2023, American Megatrends International LLC. > -# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > +# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > ## > @@ -93,6 +93,9 @@ > # Redfish Host Interface ready notification protocol > gEdkIIRedfishHostInterfaceReadyProtocolGuid =3D { 0xC3F6D062, 0x3D38, > 0x4EA4, { 0x92, 0xB1, 0xE8, 0xF8, 0x02, 0x27, 0x63, 0xDF } } > > + ## Include/Protocol/EdkIIRedfishHttpProtocol.h > + gEdkIIRedfishHttpProtocolGuid =3D { 0x58a0f47e, 0xf45f, 0x4d44, { 0x89= , > 0x5b, 0x2a, 0xfe, 0xb0, 0x80, 0x15, 0xe2 } } > + > [Guids] > gEfiRedfishPkgTokenSpaceGuid =3D { 0x4fdbccb7, 0xe829, 0x4b4c, { = 0x88, > 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }} > > @@ -154,3 +157,22 @@ > # set to EFI_REST_EX_PROTOCOL. > # > > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT3 > 2|0x00001009 > + ## This is used to enable HTTP content encoding on Redfish communicati= on. > + > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|TRUE|BO > OLEAN|0x0000100A > + # > + # Use below PCDs to control Redfhs HTTP protocol. > + # > + ## The number of retry when HTTP GET request failed. If the value is 0= , there > is no retry enabled. > + gEfiRedfishPkgTokenSpaceGuid.PcdHttpGetRetry|0|UINT16|0x0000100B > + ## The number of retry when HTTP PUT request failed. If the value is 0= , > there is no retry enabled. > + gEfiRedfishPkgTokenSpaceGuid.PcdHttpPutRetry|0|UINT16|0x0000100C > + ## The number of retry when HTTP PATCH request failed. If the value is= 0, > there is no retry enabled. > + > gEfiRedfishPkgTokenSpaceGuid.PcdHttpPatchRetry|0|UINT16|0x0000100D > + ## The number of retry when HTTP POST request failed. If the value is = 0, > there is no retry enabled. > + gEfiRedfishPkgTokenSpaceGuid.PcdHttpPostRetry|0|UINT16|0x0000100E > + ## The number of retry when HTTP DELETE request failed. If the value i= s 0, > there is no retry enabled. > + > gEfiRedfishPkgTokenSpaceGuid.PcdHttpDeleteRetry|0|UINT16|0x0000100F > + ## The number of second to wait before driver retry HTTP request. If t= he > value is 0, there is no wait before next retry. > + > gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x000 > 01010 > + ## This is used to disable Redfish HTTP cache function and every reque= st will > be sent to Redfish service. > + > gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x0 > 0001011 > diff --git a/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h > b/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h > new file mode 100644 > index 0000000000..fef365730d > --- /dev/null > +++ b/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h > @@ -0,0 +1,308 @@ > +/** @file > + This file defines the EDKII_REDFISH_HTTP_PROTOCOL interface. > + > + Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef EDKII_REDFISH_HTTP_PROTOCOL_H_ > +#define EDKII_REDFISH_HTTP_PROTOCOL_H_ > + > +#include > +#include > +#include > + > +typedef struct _EDKII_REDFISH_HTTP_PROTOCOL > EDKII_REDFISH_HTTP_PROTOCOL; > + > +/** > + This function create Redfish service. It's caller's responsibility to = free > returned > + Redfish service by calling FreeService (). > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_P= ROTOCOL > instance. > + @param[in] RedfishConfigServiceInfo Redfish config service informat= ion. > + > + @retval REDFISH_SERVICE Redfish service is created. > + @retval NULL Errors occur. > + > +**/ > +typedef > +REDFISH_SERVICE > +(EFIAPI *REDFISH_HTTP_CREATE_SERVICE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo > + ); > + > +/** > + This function free resources in Redfish service. RedfishService is no = longer > available > + after this function returns successfully. > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL > instance. > + @param[in] RedfishService Pointer to Redfish service to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_FREE_SERVICE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_SERVICE RedfishService > + ); > + > +/** > + This function returns JSON value in given RedfishPayload. Returned JSO= N > value > + is a reference to the JSON value in RedfishPayload. Any modification t= o > returned > + JSON value will change JSON value in RedfishPayload. > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL > instance. > + @param[in] RedfishPayload Pointer to Redfish payload. > + > + @retval EDKII_JSON_VALUE JSON value is returned. > + @retval NULL Errors occur. > + > +**/ > +typedef > +EDKII_JSON_VALUE > +(EFIAPI *REDFISH_HTTP_JSON_IN_PAYLOAD)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_PAYLOAD RedfishPayload > + ); > + > +/** > + This function free resources in Request. Request is no longer availabl= e > + after this function returns successfully. > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL instan= ce. > + @param[in] Request HTTP request to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_FREE_REQUEST)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_REQUEST *Request > + ); > + > +/** > + This function free resources in Response. Response is no longer availa= ble > + after this function returns successfully. > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL instan= ce. > + @param[in] Response HTTP response to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_FREE_RESPONSE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_RESPONSE *Response > + ); > + > +/** > + This function expire the cached response of given URI. > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL instan= ce. > + @param[in] Uri Target response of URI. > + > + @retval EFI_SUCCESS Target response is expired successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_EXPIRE_RESPONSE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN EFI_STRING Uri > + ); > + > +/** > + Perform HTTP GET to Get redfish resource from given resource URI with > + cache mechanism supported. It's caller's responsibility to free Respon= se > + by calling FreeResponse (). > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL insta= nce. > + @param[in] Service Redfish service instance to perform HTTP GET= . > + @param[in] Uri Target resource URI. > + @param[in] Request Additional request context. This is optional= . > + @param[out] Response HTTP response from redfish service. > + @param[in] UseCache If it is TRUE, this function will search for > + cache first. If it is FALSE, this function > + will query Redfish URI directly. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_GET_RESOURCE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN REDFISH_REQUEST *Request OPTIONAL, > + OUT REDFISH_RESPONSE *Response, > + IN BOOLEAN UseCache > + ); > + > +/** > + Perform HTTP PATCH to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling FreeResponse = (). > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL insta= nce. > + @param[in] Service Redfish service instance to perform HTTP PAT= CH. > + @param[in] Uri Target resource URI. > + @param[in] Content Data to patch. > + @param[in] ContentSize Size of the Content to be send to Redfish se= rvice. > + This is optional. When ContentSize is 0, Con= tentSize > + is the size of Content. > + @param[in] ContentType Type of the Content to be send to Redfish > service. > + This is optional. When ContentType is NULL, = content > + type HTTP_CONTENT_TYPE_APP_JSON will be used= . > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_PATCH_RESOURCE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ); > + > +/** > + Perform HTTP PUT to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling FreeResponse = (). > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL insta= nce. > + @param[in] Service Redfish service instance to perform HTTP PUT= . > + @param[in] Uri Target resource URI. > + @param[in] Content Data to put. > + @param[in] ContentSize Size of the Content to be send to Redfish se= rvice. > + This is optional. When ContentSize is 0, Con= tentSize > + is the size of Content. > + @param[in] ContentType Type of the Content to be send to Redfish > service. > + This is optional. When ContentType is NULL, = content > + type HTTP_CONTENT_TYPE_APP_JSON will be used= . > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_PUT_RESOURCE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ); > + > +/** > + Perform HTTP POST to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling FreeResponse = (). > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL insta= nce. > + @param[in] Service Redfish service instance to perform HTTP POS= T. > + @param[in] Uri Target resource URI. > + @param[in] Content Data to post. > + @param[in] ContentSize Size of the Content to be send to Redfish se= rvice. > + This is optional. When ContentSize is 0, Con= tentSize > + is the size of Content. > + @param[in] ContentType Type of the Content to be send to Redfish > service. > + This is optional. When ContentType is NULL, = content > + type HTTP_CONTENT_TYPE_APP_JSON will be used= . > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_POST_RESOURCE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ); > + > +/** > + Perform HTTP DELETE to delete redfish resource on given resource URI. > + It's caller's responsibility to free Response by calling FreeResponse = (). > + > + @param[in] This Pointer to EDKII_REDFISH_HTTP_PROTOCOL insta= nce. > + @param[in] Service Redfish service instance to perform HTTP DEL= ETE. > + @param[in] Uri Target resource URI. > + @param[in] Content JSON represented properties to be deleted. T= his is > + optional. > + @param[in] ContentSize Size of the Content to be send to Redfish se= rvice. > + This is optional. When ContentSize is 0, Con= tentSize > + is the size of Content if Content is not NUL= L. > + @param[in] ContentType Type of the Content to be send to Redfish > service. > + This is optional. When Content is not NULL a= nd > + ContentType is NULL, content type > HTTP_CONTENT_TYPE_APP_JSON > + will be used. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *REDFISH_HTTP_DELETE_RESOURCE)( > + IN EDKII_REDFISH_HTTP_PROTOCOL *This, > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content OPTIONAL, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ); > + > +/// > +/// Definition of _EDKII_REDFISH_HTTP_PROTOCOL. > +/// > +struct _EDKII_REDFISH_HTTP_PROTOCOL { > + UINT32 Version; > + REDFISH_HTTP_CREATE_SERVICE CreateService; > + REDFISH_HTTP_FREE_SERVICE FreeService; > + REDFISH_HTTP_JSON_IN_PAYLOAD JsonInPayload; > + REDFISH_HTTP_GET_RESOURCE GetResource; > + REDFISH_HTTP_PATCH_RESOURCE PatchResource; > + REDFISH_HTTP_PUT_RESOURCE PutResource; > + REDFISH_HTTP_POST_RESOURCE PostResource; > + REDFISH_HTTP_DELETE_RESOURCE DeleteResource; > + REDFISH_HTTP_FREE_REQUEST FreeRequest; > + REDFISH_HTTP_FREE_RESPONSE FreeResponse; > + REDFISH_HTTP_EXPIRE_RESPONSE ExpireResponse; > +}; > + > +#define EDKII_REDFISH_HTTP_PROTOCOL_REVISION 0x00001000 > + > +extern EFI_GUID gEdkIIRedfishHttpProtocolGuid; > + > +#endif > diff --git a/RedfishPkg/Include/RedfishServiceData.h > b/RedfishPkg/Include/RedfishServiceData.h > new file mode 100644 > index 0000000000..bcaa12ba27 > --- /dev/null > +++ b/RedfishPkg/Include/RedfishServiceData.h > @@ -0,0 +1,43 @@ > +/** @file > + This header file defines Redfish service and Redfish data structures t= hat > + are used to communicate with Redfish Ex Protocol. > + > + Copyright (c) 2019, Intel Corporation. All rights reserved.
> + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef REDFISH_SERVICE_DATA_H_ > +#define REDFISH_SERVICE_DATA_H_ > + > +#include > +#include > + > +typedef VOID *REDFISH_SERVICE; > +typedef VOID *REDFISH_PAYLOAD; > + > +/// > +/// REDFISH_REQUEST definition. > +/// > +typedef struct { > + UINTN HeaderCount; > + EFI_HTTP_HEADER *Headers; > + CHAR8 *Content; > + CHAR8 *ContentType; > + UINTN ContentLength; > +} REDFISH_REQUEST; > + > +/// > +/// REDFISH_REQUEST definition. > +/// > +typedef struct { > + EFI_HTTP_STATUS_CODE *StatusCode; > + UINTN HeaderCount; > + EFI_HTTP_HEADER *Headers; > + REDFISH_PAYLOAD Payload; > +} REDFISH_RESPONSE; > + > +#endif > -- > 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115690): https://edk2.groups.io/g/devel/message/115690 Mute This Topic: https://groups.io/mt/104463402/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-