From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.5007.1603954353508031625 for ; Wed, 28 Oct 2020 23:52:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=egkYapxA; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=057147ffc3=nickle.wang@hpe.com) Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09T6qK7r028963; Thu, 29 Oct 2020 06:52:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=wFKwXXoZYSGxoyU8lh6FcqeTkz94r+rWDyrZVX7bHcU=; b=egkYapxASwAOPcAZQo8yFFLXzLcqUxZAvMElrYGgu3W74RyjdQdUH+NqUZlaGo97Y1tK qveFdNYe/76OGCaPxs4hPusgLA5V5J2w8qJVc99kdFMcYpgdIXpEF39jJB+NdiE9PMGT Fr0BW0jZbYBMPUk1bqpvruAmzimb9Ltss/NemjObANnblDGdAXZLzqqAQGwZbvQSR59b WkKG3s52A6JQWPpEBG+ba1TRs/dk/tLreDDPjvpAQUdAppHfvaBdlmGpyPrnej6Jw5OO 75+r7LNEpS6NOFS4vDzgZVFIqbXoiQGV7ctSeKuDpBLnrpZY2FBZJXsrfWVGtQtsj1mZ uw== Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 34ep520j8w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Oct 2020 06:52:20 +0000 Received: from G4W10204.americas.hpqcorp.net (g4w10204.houston.hpecorp.net [16.207.82.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3427.houston.hpe.com (Postfix) with ESMTPS id 482737A; Thu, 29 Oct 2020 06:52:18 +0000 (UTC) Received: from G2W6311.americas.hpqcorp.net (16.197.64.53) by G4W10204.americas.hpqcorp.net (16.207.82.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Oct 2020 06:52:12 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (15.241.52.11) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 29 Oct 2020 06:52:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hW/MiDUqEVIxwxrxBDlzJ9KV/Bj3Eg3qV4PKLcWl2bs70w/hAne4+EfJMYMaJtyFS7mif5pDqtUPMAvT7a8fssNT4qJ9I1VVcGvrfh4TszVhX9tXHTd5B2LC6PaKT7FEQnIwoyRZgwwXusnHlWw25JbkqCpnpxgREhNKwlVR6sM9OWhgJJzB3GTHOpDRhJ4jtn9337CPU2aVAZcx1enp4vqwOXm1gHWTkraCOq50XronAomM5FOQ6MsTGbCv9iKlB1A0r8fsiEy9rzBTZWOg/vN1eaT9r2Msx5HBHm6hkrKvZkWjK5dHEbLrsTagLQtJysnFO4nHzbi5IKf2qLA0ww== 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-SenderADCheck; bh=wFKwXXoZYSGxoyU8lh6FcqeTkz94r+rWDyrZVX7bHcU=; b=gCLrm+EQXEGJUC8QCV1/zrw+4eKKHpzWZ/Ysgs1flUKVoyjlSdrPc8uONEZxfjdV+Akqgo15Q198OPcvJllUq76hqfoq+crixsV764NxV7rbgJza12xlucD0iNHUR2y1GD7QXzjTazaddsy5nrF15Dewzd9+ppwh+yUY2MpZyumfmWwGf+jFDRKq1g9RLUMfcCkxMXT+732ZC8+AJtpASFx+Yp2CHjcQHWgGf9gs8WqVUaEUFNoWvA7T5SBzagwA/hEH+j1KG2bXafBdLafrZK5oalZSa19cPviiyZoXNUhIKWxxYvwV0ywiwW+c7cnIx0TGtkzht4RoWaUDjXTopg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from DF4PR8401MB0812.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::7) by DF4PR8401MB0460.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7607::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.25; Thu, 29 Oct 2020 06:52:10 +0000 Received: from DF4PR8401MB0812.NAMPRD84.PROD.OUTLOOK.COM ([fe80::c9cf:9c73:a8a5:331b]) by DF4PR8401MB0812.NAMPRD84.PROD.OUTLOOK.COM ([fe80::c9cf:9c73:a8a5:331b%12]) with mapi id 15.20.3499.018; Thu, 29 Oct 2020 06:52:10 +0000 From: "Nickle Wang" To: "Chang, Abner (HPS SW/FW Technologist)" , "devel@edk2.groups.io" CC: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao Subject: Re: [RestJsonStructureDxe PATCH v3 1/3] MdePkg/Include: Definitions of EFI REST JSON Structure Protocol Thread-Topic: [RestJsonStructureDxe PATCH v3 1/3] MdePkg/Include: Definitions of EFI REST JSON Structure Protocol Thread-Index: AQHWoxEEyTyl3GFKqkyXM1+6COUWwamuOVSg Date: Thu, 29 Oct 2020 06:52:09 +0000 Message-ID: References: <20201015154928.16211-1-abner.chang@hpe.com> <20201015154928.16211-2-abner.chang@hpe.com> In-Reply-To: <20201015154928.16211-2-abner.chang@hpe.com> Accept-Language: zh-TW, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: hpe.com; dkim=none (message not signed) header.d=none;hpe.com; dmarc=none action=none header.from=hpe.com; x-originating-ip: [36.224.251.48] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 92bf5660-d154-4cc3-1c53-08d87bd72885 x-ms-traffictypediagnostic: DF4PR8401MB0460: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:133; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eNS55yhnSRcVeTuf8Ll7gJW+8BtsM+fXuWZLcgJFWAn6QsE3NgN1dCN7DQJmOn3P47Kjk/UbqL2SypUjiBvbF8y2r3zuYVVaeZQSNYSY3JBikyUDqnYwMK2EMbjWe/zd8kI2pBY9IqY8g96JEP6I1VCVqEdPnq2a9Qw2VFt44GdQTRqYIjdvplPL8KCHYYWaUqlhDYOfsuYkn+Pfz0Bstp+RuwSLJqjXvuH9X2IPrRZ0bW2UaItMR5OnmQXG8ZhcaDsUtOR9ip41mCatnIkdvexqZXEZ4Rcm0qfJsY4Mg6HJg4C4W6SGw/zwh32+C7Tx x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DF4PR8401MB0812.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(396003)(366004)(39860400002)(136003)(346002)(376002)(66946007)(478600001)(2906002)(110136005)(66446008)(52536014)(55016002)(8936002)(66556008)(8676002)(186003)(26005)(6506007)(71200400001)(316002)(7696005)(53546011)(66476007)(86362001)(83380400001)(54906003)(4326008)(64756008)(76116006)(5660300002)(33656002)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: qqYVmT4lvG4tUQ171TkuFy/dV/t2C+pNy1ThCdzLIgguolkrsVJ87qMnarYSamgqtKAD0KIYS7j8VAoKG4ignxOwu9zwE6EOII/m3+AcyDOoIoSlekPtyjR5tXOv9hD8SYTaBe5uxdkKZt6R0C3VlZXH0Qxc1v125pw6xh8EP7mKyR0J80CwU5moTXyESiHPPcJ+xU/RMjUz35VCaMq2wqj4Ysr+DZNaBAVrQ8KPakDkmKG9ofO9Jpe+9Jdnnzzl4+OnANFfZHk8xFW0oPMlrF8aWTZX3svz++Vs0M5H8L6bXyw/DtbvpF9rZxh4EQvGfsnLQ/sNdTLPjokYExHaTJ1j1ovxGQHSI6gFWSVZBqBnsevskKjPoT2TVRH0PqaKeavmnc148+3d2ePyaf9vFh8EzxwT6SxEEVchhUzOeAsJCebh4/Xx0hP5K427ID1Jfa0flUerlO74c38PnrqFZvtguQijPuNkQ0vXI3aEpENgwBcWQKJHc15Y1Mqpu7hsOOlxPx50ySWrW24rJYc9DaYa9p2Xx1+Q3sc4HqwXVSvPH4TvxQ3AD9Zk7rfypvzWeao9ywlsI5PsvRyyqU58qRHYycsD5xeklm8IrfIC1vki8E4s1mkvJil6+js2QFIG5LuA6L7afg1pHYvdCAtabw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0812.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 92bf5660-d154-4cc3-1c53-08d87bd72885 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2020 06:52:09.9463 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8/3/hBp6WI4k98VaYYo5Vh+iv9tC2/dh/Eb0ygqmqyf5D56ZP0FVQ8d4KbVjnLEFteD6I53up1dtmiYcfLzBlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0460 X-OriginatorOrg: hpe.com X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-10-29_03:2020-10-29,2020-10-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1011 mlxlogscore=999 adultscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010290047 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Abner, I found an issue on function header of EFI_REST_JSON_STRUCTURE_REGISTER tha= t is not follow UEFI spec. Thanks, Nickle > -----Original Message----- > From: Chang, Abner (HPS SW/FW Technologist) > Sent: Thursday, October 15, 2020 11:49 PM > To: devel@edk2.groups.io > Cc: Michael D Kinney ; Liming Gao > ; Zhiguang Liu ; Jiaxin > Wu ; Siyuan Fu ; Fan Wang > ; Jiewen Yao ; Wang, Nickle > (HPS SW) > Subject: [RestJsonStructureDxe PATCH v3 1/3] MdePkg/Include: Definitions > of EFI REST JSON Structure Protocol >=20 > Add definitions of EFI REST JSON Structure according to UEFI spec > 2.8 Section 29.7.3 EFI REST JSON Resource to C Structure Converter. >=20 > Signed-off-by: Abner Chang >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Jiaxin Wu > Cc: Siyuan Fu > Cc: Fan Wang > Cc: Jiewen Yao > Cc: Nickle Wang > Reviewed-by: Liming Gao > --- > MdePkg/Include/Protocol/RestJsonStructure.h | 161 > ++++++++++++++++++++ > MdePkg/MdePkg.dec | 3 + > 2 files changed, 164 insertions(+) > create mode 100644 MdePkg/Include/Protocol/RestJsonStructure.h >=20 > diff --git a/MdePkg/Include/Protocol/RestJsonStructure.h > b/MdePkg/Include/Protocol/RestJsonStructure.h > new file mode 100644 > index 0000000000..adaf148f71 > --- /dev/null > +++ b/MdePkg/Include/Protocol/RestJsonStructure.h > @@ -0,0 +1,161 @@ > +/** @file > + This file defines the EFI REST JSON Structure Protocol interface. > + > + (C) Copyright 2020 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Revision Reference: > + This Protocol is introduced in UEFI Specification 2.8 > + > +**/ > + > +#ifndef EFI_REST_JSON_STRUCTURE_PROTOCOL_H_ > +#define EFI_REST_JSON_STRUCTURE_PROTOCOL_H_ > + > +/// > +/// GUID definitions > +/// > +#define EFI_REST_JSON_STRUCTURE_PROTOCOL_GUID \ > + { \ > + 0xa9a048f6, 0x48a0, 0x4714, {0xb7, 0xda, 0xa9, 0xad,0x87, 0xd4, 0xda= , > 0xc9 } \ > + } > + > +typedef struct _EFI_REST_JSON_STRUCTURE_PROTOCOL > EFI_REST_JSON_STRUCTURE_PROTOCOL; > +typedef CHAR8 * EFI_REST_JSON_RESOURCE_TYPE_DATATYPE; > + > +/// > +/// Structure defintions of resource name space. > +/// > +/// The fields declared in this structure define the > +/// name and revision of payload delievered throught > +/// REST API. > +/// > +typedef struct _EFI_REST_JSON_RESOURCE_TYPE_NAMESPACE { > + CHAR8 *ResourceTypeName; ///< Resource type name > + CHAR8 *MajorVersion; ///< Resource major version > + CHAR8 *MinorVersion; ///< Resource minor version > + CHAR8 *ErrataVersion; ///< Resource errata version > +} EFI_REST_JSON_RESOURCE_TYPE_NAMESPACE; > + > +/// > +/// REST resource type identifier > +/// > +/// REST resource type consists of name space and data type. > +/// > +typedef struct _EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER { > + EFI_REST_JSON_RESOURCE_TYPE_NAMESPACE NameSpace; ///< > Namespace of this resource type. > + EFI_REST_JSON_RESOURCE_TYPE_DATATYPE DataType; ///< Name of > data type declared in this > + ///< resource type. > +} EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER; > + > +/// > +/// List of JSON to C structure conversions which this convertor support= s. > +/// > +typedef struct _EFI_REST_JSON_STRUCTURE_SUPPORTED { > + LIST_ENTRY NextSupportedRsrcInterp; ///< Linkli= st to next > supported conversion. > + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER RestResourceInterp; ///< > JSON resource type this convertor supports. > +} EFI_REST_JSON_STRUCTURE_SUPPORTED; > + > +/// > +/// The header file of JSON C structure > +/// > +typedef struct _EFI_REST_JSON_STRUCTURE_HEADER { > + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER JsonRsrcIdentifier; ///< > Resource identifier which use to > + ///< cho= ice the proper interpreter. > + ///< Follow by a pointer points to JSON structure, the content in the > + ///< JSON structure is implementation-specific according to converter > producer. > + VOID *JsonStructurePointer; > +} EFI_REST_JSON_STRUCTURE_HEADER; > + > +/** > + JSON-IN C Structure-OUT function. Convert the given REST JSON resource > into structure. > + > + @param[in] This This is the > EFI_REST_JSON_STRUCTURE_PROTOCOL instance. > + @param[in] JsonRsrcIdentifier This indicates the resource type and > version is given in > + ResourceJsonText. > + @param[in] ResourceJsonText REST JSON resource in text format. > + @param[out] JsonStructure Pointer to receive the pointer to > EFI_REST_JSON_STRUCTURE_HEADER > + > + @retval EFI_SUCCESS > + @retval Others > +--*/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_JSON_STRUCTURE_TO_STRUCTURE)( > + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, > + IN EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *JsonRsrcIdentifier > OPTIONAL, > + IN CHAR8 *ResourceJsonText, > + OUT EFI_REST_JSON_STRUCTURE_HEADER **JsonStructure > +); > + > +/** > + Convert the given REST JSON structure into JSON text. > + > + @param[in] This This is the > EFI_REST_JSON_STRUCTURE_PROTOCOL instance. > + @param[in] JsonStructureHeader The point to > EFI_REST_JSON_STRUCTURE_HEADER structure. > + @param[out] ResourceJsonText Pointer to receive REST JSON resour= ce > in text format. > + > + @retval EFI_SUCCESS > + @retval Others > + > +--*/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_JSON_STRUCTURE_TO_JSON)( > + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, > + IN EFI_REST_JSON_STRUCTURE_HEADER *JsonStructureHeader, > + OUT CHAR8 **ResourceJsonText > +); > + > +/** > + This function destroys the REST JSON structure. > + > + @param[in] This This is the > EFI_REST_JSON_STRUCTURE_PROTOCOL instance. > + @param[in] JsonStructureHeader JSON structure to destroy. > + > + @retval EFI_SUCCESS > + @retval Others > + > +--*/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTURE)( > + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, > + IN EFI_REST_JSON_STRUCTURE_HEADER *JsonStructureHeader > +); > +/** > + This function provides REST JSON resource to structure converter > registration. > + > + @param[in] This This is the > EFI_REST_JSON_STRUCTURE_PROTOCOL instance. > + @param[in] JsonStructureSupported The type and version of REST JS= ON > resource which this converter > + supports. > + @param[in] ToStructure The function to convert REST JS= ON > resource to structure. > + @param[in] ToJson The function to convert REST JS= ON structure > to JSON in text format. > + @param[out] DestroyStructure Destroy REST JSON structure ret= urned According to UEFI 2.8, this is [in] parameter. > in ToStructure() function. > + > + @retval EFI_SUCCESS Register successfully. > + @retval Others Fail to register. > + > +--*/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_JSON_STRUCTURE_REGISTER)( > + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, > + IN EFI_REST_JSON_STRUCTURE_SUPPORTED *JsonStructureSupported, > + IN EFI_REST_JSON_STRUCTURE_TO_STRUCTURE ToStructure, > + IN EFI_REST_JSON_STRUCTURE_TO_JSON ToJson, > + IN EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTURE DestroyStructure > +); > + > +/// > +/// EFI REST JSON to C structure protocol definition. > +/// > +struct _EFI_REST_JSON_STRUCTURE_PROTOCOL { > + EFI_REST_JSON_STRUCTURE_REGISTER Register; ///< Reg= ister > JSON to C structure convertor > + EFI_REST_JSON_STRUCTURE_TO_STRUCTURE ToStructure; ///< The > function to convert JSON to C structure > + EFI_REST_JSON_STRUCTURE_TO_JSON ToJson; ///< The > function to convert C structure to JSON > + EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTURE DestoryStructure; > ///< Destory C structure. > +}; > + > +#endif > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index 5205374d62..645f61b80e 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -1855,6 +1855,9 @@ > gEfiRestExProtocolGuid =3D { 0x55648b91, 0xe7d, 0x40a3, = { 0xa9, 0xb3, > 0xa8, 0x15, 0xd7, 0xea, 0xdf, 0x97 }} > gEfiRestExServiceBindingProtocolGuid =3D { 0x456bbe01, 0x99d0, 0x45ea, > { 0xbb, 0x5f, 0x16, 0xd8, 0x4b, 0xed, 0xc5, 0x59 }} >=20 > + ## Include/Protocol/RestJsonStructure.h > + gEfiRestJsonStructureProtocolGuid =3D { 0xa9a048f6, 0x48a0, 0x4714, {= 0xb7, > 0xda, 0xa9, 0xad,0x87, 0xd4, 0xda, 0xc9 }} > + > # > # Protocols defined in Shell2.0 > # > -- > 2.17.1