EFI TCPv6(Transmission Control Protocol version 6) Protocol Definition The EFI TCPv6 Service Binding Protocol is used to locate EFI TCPv6 Protocol drivers to create and destroy child of the driver to communicate with other host using TCP protocol. The EFI TCPv6 Protocol provides services to send and receive data stream.
Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
- Revision Reference:
- This Protocol is introduced in UEFI Specification 2.2
Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.
The Accept() function initiates an asynchronous accept request to wait for an incoming connection on the passive TCP instance. If a remote peer successfully establishes a connection with this instance, a new TCP instance will be created and its handle will be returned in ListenToken->NewChildHandle. The newly created instance is configured by inheriting the passive instance's configuration and is ready for use upon return. The new instance is in the Tcp6StateEstablished state.
The ListenToken->CompletionToken.Event will be signaled when a new connection is accepted, user aborts the listen or connection is reset.
This function only can be called when current TCP instance is in Tcp6StateListen state.
- Parameters
-
[in] | This | Pointer to the EFI_TCP6_PROTOCOL instance. |
[in] | ListenToken | Pointer to the listen token to return when operation finishes. |
- Return values
-
EFI_SUCCESS | The listen token has been queued successfully. |
EFI_NOT_STARTED | This EFI TCPv6 Protocol instance has not been configured. |
EFI_ACCESS_DENIED | One or more of the following are TRUE:
- This instance is not a passive instance.
- This instance is not in Tcp6StateListen state.
- The same listen token has already existed in the listen token queue of this TCP instance.
|
EFI_INVALID_PARAMETER | One or more of the following are TRUE:
- This is NULL.
- ListenToken is NULL.
- ListentToken->CompletionToken.Event is NULL.
|
EFI_OUT_OF_RESOURCES | Could not allocate enough resource to finish the operation. |
EFI_DEVICE_ERROR | Any unexpected and not belonged to above category error. |
Abort an asynchronous connection, listen, transmission or receive request.
The Cancel() function aborts a pending connection, listen, transmit or receive request.
If Token is not NULL and the token is in the connection, listen, transmission or receive queue when it is being cancelled, its Token->Status will be set to EFI_ABORTED and then Token->Event will be signaled.
If the token is not in one of the queues, which usually means that the asynchronous operation has completed, EFI_NOT_FOUND is returned.
If Token is NULL all asynchronous token issued by Connect(), Accept(), Transmit() and Receive() will be aborted.
- Parameters
-
- Return values
-
EFI_SUCCESS | The asynchronous I/O request is aborted and Token->Event is signaled. |
EFI_INVALID_PARAMETER | This is NULL. |
EFI_NOT_STARTED | This instance hasn't been configured. |
EFI_NOT_FOUND | The asynchronous I/O request isn't found in the transmission or receive queue. It has either completed or wasn't issued by Transmit() and Receive(). |
EFI_UNSUPPORTED | The implementation does not support this function. |
Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a nonblocking operation.
Initiate an asynchronous close token to TCP driver. After Close() is called, any buffered transmission data will be sent by TCP driver and the current instance will have a graceful close working flow described as RFC 793 if AbortOnClose is set to FALSE, otherwise, a rest packet will be sent by TCP driver to fast disconnect this connection. When the close operation completes successfully the TCP instance is in Tcp6StateClosed state, all pending asynchronous operations are signaled and any buffers used for TCP network traffic are flushed.
- Parameters
-
[in] | This | Pointer to the EFI_TCP6_PROTOCOL instance. |
[in] | CloseToken | Pointer to the close token to return when operation finishes. |
- Return values
-
EFI_SUCCESS | The Close() is called successfully. |
EFI_NOT_STARTED | This EFI TCPv6 Protocol instance has not been configured. |
EFI_ACCESS_DENIED | One or more of the following are TRUE:
- CloseToken or CloseToken->CompletionToken.Event is already in use.
- Previous Close() call on this instance has not finished.
|
EFI_INVALID_PARAMETER | One or more of the following are TRUE:
- This is NULL.
- CloseToken is NULL.
- CloseToken->CompletionToken.Event is NULL.
|
EFI_OUT_OF_RESOURCES | Could not allocate enough resource to finish the operation. |
EFI_DEVICE_ERROR | Any unexpected and not belonged to above category error. |
Initialize or brutally reset the operational parameters for this EFI TCPv6 instance.
The Configure() function does the following:
- Initialize this TCP instance, i.e., initialize the communication end settings and specify active open or passive open for an instance.
- Reset this TCP instance brutally, i.e., cancel all pending asynchronous tokens, flush transmission and receiving buffer directly without informing the communication peer.
No other TCPv6 Protocol operation except Poll() can be executed by this instance until it is configured properly. For an active TCP instance, after a proper configuration it may call Connect() to initiates the three-way handshake. For a passive TCP instance, its state will transit to Tcp6StateListen after configuration, and Accept() may be called to listen the incoming TCP connection requests. If Tcp6ConfigData is set to NULL, the instance is reset. Resetting process will be done brutally, the state machine will be set to Tcp6StateClosed directly, the receive queue and transmit queue will be flushed, and no traffic is allowed through this instance.
- Parameters
-
[in] | This | Pointer to the EFI_TCP6_PROTOCOL instance. |
[in] | Tcp6ConfigData | Pointer to the configure data to configure the instance. If Tcp6ConfigData is set to NULL, the instance is reset. |
- Return values
-
EFI_SUCCESS | The operational settings are set, changed, or reset successfully. |
EFI_NO_MAPPING | The underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use. |
EFI_INVALID_PARAMETER | One or more of the following conditions are TRUE:
- This is NULL.
- Tcp6ConfigData->AccessPoint.StationAddress is neither zero nor one of the configured IP addresses in the underlying IPv6 driver.
- Tcp6ConfigData->AccessPoint.RemoteAddress isn't a valid unicast IPv6 address.
- Tcp6ConfigData->AccessPoint.RemoteAddress is zero or Tcp6ConfigData->AccessPoint.RemotePort is zero when Tcp6ConfigData->AccessPoint.ActiveFlag is TRUE.
- A same access point has been configured in other TCP instance properly.
|
EFI_ACCESS_DENIED | Configuring TCP instance when it is configured without calling Configure() with NULL to reset it. |
EFI_UNSUPPORTED | One or more of the control options are not supported in the implementation. |
EFI_OUT_OF_RESOURCES | Could not allocate enough system resources when executing Configure(). |
EFI_DEVICE_ERROR | An unexpected network or system error occurred. |
Initiate a nonblocking TCP connection request for an active TCP instance.
The Connect() function will initiate an active open to the remote peer configured in current TCP instance if it is configured active. If the connection succeeds or fails due to any error, the ConnectionToken->CompletionToken.Event will be signaled and ConnectionToken->CompletionToken.Status will be updated accordingly. This function can only be called for the TCP instance in Tcp6StateClosed state. The instance will transfer into Tcp6StateSynSent if the function returns EFI_SUCCESS. If TCP three-way handshake succeeds, its state will become Tcp6StateEstablished, otherwise, the state will return to Tcp6StateClosed.
- Parameters
-
[in] | This | Pointer to the EFI_TCP6_PROTOCOL instance. |
[in] | ConnectionToken | Pointer to the connection token to return when the TCP three way handshake finishes. |
- Return values
-
EFI_SUCCESS | The connection request is successfully initiated and the state of this TCP instance has been changed to Tcp6StateSynSent. |
EFI_NOT_STARTED | This EFI TCPv6 Protocol instance has not been configured. |
EFI_ACCESS_DENIED | One or more of the following conditions are TRUE:
- This instance is not configured as an active one.
- This instance is not in Tcp6StateClosed state.
|
EFI_INVALID_PARAMETER | One or more of the following are TRUE:
- This is NULL.
- ConnectionToken is NULL.
- ConnectionToken->CompletionToken.Event is NULL.
|
EFI_OUT_OF_RESOURCES | The driver can't allocate enough resource to initiate the active open. |
EFI_DEVICE_ERROR | An unexpected system or network error occurred. |