/** @file\r
DevicePathToText protocol as defined in the UEFI 2.0 specification.\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
SATA_DEVICE_PATH *Sata;\r
\r
Sata = DevPath;\r
- if (Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) {\r
+ if ((Sata->PortMultiplierPortNumber & SATA_HBA_DIRECT_CONNECT_FLAG) != 0) {\r
CatPrint (\r
Str,\r
L"Sata(0x%x,0x%x)",\r
CatPrint (Str, L",0x%x)", (UINTN) MacDevPath->IfType);\r
}\r
\r
+/**\r
+ Converts network protocol string to its text representation.\r
+\r
+ @param Str The string representative of input device.\r
+ @param Protocol The network protocol ID.\r
+\r
+**/\r
+VOID\r
+CatNetworkProtocol (\r
+ IN OUT POOL_PRINT *Str,\r
+ IN UINT16 Protocol\r
+ )\r
+{\r
+ if (Protocol == RFC_1700_TCP_PROTOCOL) {\r
+ CatPrint (Str, L"TCP");\r
+ } else if (Protocol == RFC_1700_UDP_PROTOCOL) {\r
+ CatPrint (Str, L"UDP");\r
+ } else {\r
+ CatPrint (Str, L"0x%x", Protocol);\r
+ }\r
+}\r
+\r
/**\r
Converts a IPv4 device path structure to its string representative.\r
\r
\r
CatPrint (\r
Str,\r
- L"IPv4(%d.%d.%d.%d,%s,%s,%d.%d.%d.%d)",\r
+ L"IPv4(%d.%d.%d.%d,",\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[0],\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[1],\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[2],\r
- (UINTN) IPDevPath->RemoteIpAddress.Addr[3],\r
- (IPDevPath->Protocol == 1) ? L"TCP" : L"UDP",\r
+ (UINTN) IPDevPath->RemoteIpAddress.Addr[3]\r
+ );\r
+\r
+ CatNetworkProtocol (\r
+ Str,\r
+ IPDevPath->Protocol\r
+ );\r
+\r
+ CatPrint (\r
+ Str,\r
+ L",%s,%d.%d.%d.%d)",\r
IPDevPath->StaticIpAddress ? L"Static" : L"DHCP",\r
(UINTN) IPDevPath->LocalIpAddress.Addr[0],\r
(UINTN) IPDevPath->LocalIpAddress.Addr[1],\r
\r
CatPrint (\r
Str,\r
- L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x,%s,%s,%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
+ L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x,",\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[0],\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[1],\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[2],\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[12],\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[13],\r
(UINTN) IPDevPath->RemoteIpAddress.Addr[14],\r
- (UINTN) IPDevPath->RemoteIpAddress.Addr[15],\r
- (IPDevPath->Protocol == 1) ? L"TCP" : L"UDP",\r
+ (UINTN) IPDevPath->RemoteIpAddress.Addr[15]\r
+ );\r
+ \r
+ CatNetworkProtocol (\r
+ Str,\r
+ IPDevPath->Protocol\r
+ );\r
+\r
+ CatPrint (\r
+ Str,\r
+ L"%s,%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)",\r
IPDevPath->StaticIpAddress ? L"Static" : L"DHCP",\r
(UINTN) IPDevPath->LocalIpAddress.Addr[0],\r
(UINTN) IPDevPath->LocalIpAddress.Addr[1],\r