From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 26012820E6 for ; Wed, 15 Feb 2017 00:39:19 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 15 Feb 2017 00:39:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,165,1484035200"; d="scan'208";a="65373960" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 15 Feb 2017 00:39:16 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 15 Feb 2017 00:39:13 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 15 Feb 2017 00:39:13 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Wed, 15 Feb 2017 16:38:52 +0800 From: "Ye, Ting" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" Thread-Topic: [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type Thread-Index: AQHSh164QJc5+BhsXUa80MOqKKTjNKFpvwkg Date: Wed, 15 Feb 2017 08:38:51 +0000 Message-ID: References: <1487144384-39816-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1487144384-39816-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 08:39:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ye Ting =20 -----Original Message----- From: Wu, Jiaxin=20 Sent: Wednesday, February 15, 2017 3:40 PM To: edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jia= xin Subject: [Patch] NetworkPkg/HttpBootDxe: Update to check specified media ty= pe IANA has approved below new media type for EFI http(s) boot usage: application/vnd.efi.img application/vnd.efi.iso HTTP boot driver should be updated to check the above media type from Conte= nt-Type header field. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- NetworkPkg/HttpBootDxe/HttpBootDxe.h | 6 ++++-- NetworkPkg/HttpBootDxe/HttpBootSupport.c | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.h b/NetworkPkg/HttpBootDxe/= HttpBootDxe.h index 2814594..a1e6792 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootDxe.h +++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.h @@ -72,14 +72,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. // Driver Version // #define HTTP_BOOT_DXE_VERSION 0xa =20 // -// Provisional Standard Media Types defined in -// http://www.iana.org/ass= ignments/provisional-standard-media-types/provisional-standard-media-types.= xhtml +// Standard Media Types defined in +// http://www.iana.org/assignments/media-types // #define HTTP_CONTENT_TYPE_APP_EFI "application/efi" +#define HTTP_CONTENT_TYPE_APP_IMG "application/vnd.efi-img" +#define HTTP_CONTENT_TYPE_APP_ISO "application/vnd.efi-iso" =20 // // Protocol instances // extern EFI_DRIVER_BINDING_PROTOCOL gHttpBootDxeDriverBinding; diff --git = a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBoo= tSupport.c index d786d72..5cdc306 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c +++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c @@ -1174,17 +1174,25 @@ HttpBootCheckImageType ( return EFI_INVALID_PARAMETER; } =20 // // Determine the image type by the HTTP Content-Type header field first. - // "application/efi" -> EFI Image + // "application/efi" -> EFI Image + // "application/vnd.efi-iso" -> CD/DVD Image + // "application/vnd.efi-img" -> Virtual Disk Image // Header =3D HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_TYP= E); if (Header !=3D NULL) { if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_EFI) =3D= =3D 0) { *ImageType =3D ImageTypeEfi; return EFI_SUCCESS; + } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_ISO= ) =3D=3D 0) { + *ImageType =3D ImageTypeVirtualCd; + return EFI_SUCCESS; + } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_IMG= ) =3D=3D 0) { + *ImageType =3D ImageTypeVirtualDisk; + return EFI_SUCCESS; } } =20 // // Determine the image type by file extension: -- 1.9.5.msysgit.1