From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.36259.1602492827365676142 for ; Mon, 12 Oct 2020 01:53:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=C1KBWMtm; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: jiaxin.wu@intel.com) IronPort-SDR: KJj3LmKuD0TugTTIzsSHgwaSRar1Lv55XHqHk4sQ3LAEVC8p8+bNcBCmN+mU7wtokvd7eaUuxU QzyRmE+fFJTQ== X-IronPort-AV: E=McAfee;i="6000,8403,9771"; a="153539760" X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="153539760" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 01:53:45 -0700 IronPort-SDR: N5ae7rRTaNjjCGksaI03Ds1tmhpJYq8tTkIVfXjhotsUqQFSTiYQvtZKHqOIeqMC1ivm4/CqBs 7Zm6OKYxtFXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="299160611" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga007.fm.intel.com with ESMTP; 12 Oct 2020 01:53:45 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 12 Oct 2020 01:53:44 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 12 Oct 2020 01:53:44 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.45) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 12 Oct 2020 01:53:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CDfab3/DRCz2KLQuTbZ2IXSPzWHTsTRGpwLNc4mMVvmCtQsf+cqx0yTox1FWfStyO1IzqsglG2bRWUUos6bWMiscXNJKIdup37YoBwnE8tv8u5FmJhZfxJwuHFP3G5BF2+MauacH82a2eJom6YV/eo2EGkcZinxi+WzYRD7G5M/Xfo85iMPqJGO4TWohBpQxnRbUP4Deu75Svv7KAKaBPHNYozhppT5Gthafd+fH/57yJNK5Cdvrs0TYPedmTbPjeCIUWRTm71rBNQjc8Zigt/n74ouQxMlQSwx2S/1vbu+Z8UjD9FS5DnTka8WP7j8siD36dYmY+om8pKIWRu4pPA== 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=59+Do+f9k2AFdLMMTg93MTXsq7VhNPB0AjTIhtiafCM=; b=S6mv8rd14fJEJBRf5r9cT99VKxSc4HlgDyEZxR9N9+D4E2NPNBzmuNNChKqPkai2rSq3qlQddaMOe0u3YeMVHHDa+n2r1HZIxRdE41HyGadPiJ4otam5rCsFJX8Pr+eSfzAGckIpXwS/uoZpN1l2CA2YB/RI7LmQzCDN3zVYHreCa3j1iF6EfmkXjnVWwGJkKvqnRRi3B7cZyjRZAetpLA9aDS5RK/j/D5IhjTY4U6FybEeW1gW4akG94cHfyumOQQIkNjjlPyZl4eje2RcRr8cwVhb3grMEP+/Oklyc/v7AkJxvSw/fxM8jgEJRG0eQUUTN8VbVSkWe/G5mq7OQlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=59+Do+f9k2AFdLMMTg93MTXsq7VhNPB0AjTIhtiafCM=; b=C1KBWMtm3IG+LW68COaXfx+ulPC4VfWWFTe0ZmuTOk+Jcfp8qTXgd3pr8EyoX4sIcV+0FlcT8SgTquGlrwAUCFxuRA0+daU136Yia30egwwwYO7xHf+czMlzDVDZEX4H5+ASxwqinA7IrE1HW9dalsTSEjF0zlxtR9uI/L3N5YY= Received: from DM5PR11MB1372.namprd11.prod.outlook.com (2603:10b6:3:11::14) by DM6PR11MB2555.namprd11.prod.outlook.com (2603:10b6:5:c5::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.38; Mon, 12 Oct 2020 08:53:42 +0000 Received: from DM5PR11MB1372.namprd11.prod.outlook.com ([fe80::b807:5b9e:5d17:aa0a]) by DM5PR11MB1372.namprd11.prod.outlook.com ([fe80::b807:5b9e:5d17:aa0a%10]) with mapi id 15.20.3455.030; Mon, 12 Oct 2020 08:53:42 +0000 From: "Wu, Jiaxin" To: "devel@edk2.groups.io" , "abner.chang@hpe.com" CC: "Kinney, Michael D" , Liming Gao , "Liu, Zhiguang" , "Yao, Jiewen" , Nickle Wang Subject: Re: [edk2-devel] [Rest Ex Definition PATCH 1/2] MdePkg/Include: Definitions of EFI REST EX Protocol Thread-Topic: [edk2-devel] [Rest Ex Definition PATCH 1/2] MdePkg/Include: Definitions of EFI REST EX Protocol Thread-Index: AQHWoGwu57VYPCiLiE6AauPt8p3BaKmTqXMA Date: Mon, 12 Oct 2020 08:53:42 +0000 Message-ID: References: <20201012070415.5878-1-abner.chang@hpe.com> <20201012070415.5878-2-abner.chang@hpe.com> In-Reply-To: <20201012070415.5878-2-abner.chang@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDY3N2JhN2MtMzJmMi00ODgyLWI0N2YtMjcwZjExYTU1Mjc3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoic3N4THNSSEE0emJxRlpXbEcyREVqeHI5dGNzbkY2NGREK3ZHMG9iaGJJWkFxTk53cFQ0YzFpWUxIRWZBRkdLVCJ9 dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.202] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 670ef2f1-f5a3-45c1-27b2-08d86e8c5208 x-ms-traffictypediagnostic: DM6PR11MB2555: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: W7Un+a4oHxAnsyRaE+RbVSQEOXxJ3DrdQBiAhC2OJYumelTeDoy7fAXZyuPYU0hM1f9n4D2tCh+sM5UNqjtkKGISsNd+HMwpSFRAxySWGG6rOKIWGOy/KWZeNOdsPpg2+gad8skXg5i05lbodfjxS4MwkoqYpiwRVYNtDj0i9I+edurPcma71dzivT+jdI3vXWgNygI3Q/i8ujMD8r1cPhuD2bT8HldnlI/tFJS9A2Q2x7QRPfQQmCnedhE4VNr14FuZM2VB2efGwOArcI/qpg6YyVK5/evTnereNtn8+EGbZrBJnQ4+wN0AyWqTapd966Cx0QYWKkU9CHcH7iGHSRmmO0vSc9e4qZXNKId3/T7ev86x0aOibVgTyRkCqDS3BHIDVKXXB/zFe34zVF1EeA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR11MB1372.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(136003)(376002)(39860400002)(366004)(396003)(64756008)(52536014)(478600001)(2906002)(316002)(8676002)(55016002)(8936002)(33656002)(9686003)(5660300002)(66946007)(71200400001)(76116006)(83080400001)(86362001)(4326008)(30864003)(66476007)(66556008)(7696005)(66446008)(6506007)(26005)(966005)(110136005)(54906003)(53546011)(83380400001)(186003)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: N1MX6rMWxM/+g+Cb1StiwFV3nKhxNTkQTazdC0d7FjiaTyaosBKoSIK0dbMqUaP5vlZ3soUsAW6gt5sw3JiOpxdC2fckytNyNXu+JV7/bo1/k5ar/qJUGHkj7Oz4oQjFmGOvIw+ahdIQZ3qURQDRcBBqq3uYawmkj9JQBpmAYsE1sA9x1U/RVI5uVbSV+smntGHncCgzWz2teAsB8IRqwzfWa5hjS5aHAIAbWXipScE16o89WN0NI65TB+8uCSrefMdhNGUeHjwmuAKDjldrRjYDbzDXrolYSkhQ0H7s/41v/GNMqyuaNNxX3BXYVVj+7G1xXbEogoEi2zuUa/EKJYaNkctA1igPbBjnD5x3cDS46rtcCKlV4+hDJ8LnEtMKNv7nBnJzc73Z1ESruYZCeXLKjtial9QBQuy0k4lUCQPDk6QmOAI5H4aBHN9h6vhDAtfyJudYdVD5QbmBxP6nXC8mOBbyvQKPfDxjNrrRzu3K9gu+mZ+4GkSPlEsbM+beCh5S8u8a4GOznV6rR1M3Zv3Zano0pFrLdu6NCOj63eod4azLXaokDCoEtCSTs5TpfvO66L8aTapQKhq+x3wUUwFqBBNCDTsfdTbrEL5FK2SIXrH+ngboaipTJcA8Cm/KORGCLEDNQoGT5rN+y0j/Fw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1372.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 670ef2f1-f5a3-45c1-27b2-08d86e8c5208 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2020 08:53:42.3008 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9Shp0oB4ZNDnnZKUTO/JYLAvdB6Kzo79gFRiGce8OsPMYRBJWO4yr+a8UJSfvoYRA7KC9fj9nn10JbF7ZX6bCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2555 Return-Path: jiaxin.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiaxin Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Abner > Chang > Sent: Monday, October 12, 2020 3:04 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Liming Gao > ; Liu, Zhiguang ; Yao, > Jiewen ; Nickle Wang > Subject: [edk2-devel] [Rest Ex Definition PATCH 1/2] MdePkg/Include: > Definitions of EFI REST EX Protocol >=20 > Add definitions of EFI REST EX Protocol according > to UEFI spec v2.8 Section 29.7.2 EFI REST EX Protocol. >=20 > Signed-off-by: Jiaxin Wu > Signed-off-by: Siyuan Fu > Signed-off-by: Fan Wang > Signed-off-by: Abner Chang >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Jiewen Yao > Cc: Nickle Wang > --- > MdePkg/Include/Protocol/RestEx.h | 388 > +++++++++++++++++++++++++++++++ > MdePkg/MdePkg.dec | 7 + > 2 files changed, 395 insertions(+) > create mode 100644 MdePkg/Include/Protocol/RestEx.h >=20 > diff --git a/MdePkg/Include/Protocol/RestEx.h > b/MdePkg/Include/Protocol/RestEx.h > new file mode 100644 > index 0000000000..c42096d14c > --- /dev/null > +++ b/MdePkg/Include/Protocol/RestEx.h > @@ -0,0 +1,388 @@ > +/** @file > + This file defines the EFI REST EX Protocol interface. It is > + split into the following two main sections. > + > + - REST EX Service Binding Protocol > + - REST EX Protocol > + > + Copyright (c) 2019, Intel Corporation. All rights reserved.
> + (C) Copyright 2020 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + > +**/ > + > +#ifndef EFI_REST_EX_PROTOCOL_H_ > +#define EFI_REST_EX_PROTOCOL_H_ > + > +#include > + > +// > +//GUID definitions > +// > +#define EFI_REST_EX_SERVICE_BINDING_PROTOCOL_GUID \ > + { \ > + 0x456bbe01, 0x99d0, 0x45ea, {0xbb, 0x5f, 0x16, 0xd8, 0x4b, 0xed, 0x= c5, > 0x59 } \ > + } > + > +#define EFI_REST_EX_PROTOCOL_GUID \ > + { \ > + 0x55648b91, 0xe7d, 0x40a3, {0xa9, 0xb3, 0xa8, 0x15, 0xd7, 0xea, 0xd= f, > 0x97 } \ > + } > + > +typedef struct _EFI_REST_EX_PROTOCOL EFI_REST_EX_PROTOCOL; > + > +//******************************************************* > +//EFI_REST_EX_SERVICE_INFO_VER > +//******************************************************* > +typedef struct { > + UINT8 Major; > + UINT8 Minor; > +} EFI_REST_EX_SERVICE_INFO_VER; > + > +//******************************************************* > +//EFI_REST_EX_SERVICE_INFO_HEADER > +//******************************************************* > +typedef struct { > + UINT32 Length; > + EFI_REST_EX_SERVICE_INFO_VER RestServiceInfoVer; > +} EFI_REST_EX_SERVICE_INFO_HEADER; > + > +//******************************************************* > +// EFI_REST_EX_SERVICE_TYPE > +//******************************************************* > +typedef enum { > + EfiRestExServiceUnspecific =3D 1, > + EfiRestExServiceRedfish, > + EfiRestExServiceOdata, > + EfiRestExServiceVendorSpecific =3D 0xff, > + EfiRestExServiceTypeMax > +} EFI_REST_EX_SERVICE_TYPE; > + > +//******************************************************* > +// EFI_REST_EX_SERVICE_ACCESS_MODE > +//******************************************************* > +typedef enum { > + EfiRestExServiceInBandAccess =3D 1, > + EfiRestExServiceOutOfBandAccess =3D 2, > + EfiRestExServiceModeMax > +} EFI_REST_EX_SERVICE_ACCESS_MODE; > + > +//******************************************************* > +// EFI_REST_EX_CONFIG_TYPE > +//******************************************************* > +typedef enum { > + EfiRestExConfigHttp, > + EfiRestExConfigUnspecific, > + EfiRestExConfigTypeMax > +} EFI_REST_EX_CONFIG_TYPE; > + > +//******************************************************* > +//EFI_REST_EX_SERVICE_INFO v1.0 > +//******************************************************* > +typedef struct { > + EFI_REST_EX_SERVICE_INFO_HEADER EfiRestExServiceInfoHeader; > + EFI_REST_EX_SERVICE_TYPE RestServiceType; > + EFI_REST_EX_SERVICE_ACCESS_MODE RestServiceAccessMode; > + EFI_GUID VendorRestServiceName; > + UINT32 VendorSpecificDataLength; > + UINT8 *VendorSpecifcData; > + EFI_REST_EX_CONFIG_TYPE RestExConfigType; > + UINT8 RestExConfigDataLength; > +} EFI_REST_EX_SERVICE_INFO_V_1_0; > + > +//******************************************************* > +//EFI_REST_EX_SERVICE_INFO > +//******************************************************* > +typedef union { > + EFI_REST_EX_SERVICE_INFO_HEADER EfiRestExServiceInfoHeader; > + EFI_REST_EX_SERVICE_INFO_V_1_0 EfiRestExServiceInfoV10; > +} EFI_REST_EX_SERVICE_INFO; > + > +//******************************************************* > +// EFI_REST_EX_HTTP_CONFIG_DATA > +//******************************************************* > +typedef struct { > + EFI_HTTP_CONFIG_DATA HttpConfigData; > + UINT32 SendReceiveTimeout; > +} EFI_REST_EX_HTTP_CONFIG_DATA; > + > +//******************************************************* > +//EFI_REST_EX_CONFIG_DATA > +//******************************************************* > +typedef UINT8 *EFI_REST_EX_CONFIG_DATA; > + > +//******************************************************* > +//EFI_REST_EX_TOKEN > +//******************************************************* > +typedef struct { > + EFI_EVENT Event; > + EFI_STATUS Status; > + EFI_HTTP_MESSAGE *ResponseMessage; > +} EFI_REST_EX_TOKEN; > + > +/** > + Provides a simple HTTP-like interface to send and receive resources f= rom a > REST service. > + > + The SendReceive() function sends an HTTP request to this REST service= , > and returns a > + response when the data is retrieved from the service. RequestMessage > contains the HTTP > + request to the REST resource identified by RequestMessage.Request.Url= . > The > + ResponseMessage is the returned HTTP response for that request, > including any HTTP > + status. > + > + @param[in] This Pointer to EFI_REST_EX_PROTOCOL insta= nce for a > particular > + REST service. > + @param[in] RequestMessage Pointer to the HTTP request data for = this > resource > + @param[out] ResponseMessage Pointer to the HTTP response data > obtained for this requested. > + > + @retval EFI_SUCCESS operation succeeded. > + @retval EFI_INVALID_PARAMETER This, RequestMessage, or > ResponseMessage are NULL. > + @retval EFI_DEVICE_ERROR An unexpected system or network error > occurred. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_SEND_RECEIVE)( > + IN EFI_REST_EX_PROTOCOL *This, > + IN EFI_HTTP_MESSAGE *RequestMessage, > + OUT EFI_HTTP_MESSAGE *ResponseMessage > + ); > + > +/** > + Obtain the current time from this REST service instance. > + > + The GetServiceTime() function is an optional interface to obtain the > current time from > + this REST service instance. If this REST service does not support to = retrieve > the time, > + this function returns EFI_UNSUPPORTED. This function must returns > EFI_UNSUPPORTED if > + EFI_REST_EX_SERVICE_TYPE returned in EFI_REST_EX_SERVICE_INFO from > GetService() is > + EFI_REST_EX_SERVICE_UNSPECIFIC. > + > + @param[in] This Pointer to EFI_REST_EX_PROTOCOL insta= nce for a > particular > + REST service. > + @param[out] Time A pointer to storage to receive a sna= pshot of > the current time of > + the REST service. > + > + @retval EFI_SUCCESS operation succeeded. > + @retval EFI_INVALID_PARAMETER This or Time are NULL. > + @retval EFI_UNSUPPORTED The RESTful service does not support > returning the time. > + @retval EFI_DEVICE_ERROR An unexpected system or network error > occurred. > + @retval EFI_NOT_READY The configuration of this instance is= not set > yet. Configure() must > + be executed and returns successfully = prior to invoke this > function. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_GET_TIME)( > + IN EFI_REST_EX_PROTOCOL *This, > + OUT EFI_TIME *Time > + ); > + > +/** > + This function returns the information of REST service provided by thi= s EFI > REST EX driver instance. > + > + The information such as the type of REST service and the access mode = of > REST EX driver instance > + (In-band or Out-of-band) are described in EFI_REST_EX_SERVICE_INFO > structure. For the vendor-specific > + REST service, vendor-specific REST service information is returned in > VendorSpecifcData. > + REST EX driver designer is well know what REST service this REST EX d= river > instance intends to > + communicate with. The designer also well know this driver instance is= used > to talk to BMC through > + specific platform mechanism or talk to REST server through UEFI HTTP > protocol. REST EX driver is > + responsible to fill up the correct information in > EFI_REST_EX_SERVICE_INFO. EFI_REST_EX_SERVICE_INFO > + is referred by EFI REST clients to pickup the proper EFI REST EX driv= er > instance to get and set resource. > + GetService() is a basic and mandatory function which must be able to = use > even Configure() is not invoked > + in previously. > + > + @param[in] This Pointer to EFI_REST_EX_PROTOCOL insta= nce for a > particular > + REST service. > + @param[out] RestExServiceInfo Pointer to receive a pointer to > EFI_REST_EX_SERVICE_INFO structure. The > + format of EFI_REST_EX_SERVICE_INFO is= version > controlled for the future > + extension. The version of EFI_REST_EX= _SERVICE_INFO > structure is returned > + in the header within this structure. = EFI REST client refers to > the correct > + format of structure according to the = version number. The > pointer to > + EFI_REST_EX_SERVICE_INFO is a memory = block allocated > by EFI REST EX driver > + instance. That is caller's responsibi= lity to free this memory > when this > + structure is no longer needed. Refer = to Related Definitions > below for the > + definitions of EFI_REST_EX_SERVICE_IN= FO structure. > + > + @retval EFI_SUCCESS EFI_REST_EX_SERVICE_INFO is returned = in > RestExServiceInfo. This function > + is not supported in this REST EX Prot= ocol driver instance. > + @retval EFI_UNSUPPORTED This function is not supported in thi= s REST > EX Protocol driver instance. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_EX_GET_SERVICE)( > + IN EFI_REST_EX_PROTOCOL *This, > + OUT EFI_REST_EX_SERVICE_INFO **RestExServiceInfo > + ); > + > +/** > + This function returns operational configuration of current EFI REST E= X child > instance. > + > + This function returns the current configuration of EFI REST EX child = instance. > The format of > + operational configuration depends on the implementation of EFI REST E= X > driver instance. For > + example, HTTP-aware EFI REST EX driver instance uses EFI HTTP protoco= l as > the undying protocol > + to communicate with REST service. In this case, the type of configura= tion is > + EFI_REST_EX_CONFIG_TYPE_HTTP returned from GetService(). > EFI_HTTP_CONFIG_DATA is used as EFI REST > + EX configuration format and returned to EFI REST client. User has to = type > cast RestExConfigData > + to EFI_HTTP_CONFIG_DATA. For those non HTTP-aware REST EX driver > instances, the type of configuration > + is EFI_REST_EX_CONFIG_TYPE_UNSPECIFIC returned from GetService(). In > this case, the format of > + returning data could be non industrial. Instead, the format of config= uration > data is system/platform > + specific definition such as BMC mechanism used in EFI REST EX driver > instance. EFI REST client and > + EFI REST EX driver instance have to refer to the specific system /pla= tform > spec which is out of UEFI scope. > + > + @param[in] This This is the EFI_REST_EX_PROTOCOL inst= ance. > + @param[out] RestExConfigData Pointer to receive a pointer to > EFI_REST_EX_CONFIG_DATA. > + The memory allocated for configuratio= n data should be > freed > + by caller. See Related Definitions fo= r the details. > + > + @retval EFI_SUCCESS EFI_REST_EX_CONFIG_DATA is returned i= n > successfully. > + @retval EFI_UNSUPPORTED This function is not supported in thi= s REST > EX Protocol driver instance. > + @retval EFI_NOT_READY The configuration of this instance is= not set > yet. Configure() must be > + executed and returns successfully pri= or to invoke this > function. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_EX_GET_MODE_DATA)( > + IN EFI_REST_EX_PROTOCOL *This, > + OUT EFI_REST_EX_CONFIG_DATA *RestExConfigData > + ); > + > +/** > + This function is used to configure EFI REST EX child instance. > + > + This function is used to configure the setting of underlying protocol= of REST > EX child > + instance. The type of configuration is according to the implementatio= n of > EFI REST EX > + driver instance. For example, HTTP-aware EFI REST EX driver instance = uses > EFI HTTP protocol > + as the undying protocol to communicate with REST service. The type of > configuration is > + EFI_REST_EX_CONFIG_TYPE_HTTP and RestExConfigData is the same > format with EFI_HTTP_CONFIG_DATA. > + Akin to HTTP configuration, REST EX child instance can be configure t= o use > different HTTP > + local access point for the data transmission. Multiple REST clients m= ay use > different > + configuration of HTTP to distinguish themselves, such as to use the > different TCP port. > + For those non HTTP-aware REST EX driver instance, the type of > configuration is > + EFI_REST_EX_CONFIG_TYPE_UNSPECIFIC. RestExConfigData refers to the > non industrial standard. > + Instead, the format of configuration data is system/platform specific > definition such as BMC. > + In this case, EFI REST client and EFI REST EX driver instance have to= refer to > the specific > + system/platform spec which is out of the UEFI scope. Besides > GetService()function, no other > + EFI REST EX functions can be executed by this instance until Configur= e()is > executed and returns > + successfully. All other functions must returns EFI_NOT_READY if this > instance is not configured > + yet. Set RestExConfigData to NULL means to put EFI REST EX child inst= ance > into the unconfigured > + state. > + > + @param[in] This This is the EFI_REST_EX_PROTOCOL inst= ance. > + @param[in] RestExConfigData Pointer to EFI_REST_EX_CONFIG_DATA. > See Related Definitions in > + GetModeData() protocol interface. > + > + @retval EFI_SUCCESS EFI_REST_EX_CONFIG_DATA is set in > successfully. > + @retval EFI_DEVICE_ERROR Configuration for this REST EX child > instance is failed with the given > + EFI_REST_EX_CONFIG_DATA. > + @retval EFI_UNSUPPORTED This function is not supported in thi= s REST > EX Protocol driver instance. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_EX_CONFIGURE)( > + IN EFI_REST_EX_PROTOCOL *This, > + IN EFI_REST_EX_CONFIG_DATA RestExConfigData > + ); > + > +/** > + This function sends REST request to REST service and signal caller's = event > asynchronously when > + the final response is received by REST EX Protocol driver instance. > + > + The essential design of this function is to handle asynchronous > send/receive implicitly according > + to REST service asynchronous request mechanism. Caller will get the > notification once the response > + is returned from REST service. > + > + @param[in] This This is the EFI_REST_EX_PROTOCOL in= stance. > + @param[in] RequestMessage This is the HTTP request message se= nt > to REST service. Set RequestMessage > + to NULL to cancel the previous asyn= chronous request > associated with the > + corresponding RestExToken. See desc= riptions for the > details. > + @param[in] RestExToken REST EX token which REST EX Protoco= l > instance uses to notify REST client > + the status of response of asynchron= ous REST request. See > related definition > + of EFI_REST_EX_TOKEN. > + @param[in] TimeOutInMilliSeconds The pointer to the timeout in > milliseconds which REST EX Protocol driver > + instance refers as the duration to = drop asynchronous REST > request. NULL > + pointer means no timeout for this R= EST request. REST EX > Protocol driver > + signals caller's event with EFI_STA= TUS set to EFI_TIMEOUT > in RestExToken > + if REST EX Protocol can't get the r= esponse from REST > service within > + TimeOutInMilliSeconds. > + > + @retval EFI_SUCCESS Asynchronous REST request is establ= ished. > + @retval EFI_UNSUPPORTED This REST EX Protocol driver instan= ce > doesn't support asynchronous request. > + @retval EFI_TIMEOUT Asynchronous REST request is not > established and timeout is expired. > + @retval EFI_ABORT Previous asynchronous REST request = has been > canceled. > + @retval EFI_DEVICE_ERROR Otherwise, returns EFI_DEVICE_ERROR > for other errors according to HTTP Status Code. > + @retval EFI_NOT_READY The configuration of this instance = is not set > yet. Configure() must be executed > + and returns successfully prior to i= nvoke this function. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_EX_ASYNC_SEND_RECEIVE)( > + IN EFI_REST_EX_PROTOCOL *This, > + IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL, > + IN EFI_REST_EX_TOKEN *RestExToken, > + IN UINTN *TimeOutInMilliSeconds OPTIONAL > + ); > + > +/** > + This function sends REST request to a REST Event service and signals = caller's > event > + token asynchronously when the URI resource change event is received b= y > REST EX > + Protocol driver instance. > + > + The essential design of this function is to monitor event implicitly = according > to > + REST service event service mechanism. Caller will get the notificatio= n if > certain > + resource is changed. > + > + @param[in] This This is the EFI_REST_EX_PROTOCOL in= stance. > + @param[in] RequestMessage This is the HTTP request message se= nt > to REST service. Set RequestMessage > + to NULL to cancel the previous even= t service associated > with the corresponding > + RestExToken. See descriptions for t= he details. > + @param[in] RestExToken REST EX token which REST EX Protoco= l > driver instance uses to notify REST client > + the URI resource which monitored by= REST client has > been changed. See the related > + definition of EFI_REST_EX_TOKEN in > EFI_REST_EX_PROTOCOL.AsyncSendReceive(). > + > + @retval EFI_SUCCESS Asynchronous REST request is establ= ished. > + @retval EFI_UNSUPPORTED This REST EX Protocol driver instan= ce > doesn't support asynchronous request. > + @retval EFI_ABORT Previous asynchronous REST request = has been > canceled or event subscription has been > + delete from service. > + @retval EFI_DEVICE_ERROR Otherwise, returns EFI_DEVICE_ERROR > for other errors according to HTTP Status Code. > + @retval EFI_NOT_READY The configuration of this instance = is not set > yet. Configure() must be executed > + and returns successfully prior to i= nvoke this function. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *EFI_REST_EX_EVENT_SERVICE)( > + IN EFI_REST_EX_PROTOCOL *This, > + IN EFI_HTTP_MESSAGE *RequestMessage OPTIONAL, > + IN EFI_REST_EX_TOKEN *RestExToken > +); > + > +/// > +/// EFI REST(EX) protocols are designed to support REST communication > between EFI REST client > +/// applications/drivers and REST services. EFI REST client tool uses E= FI > REST(EX) protocols > +/// to send/receive resources to/from REST service to manage systems, > configure systems or > +/// manipulate resources on REST service. Due to HTTP protocol is > commonly used to communicate > +/// with REST service in practice, EFI REST(EX) protocols adopt HTTP as= the > message format to > +/// send and receive REST service resource. EFI REST(EX) driver instanc= e > abstracts EFI REST > +/// client functionality and provides underlying interface to communica= te > with REST service. > +/// EFI REST(EX) driver instance knows how to communicate with REST > service through certain > +/// interface after the corresponding configuration is initialized. > +/// > +struct _EFI_REST_EX_PROTOCOL { > + EFI_REST_SEND_RECEIVE SendReceive; > + EFI_REST_GET_TIME GetServiceTime; > + EFI_REST_EX_GET_SERVICE GetService; > + EFI_REST_EX_GET_MODE_DATA GetModeData; > + EFI_REST_EX_CONFIGURE Configure; > + EFI_REST_EX_ASYNC_SEND_RECEIVE AyncSendReceive; > + EFI_REST_EX_EVENT_SERVICE EventService; > +}; > + > +extern EFI_GUID gEfiRestExServiceBindingProtocolGuid; > +extern EFI_GUID gEfiRestExProtocolGuid; > + > +#endif > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index 812be75fb3..5205374d62 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -1848,6 +1848,13 @@ > ## Include/Protocol/NvdimmLabel.h > gEfiNvdimmLabelProtocolGuid =3D { 0xd40b6b80, 0x97d5, 0= x4282, > { 0xbb, 0x1d, 0x22, 0x3a, 0x16, 0x91, 0x80, 0x58 }} >=20 > + # > + # Protocols defined in UEFI2.8 > + # > + ## Include/Protocol/RestEx.h > + 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 }} > + > # > # Protocols defined in Shell2.0 > # > -- > 2.17.1 >=20 >=20 >=20 >=20 >=20