/** @file\r
Implement the TCP6 driver support for the socket layer.\r
\r
- Copyright (c) 2011, 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
- http://opensource.org/licenses/bsd-license.php\r
+ Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials are licensed and made available\r
+ under the terms and conditions of the BSD License which accompanies this\r
+ distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
\section ConnectionManagement Connection Management\r
- \r
+\r
The ::EslTcp6Listen routine initially places the SOCK_STREAM or\r
SOCK_SEQPACKET socket into a listen state. When a remote machine\r
makes a connection to the socket, the TCPv6 network layer calls\r
pTcp6->ConfigData.AccessPoint.RemoteAddress.Addr[15],\r
pTcp6->ConfigData.AccessPoint.RemotePort ));\r
\r
+ //\r
+ // Start the receive operations\r
+ //\r
+ pSocket->bConfigured = TRUE;\r
+ pSocket->State = SOCKET_STATE_CONNECTED;\r
+ EslSocketRxStart ( pPort );\r
+\r
//\r
// Remove the rest of the ports\r
//\r
case EFI_DEVICE_ERROR:\r
pSocket->errno = EIO;\r
break;\r
- \r
+\r
case EFI_ABORTED:\r
pSocket->errno = ECONNABORTED;\r
break;\r
- \r
+\r
case EFI_ACCESS_DENIED:\r
pSocket->errno = EACCES;\r
break;\r
- \r
+\r
case EFI_CONNECTION_RESET:\r
pSocket->errno = ECONNRESET;\r
break;\r
- \r
+\r
case EFI_INVALID_PARAMETER:\r
pSocket->errno = EADDRNOTAVAIL;\r
break;\r
- \r
+\r
case EFI_HOST_UNREACHABLE:\r
case EFI_NO_RESPONSE:\r
pSocket->errno = EHOSTUNREACH;\r
break;\r
- \r
+\r
case EFI_NO_MAPPING:\r
pSocket->errno = EAFNOSUPPORT;\r
break;\r
- \r
+\r
case EFI_NO_MEDIA:\r
case EFI_NETWORK_UNREACHABLE:\r
pSocket->errno = ENETDOWN;\r
break;\r
- \r
+\r
case EFI_OUT_OF_RESOURCES:\r
pSocket->errno = ENOBUFS;\r
break;\r
- \r
+\r
case EFI_PORT_UNREACHABLE:\r
case EFI_PROTOCOL_UNREACHABLE:\r
case EFI_CONNECTION_REFUSED:\r
pSocket->errno = ECONNREFUSED;\r
break;\r
- \r
+\r
case EFI_SUCCESS:\r
pSocket->errno = 0;\r
- pSocket->bConfigured = TRUE;\r
break;\r
- \r
+\r
case EFI_TIMEOUT:\r
pSocket->errno = ETIMEDOUT;\r
break;\r
- \r
+\r
case EFI_UNSUPPORTED:\r
pSocket->errno = EOPNOTSUPP;\r
break;\r
EFI_STATUS Status;\r
\r
DBG_ENTER ( );\r
- \r
+\r
//\r
// Determine if any more local adapters are available\r
//\r
// Status to errno translation gets done in EslTcp4ConnectPoll\r
//\r
pTcp6->ConnectToken.CompletionToken.Status = Status;\r
- \r
+\r
//\r
// Continue with the next port\r
//\r
//\r
pPort = pNextPort;\r
}\r
- \r
+\r
//\r
// Determine if any ports are in the listen state\r
//\r
EFI_HANDLE ChildHandle;\r
struct sockaddr_in6 LocalAddress;\r
EFI_TCP6_CONFIG_DATA * pConfigData;\r
- ESL_LAYER * pLayer;\r
ESL_PORT * pNewPort;\r
ESL_SOCKET * pNewSocket;\r
ESL_SOCKET * pSocket;\r
// Allocate a socket for this connection\r
//\r
ChildHandle = NULL;\r
- pLayer = &mEslLayer;\r
Status = EslSocketAllocate ( &ChildHandle,\r
DEBUG_CONNECTION,\r
&pNewSocket );\r
// Process:\r
// Call close\r
// Release the resources\r
- \r
+\r
}\r
\r
DBG_EXIT ( );\r
\r
This routine is called by ::EslSocketPortClose.\r
See the \ref PortCloseStateMachine section.\r
- \r
+\r
@param [in] pPort Address of an ::ESL_PORT structure.\r
\r
@retval EFI_SUCCESS The port is closed\r
UINTN DebugFlags;\r
ESL_TCP6_CONTEXT * pTcp6;\r
EFI_STATUS Status;\r
- \r
+\r
DBG_ENTER ( );\r
\r
//\r
@param [in] pPort Address of an ::ESL_PORT structure.\r
\r
@param [in] pPacket Address of an ::ESL_PACKET structure.\r
- \r
+\r
@param [in] pbConsumePacket Address of a BOOLEAN indicating if the packet is to be consumed\r
- \r
+\r
@param [in] BufferLength Length of the the buffer\r
- \r
+\r
@param [in] pBuffer Address of a buffer to receive the data.\r
- \r
+\r
@param [in] pDataLength Number of received data bytes in the buffer.\r
\r
@param [out] pAddress Network address to receive the remote system address\r
during the current transmission attempt.\r
\r
@param [in] pSocket Address of an ::ESL_SOCKET structure\r
- \r
+\r
@param [in] Flags Message control flags\r
- \r
+\r
@param [in] BufferLength Length of the the buffer\r
- \r
+\r
@param [in] pBuffer Address of a buffer to receive the data.\r
- \r
+\r
@param [in] pDataLength Number of received data bytes in the buffer.\r
\r
@param [in] pAddress Network address of the remote system address\r
ESL_PACKET ** ppQueueHead;\r
ESL_PACKET ** ppQueueTail;\r
ESL_PACKET * pPreviousPacket;\r
- ESL_TCP6_CONTEXT * pTcp6;\r
size_t * pTxBytes;\r
EFI_TCP6_TRANSMIT_DATA * pTxData;\r
EFI_STATUS Status;\r
//\r
// Determine the queue head\r
//\r
- pTcp6 = &pPort->Context.Tcp6;\r
bUrgent = (BOOLEAN)( 0 != ( Flags & MSG_OOB ));\r
bUrgentQueue = bUrgent\r
&& ( !pSocket->bOobInLine )\r
ESL_PORT * pPort;\r
ESL_SOCKET * pSocket;\r
EFI_STATUS Status;\r
- \r
+\r
DBG_ENTER ( );\r
\r
//\r