From nobody Thu May 9 10:55:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66790+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66790+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604021762; cv=none; d=zohomail.com; s=zohoarc; b=O4oeDmSeYpP7OOins02pVTL7dH2WT5YcHuM65WimF0jmC9HBGwnBcYLMBZ6W/A6iz22yfd//FwTd7un+u9itYau405mvv6nQhJUUg5YJrRwa6JZqH1g0mzc3x7DMQdb2ukX/mlEIUkLjti2qBNdUimSt01H9zcVNGvKS0xDzHto= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604021762; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=G6tH1j9UPQtx5sxtNZu1uv0PFJoFLITvJz3E8QMWSHM=; b=SXIzwYgZLXRUkHdffXqAnoBxmpYW29fyRM7LZt7KtIEXfPt1pM5RuAKdkrWLp1zELSXj2dWl6BKNFIoOIAdxrvTJFPiPf8l8I6j2D90VyH5J5lgJQpIGxwmmT5fcCnQnAbBsM4RPfYzxlKBjITRfp9LW6KTqVIaL1hv08Du11kE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66790+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1604021762450391.7800817471923; Thu, 29 Oct 2020 18:36:02 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 30XHYY1788612xl3qy3QbvNv; Thu, 29 Oct 2020 18:36:02 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.7132.1604021760879583505 for ; Thu, 29 Oct 2020 18:36:00 -0700 X-Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09U1UfQt016813; Fri, 30 Oct 2020 01:35:57 GMT X-Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 34f5471b60-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 01:35:57 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 60B5A9C; Fri, 30 Oct 2020 01:35:56 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 83A3436; Fri, 30 Oct 2020 01:35:53 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang Subject: [edk2-devel] [RestJsonStructureDxe PATCH v4 1/3] MdePkg/Include: Definitions of EFI REST JSON Structure Protocol Date: Fri, 30 Oct 2020 08:50:31 +0800 Message-Id: <20201030005033.31953-2-abner.chang@hpe.com> In-Reply-To: <20201030005033.31953-1-abner.chang@hpe.com> References: <20201030005033.31953-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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@hpe.com X-Gm-Message-State: 5TEmkhMIbJ9DPyqeXZ91tKONx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604021762; bh=imvKrhbplv6qGgw1fsPN0VlCU6CKuqp89f1JdwsQVGQ=; h=Cc:Date:From:Reply-To:Subject:To; b=KKYuKjHPAkAVAXKZDwYnmt9qrz/vFWvGqgeWBxd1PrO3mKGVMRQfWx53elcnqY8JhO3 eexrmNIbZkn7Q96LUW2ENnze0cf/tbDeOxo4aAgG54UPMihUtZnT/Y+r58rKdxCPqvzee n00/H+x4rceSSZtG/vQ4qi2/2+35Hbu3wtU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Abner Chang 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 diff --git a/MdePkg/Include/Protocol/RestJsonStructure.h b/MdePkg/Include/P= rotocol/RestJsonStructure.h new file mode 100644 index 0000000000..c9e9a35a41 --- /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_P= ROTOCOL; +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 supports. +/// +typedef struct _EFI_REST_JSON_STRUCTURE_SUPPORTED { + LIST_ENTRY NextSupportedRsrcInterp; ///< Linklist= to next supported conversion. + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER RestResourceInterp; ///< JSON res= ource 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; ///< Resou= rce identifier which use to + ///< choic= e the proper interpreter. + ///< Follow by a pointer points to JSON structure, the content in the + ///< JSON structure is implementation-specific according to converter pr= oducer. + VOID *JsonStructurePointer; +} EFI_REST_JSON_STRUCTURE_HEADER; + +/** + JSON-IN C Structure-OUT function. Convert the given REST JSON resource i= nto structure. + + @param[in] This This is the EFI_REST_JSON_STRUCTURE_PR= OTOCOL instance. + @param[in] JsonRsrcIdentifier This indicates the resource type and v= ersion 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_P= ROTOCOL instance. + @param[in] JsonStructureHeader The point to EFI_REST_JSON_STRUCTURE_= HEADER structure. + @param[out] ResourceJsonText Pointer to receive REST JSON resource= 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_P= ROTOCOL 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 registr= ation. + + @param[in] This This is the EFI_REST_JSON_STRUCTU= RE_PROTOCOL instance. + @param[in] JsonStructureSupported The type and version of REST JSON= resource which this converter + supports. + @param[in] ToStructure The function to convert REST JSON= resource to structure. + @param[in] ToJson The function to convert REST JSON= structure to JSON in text format. + @param[out] DestroyStructure Destroy REST JSON structure retu= rned 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; ///< Regis= ter JSON to C structure convertor + EFI_REST_JSON_STRUCTURE_TO_STRUCTURE ToStructure; ///< The f= unction to convert JSON to C structure + EFI_REST_JSON_STRUCTURE_TO_JSON ToJson; ///< The f= unction to convert C structure to JSON + EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTURE DestoryStructure; ///< Desto= ry 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, {0x= b7, 0xda, 0xa9, 0xad,0x87, 0xd4, 0xda, 0xc9 }} + # # Protocols defined in Shell2.0 # --=20 2.17.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 (#66790): https://edk2.groups.io/g/devel/message/66790 Mute This Topic: https://groups.io/mt/77902814/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 10:55:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66791+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66791+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604021778; cv=none; d=zohomail.com; s=zohoarc; b=e5ySyFNKX/BArbxhBgfQ9d5swzCE4NDQDDavJ5T2KXt3+EagGB5TqnH55gzwauOylj+m+gLl+fc4a9Xmj/pZxrLrM1+qXSlkrYs6FCL1UF1V7+YZvDhU9CJJ0E8MYOPMrSbVM1i3h8xI9hbCNiTMZ+aBMmGXc4UsRH8V46Kjq0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604021778; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=vaFel38IlsISkqd4V1TkSBhrtbpmuN8S72jRxWY4AGw=; b=HQfDXxNADuwPJ+r2VSGtHQJ+Mln3NtNmzZXzzEdTEgZQs9XLDIpHXZtvPPjpD/FWrBGCgKqIsaRYWW6rICF8O8MzlVks6RpKJn29237lqDF32lx8GQVN+MnWkfjamztZS9YSuOKt5ZKPEx0c0Nn7qOTTl8htr1Fz0lrl2GhL1NA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66791+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1604021778775805.1572798084612; Thu, 29 Oct 2020 18:36:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id zZFPYY1788612xgF8vCD3dJt; Thu, 29 Oct 2020 18:36:18 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web09.7265.1604021777376274140 for ; Thu, 29 Oct 2020 18:36:17 -0700 X-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 09U1aGI6004019; Fri, 30 Oct 2020 01:36:16 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 34ftw4y9jj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 01:36:16 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 11A9F6D; Fri, 30 Oct 2020 01:35:58 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id AD99C36; Fri, 30 Oct 2020 01:35:56 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang Subject: [edk2-devel] [RestJsonStructureDxe PATCH v4 2/3] RedfishPkg/RestJsonStructureDxe: EFI REST JSON Structure Protocol Date: Fri, 30 Oct 2020 08:50:32 +0800 Message-Id: <20201030005033.31953-3-abner.chang@hpe.com> In-Reply-To: <20201030005033.31953-1-abner.chang@hpe.com> References: <20201030005033.31953-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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@hpe.com X-Gm-Message-State: SUhWZiD3EVrLoMmkLIr7vAz9x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604021778; bh=2vR3aYFTEBd0uQxosH8oLTAbv0Iz2MH1bakm8L7jDhA=; h=Cc:Date:From:Reply-To:Subject:To; b=j1sQgxQllCxeJdlcvjN0TgLWfolQ+H8GfnSO+G2fzBGHce3TzKHRXqvoM4qV5SDTHLD VM4P3cLvRpKfi3xRtachYs+biX7MzWsGltFWpllAkit6lgxHTknDIrOUDKVKdtvUr6dGs /hy2RAGhCI5o+/pml/4pF10K0k1bpco05jw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Implementation of EFI_REST_JSON_STRUCTURE_PROTOCOL, refer to UEFI spec 2.8 Section 29.7.3 EFI REST JSON Resource to C Structure Converter. Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Fan Wang Cc: Jiewen Yao Cc: Nickle Wang Reviewed-by: Nickle Wang --- RedfishPkg/RedfishPkg.dsc | 11 + .../RestJsonStructureDxe.c | 586 ++++++++++++++++++ .../RestJsonStructureDxe.inf | 39 ++ .../RestJsonStructureInternal.h | 33 + 4 files changed, 669 insertions(+) create mode 100644 RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c create mode 100644 RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf create mode 100644 RedfishPkg/RestJsonStructureDxe/RestJsonStructureIntern= al.h diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc index 8acadddefc..f0c6740fac 100644 --- a/RedfishPkg/RedfishPkg.dsc +++ b/RedfishPkg/RedfishPkg.dsc @@ -38,3 +38,14 @@ DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableL= ib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf + +[LibraryClasses.ARM, LibraryClasses.AARCH64] + # + # This library provides the instrinsic functions generated by a given co= mpiler. + # + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf + ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf + +[Components] + RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c b/Redfi= shPkg/RestJsonStructureDxe/RestJsonStructureDxe.c new file mode 100644 index 0000000000..a3f4cd3c9a --- /dev/null +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c @@ -0,0 +1,586 @@ +/** @file + + The implementation of EFI REST Resource JSON to C structure convertor + Protocol. + + (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include "RestJsonStructureInternal.h" + +LIST_ENTRY mRestJsonStructureList; +EFI_HANDLE mProtocolHandle; + +/** + This function registers Restful resource interpreter for the + specific schema. + + @param[in] This This is the EFI_REST_JSON_STRUCTU= RE_PROTOCOL instance. + @param[in] JsonStructureSupported The type and version of REST JSON= resource which this converter + supports. + @param[in] ToStructure The function to convert REST JSON= resource to structure. + @param[in] ToJson The function to convert REST JSON= structure to JSON in text format. + @param[in] DestroyStructure Destroy REST JSON structure retur= ned in ToStructure() function. + + @retval EFI_SUCCESS Register successfully. + @retval Others Fail to register. + +**/ +EFI_STATUS +EFIAPI +RestJsonStructureRegister ( + 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 +) +{ + UINTN NumberOfNS; + UINTN Index; + LIST_ENTRY *ThisList; + REST_JSON_STRUCTURE_INSTANCE *Instance; + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *CloneSupportedInterpId; + EFI_REST_JSON_STRUCTURE_SUPPORTED *ThisSupportedInterp; + + if (This =3D=3D NULL || + ToStructure =3D=3D NULL || + ToJson =3D=3D NULL || + DestroyStructure =3D=3D NULL || + JsonStructureSupported =3D=3D NULL + ) { + return EFI_INVALID_PARAMETER; + } + + // + // Check how many name space interpreter can interpret. + // + ThisList =3D &JsonStructureSupported->NextSupportedRsrcInterp; + NumberOfNS =3D 1; + while (TRUE) { + if (ThisList->ForwardLink =3D=3D &JsonStructureSupported->NextSupporte= dRsrcInterp) { + break; + } else { + ThisList =3D ThisList->ForwardLink; + NumberOfNS ++; + } + }; + + Instance =3D + (REST_JSON_STRUCTURE_INSTANCE *)AllocateZeroPool (sizeof (REST_JSON_ST= RUCTURE_INSTANCE) + NumberOfNS * sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTI= FIER)); + if (Instance =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + InitializeListHead (&Instance->NextRestJsonStructureInstance); + Instance->NumberOfNameSpaceToConvert =3D NumberOfNS; + Instance->SupportedRsrcIndentifier =3D (EFI_REST_JSON_RESOURCE_TYPE_IDEN= TIFIER *)((REST_JSON_STRUCTURE_INSTANCE *)Instance + 1); + // + // Copy supported resource identifer interpreter. + // + CloneSupportedInterpId =3D Instance->SupportedRsrcIndentifier; + ThisSupportedInterp =3D JsonStructureSupported; + for (Index =3D 0; Index < NumberOfNS; Index ++) { + CopyMem ((VOID *)CloneSupportedInterpId, (VOID *)&ThisSupportedInterp-= >RestResourceInterp, sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER)); + ThisSupportedInterp =3D (EFI_REST_JSON_STRUCTURE_SUPPORTED *)ThisSuppo= rtedInterp->NextSupportedRsrcInterp.ForwardLink; + CloneSupportedInterpId ++; + } + Instance->JsonToStructure =3D ToStructure; + Instance->StructureToJson =3D ToJson; + Instance->DestroyStructure =3D DestroyStructure; + InsertTailList (&mRestJsonStructureList, &Instance->NextRestJsonStructur= eInstance); + return EFI_SUCCESS; +} + +/** + This function check if this interpreter instance support the given names= apce. + + @param[in] This EFI_REST_JSON_STRUCTURE_PROTOCOL insta= nce. + @param[in] InterpreterInstance REST_JSON_STRUCTURE_INSTANCE + @param[in] RsrcTypeIdentifier Resource type identifier. + @param[in] ResourceRaw Given Restful resource. + @param[out] RestJSonHeader Property interpreted from given Resour= ceRaw. + + @retval EFI_SUCCESS + @retval Others. + +**/ +EFI_STATUS +InterpreterInstanceToStruct ( + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, + IN REST_JSON_STRUCTURE_INSTANCE *InterpreterInstance, + IN EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier OPTIONAL, + IN CHAR8 *ResourceRaw, + OUT EFI_REST_JSON_STRUCTURE_HEADER **RestJSonHeader + ) +{ + UINTN Index; + EFI_STATUS Status; + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *ThisSupportedRsrcTypeId; + + if (This =3D=3D NULL || + InterpreterInstance =3D=3D NULL || + ResourceRaw =3D=3D NULL || + RestJSonHeader =3D=3D NULL + ) { + return EFI_INVALID_PARAMETER; + } + + Status =3D EFI_UNSUPPORTED; + if (RsrcTypeIdentifier =3D=3D NULL) { + // + // No resource type identifier, send to intepreter anyway. + // Interpreter may recognize this resource. + // + Status =3D InterpreterInstance->JsonToStructure ( + This, + NULL, + ResourceRaw, + RestJSonHeader + ); + } else { + // + // Check if the namesapce and version is supported by this interpreter. + // + ThisSupportedRsrcTypeId =3D InterpreterInstance->SupportedRsrcIndentif= ier; + for (Index =3D 0; Index < InterpreterInstance->NumberOfNameSpaceToConv= ert; Index ++){ + if (AsciiStrCmp ( + RsrcTypeIdentifier->NameSpace.ResourceTypeName, + ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName) =3D=3D 0){ + if ((RsrcTypeIdentifier->NameSpace.MajorVersion =3D=3D NULL) && + (RsrcTypeIdentifier->NameSpace.MinorVersion =3D=3D NULL) && + (RsrcTypeIdentifier->NameSpace.ErrataVersion =3D=3D NULL) + ) { + // + // Don't check version of this resource type identifier. + // + Status =3D InterpreterInstance->JsonToStructure ( + This, + RsrcTypeIdentifier, + ResourceRaw, + RestJSonHeader + ); + break; + } else { + // + // Check version. + // + if ((AsciiStrCmp ( + RsrcTypeIdentifier->NameSpace.MajorVersion, + ThisSupportedRsrcTypeId->NameSpace.MajorVersion) =3D=3D 0)= && + (AsciiStrCmp ( + RsrcTypeIdentifier->NameSpace.MinorVersion, + ThisSupportedRsrcTypeId->NameSpace.MinorVersion) =3D=3D 0)= && + (AsciiStrCmp ( + RsrcTypeIdentifier->NameSpace.ErrataVersion, + ThisSupportedRsrcTypeId->NameSpace.ErrataVersion) =3D=3D 0= )) { + Status =3D InterpreterInstance->JsonToStructure ( + This, + RsrcTypeIdentifier, + ResourceRaw, + RestJSonHeader + ); + break; + } + } + } + ThisSupportedRsrcTypeId ++; + } + } + return Status; +} +/** + This function converts JSON C structure to JSON property. + + @param[in] This EFI_REST_JSON_STRUCTURE_PROTOCOL inst= ance. + @param[in] InterpreterInstance REST_JSON_STRUCTURE_INSTANCE + @param[in] RestJSonHeader Resource type identifier. + @param[out] ResourceRaw Output in JSON text format. + + @retval EFI_SUCCESS + @retval Others. + +**/ +EFI_STATUS +InterpreterEfiStructToInstance ( + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, + IN REST_JSON_STRUCTURE_INSTANCE *InterpreterInstance, + IN EFI_REST_JSON_STRUCTURE_HEADER *RestJSonHeader, + OUT CHAR8 **ResourceRaw +) +{ + UINTN Index; + EFI_STATUS Status; + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *ThisSupportedRsrcTypeId; + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier; + + if (This =3D=3D NULL || + InterpreterInstance =3D=3D NULL || + RestJSonHeader =3D=3D NULL || + ResourceRaw =3D=3D NULL + ) { + return EFI_INVALID_PARAMETER; + } + RsrcTypeIdentifier =3D &RestJSonHeader->JsonRsrcIdentifier; + if (RsrcTypeIdentifier =3D=3D NULL || + RsrcTypeIdentifier->NameSpace.ResourceTypeName =3D=3D NULL || + RsrcTypeIdentifier->NameSpace.MajorVersion =3D=3D NULL || + RsrcTypeIdentifier->NameSpace.MinorVersion =3D=3D NULL || + RsrcTypeIdentifier->NameSpace.ErrataVersion =3D=3D NULL + ) { + return EFI_INVALID_PARAMETER; + } + + // + // Check if the namesapce and version is supported by this interpreter. + // + Status =3D EFI_UNSUPPORTED; + ThisSupportedRsrcTypeId =3D InterpreterInstance->SupportedRsrcIndentifie= r; + for (Index =3D 0; Index < InterpreterInstance->NumberOfNameSpaceToConver= t; Index ++){ + if (AsciiStrCmp ( + RsrcTypeIdentifier->NameSpace.ResourceTypeName, + ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName) =3D=3D 0){ + // + // Check version. + // + if ((AsciiStrCmp ( + RsrcTypeIdentifier->NameSpace.MajorVersion, + ThisSupportedRsrcTypeId->NameSpace.MajorVersion) =3D=3D 0) && + (AsciiStrCmp ( + RsrcTypeIdentifier->NameSpace.MinorVersion, + ThisSupportedRsrcTypeId->NameSpace.MinorVersion) =3D=3D 0) && + (AsciiStrCmp ( + RsrcTypeIdentifier->NameSpace.ErrataVersion, + ThisSupportedRsrcTypeId->NameSpace.ErrataVersion) =3D=3D 0)) { + Status =3D InterpreterInstance->StructureToJson ( + This, + RestJSonHeader, + ResourceRaw + ); + break; + } + } + ThisSupportedRsrcTypeId ++; + } + return Status; +} + +/** + This function destory REST property structure. + + @param[in] This EFI_REST_JSON_STRUCTURE_PROTOCOL inst= ance. + @param[in] InterpreterInstance REST_JSON_STRUCTURE_INSTANCE + @param[in] RestJSonHeader Property interpreted from given Resou= rceRaw. + + @retval EFI_SUCCESS + @retval Others. + +**/ +EFI_STATUS +InterpreterInstanceDestoryJsonStruct ( + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, + IN REST_JSON_STRUCTURE_INSTANCE *InterpreterInstance, + IN EFI_REST_JSON_STRUCTURE_HEADER *RestJSonHeader + ) +{ + UINTN Index; + EFI_STATUS Status; + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *ThisSupportedRsrcTypeId; + + if (This =3D=3D NULL || + InterpreterInstance =3D=3D NULL || + RestJSonHeader =3D=3D NULL + ) { + return EFI_INVALID_PARAMETER; + } + + Status =3D EFI_UNSUPPORTED; + // + // Check if the namesapce and version is supported by this interpreter. + // + ThisSupportedRsrcTypeId =3D InterpreterInstance->SupportedRsrcIndentifie= r; + for (Index =3D 0; Index < InterpreterInstance->NumberOfNameSpaceToConver= t; Index ++){ + if (AsciiStrCmp ( + RestJSonHeader->JsonRsrcIdentifier.NameSpace.ResourceTypeName, + ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName) =3D=3D 0) { + if ((RestJSonHeader->JsonRsrcIdentifier.NameSpace.MajorVersion =3D= =3D NULL) && + (RestJSonHeader->JsonRsrcIdentifier.NameSpace.MinorVersion =3D= =3D NULL) && + (RestJSonHeader->JsonRsrcIdentifier.NameSpace.ErrataVersion =3D= =3D NULL) + ) { + // + // Don't check version of this resource type identifier. + // + Status =3D InterpreterInstance->DestroyStructure ( + This, + RestJSonHeader + ); + break; + } else { + // + // Check version. + // + if ((AsciiStrCmp ( + RestJSonHeader->JsonRsrcIdentifier.NameSpace.MajorVersion, + ThisSupportedRsrcTypeId->NameSpace.MajorVersion) =3D=3D 0) && + (AsciiStrCmp ( + RestJSonHeader->JsonRsrcIdentifier.NameSpace.MinorVersion, + ThisSupportedRsrcTypeId->NameSpace.MinorVersion) =3D=3D 0) && + (AsciiStrCmp ( + RestJSonHeader->JsonRsrcIdentifier.NameSpace.ErrataVersion, + ThisSupportedRsrcTypeId->NameSpace.ErrataVersion) =3D=3D 0))= { + Status =3D InterpreterInstance->DestroyStructure ( + This, + RestJSonHeader + ); + break; + } + } + } + ThisSupportedRsrcTypeId ++; + } + return Status; +} + +/** + This function translates the given JSON text to JSON C Structure. + + @param[in] This EFI_REST_JSON_STRUCTURE_PROTOCOL insta= nce. + @param[in] RsrcTypeIdentifier Resource type identifier. + @param[in] ResourceJsonText Given Restful resource. + @param[out] JsonStructure Property interpreted from given Resour= ceRaw. + + @retval EFI_SUCCESS + @retval Others. + +**/ +EFI_STATUS +EFIAPI +RestJsonStructureToStruct ( + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, + IN EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier OPTIONAL, + IN CHAR8 *ResourceJsonText, + OUT EFI_REST_JSON_STRUCTURE_HEADER **JsonStructure +) +{ + EFI_STATUS Status; + REST_JSON_STRUCTURE_INSTANCE *Instance; + + if (This =3D=3D NULL || + ResourceJsonText =3D=3D NULL || + JsonStructure =3D=3D NULL + ) { + return EFI_INVALID_PARAMETER; + } + + if (IsListEmpty (&mRestJsonStructureList)) { + return EFI_UNSUPPORTED; + } + Status =3D EFI_SUCCESS; + Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetFirstNode (&mRestJsonStr= uctureList); + while (TRUE) { + Status =3D InterpreterInstanceToStruct ( + This, + Instance, + RsrcTypeIdentifier, + ResourceJsonText, + JsonStructure + ); + if (!EFI_ERROR (Status)) { + break; + } + if (IsNodeAtEnd(&mRestJsonStructureList, &Instance->NextRestJsonStruct= ureInstance)) { + Status =3D EFI_UNSUPPORTED; + break; + } + Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetNextNode (&mRestJsonSt= ructureList, &Instance->NextRestJsonStructureInstance); + }; + return Status; +} + +/** + This function destory REST property EFI structure which returned in + JsonToStructure(). + + @param[in] This EFI_REST_JSON_STRUCTURE_PROTOCOL instance. + @param[in] RestJSonHeader Property to destory. + + @retval EFI_SUCCESS + @retval Others + +**/ +EFI_STATUS +EFIAPI +RestJsonStructureDestroyStruct ( + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, + IN EFI_REST_JSON_STRUCTURE_HEADER *RestJSonHeader +) +{ + EFI_STATUS Status; + REST_JSON_STRUCTURE_INSTANCE *Instance; + + if (This =3D=3D NULL || RestJSonHeader =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + if (IsListEmpty (&mRestJsonStructureList)) { + return EFI_UNSUPPORTED; + } + Status =3D EFI_SUCCESS; + Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetFirstNode (&mRestJsonStr= uctureList); + while (TRUE) { + Status =3D InterpreterInstanceDestoryJsonStruct ( + This, + Instance, + RestJSonHeader + ); + if (!EFI_ERROR (Status)) { + break; + } + if (IsNodeAtEnd(&mRestJsonStructureList, &Instance->NextRestJsonStruct= ureInstance)) { + Status =3D EFI_UNSUPPORTED; + break; + } + Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetNextNode (&mRestJsonSt= ructureList, &Instance->NextRestJsonStructureInstance); + }; + return Status; +} + +/** + This function translates the given JSON C Structure to JSON text. + + @param[in] This EFI_REST_JSON_STRUCTURE_PROTOCOL instance. + @param[in] RestJSonHeader Given Restful resource. + @param[out] ResourceRaw Resource in RESTfuls service oriented. + + @retval EFI_SUCCESS + @retval Others Fail to remove the entry + +**/ +EFI_STATUS +EFIAPI +RestJsonStructureToJson ( + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *This, + IN EFI_REST_JSON_STRUCTURE_HEADER *RestJSonHeader, + OUT CHAR8 **ResourceRaw +) +{ + EFI_STATUS Status; + REST_JSON_STRUCTURE_INSTANCE *Instance; + + if (This =3D=3D NULL || RestJSonHeader =3D=3D NULL || ResourceRaw =3D=3D= NULL) { + return EFI_INVALID_PARAMETER; + } + + if (IsListEmpty (&mRestJsonStructureList)) { + return EFI_UNSUPPORTED; + } + Status =3D EFI_SUCCESS; + Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetFirstNode (&mRestJsonStr= uctureList); + while (TRUE) { + Status =3D InterpreterEfiStructToInstance ( + This, + Instance, + RestJSonHeader, + ResourceRaw + ); + if (!EFI_ERROR (Status)) { + break; + } + if (IsNodeAtEnd(&mRestJsonStructureList, &Instance->NextRestJsonStruct= ureInstance)) { + Status =3D EFI_UNSUPPORTED; + break; + } + Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetNextNode (&mRestJsonSt= ructureList, &Instance->NextRestJsonStructureInstance); + }; + return Status; +} + +EFI_REST_JSON_STRUCTURE_PROTOCOL mRestJsonStructureProtocol =3D { + RestJsonStructureRegister, + RestJsonStructureToStruct, + RestJsonStructureToJson, + RestJsonStructureDestroyStruct +}; + +/** + This is the declaration of an EFI image entry point. + + @param ImageHandle The firmware allocated handle for the UEFI= image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The operation completed successfully. + @retval Others An unexpected error occurred. +**/ +EFI_STATUS +EFIAPI +RestJsonStructureEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + InitializeListHead (&mRestJsonStructureList); + // + // Install the Restful Resource Interpreter Protocol. + // + mProtocolHandle =3D NULL; + Status =3D gBS->InstallProtocolInterface ( + &mProtocolHandle, + &gEfiRestJsonStructureProtocolGuid, + EFI_NATIVE_INTERFACE, + (VOID *)&mRestJsonStructureProtocol + ); + return Status; +} + +/** + This is the unload handle for Redfish discover module. + + Disconnect the driver specified by ImageHandle from all the devices in t= he handle database. + Uninstall all the protocols installed in the driver entry point. + + @param[in] ImageHandle The drivers' driver image. + + @retval EFI_SUCCESS The image is unloaded. + @retval Others Failed to unload the image. + +**/ +EFI_STATUS +EFIAPI +RestJsonStructureUnload ( + IN EFI_HANDLE ImageHandle + ) +{ + EFI_STATUS Status; + REST_JSON_STRUCTURE_INSTANCE *Instance; + REST_JSON_STRUCTURE_INSTANCE *NextInstance; + + Status =3D gBS->UninstallProtocolInterface ( + mProtocolHandle, + &gEfiRestJsonStructureProtocolGuid, + (VOID *)&mRestJsonStructureProtocol + ); + + if (IsListEmpty (&mRestJsonStructureList)) { + return Status; + } + // + // Free memory of REST_JSON_STRUCTURE_INSTANCE instance. + // + Instance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetFirstNode (&mRestJsonStr= uctureList); + do { + NextInstance =3D NULL; + if (!IsNodeAtEnd(&mRestJsonStructureList, &Instance->NextRestJsonStruc= tureInstance)) { + NextInstance =3D (REST_JSON_STRUCTURE_INSTANCE *)GetNextNode (&mRest= JsonStructureList, &Instance->NextRestJsonStructureInstance); + } + FreePool ((VOID *)Instance); + Instance =3D NextInstance; + } while (Instance !=3D NULL); + + return Status; +} diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf b/Red= fishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf new file mode 100644 index 0000000000..61e6253d31 --- /dev/null +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf @@ -0,0 +1,39 @@ +## @file +# Implementation of EFI REST JSON Structure Protocol. +# +# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D RestJsonStructureDxe + FILE_GUID =3D 83FAAFBF-FC4B-469F-892A-798E66A6F50A + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D RestJsonStructureEntryPoint + UNLOAD_IMAGE =3D RestJsonStructureUnload + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishPkg/RedfishPkg.dec + +[Sources] + RestJsonStructureDxe.c + RestJsonStructureInternal.h + +[LibraryClasses] + BaseLib + BaseMemoryLib + MemoryAllocationLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + +[Protocols] + gEfiRestJsonStructureProtocolGuid ## Producing + +[Depex] + TRUE + diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h b/= RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h new file mode 100644 index 0000000000..e8a3408404 --- /dev/null +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h @@ -0,0 +1,33 @@ +/** @file + The internal definitions of EFI REST Resource JSON to C structure conver= tor + Protocol. + + (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef EFI_REST_JSON_STRUCTURE_INTERNAL_H_ +#define EFI_REST_JSON_STRUCTURE_INTERNAL_H_ + +#include +#include +#include +#include +#include +#include + +/// +/// Internal structure to maintain the information of JSON to +/// C structure convertor. +/// +typedef struct _REST_JSON_STRUCTURE_INSTANCE { + LIST_ENTRY NextRestJsonStructureInstance; ///< Next convertor instance + UINTN NumberOfNameSpaceToConvert; ///< Number of resource type = this convertor supports. + EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *SupportedRsrcIndentifier; //= /< The resource type linklist + EFI_REST_JSON_STRUCTURE_TO_STRUCTURE JsonToStructure; //= /< JSON to C structure function + EFI_REST_JSON_STRUCTURE_TO_JSON StructureToJson; //= /< C structure to JSON function + EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTURE DestroyStructure; //= /< Destory C struture function. +} REST_JSON_STRUCTURE_INSTANCE; +#endif --=20 2.17.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 (#66791): https://edk2.groups.io/g/devel/message/66791 Mute This Topic: https://groups.io/mt/77902818/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 10:55:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66789+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66789+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1604021766; cv=none; d=zohomail.com; s=zohoarc; b=aMavq1/+a+OF949gfa8Ho00JwoUgqf0dA4WpL8bmxoFEOH4wkA0U+J6nlckxO520J/PGXDlQZeh3z7FYD63JP2nZiTYuuOm1divqgnI+exCuCtTlbVeZ+6wkk4YPB+rMwW1kHP6HAwMj0nIHaKAtMy/epmtKKqNkECWw2bj/q5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604021766; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=R3HODHTQhe3mT7xpjZ3gCLwIpPV0O9IF6upHk9TpdW4=; b=k87Mcc09O4x+xpirFdEVZ9VP9z59ZTCcoQCTgLDyWN9MqQ6RIlORFKPstaXHMEi5igNpRQZLkHnEAsg9z2uUW5Pmvak9HFYrAxzVaKBLUS34K9w2b22OhClSmTmJbVsz8HP9OWWzUj9shYAhJLyKiZiD5UVBZvj/AcDTQ2l7uqM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66789+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1604021766461462.42493433623474; Thu, 29 Oct 2020 18:36:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 67wHYY1788612xPwzjTxhQvI; Thu, 29 Oct 2020 18:36:06 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web12.7189.1604021760771738934 for ; Thu, 29 Oct 2020 18:36:00 -0700 X-Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09U1Ugob016875; Fri, 30 Oct 2020 01:36:00 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 34f5471b6c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Oct 2020 01:36:00 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id C102E84; Fri, 30 Oct 2020 01:35:59 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 60B2B3D; Fri, 30 Oct 2020 01:35:58 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang Subject: [edk2-devel] [RestJsonStructureDxe PATCH v4 3/3] RedfishPkg: Changes on RedfishPkg for CI test Date: Fri, 30 Oct 2020 08:50:33 +0800 Message-Id: <20201030005033.31953-4-abner.chang@hpe.com> In-Reply-To: <20201030005033.31953-1-abner.chang@hpe.com> References: <20201030005033.31953-1-abner.chang@hpe.com> X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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@hpe.com X-Gm-Message-State: Y8wm2tc4pJqRoP421nJ3WhaRx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604021766; bh=HnJXPJ1E8xtU/dDdIP0aH2B05KwJRh8YCHddhQUxvo8=; h=Cc:Date:From:Reply-To:Subject:To; b=i778d4k6ZzSqX6bsIIAleIZxgNCz2uQOnoTddz6s1KuNmLjFr95xjiI+wxZUy+PI0O8 uHVRYXVVp+5gMTrTrfzgssymsJy4baw05F2ddhlmD/LW/0lMOnc1CzX3Meih7S2+8FHYn v5dVjmmc7OjJfKQL9n9QeGby3rEABL7GJU4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add accepted dependency of RedfishPkg in RedfishPkg CI yaml file. Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Fan Wang Cc: Jiewen Yao Cc: Nickle Wang Reviewed-by: Nickle Wang --- RedfishPkg/RedfishPkg.ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml index 75c3b6a8ad..bb3b8b6746 100644 --- a/RedfishPkg/RedfishPkg.ci.yaml +++ b/RedfishPkg/RedfishPkg.ci.yaml @@ -29,7 +29,8 @@ "AcceptableDependencies": [ "MdePkg/MdePkg.dec", "MdeModulePkg/MdeModulePkg.dec", - "NetworkPkg/NetworkPkg.dec" + "NetworkPkg/NetworkPkg.dec", + "RedfishPkg/RedfishPkg.dec" ], # For host based unit tests "AcceptableDependencies-HOST_APPLICATION":[], --=20 2.17.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 (#66789): https://edk2.groups.io/g/devel/message/66789 Mute This Topic: https://groups.io/mt/77902813/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-