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 8B72A780091 for ; Tue, 16 Jan 2024 05:04:38 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=BrRVFSg8/Rs6rrCBKxYQN9QhtK0/JZJoXrdSrw31IjY=; 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: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=1705381477; v=1; b=IZacMQ6LVSYjOPtfbK3PUpj978RdexdgKjUQ29y4/lpQCcT8qBcGXMxKIrW1w7Ahah2Q0mVP VN5UqNmmRU8Q4i97KBszNoSQd/6IFw5K0q4G766bywDc+4hA5ou5xx36SmGFF71/fN+N/pzVEHz iqYCEt3nQAhFhHq5UN5PH7Pc= X-Received: by 127.0.0.2 with SMTP id YTRwYY7687511xCyQu2rsMpc; Mon, 15 Jan 2024 21:04:37 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.61]) by mx.groups.io with SMTP id smtpd.web11.3295.1705375077241938933 for ; Mon, 15 Jan 2024 19:17:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i8Y7nbd1sxew/EsVR6bzxBqr+yiQcL1H1ZBv2PY3BlfhA0enq2QO03LAHs5hd9+M7GyfVvn3P0AhojpPsDWSasvwWEzNvTZxWeirVeeWOZZR7e6yix21EZVqE9U/PZYjy2ESP7894BsfoS42mK47ykMKsidFwqaYF5s10hmBi1oUjN5LO2fBLmQri9nHDlaWQhW25055nTYZXYLx3x55/gjpXRX+dj6XNsoYz/bAFz+VhQJrsR7mzQ1BaJFNmqPV7P+U90IG0DdGDQ2NmPJlQB+a/e923Q5lU9C2XOgYFtRTTQaz6TnoeOurpy57VjUP8U7wv4OlXPC9EDy2mkzU3w== 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=c7W1WciF+3BhDLz/hrPWst8ypJZS9G/U2pDCl8z4jqY=; b=Lk6eLwu+uIrIMPPaC0s026xHi14iTUNVRrGBuONE8ydBUrmFq8ctUtIH/OGp3kN0FzBiibWz7h0O7iIivWPQHik864g0EabSpfSOgXFSFhaVUAEPeICqU9ouk7NF+mpkj8BnfYTzt4pjRowKJAsg8KCECwUapaL5wGQYkZD8ZkitscqFXouo96R7TvyG06chojhpv6MWN+qcGFLeUq5xXG08DDhQAl1cn2Lxwu/YjCCqAbrbXLOKl0AnbGVcvgcA/uIlrJn+CW+hhAL7+lhwiuzyYWrhEYzNfMJ9JE+lQIP/SMQB7l0ZPwvk+J505cJd2ijt32QM3EA8s7XxgCszvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by DS7PR12MB6047.namprd12.prod.outlook.com (2603:10b6:8:84::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Tue, 16 Jan 2024 03:17:52 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::a78e:602e:415c:4cb4]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::a78e:602e:415c:4cb4%3]) with mapi id 15.20.7181.020; Tue, 16 Jan 2024 03:17:52 +0000 From: "Nickle Wang via groups.io" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/ConverterLib: Function to remove Redfish unchangeable properties Thread-Topic: [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/ConverterLib: Function to remove Redfish unchangeable properties Thread-Index: AQHaRQc4HTeiDNjzZUSd1KJIVDmyR7Dbylvg Date: Tue, 16 Jan 2024 03:17:52 +0000 Message-ID: References: <20240112032622.274-1-abner.chang@amd.com> <20240112032622.274-3-abner.chang@amd.com> In-Reply-To: <20240112032622.274-3-abner.chang@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|DS7PR12MB6047:EE_ x-ms-office365-filtering-correlation-id: b8b123e5-114f-4d8e-b3f6-08dc1641b9f4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: OQdMf8ZoiDMP9KCiDyzKuKqVTmNxRkTyBcn7Mf6cYHluVXb56GuCzQIZ30cBJvrb1Z2PVgFhBXsRS5704gh/LJxFFf7rif9m2LmA6B20CsnEgl+8VpCpBv9wMZhJVq0GedxTZiqzdgJx+y618UcsVqmqONagIKeNpE1Z7i8Q8r3Xc9UzvUMM6H5JuEPvxo6dmqSlKRnc7mk7iR4IxllgrJnpGibqgHfRGw/6Plyex3pOdd3cD9rWQkf7MKjWryLDjhd1ZqluFghN94ymqb9CXOQ+EiR0LGxP8lXv7VvVNaAd5UydLBmm7oSAW0N5wsVQe6w1szbwpqd7dlkl5PI/TQRU3lf4jR1y4EQFy74N3N49Stldi6xqoFJy3Mzc0iVa+F146C8YAsgkwTNEF0QJSEyh8wZz6WonNyVNAO8LjbNy/3AjI1xCLMBKThzj7GcCFiael6Em5gOS6WXJtaEAKn1oxeQxqZZEn0iTjDiX8cabFIjuNMqizppRFC23BEDOLBRN4oNdTMPwEzEd5/3naG8hC3ZFwsOX+GIm3HCJ0EcxvXNvyct5fkxLybvuQ6cJPtAbqrW7P947QAhCAfoHZljMJ2aFUN/znIiV4lpsRTBSw6eOKw3Pc4KDmXegN56gnH1LpWGEWUhcFS2Y5G+22Do/s39OMeHvjlI31PP4JEY= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?au26JZGNitqWCD95rw6Ipuotz/6tmiHh/TA9Lkjx5gRRCjB1keZnnlg6kysg?= =?us-ascii?Q?U4lv6T3rI15169uvapmoqeSNbdM1DzC1D/Y6Ps7gSthl5A2R9/vHSYvktXZ0?= =?us-ascii?Q?LgegUMM/rty1Oly5jTdNnwtBMU+5xrBqu/Au8ZGxnWdStm31mH6z5jjJr1v/?= =?us-ascii?Q?284kmSJgh0qwOUo8VZhMMHjnLiwX3MKXJ0oyLHuaBXibcBgCcPz1opvETx+3?= =?us-ascii?Q?MnpJyOLvNryd20BzLi4B/rLsGpcipDJG5k8FwP0IuH7IgWH+kVAVLKeukZeZ?= =?us-ascii?Q?1S6WoMZ/utxezXWY2wctqHevYI0KX/5UX3LS61sH8ss8Lw89R/oFtEPamQIX?= =?us-ascii?Q?9N3MZAhbEHf45o/q7yEJv4A21Du7TJxxJIqWXgS7go77uORHK1xkrxQ0y60n?= =?us-ascii?Q?XU5edTsGFwO3fci9FHtO9kg18FUCawfJ2ziB0NVKLzHVy8byrt6KftbEc8ed?= =?us-ascii?Q?pSu9SncdIXhYNQqwe6d7n8hFXoyJ6p//XoeLn3ITQHIDoCHdWz5OhMZXLm54?= =?us-ascii?Q?X3+i3X1rX1/Gwefyp0XBrEv/FTgRFeZDoT73rjbimmjMkWRm6263AUwzA7eN?= =?us-ascii?Q?8Rt/SayNplRFSsVGWn9qQXFIQRfesj/hJAzoNRAuVDuEcZNd/dQANGnQT9no?= =?us-ascii?Q?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?= =?us-ascii?Q?/sfj4z6MJl/0cxMcpE9KPKCKl4QjuCEdLxggDuyd2HpiS76AtrIdLPAWMopw?= =?us-ascii?Q?fFu6kQP6Hw7eENzINHHQMrMb251GQjJEIAGwuhAZSxlF?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8b123e5-114f-4d8e-b3f6-08dc1641b9f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2024 03:17:52.8235 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zWlrYc62sgeFRfEN2wUR9fowtaiv+UQ8G7SuGJ2WrfOQkHLKZN32JaUDkFPihhVIkzNHWUj8ma4DjcW5zUhjBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6047 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,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: yY1tYayShHtmLvQ1azolKoIfx7686176AA= 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=IZacMQ6L; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io I found typos. Please see below. Regards, Nickle > -----Original Message----- > From: abner.chang@amd.com > Sent: Friday, January 12, 2024 11:26 AM > To: devel@edk2.groups.io > Cc: Nickle Wang ; Igor Kulchytskyy > Subject: [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/ConverterLib: > Function to remove Redfish unchangeable properties >=20 > External email: Use caution opening links or attachments >=20 >=20 > From: Abner Chang >=20 > Update RedfishCsCommon.c to add a function to remove Redfish unchangeable > properties. >=20 > Signed-off-by: Abner Chang > Cc: Nickle Wang > Cc: Igor Kulchytskyy > --- > .../ConverterLib/include/RedfishCsCommon.h | 20 +++++++ > .../ConverterLib/src/RedfishCsCommon.c | 55 +++++++++++++++++++ > 2 files changed, 75 insertions(+) >=20 > diff --git a/RedfishClientPkg/ConverterLib/include/RedfishCsCommon.h > b/RedfishClientPkg/ConverterLib/include/RedfishCsCommon.h > index e454ab0b73..f5278015aa 100644 > --- a/RedfishClientPkg/ConverterLib/include/RedfishCsCommon.h > +++ b/RedfishClientPkg/ConverterLib/include/RedfishCsCommon.h > @@ -104,6 +104,26 @@ DestoryCsMemory ( > RedfishCS_void *rootCs > ); >=20 > +/** > + This function removes the unchangeable Redfish properties from JSON > +raw text > + The content in JsonString is left unmodified, the caller has to give > +enoungh > + memory pointed by NewJsonBuffer in the size of BufferSize. > + > + JsonString Input JSON raw string > + NewJsonBuffer Pointer to memory for the updated JSON raw string in > + size of BuufferSize. > + BuufferSize The buffer size of NewJsonBuffer > + > + Return RedfishCS_status. > + > +**/ > +RedfishCS_status > +RemoveUnchangeableProperties ( > + RedfishCS_char *JsonString, > + RedfishCS_char *NewJsonBuffer, > + RedfishCS_uint32 BuufferSize > + ); BufferSize. You have double 'u' above. And how about to use ReadOnly inste= ad of "Unchangeable"? > + > typedef struct _RedfishCS_char_Array RedfishCS_char_Array; > typedef struct _RedfishCS_int64_Array RedfishCS_int64_Array; > typedef struct _RedfishCS_bool_Array RedfishCS_bool_Array; > diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c > b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c > index fd31e5296b..c6996d7d5d 100644 > --- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c > +++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c > @@ -1461,3 +1461,58 @@ CsEmptyPropLinkToJson ( >=20 > return RedfishCS_status_success; > } > + > +/** > + This function removes the unchangeable Redfish properties from JSON > +raw text > + The content in JsonString is left unmodified, the caller has to give > +enoungh > + memory pointed by NewJsonBuffer in the size of BufferSize. > + > + JsonString Input JSON raw string > + NewJsonBuffer Pointer to memory for the updated JSON raw string in > + size of BuufferSize. > + BuufferSize The buffer size of NewJsonBuffer > + > + Return RedfishCS_status. > + > +**/ > +RedfishCS_status > +RemoveUnchangeableProperties ( > + RedfishCS_char *JsonString, > + RedfishCS_char *NewJsonBuffer, > + RedfishCS_uint32 BuufferSize > + ) BufferSize. You have double 'u' above. > +{ > + json_t *JsonObj; > + RedfishCS_char *TempChar; > + RedfishCS_status Status; > + > + if ((JsonString =3D=3D NULL) || (NewJsonBuffer =3D=3D NULL)) { > + return RedfishCS_status_invalid_parameter; > + } > + > + JsonObj =3D json_loads (JsonString, 0, NULL); if (JsonObj =3D=3D NULL= ) { > + return RedfishCS_status_unknown_error; } > + > + json_object_del (JsonObj, "@odata.type"); json_object_del (JsonObj, > + "@odata.id"); json_object_del (JsonObj, "Id"); json_object_del > + (JsonObj, "Name"); > + > + TempChar =3D json_dumps ((json_t *)JsonObj, JSON_INDENT (2)); > + if (TempChar !=3D NULL) { > + if ((strlen (TempChar) + 1) > BuufferSize) { > + Status =3D RedfishCS_status_insufficient_memory; > + } else { > + memcpy (NewJsonBuffer, TempChar, strlen (TempChar) + 1); > + free (TempChar); > + Status =3D RedfishCS_status_success; > + } > + } else { > + Status =3D RedfishCS_status_unknown_error; > + } > + json_decref(JsonObj); > + return Status; > +} > + > -- > 2.37.1.windows.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 (#113863): https://edk2.groups.io/g/devel/message/113863 Mute This Topic: https://groups.io/mt/103676920/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-