26 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
27 MAC_ADDR_DEVICE_PATH *Mac;
28 VLAN_DEVICE_PATH *Vlan;
29 EFI_DEVICE_PATH_PROTOCOL *Ip;
30 EFI_DEVICE_PATH_PROTOCOL *Uri;
32 UINTN DescriptionSize;
34 Status =
gBS->OpenProtocol (
36 &gEfiLoadFileProtocolGuid,
40 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
42 if (EFI_ERROR (Status)) {
46 Status =
gBS->OpenProtocol (
52 EFI_OPEN_PROTOCOL_GET_PROTOCOL
54 if (EFI_ERROR (Status) || (DevicePath == NULL)) {
68 while (!IsDevicePathEnd (DevicePath) &&
69 ((DevicePathType (DevicePath) != MESSAGING_DEVICE_PATH) ||
70 (DevicePathSubType (DevicePath) != MSG_MAC_ADDR_DP))
73 DevicePath = NextDevicePathNode (DevicePath);
76 if (IsDevicePathEnd (DevicePath)) {
80 Mac = (MAC_ADDR_DEVICE_PATH *)DevicePath;
81 DevicePath = NextDevicePathNode (DevicePath);
86 if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
87 (DevicePathSubType (DevicePath) == MSG_VLAN_DP)
90 Vlan = (VLAN_DEVICE_PATH *)DevicePath;
91 DevicePath = NextDevicePathNode (DevicePath);
99 if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
100 (DevicePathSubType (DevicePath) == MSG_WIFI_DP)
103 DevicePath = NextDevicePathNode (DevicePath);
109 if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
110 ((DevicePathSubType (DevicePath) == MSG_IPv4_DP) ||
111 (DevicePathSubType (DevicePath) == MSG_IPv6_DP))
115 DevicePath = NextDevicePathNode (DevicePath);
123 if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
124 (DevicePathSubType (DevicePath) == MSG_DNS_DP)
127 DevicePath = NextDevicePathNode (DevicePath);
133 if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
134 (DevicePathSubType (DevicePath) == MSG_URI_DP)
138 DevicePath = NextDevicePathNode (DevicePath);
148 DescriptionSize =
sizeof (L
"HTTP Boot IPv6 (MAC:11-22-33-44-55-66 VLAN65535)");
149 Description = AllocatePool (DescriptionSize);
150 ASSERT (Description != NULL);
155 L
"%s Boot IPv%d (MAC:%02x-%02x-%02x-%02x-%02x-%02x)" :
156 L
"%s Boot IPv%d (MAC:%02x-%02x-%02x-%02x-%02x-%02x VLAN%d)",
157 (Uri == NULL) ? L
"PXE" : L
"HTTP",
158 ((Ip == NULL) || (DevicePathSubType (Ip) == MSG_IPv4_DP)) ? 4 : 6,
159 Mac->MacAddress.Addr[0],
160 Mac->MacAddress.Addr[1],
161 Mac->MacAddress.Addr[2],
162 Mac->MacAddress.Addr[3],
163 Mac->MacAddress.Addr[4],
164 Mac->MacAddress.Addr[5],
165 (Vlan == NULL) ? 0 : Vlan->VlanId