From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web08.392.1663797121780520189 for ; Wed, 21 Sep 2022 14:52:06 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Z8dEbgV8; spf=pass (domain: intel.com, ip: 192.55.52.120, 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=1663797126; x=1695333126; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yc4MnAPogvqdt/KeS536TfcG4BaOKuRkeSsxGFyJi2M=; b=Z8dEbgV8I35tvnrS3oqr/uwecSoFgw7zNQfPToJp6xD0JTMIJ5wChExi a2uVCmzzDevOCZt9VzYs1im7K5+7NoLMY1Wps8wPe6T0pQQRvIagY0TQS vynvM0M9TNyqJQ++PgdD8QADW1CdtreVgPdx2Bjd7pJha7TlSwK5QCxWC W4uJ+tZIrV1QPHjqHguRoCbMgramoLQX7kdKpniaxxLtzMdaU8I0379rL BV5R55tyr5TKs5wuGDbQEbgISoR6TRbzQ5tZj+ECrl5ozuvceX+T+W2KK 1L7EPko5qlOFc2z2oB8/WJxMMo3Slnu4BjOgqK5nV8VRtWFe4OvHf90rH w==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="298850819" X-IronPort-AV: E=Sophos;i="5.93,334,1654585200"; d="scan'208";a="298850819" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 14:52:06 -0700 X-IronPort-AV: E=Sophos;i="5.93,334,1654585200"; d="scan'208";a="597172817" Received: from fmbiosdev02.amr.corp.intel.com ([10.80.127.10]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 14:52:05 -0700 From: "Saloni Kasbekar" To: devel@edk2.groups.io Cc: Saloni Kasbekar , Jian J Wang , Liming Gao Subject: [[edk2-staging/HttpProxy] 2/3] MdeModulePkg/Library: Add support for multi-URI device path Date: Wed, 21 Sep 2022 14:51:50 -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 Process device path with proxy server and endpoint server included. Update comment for sample HTTP 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..19b7cd1457 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