/** @file\r
Data source for network testing.\r
\r
- Copyright (c) 2011, Intel Corporation\r
+ Copyright (c) 2011-2012, Intel Corporation\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
( pRemoteAddress4->sin_addr.s_addr >> 8 ) & 0xff,\r
( pRemoteAddress4->sin_addr.s_addr >> 16 ) & 0xff,\r
( pRemoteAddress4->sin_addr.s_addr >> 24 ) & 0xff,\r
- htons ( pRemoteAddress4->sin_port ));\r
+ ntohs ( pRemoteAddress4->sin_port ));\r
}\r
else {\r
Print ( L"Connecting to remote system [%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]:%d\r\n",\r
pRemoteAddress6->sin6_addr.__u6_addr.__u6_addr8[ 13 ],\r
pRemoteAddress6->sin6_addr.__u6_addr.__u6_addr8[ 14 ],\r
pRemoteAddress6->sin6_addr.__u6_addr.__u6_addr8[ 15 ],\r
- htons ( pRemoteAddress6->sin6_port ));\r
+ ntohs ( pRemoteAddress6->sin6_port ));\r
}\r
\r
//\r
( pRemoteAddress4->sin_addr.s_addr >> 8 ) & 0xff,\r
( pRemoteAddress4->sin_addr.s_addr >> 16 ) & 0xff,\r
( pRemoteAddress4->sin_addr.s_addr >> 24 ) & 0xff,\r
- htons ( pRemoteAddress4->sin_port ));\r
+ ntohs ( pRemoteAddress4->sin_port ));\r
}\r
else {\r
Print ( L"Connected to remote system [%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]:%d\r\n",\r
pRemoteAddress6->sin6_addr.__u6_addr.__u6_addr8[ 13 ],\r
pRemoteAddress6->sin6_addr.__u6_addr.__u6_addr8[ 14 ],\r
pRemoteAddress6->sin6_addr.__u6_addr.__u6_addr8[ 15 ],\r
- htons ( pRemoteAddress6->sin6_port ));\r
+ ntohs ( pRemoteAddress6->sin6_port ));\r
}\r
+Print ( L"ConnectStatus: %d, Status: %r\r\n", ConnectStatus, Status );\r
}\r
else {\r
//\r
//\r
// Return the operation status\r
//\r
+Print ( L"SocketConnect returning Status: %r\r\n", Status );\r
return Status;\r
}\r
\r
DEBUG (( DEBUG_INFO,\r
"ERROR: send failed, errno: %d\r\n",\r
errno ));\r
+Print ( L"ERROR: send failed, errno: %d\r\n", errno );\r
\r
//\r
// Try again\r
// Wait for the remote network application to start\r
//\r
Status = SocketConnect ( );\r
+Print ( L"Status: %r\r\n", Status );\r
if ( EFI_NOT_STARTED == Status ) {\r
Status = SocketClose ( );\r
continue;\r
//\r
// Return the operation status\r
//\r
+Print ( L"Returning Status: %r\r\n", Status );\r
return Status;\r
}\r
\r
pIpAddress[1],\r
pIpAddress[2],\r
pIpAddress[3],\r
- htons ( ((struct sockaddr_in *)&RemoteHostAddress)->sin_port ));\r
+ ntohs ( ((struct sockaddr_in *)&RemoteHostAddress)->sin_port ));\r
}\r
}\r
}\r
pIpAddress[1],\r
pIpAddress[2],\r
pIpAddress[3],\r
- htons ( ((struct sockaddr_in *)&RemoteHostAddress)->sin_port ));\r
+ ntohs ( ((struct sockaddr_in *)&RemoteHostAddress)->sin_port ));\r
bTcp4Connecting = FALSE;\r
}\r
\r
Tcp4ConfigData.AccessPoint.RemoteAddress.Addr[1] = (UINT8)( ((struct sockaddr_in *)&RemoteHostAddress)->sin_addr.s_addr >> 8 );\r
Tcp4ConfigData.AccessPoint.RemoteAddress.Addr[2] = (UINT8)( ((struct sockaddr_in *)&RemoteHostAddress)->sin_addr.s_addr >> 16 );\r
Tcp4ConfigData.AccessPoint.RemoteAddress.Addr[3] = (UINT8)( ((struct sockaddr_in *)&RemoteHostAddress)->sin_addr.s_addr >> 24 );\r
- Tcp4ConfigData.AccessPoint.RemotePort = ((struct sockaddr_in *)&RemoteHostAddress)->sin_port;\r
+ Tcp4ConfigData.AccessPoint.RemotePort = ntohs (((struct sockaddr_in *)&RemoteHostAddress)->sin_port);\r
Tcp4ConfigData.AccessPoint.UseDefaultAddress = TRUE;\r
Tcp4ConfigData.AccessPoint.SubnetMask.Addr[0] = 0;\r
Tcp4ConfigData.AccessPoint.SubnetMask.Addr[1] = 0;\r
pIpAddress[1],\r
pIpAddress[2],\r
pIpAddress[3],\r
- htons ( ((struct sockaddr_in *)&RemoteHostAddress)->sin_port ));\r
+ ntohs ( ((struct sockaddr_in *)&RemoteHostAddress)->sin_port ));\r
} while ( 0 );\r
\r
if ( EFI_ERROR ( Status )) {\r