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 EEEC6740032 for ; Wed, 21 Feb 2024 01:54:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GTwx/NGpzksWg/yvuz0+TBRzOFbCxI2p7o+YVcrl+hs=; 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=1708480455; v=1; b=CFBGzHR0Zggbeimsox7A69y5uhLzowRs1L/Dy9xFzIbiuUN45IJJUB20LGvDgNHLFEDtC/0h hkURGd55J9xOq1/vB5UTbec0EAZYAmD8J443gkETKcb+JIndi5qvDHcpLiCFdM9ZxfqKcal//oK DV1XvLO67cRDVSHikoROIJaY= X-Received: by 127.0.0.2 with SMTP id ZdTQYY7687511xPg8MgracU0; Tue, 20 Feb 2024 17:54:15 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.85]) by mx.groups.io with SMTP id smtpd.web11.3756.1708480454374272370 for ; Tue, 20 Feb 2024 17:54:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G6F5TQVp3u/E8nO3lxSzFe5X63kfQWZk3Ne4GW61tJKJrUysytRs8b7dyGFp5TMXmJu6AhPuvWgZ5spX+dLMuuuGvnoCIJbHMXzozC5IKTDjtdS/3I7g0on8o4o8U1EJpOH8VoGLiw+TKDT8ePcpFl8MKpVlw2v/lo4asR5dBdtAh+hnC0J5Db9X3BEnpoc+TToEWrguNRJhukh7bnDuSuvFHUcCW1GUJ7/nRxVrSrMWMa/y+kVWi7K6IDBYdXkoZju2H28jSa7BIbwMCavENzZQqEefXwPIihdeuPI9xGG+K+UfNUSpj0JF3/WeSGGZizDjCDlZhgyjXeStkwUZEw== 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=9Leacqyq7O3MSOUfGzeQ/HgMzz+sfH1CzOEzOjhY5Dc=; b=PXGLCYWsBJilA/uwqphfA9EUKzOJk4183gU9Y3K7UT2aI6YM4VXFDBlnnOHxqKJIZZmXVaDYdp2DymKW7btQQs131eHzCgOmIrHz75OX9+9tlM3+KUOwTM5kEaaea8/Q3yHQfuAkpSn/kAc+Xs95VDyPOJTHMNHdJ1oiERzAKYVQ8GeViIAFOKqHFiY7tKxl2Tw+NZQUkDWIk6NI5p6sGq14CAE/35LvwycQ57EGL6XD/d6G0QurENRaJaFuaJ0KK7cgbC3U/yQ8e4IgVpBwz9WNNv87W6dYLJuD5gUFFvl8M1laQklK80kAVaToVwna2ej+piR7sZumlhE5kde8zQ== 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 MW6PR12MB7088.namprd12.prod.outlook.com (2603:10b6:303:238::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.21; Wed, 21 Feb 2024 01:54:11 +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:54:11 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [PATCH 3/6] RedfishPkg: introduce RedfishHttpLib Thread-Topic: [PATCH 3/6] RedfishPkg: introduce RedfishHttpLib Thread-Index: AQHaY8fh76QRVMuzzUiOaN/TIKhge7EUCgpw Date: Wed, 21 Feb 2024 01:54:10 +0000 Message-ID: References: <20240220064130.28429-1-nicklew@nvidia.com> In-Reply-To: <20240220064130.28429-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=a4a6329c-31a2-4bc2-af86-9ba5cc6454ad;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:53:43Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR12MB9452:EE_|MW6PR12MB7088:EE_ x-ms-office365-filtering-correlation-id: 8cd5362c-cc55-41c7-477b-08dc327fff96 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 9y6i0pN7i/PnTRm9/ZtwgqN2faPUSU45rx/RrrZpYmKd5ipa8ZVa9+IwOw+XwWy/eyNy3XrauE6Sh0Tvvq9zQ5SwlazUC6u2bzcqaRN3wb4wT5IMYpL+vaDE8QlJojBHRJz2esLBD/6iAIP1Ao+9sEqFAxzvfkL8JT75VbBsBdNzn1oPaXViUsuU5F4GJQVhe5ISmX8/JBt7kzSmlRXLW9hw1gGQLQVf1LauHvfi4g3S5p6YA6x414MVv2TbKg6iKlEyVq4kR8NNFMLrFbu8NSz3BCwhJanxos/iyEasKo5pPrnMqAiOQy7J7ekbG9EOTVW6RQLuCgwbR5yN9M+ej/1IA34JmSjzesr2mygXgh17Y8NcTbIx14bU5QHd3F0+v+2qsiRAnrHSVusxYm2SPxTiUF2xC7YXyO6RmmilEvLopc+pf4ckw5LZp/+5CzhTXOSiGb+GSa/8VPve1a93ND4yufAVavEbTUY9lfyOswtLdWQG/wp4lQI6JbPqyO9lQ/KX74e8zC9ir2fq2qAGYlw+MNFodDQMboi+VojgEdb4wmn2xAPMy0EKgnGsPzLzv7o5tWgmNYur807jlTKef3JcD+iq9VVcQUn1t1EmKv7abHAB84AAgId3BAuGTy2q x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qCyUF8erT57qmfplPWtc1lA10aZvyW7uXM6UhdA9tuWIPUuh9quYt4DqOuA1?= =?us-ascii?Q?zBoSCzhuvrg6W/Lc3jiRrdwe+SLR4OAOGb935Nj5mAqCdUqrW98ubN3zOIeG?= =?us-ascii?Q?3RvaAnEMuVkIi0pOcFVYM4p9p+3UqHSBHiIRYIeOuII1mPr/i37Lb2haoqEx?= =?us-ascii?Q?e0KgcJXeAuv4ThFHSdKEeCHqs5hMCbEy1OfAwv72o+LlTXTe38GXPFZ7N/FQ?= =?us-ascii?Q?wsKdAewLcjvIa1mnT9FdtwyclpEWDs2psHnoDmW9Jzp5K/L4R0gPtfp0N1wP?= =?us-ascii?Q?nFh6y62TMEfoKxDzL/ZNB3u9HG4PmcE1QxCfHm36BFzGyBn9HyuzU2LwJHag?= =?us-ascii?Q?CosVZEDdJYzrBun5MxpAygMS0dlAvEb242Vq7vSzbS63Ct/sWVQZ5TLsxXjF?= =?us-ascii?Q?e07ezw8VBEgB7xBSCDylN6QXOBBC4CudArKxGqqHV/ePk1TMyTweUNYbP63B?= =?us-ascii?Q?9QQt2EbETTQvwdcBe7U7kr8nhY/zfg6gIwd6wm3BXzeyAUHsKdaxBiQef/3w?= =?us-ascii?Q?iRD1j42W1zrg9wz+dOs/KNLp2u81YeDrYy6/hSLO+TfBqKM1LajwKhGrhApz?= =?us-ascii?Q?oqEP2e2HFlGm6p1efsMkPg9kHVLCyMq1LDNwobLsVH42UzXcjwXEyyIQvNrD?= =?us-ascii?Q?EybOKJBSEQiskDwJncPnFhOxFxfCB0yWk/DofaRFHcndb2TF12jqVHD+6qPG?= =?us-ascii?Q?RbnUectvWu8K8v9lpPb+vjOtnTrO9QuMSwtz78A9QIGsReSMu9tIMYzDBCnt?= =?us-ascii?Q?M/3opQJSfYvrO9kmRzFciZuWexqCOygIbmt9ui4gWGoRoQUOQ979svB9nyDX?= =?us-ascii?Q?fdTfJXnD1UUI1SF19GGw1ZqSFa2jlG5JWUSZvPowQMDbj5ltdjWgUBN5xsJh?= =?us-ascii?Q?qzqVgEadpYaSjH1WtYJG1eR1T+7znY4z22AagT5TboGwns08nueig2E2EUas?= =?us-ascii?Q?ngqWh32/JpwxSpHoWzSVNvO5Bo8C9iWDxbdJGjdHhMKdgdeyWHvL9dKZJ9eE?= =?us-ascii?Q?Tgq/bIwmPH98nFRQ1ZaZ9j8lflWxGjbzEF1jXs0danWb1w+2JLK+6Ew01nWf?= =?us-ascii?Q?Nlt5x0QUclfeqA8M1oriTZIwU02ASGR39TSCav3KmEBotEBA4bucUi2HQWo6?= =?us-ascii?Q?rfi2LSwRh7IfXbCyCXi6fN2xR5x+Vv0L2hpvahWlKfS4EGCEgYy2ZSUxVfH4?= =?us-ascii?Q?GBiDbGKpNYDv9DugLc5fPx68qGfZii/F9oWSLAiI6sKrvN0d5liigTaLoENw?= =?us-ascii?Q?g9MjhyFZmTlVcqvXYgcQPuQ3L0M8vAXBCSE/D+mszYxSTODnIsDN1v6gBuca?= =?us-ascii?Q?icJ6eeGBcO8keimz9vSHgiAvUOXW8cgLU74iSzTthgbO/UaYXUDWKI4KmwGH?= =?us-ascii?Q?/rW9ARXrb1MIuwlif05dlnVjVTZWgeR4H0JJpUUPJ7Gotd7p1q57S93VQPrm?= =?us-ascii?Q?K+HY6uPwd2zPHc7SNOY7/xEFQkoTxdE/b9LCzHbDmcs0DSwxmMBMsp2+c1xu?= =?us-ascii?Q?vfTo/ajvRj9aurOrmCO3RbA+6g5eYF3kBMgat5HHgonvrWGpgJOyDpAp+/Lo?= =?us-ascii?Q?+Rvd5C/bkfv0iOHKqWw=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: 8cd5362c-cc55-41c7-477b-08dc327fff96 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2024 01:54:10.9426 (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: lLvbBtfdH3cha4KBviRAm7/UF7jVzVeB7AR4OoJsiU+mY+7uWK1BWF2gHUZizEMuSP8dAHf+1wSE16EAcO/J2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7088 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: ZsSF2ucwBQ76JEV59nHNXjp8x7686176AA= 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=CFBGzHR0; 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:42 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > ; Nick Ramirez > Subject: [PATCH 3/6] RedfishPkg: introduce RedfishHttpLib > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > RedfishHttpLib is a wrapper library for Redfish feature drivers to > call Redfish HTTP Protocol easily. > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > RedfishPkg/RedfishPkg.dec | 5 + > RedfishPkg/RedfishLibs.dsc.inc | 3 +- > RedfishPkg/RedfishPkg.dsc | 3 +- > .../Library/RedfishHttpLib/RedfishHttpLib.inf | 43 ++ > RedfishPkg/Include/Library/RedfishHttpLib.h | 326 ++++++++++ > .../Library/RedfishHttpLib/RedfishHttpLib.c | 585 ++++++++++++++++++ > 6 files changed, 963 insertions(+), 2 deletions(-) > create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf > create mode 100644 RedfishPkg/Include/Library/RedfishHttpLib.h > create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c > > diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec > index 114f8d2ad8..1a9c9ed7bc 100644 > --- a/RedfishPkg/RedfishPkg.dec > +++ b/RedfishPkg/RedfishPkg.dec > @@ -69,6 +69,11 @@ > # > RedfishPlatformConfigLib|Include/Library/RedfishPlatformConfigLib.h > > + ## @libraryclass Provides the library functions to access Redfish HT= TP > + # protocol. > + # > + RedfishHttpLib|Include/Library/RedfishHttpLib.h > + > [LibraryClasses.Common.Private] > ## @libraryclass Provides the private C runtime library functions. > # CRT library is currently used by edk2 JsonLib (open source > diff --git a/RedfishPkg/RedfishLibs.dsc.inc b/RedfishPkg/RedfishLibs.dsc.= inc > index 5426957da8..55846aaa9d 100644 > --- a/RedfishPkg/RedfishLibs.dsc.inc > +++ b/RedfishPkg/RedfishLibs.dsc.inc > @@ -6,7 +6,7 @@ > # of EDKII network library classes. > # > # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> -# 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 > # > @@ -21,5 +21,6 @@ > > RedfishPlatformCredentialLib|RedfishPkg/Library/RedfishPlatformCredential= I > pmiLib/RedfishPlatformCredentialIpmiLib.inf > HiiUtilityLib|RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf > > RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/Red > fishPlatformConfigLib.inf > + RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf > !endif > > diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc > index 5849e7cf9e..b0150043a9 100644 > --- a/RedfishPkg/RedfishPkg.dsc > +++ b/RedfishPkg/RedfishPkg.dsc > @@ -4,7 +4,7 @@ > # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
> # (C) Copyright 2021 Hewlett-Packard Enterprise Development LP. > # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. > -# 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 > # > @@ -74,5 +74,6 @@ > RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf > RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf > RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.i= nf > + RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf > > !include RedfishPkg/Redfish.dsc.inc > diff --git a/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf > b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf > new file mode 100644 > index 0000000000..fd53b8c2ed > --- /dev/null > +++ b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf > @@ -0,0 +1,43 @@ > +## @file > +# Redfish HTTP library is wrapper library for application to call Redfi= sh > +# HTTP protocol easily. > +# > +# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + INF_VERSION =3D 0x00010006 > + BASE_NAME =3D RedfishHttpLib > + FILE_GUID =3D 62855D9B-441B-436B-9CA6-B7FEB7ABF54= E > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D RedfishHttpLib| DXE_DRIVER UEFI_DRI= VER > + CONSTRUCTOR =3D RedfishHttpConstructor > + > +# > +# VALID_ARCHITECTURES =3D IA32 X64 EBC > +# > + > +[Sources] > + RedfishHttpLib.c > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + RedfishPkg/RedfishPkg.dec > + > +[LibraryClasses] > + BaseLib > + DebugLib > + UefiLib > + UefiBootServicesTableLib > + > +[Protocols] > + gEdkIIRedfishHttpProtocolGuid ## CONSUMES ## > + > +[depex] > + TRUE > + > diff --git a/RedfishPkg/Include/Library/RedfishHttpLib.h > b/RedfishPkg/Include/Library/RedfishHttpLib.h > new file mode 100644 > index 0000000000..b07a46993b > --- /dev/null > +++ b/RedfishPkg/Include/Library/RedfishHttpLib.h > @@ -0,0 +1,326 @@ > +/** @file > + This file defines the Redfish HTTP library interface. > + > + Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef REDFISH_HTTP_LIB_H_ > +#define REDFISH_HTTP_LIB_H_ > + > +#include > + > +/** > + This function create Redfish service. It's caller's responsibility to = free > returned > + Redfish service by calling FreeService (). > + > + @param[in] RedfishConfigServiceInfo Redfish config service informat= ion. > + > + @retval REDFISH_SERVICE Redfish service is created. > + @retval NULL Errors occur. > + > +**/ > +REDFISH_SERVICE > +RedfishCreateService ( > + 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] RedfishService Pointer to Redfish service to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishCleanupService ( > + 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] RedfishPayload Pointer to Redfish payload. > + > + @retval EDKII_JSON_VALUE JSON value is returned. > + @retval NULL Errors occur. > + > +**/ > +EDKII_JSON_VALUE > +RedfishJsonInPayload ( > + IN REDFISH_PAYLOAD RedfishPayload > + ); > + > +/** > + This function free resources in Request. Request is no longer availabl= e > + after this function returns successfully. > + > + @param[in] Request HTTP request to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpFreeRequest ( > + IN REDFISH_REQUEST *Request > + ); > + > +/** > + This function free resources in Response. Response is no longer availa= ble > + after this function returns successfully. > + > + @param[in] Response HTTP response to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpFreeResponse ( > + IN REDFISH_RESPONSE *Response > + ); > + > +/** > + This function expire the cached response of given URI. > + > + @param[in] Uri Target response of URI. > + > + @retval EFI_SUCCESS Target response is expired successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpExpireResponse ( > + IN EFI_STRING Uri > + ); > + > +/** > + Get redfish resource from given resource URI with cache mechanism > + supported. It's caller's responsibility to Response by calling > + RedfishHttpFreeResponse (). > + > + @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. > + > +**/ > +EFI_STATUS > +RedfishHttpGetResource ( > + 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 > RedfishHttpFreeResponse (). > + > + @param[in] Service Redfish service instance to perform HTTP PAT= CH. > + @param[in] Uri Target resource URI. > + @param[in] Content Data to patch. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPatchResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + OUT REDFISH_RESPONSE *Response > + ); > + > +/** > + Perform HTTP PATCH to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @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. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPatchResourceEx ( > + 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 > RedfishHttpFreeResponse (). > + > + @param[in] Service Redfish service instance to perform HTTP PUT= . > + @param[in] Uri Target resource URI. > + @param[in] Content Data to put. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPutResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + 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 > RedfishHttpFreeResponse (). > + > + @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. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPutResourceEx ( > + 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 > RedfishHttpFreeResponse (). > + > + @param[in] Service Redfish service instance to perform HTTP POS= T. > + @param[in] Uri Target resource URI. > + @param[in] Content Data to post. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPostResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + 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 > RedfishHttpFreeResponse (). > + > + @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. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPostResourceEx ( > + 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 > RedfishHttpFreeResponse (). > + > + @param[in] Service Redfish service instance to perform HTTP DEL= ETE. > + @param[in] Uri Target resource URI. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpDeleteResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + 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 > RedfishHttpFreeResponse (). > + > + @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. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpDeleteResourceEx ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content OPTIONAL, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ); > + > +#endif > diff --git a/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c > b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c > new file mode 100644 > index 0000000000..0a17952d63 > --- /dev/null > +++ b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c > @@ -0,0 +1,585 @@ > +/** @file > + Redfish HTTP cache library helps Redfish application to get Redfish re= source > + from BMC with cache mechanism enabled. > + > + Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > + > +EDKII_REDFISH_HTTP_PROTOCOL *mRedfishHttpProtocol =3D NULL; > + > +/** > + This function create Redfish service. It's caller's responsibility to = free > returned > + Redfish service by calling FreeService (). > + > + @param[in] RedfishConfigServiceInfo Redfish config service informat= ion. > + > + @retval REDFISH_SERVICE Redfish service is created. > + @retval NULL Errors occur. > + > +**/ > +REDFISH_SERVICE > +RedfishCreateService ( > + IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return NULL; > + } > + > + return mRedfishHttpProtocol->CreateService ( > + mRedfishHttpProtocol, > + RedfishConfigServiceInfo > + ); > +} > + > +/** > + This function free resources in Redfish service. RedfishService is no = longer > available > + after this function returns successfully. > + > + @param[in] RedfishService Pointer to Redfish service to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishCleanupService ( > + IN REDFISH_SERVICE RedfishService > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->FreeService ( > + mRedfishHttpProtocol, > + 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] RedfishPayload Pointer to Redfish payload. > + > + @retval EDKII_JSON_VALUE JSON value is returned. > + @retval NULL Errors occur. > + > +**/ > +EDKII_JSON_VALUE > +RedfishJsonInPayload ( > + IN REDFISH_PAYLOAD RedfishPayload > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return NULL; > + } > + > + return mRedfishHttpProtocol->JsonInPayload ( > + mRedfishHttpProtocol, > + RedfishPayload > + ); > +} > + > +/** > + This function free resources in Request. Request is no longer availabl= e > + after this function returns successfully. > + > + @param[in] Request HTTP request to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpFreeRequest ( > + IN REDFISH_REQUEST *Request > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->FreeRequest ( > + mRedfishHttpProtocol, > + Request > + ); > +} > + > +/** > + This function free resources in Response. Response is no longer availa= ble > + after this function returns successfully. > + > + @param[in] Response HTTP response to be released. > + > + @retval EFI_SUCCESS Resrouce is released successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpFreeResponse ( > + IN REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->FreeResponse ( > + mRedfishHttpProtocol, > + Response > + ); > +} > + > +/** > + This function expire the cached response of given URI. > + > + @param[in] Uri Target response of URI. > + > + @retval EFI_SUCCESS Target response is expired successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpExpireResponse ( > + IN EFI_STRING Uri > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->ExpireResponse ( > + mRedfishHttpProtocol, > + Uri > + ); > +} > + > +/** > + Get redfish resource from given resource URI with cache mechanism > + supported. It's caller's responsibility to Response by calling > + RedfishHttpFreeResponse (). > + > + @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. > + > +**/ > +EFI_STATUS > +RedfishHttpGetResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN REDFISH_REQUEST *Request OPTIONAL, > + OUT REDFISH_RESPONSE *Response, > + IN BOOLEAN UseCache > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->GetResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + Request, > + Response, > + UseCache > + ); > +} > + > +/** > + Perform HTTP PATCH to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @param[in] Service Redfish service instance to perform HTTP PAT= CH. > + @param[in] Uri Target resource URI. > + @param[in] Content Data to patch. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPatchResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + OUT REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->PatchResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + Content, > + 0, > + NULL, > + Response > + ); > +} > + > +/** > + Perform HTTP PATCH to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @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. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPatchResourceEx ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->PatchResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + Content, > + ContentSize, > + ContentType, > + Response > + ); > +} > + > +/** > + Perform HTTP PUT to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @param[in] Service Redfish service instance to perform HTTP PUT= . > + @param[in] Uri Target resource URI. > + @param[in] Content Data to put. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPutResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + OUT REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->PutResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + Content, > + 0, > + NULL, > + Response > + ); > +} > + > +/** > + Perform HTTP PUT to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @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. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPutResourceEx ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->PutResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + Content, > + ContentSize, > + ContentType, > + Response > + ); > +} > + > +/** > + Perform HTTP POST to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @param[in] Service Redfish service instance to perform HTTP POS= T. > + @param[in] Uri Target resource URI. > + @param[in] Content Data to post. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPostResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + OUT REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->PostResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + Content, > + 0, > + NULL, > + Response > + ); > +} > + > +/** > + Perform HTTP POST to send redfish resource to given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @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. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpPostResourceEx ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->PostResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + Content, > + ContentSize, > + ContentType, > + Response > + ); > +} > + > +/** > + Perform HTTP DELETE to delete redfish resource on given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @param[in] Service Redfish service instance to perform HTTP DEL= ETE. > + @param[in] Uri Target resource URI. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpDeleteResource ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + OUT REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->DeleteResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + NULL, > + 0, > + NULL, > + Response > + ); > +} > + > +/** > + Perform HTTP DELETE to delete redfish resource on given resource URI. > + It's caller's responsibility to free Response by calling > RedfishHttpFreeResponse (). > + > + @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. > + @param[out] Response HTTP response from redfish service. > + > + @retval EFI_SUCCESS Resrouce is returned successfully. > + @retval Others Errors occur. > + > +**/ > +EFI_STATUS > +RedfishHttpDeleteResourceEx ( > + IN REDFISH_SERVICE Service, > + IN EFI_STRING Uri, > + IN CHAR8 *Content OPTIONAL, > + IN UINTN ContentSize OPTIONAL, > + IN CHAR8 *ContentType OPTIONAL, > + OUT REDFISH_RESPONSE *Response > + ) > +{ > + if (mRedfishHttpProtocol =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + > + return mRedfishHttpProtocol->DeleteResource ( > + mRedfishHttpProtocol, > + Service, > + Uri, > + Content, > + ContentSize, > + ContentType, > + Response > + ); > +} > + > +/** > + Callback function when gEdkIIRedfishHttpProtocolGuid is installed. > + > + @param[in] Event Event whose notification function is being invoked= . > + @param[in] Context Pointer to the notification function's context. > +**/ > +VOID > +EFIAPI > +RedfishHttpProtocolIsReady ( > + IN EFI_EVENT Event, > + IN VOID *Context > + ) > +{ > + EFI_STATUS Status; > + > + if (mRedfishHttpProtocol !=3D NULL) { > + gBS->CloseEvent (Event); > + return; > + } > + > + Status =3D gBS->LocateProtocol ( > + &gEdkIIRedfishHttpProtocolGuid, > + NULL, > + (VOID **)&mRedfishHttpProtocol > + ); > + if (EFI_ERROR (Status)) { > + return; > + } > + > + gBS->CloseEvent (Event); > +} > + > +/** > + > + Initial HTTP library instance. > + > + @param[in] ImageHandle The image handle. > + @param[in] SystemTable The system table. > + > + @retval EFI_SUCCESS Initial library successfully. > + @retval Other Return error status. > + > +**/ > +EFI_STATUS > +EFIAPI > +RedfishHttpConstructor ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + VOID *Registration; > + > + EfiCreateProtocolNotifyEvent ( > + &gEdkIIRedfishHttpProtocolGuid, > + TPL_CALLBACK, > + RedfishHttpProtocolIsReady, > + NULL, > + &Registration > + ); > + > + return EFI_SUCCESS; > +} > -- > 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 (#115693): https://edk2.groups.io/g/devel/message/115693 Mute This Topic: https://groups.io/mt/104463405/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-