public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type
@ 2017-02-15  7:39 Jiaxin Wu
  2017-02-15  8:19 ` Fu, Siyuan
  2017-02-15  8:38 ` Ye, Ting
  0 siblings, 2 replies; 3+ messages in thread
From: Jiaxin Wu @ 2017-02-15  7:39 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

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 Content-Type header field.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 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, EITHER EXPRESS OR IMPLIED.
 // Driver Version
 //
 #define HTTP_BOOT_DXE_VERSION  0xa
 
 //
-// Provisional Standard Media Types defined in 
-// http://www.iana.org/assignments/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"
 
 //
 // Protocol instances
 //
 extern EFI_DRIVER_BINDING_PROTOCOL  gHttpBootDxeDriverBinding;
diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
index d786d72..5cdc306 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
@@ -1174,17 +1174,25 @@ HttpBootCheckImageType (
     return EFI_INVALID_PARAMETER;
   }
 
   //
   // 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 = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_TYPE);
   if (Header != NULL) {
     if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_EFI) == 0) {
       *ImageType = ImageTypeEfi;
       return EFI_SUCCESS;
+    } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_ISO) == 0) {
+      *ImageType = ImageTypeVirtualCd;
+      return EFI_SUCCESS;
+    } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_IMG) == 0) {
+      *ImageType = ImageTypeVirtualDisk;
+      return EFI_SUCCESS;
     }
   }
 
   //
   // Determine the image type by file extension:
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type
  2017-02-15  7:39 [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type Jiaxin Wu
@ 2017-02-15  8:19 ` Fu, Siyuan
  2017-02-15  8:38 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Fu, Siyuan @ 2017-02-15  8:19 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Ye, Ting

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>


-----Original Message-----
From: Wu, Jiaxin 
Sent: 2017年2月15日 15:40
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type

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 Content-Type header field.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 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, EITHER EXPRESS OR IMPLIED.
 // Driver Version
 //
 #define HTTP_BOOT_DXE_VERSION  0xa
 
 //
-// Provisional Standard Media Types defined in -// http://www.iana.org/assignments/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"
 
 //
 // Protocol instances
 //
 extern EFI_DRIVER_BINDING_PROTOCOL  gHttpBootDxeDriverBinding; diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
index d786d72..5cdc306 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
@@ -1174,17 +1174,25 @@ HttpBootCheckImageType (
     return EFI_INVALID_PARAMETER;
   }
 
   //
   // 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 = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_TYPE);
   if (Header != NULL) {
     if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_EFI) == 0) {
       *ImageType = ImageTypeEfi;
       return EFI_SUCCESS;
+    } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_ISO) == 0) {
+      *ImageType = ImageTypeVirtualCd;
+      return EFI_SUCCESS;
+    } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_IMG) == 0) {
+      *ImageType = ImageTypeVirtualDisk;
+      return EFI_SUCCESS;
     }
   }
 
   //
   // Determine the image type by file extension:
--
1.9.5.msysgit.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type
  2017-02-15  7:39 [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type Jiaxin Wu
  2017-02-15  8:19 ` Fu, Siyuan
@ 2017-02-15  8:38 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Ye, Ting @ 2017-02-15  8:38 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Wu, Jiaxin 
Sent: Wednesday, February 15, 2017 3:40 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type

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 Content-Type header field.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 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, EITHER EXPRESS OR IMPLIED.
 // Driver Version
 //
 #define HTTP_BOOT_DXE_VERSION  0xa
 
 //
-// Provisional Standard Media Types defined in -// http://www.iana.org/assignments/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"
 
 //
 // Protocol instances
 //
 extern EFI_DRIVER_BINDING_PROTOCOL  gHttpBootDxeDriverBinding; diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
index d786d72..5cdc306 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
@@ -1174,17 +1174,25 @@ HttpBootCheckImageType (
     return EFI_INVALID_PARAMETER;
   }
 
   //
   // 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 = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_TYPE);
   if (Header != NULL) {
     if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_EFI) == 0) {
       *ImageType = ImageTypeEfi;
       return EFI_SUCCESS;
+    } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_ISO) == 0) {
+      *ImageType = ImageTypeVirtualCd;
+      return EFI_SUCCESS;
+    } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_IMG) == 0) {
+      *ImageType = ImageTypeVirtualDisk;
+      return EFI_SUCCESS;
     }
   }
 
   //
   // Determine the image type by file extension:
--
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-15  8:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15  7:39 [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type Jiaxin Wu
2017-02-15  8:19 ` Fu, Siyuan
2017-02-15  8:38 ` Ye, Ting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox