From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.49]) by mx.groups.io with SMTP id smtpd.web10.18697.1683255243682489216 for ; Thu, 04 May 2023 19:54:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=jNxb4leO; 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.94.49, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W0vOxcMnsnoahHp+CsTv6jG+A2pR3Bt8FTKGkWrui/tT5w4ge1v2NKdRbHM+kEbykBtoixhiaIc1zQ/bb/4AnpWLSAN3BLc0OSqbIaHigJyCgxxRSqMnuEeW7hUFVAVJmzp98MkA5350ZLjnpsDYbM91sCuXKH3cspAFB1buIf1FEAo4YIObrWRo2UOHDeh5HvPIXBekGlCqOG+K2YoWU40upvKWlUu0OuBLcH314NCehDBD2yo9HT2LECNPJNW87kaqbC855YkgMh7AQINcpgmNbQzhYMMVmFN0A1m/CX+EQnqLcCdEDNoEr1rzIM+4h8A8lqKgAcuyCwkEp6fN7Q== 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=1dwDBgygJzjudTBUF8b/X51e8lrWzLcIaFLqV0LQ/Uc=; b=eDOORDMWCsQmB13pZl3gVF8Or2ACBCU9c1oxXaB3YIV30+aUvuNawRYC+fMmdgA10VSfKj1kVften07gYwwstoDLoPU94qfZxJ5IN6v2wFmlJkWbNuDcflMyVa5y2DkoAOnkwsFHD1aqaUB5svMIY9YpxbFWP06j1H1TACN3/Xr66F1O1scqu39mCx4kmGkwu8chM4CR+kfi4p21QDEXLFYtc57MRTI6gzYX1f49lcB+Ti/+hSDnG/MW5QbA05YV6XBwFjdp3Hv1jtgE/edvR5URppTrV/43vWI04hNMoF0pNwgZjWeUbWip20mWJphEUChUSl9UKJlWt5IkINPEVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=1dwDBgygJzjudTBUF8b/X51e8lrWzLcIaFLqV0LQ/Uc=; b=jNxb4leO7k/9Hodw0oSV0Mb0t/2b1zxiKh0l7qlOLVADL00LCFdnfvDzsX0nxBirWmBeJOF9KElznc8uQDno1hZotfg3KlOXjvj/Ji4Dj8YIPnSgU69iXAEa0LKrFJgYNVXfoQzH1xmg7UzexTt1wDYUn7/WfHGmwcr0jLHeMao= Received: from BY5PR16CA0030.namprd16.prod.outlook.com (2603:10b6:a03:1a0::43) by MW5PR12MB5622.namprd12.prod.outlook.com (2603:10b6:303:198::13) 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 02:54:01 +0000 Received: from DM6NAM11FT079.eop-nam11.prod.protection.outlook.com (2603:10b6:a03:1a0:cafe::78) by BY5PR16CA0030.outlook.office365.com (2603:10b6:a03:1a0::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.26 via Frontend Transport; Fri, 5 May 2023 02:54:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT079.mail.protection.outlook.com (10.13.173.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.27 via Frontend Transport; Fri, 5 May 2023 02:54:00 +0000 Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 4 May 2023 21:53:58 -0500 From: "Chang, Abner" To: CC: Nickle Wang , Igor Kulchytskyy Subject: [edk2-redfish-client][PATCH] RedfishClientPkg: Add converter helper library Date: Fri, 5 May 2023 10:53:38 +0800 Message-ID: <20230505025338.1879-1-abner.chang@amd.com> X-Mailer: git-send-email 2.37.1.windows.1 MIME-Version: 1.0 Return-Path: Abner.Chang@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT079:EE_|MW5PR12MB5622:EE_ X-MS-Office365-Filtering-Correlation-Id: f3fdb428-7716-42fe-c5ce-08db4d13faa5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tOAMwxti7bLM0cC88hLaaJ30TxiN0LFtDhJK+FmdYbyekmT0/JhRxB0uVUg7leE31M+kdHnrwSBn6/ddyH2nQYx1QEylbRBcOG/2nv4CfZ321SOvJqcWq9ON6oYSyhgY+eojste8df8tCnWT6d1yPOQFFtfJ9AEPIB3URdwd9GT9du4hbk7Jl6P7+b72JKJi2d/IaSq4YXMMAgDv2198ZTWSwz0Ih3eTDu2iGVZPPd5hSKFIndEn9Wdb9KPzDPBXe6MbT1+cPcQXogO9k/vl1A3EI6+idOJFkipWJyqCT62/Xd4kvvF8URr3orJknbIXJ9bYKM6VycAg/z1a5GH6bjksHhJvO984E07UgVKweIC2I3VZIWoZVflRpzqTHlcM0+P6jXRW4yskI3KtuqBTX2WHrbrrMXKNUYANmPWusVI8m2YfiuQ+o4Q2hmF0Sr99YayUaj3NJ9Dcc316+j0XQCdut4fCQbxjNyjYl0qepgDb7z0pFmRK4uSIX10pD2pjxl1wtJlpPg5kqcKXG5758h20pa/Ziw/RB/lBqCcfQh7sN9J8Ndi45OwUoXtBoWXlw5o/3acBJsbxwC3eNVJgyb19NzNflvrXMhseDJmb897b4qPqhJqc7pvwhb1OqWkQBR/dVA6giOwFpE4CeDa9HmREBu1H9CF80zMsLc28JgjF0RSF3Qh7/ENug6OvYvLFv2x7Slh6MySafoDjTjNW53B3RCo3dm4dfmJ5I0Qf1e0= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199021)(46966006)(36840700001)(40470700004)(1076003)(26005)(16526019)(186003)(2616005)(336012)(426003)(54906003)(83380400001)(36860700001)(7696005)(47076005)(36756003)(40460700003)(6666004)(2876002)(316002)(40480700001)(8936002)(82740400003)(5660300002)(2906002)(478600001)(86362001)(6916009)(4326008)(41300700001)(8676002)(70586007)(356005)(82310400005)(81166007)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 02:54:00.7161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3fdb428-7716-42fe-c5ce-08db4d13faa5 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT079.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5622 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Abner Chang Add the helper library of JSON to C structure converter common functions. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy --- RedfishClientPkg/RedfishClientLibs.dsc.inc | 1 + .../ConverterCommonLib/ConverterCommonLib.inf | 44 +++++++++++++++++++ .../ConverterCommonLib/RedfishCsCommon.h | 14 ++++++ .../ConverterCommonLib/RedfishDataTypeDef.h | 14 ++++++ 4 files changed, 73 insertions(+) create mode 100644 RedfishClientPkg/ConverterLib/edk2library/ConverterComm= onLib/ConverterCommonLib.inf create mode 100644 RedfishClientPkg/ConverterLib/edk2library/ConverterComm= onLib/RedfishCsCommon.h create mode 100644 RedfishClientPkg/ConverterLib/edk2library/ConverterComm= onLib/RedfishDataTypeDef.h diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc b/RedfishClientPkg/= RedfishClientLibs.dsc.inc index 4655dd7081..a23b9478af 100644 --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc @@ -20,4 +20,5 @@ RedfishFeatureUtilityLib|RedfishClientPkg/Library/RedfishFeatureUtilityL= ib/RedfishFeatureUtilityLib.inf RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/Red= fishPlatformConfigLib.inf RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/R= edfishContentCodingLibNull.inf + ConverterCommonLib|RedfishClientPkg/ConverterLib/edk2library/ConverterCo= mmonLib/ConverterCommonLib.inf =20 diff --git a/RedfishClientPkg/ConverterLib/edk2library/ConverterCommonLib/C= onverterCommonLib.inf b/RedfishClientPkg/ConverterLib/edk2library/Converter= CommonLib/ConverterCommonLib.inf new file mode 100644 index 0000000000..589c864815 --- /dev/null +++ b/RedfishClientPkg/ConverterLib/edk2library/ConverterCommonLib/Converte= rCommonLib.inf @@ -0,0 +1,44 @@ +## @file +# This is the helper library of converter +# +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +[Defines] +INF_VERSION =3D 0x00010006 +BASE_NAME =3D ConverterCommonLib +FILE_GUID =3D B70BDFAE-4D07-9B07-FD24-42AA235D6108 +MODULE_TYPE =3D BASE +VERSION_STRING =3D 1.0 +LIBRARY_CLASS =3D ConverterCommonLib | DXE_DRIVER DXE_RUN= TIME_DRIVER UEFI_APPLICATION UEFI_DRIVER +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC RISCV64 +# + +[Sources] + ../../src/RedfishCsCommon.c + ../../src/RedfishCsMemory.c + +[Packages] + MdePkg/MdePkg.dec + RedfishPkg/RedfishPkg.dec + RedfishClientPkg/RedfishClientPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + MemoryAllocationLib + JsonLib + +[BuildOptions] + # + # Disables the following Visual Studio compiler warnings + # so we do not break the build with /WX option: + # C4706: assignment within conditional expression + # + MSFT:*_*_*_CC_FLAGS =3D /wd4706 + diff --git a/RedfishClientPkg/ConverterLib/edk2library/ConverterCommonLib/R= edfishCsCommon.h b/RedfishClientPkg/ConverterLib/edk2library/ConverterCommo= nLib/RedfishCsCommon.h new file mode 100644 index 0000000000..8567284ee4 --- /dev/null +++ b/RedfishClientPkg/ConverterLib/edk2library/ConverterCommonLib/RedfishC= sCommon.h @@ -0,0 +1,14 @@ +/** @file + Wrapper file for RedfishCsCommon.h + + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef WRAPPER_REDFISH_CS_COMMON_H_ +#define WRAPPER_REDFISH_CS_COMMON_H_ + +#include "../../include/RedfishCsCommon.h" + +#endif diff --git a/RedfishClientPkg/ConverterLib/edk2library/ConverterCommonLib/R= edfishDataTypeDef.h b/RedfishClientPkg/ConverterLib/edk2library/ConverterCo= mmonLib/RedfishDataTypeDef.h new file mode 100644 index 0000000000..9d29342972 --- /dev/null +++ b/RedfishClientPkg/ConverterLib/edk2library/ConverterCommonLib/RedfishD= ataTypeDef.h @@ -0,0 +1,14 @@ +/** @file + Wrapper file for RedfishDataTypeDef.h + + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef WRAPPER_REDFISH_DATA_TYPE_H_ +#define WRAPPER_REDFISH_DATA_TYPE_H_ + +#include "../../include/RedfishDataTypeDef.h" + +#endif --=20 2.37.1.windows.1