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.web11.262.1665178478972669259 for ; Fri, 07 Oct 2022 14:34:40 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=oI3eFA7D; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: saloni.kasbekar@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665178480; x=1696714480; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WyblGCxTxiyWlS1khtJt5JSc2xZXk31UQ83p2HfHdYE=; b=oI3eFA7DfThkU0OwSnyCzvy+VY2Yx/xedrHq3YQNem3xLsswoAyAfNH5 PAC+rU7ZGd8Ppjv0QzL26WDiQuJlZQvPKjidZYeV+9ASI00IHsFgKYott At2EiKtl2iIBr8/ZhGdfIjixCpdTnRmBASfaHUzwh0uP0LTDj90/yNt3M XZuusIsOkB95Zd1R68YktT7lvCocUyLS12qUbxmBfvvqf2gdkljRubTbg 3UwgybIKhC7vykBS+B4GmTswlxfIQMljmHeL8SxdWl+AnfTMvDhJ9eL7y qTmQaQ3VjBCck9UpaSnbFwavespziT9hJ7iKRl1F7jzWSWac1aGyX8ZmR Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10493"; a="287069048" X-IronPort-AV: E=Sophos;i="5.95,167,1661842800"; d="scan'208";a="287069048" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2022 14:34:40 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10493"; a="658479323" X-IronPort-AV: E=Sophos;i="5.95,167,1661842800"; d="scan'208";a="658479323" Received: from fmbiosdev02.amr.corp.intel.com ([10.80.127.10]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2022 14:34:40 -0700 From: "Saloni Kasbekar" To: devel@edk2.groups.io Cc: Saloni Kasbekar , Jian J Wang , Liming Gao Subject: [[edk2-staging/HttpProxy PATCH v2] 1/6] MdeModulePkg/Library: Support multi-URI HTTP Boot device path Date: Fri, 7 Oct 2022 14:34:25 -0700 Message-Id: X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3951 Process device path with proxy server and endpoint server included. Update comment for sample HTTP Boot device path. Cc: Jian J Wang Cc: Liming Gao Signed-off-by: Saloni Kasbekar --- .../Library/UefiBootManagerLib/BmBoot.c | 28 +++++++++++++++++++ .../UefiBootManagerLib/BmBootDescription.c | 4 +-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 962892d38f..fdef1ba292 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -1513,6 +1513,9 @@ BmExpandLoadFiles ( UINTN HandleCount; UINTN Index; EFI_DEVICE_PATH_PROTOCOL *Node; + URI_DEVICE_PATH *NullUriPath; + + NullUriPath = NULL; // // Get file buffer from load file instance. @@ -1545,11 +1548,36 @@ BmExpandLoadFiles ( for (Index = 0; Index < HandleCount; Index++) { if (BmMatchHttpBootDevicePath (DevicePathFromHandle (Handles[Index]), FilePath)) { + // + // Matches HTTP Boot Device Path described as + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...) + // + Handle = Handles[Index]; + goto Done; + } + } + + NullUriPath = (URI_DEVICE_PATH *)CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_URI_DP, + (UINT16)(sizeof (URI_DEVICE_PATH)) + ); + for (Index = 0; Index < HandleCount; Index++) { + if (BmMatchHttpBootDevicePath (AppendDevicePathNode (DevicePathFromHandle (Handles[Index]), (EFI_DEVICE_PATH_PROTOCOL *)NullUriPath), FilePath)) { + // + // Matches HTTP Boot Device Path described as + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)/Uri(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)/Uri(...) + // Handle = Handles[Index]; break; } } + FreePool (NullUriPath); + +Done: if (Handles != NULL) { FreePool (Handles); } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c index fac33b9ee9..108efd8096 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c @@ -412,8 +412,8 @@ BmGetNetworkDescription ( // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...) // // The HTTP device path is like: - // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...) - // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)][/Uri(...)]/Uri(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)][/Uri(...)]/Uri(...) // while (!IsDevicePathEnd (DevicePath) && ((DevicePathType (DevicePath) != MESSAGING_DEVICE_PATH) || -- 2.36.1.windows.1