EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Data Structures | Defines | Typedefs | Functions | Variables

NetworkPkg/TcpDxe/TcpMain.h File Reference

#include <Protocol/ServiceBinding.h>
#include <Protocol/DriverBinding.h>
#include <Library/IpIoLib.h>
#include <Library/DevicePathLib.h>
#include "Socket.h"
#include "TcpProto.h"
#include "TcpDriver.h"
#include "TcpFunc.h"

Go to the source code of this file.

Data Structures

union  TCP_CONFIG_DATA
union  TCP_ACCESS_POINT
struct  _TCP4_MODE_DATA
struct  _TCP6_MODE_DATA
struct  _TCP4_ROUTE_INFO

Defines

#define TCP6_KEEP_NEIGHBOR_TIME   30
#define TCP6_REFRESH_NEIGHBOR_TICK   25
#define TCP_EXPIRE_TIME   65535
#define TCP_BASE_ISS   0x4d7e980b
#define TCP_ISS_INCREMENT_1   2048
#define TCP_ISS_INCREMENT_2   100

Typedefs

typedef struct _TCP4_MODE_DATA TCP4_MODE_DATA
typedef struct _TCP6_MODE_DATA TCP6_MODE_DATA
typedef struct _TCP4_ROUTE_INFO TCP4_ROUTE_INFO

Functions

EFI_STATUS EFIAPI Tcp4GetModeData (IN EFI_TCP4_PROTOCOL *This, OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL, OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL, OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
EFI_STATUS EFIAPI Tcp4Configure (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL)
EFI_STATUS EFIAPI Tcp4Routes (IN EFI_TCP4_PROTOCOL *This, IN BOOLEAN DeleteRoute, IN EFI_IPv4_ADDRESS *SubnetAddress, IN EFI_IPv4_ADDRESS *SubnetMask, IN EFI_IPv4_ADDRESS *GatewayAddress)
EFI_STATUS EFIAPI Tcp4Connect (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken)
EFI_STATUS EFIAPI Tcp4Accept (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_LISTEN_TOKEN *ListenToken)
EFI_STATUS EFIAPI Tcp4Transmit (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token)
EFI_STATUS EFIAPI Tcp4Receive (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token)
EFI_STATUS EFIAPI Tcp4Close (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CLOSE_TOKEN *CloseToken)
EFI_STATUS EFIAPI Tcp4Cancel (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL)
EFI_STATUS EFIAPI Tcp4Poll (IN EFI_TCP4_PROTOCOL *This)
EFI_STATUS EFIAPI Tcp6GetModeData (IN EFI_TCP6_PROTOCOL *This, OUT EFI_TCP6_CONNECTION_STATE *Tcp6State OPTIONAL, OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL, OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
EFI_STATUS EFIAPI Tcp6Configure (IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL)
EFI_STATUS EFIAPI Tcp6Connect (IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CONNECTION_TOKEN *ConnectionToken)
EFI_STATUS EFIAPI Tcp6Accept (IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_LISTEN_TOKEN *ListenToken)
EFI_STATUS EFIAPI Tcp6Transmit (IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_IO_TOKEN *Token)
EFI_STATUS EFIAPI Tcp6Receive (IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_IO_TOKEN *Token)
EFI_STATUS EFIAPI Tcp6Close (IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CLOSE_TOKEN *CloseToken)
EFI_STATUS EFIAPI Tcp6Cancel (IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_COMPLETION_TOKEN *Token OPTIONAL)
EFI_STATUS EFIAPI Tcp6Poll (IN EFI_TCP6_PROTOCOL *This)

Variables

UINT16 mTcp4RandomPort
UINT16 mTcp6RandomPort
CHAR16mTcpStateName []
EFI_COMPONENT_NAME_PROTOCOL gTcpComponentName
EFI_COMPONENT_NAME2_PROTOCOL gTcpComponentName2
LIST_ENTRY mTcpRunQue
LIST_ENTRY mTcpListenQue
TCP_SEQNO mTcpGlobalIss
UINT32 mTcpTick

Detailed Description

Declaration of protocol interfaces in EFI_TCP4_PROTOCOL and EFI_TCP6_PROTOCOL. It is the common head file for all Tcp*.c in TCP driver.

Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file TcpMain.h.


Define Documentation

#define TCP6_KEEP_NEIGHBOR_TIME   30

30 seconds.

Definition at line 44 of file TcpMain.h.

#define TCP6_REFRESH_NEIGHBOR_TICK   25

5 seconds, since 1 tick equals 200ms.

Definition at line 48 of file TcpMain.h.

#define TCP_BASE_ISS   0x4d7e980b

The implementation selects the initial send sequence number and the unit to be added when it is increased.

Definition at line 56 of file TcpMain.h.

#define TCP_EXPIRE_TIME   65535

Definition at line 50 of file TcpMain.h.

#define TCP_ISS_INCREMENT_1   2048

Definition at line 57 of file TcpMain.h.

#define TCP_ISS_INCREMENT_2   100

Definition at line 58 of file TcpMain.h.


Typedef Documentation


Function Documentation

EFI_STATUS EFIAPI Tcp4Accept ( IN EFI_TCP4_PROTOCOL This,
IN EFI_TCP4_LISTEN_TOKEN ListenToken 
)

Listen on the passive instance to accept an incoming connection request.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]ListenTokenPointer to the listen token to return when operation finishes.
Return values:
EFI_SUCCESSThe listen token has been queued successfully.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDThe instatnce is not a passive one or it is not in Tcp4StateListen state, or a same listen token has already existed in the listen token queue of this TCP instance.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to finish the operation.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Listen on the passive instance to accept an incoming connection request.

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 instance is in the Tcp4StateEstablished 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 Tcp4StateListen state.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance
ListenTokenPointer to the listen token to return when operation finishes.
Return values:
EFI_SUCCESSThe listen token has been queued successfully.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDThe instatnce is not a passive one or it is not in Tcp4StateListen state or a same listen token has already existed in the listen token queue of this TCP instance.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to finish the operation.
EFI_DEVICE_ERRORAny unexpected and not belonged to above category error.

Listen on the passive instance to accept an incoming connection request.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]ListenTokenPointer to the listen token to return when operation finishes.
Return values:
EFI_SUCCESSThe listen token was queued successfully.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDThe instatnce is not a passive one or it is not in Tcp4StateListen state or a same listen token has already existed in the listen token queue of this TCP instance.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to finish the operation.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Definition at line 369 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4Cancel ( IN EFI_TCP4_PROTOCOL This,
IN EFI_TCP4_COMPLETION_TOKEN *Token  OPTIONAL 
)

Abort an asynchronous connection, listen, transmission or receive request.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]TokenPointer to a token that has been issued by Connect(), Accept(), Transmit() or Receive(). If NULL, all pending tokens issued by the above four functions will be aborted.
Return values:
EFI_UNSUPPORTEDThe operation is not supported in the current implementation.

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. NOTE: It has not been implemented currently.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance.
TokenPointer to a token that has been issued by Connect(), Accept(), Transmit() or Receive(). If NULL, all pending tokens issued by above four functions will be aborted.
Return values:
EFI_SUCCESSThe asynchronous I/O request is aborted and Token->Event is signaled.
EFI_INVALID_PARAMETERThis is NULL.
EFI_NOT_STARTEDThis instance hasn's been configured.
EFI_NO_MAPPINGWhen using the default address, configuration (DHCP, BOOTP,RARP, etc.) hasn's finished yet.
EFI_NOT_FOUNDThe asynchronous I/O request isn's found in the transmission or receive queue. It has either completed or wasn's issued by Transmit() and Receive().
EFI_UNSUPPORTEDThe operation is not supported in current implementation.

Abort an asynchronous connection, listen, transmission or receive request.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]TokenPointer to a token that has been issued by Connect(), Accept(), Transmit() or Receive(). If NULL, all pending tokens issued by the four functions listed above will be aborted.
Return values:
EFI_UNSUPPORTEDThe operation is not supported in the current implementation.

Definition at line 625 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4Close ( IN EFI_TCP4_PROTOCOL This,
IN EFI_TCP4_CLOSE_TOKEN CloseToken 
)

Disconnecting a TCP connection gracefully or reset a TCP connection.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]CloseTokenPointer to the close token to return when operation finishes.
Return values:
EFI_SUCCESSThe operation completed successfully.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDOne or more of the following are TRUE: * Configure() has been called with TcpConfigData set to NULL and this function has not returned. Previous Close() call on this instance has not finished.
EFI_INVALID_PARAMETEROne ore more parameters are invalid.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to finish the operation.
EFI_DEVICE_ERRORAny unexpected error not belonging to the error categories given above.

Disconnecting a TCP connection gracefully or reset a TCP connection.

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 Tcp4StateClosed state, all pending asynchronous operation is signaled and any buffers used for TCP network traffic is flushed.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance.
CloseTokenPointer to the close token to return when operation finishes.
Return values:
EFI_SUCCESSThe operation completed successfully.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDOne or more of the following are TRUE: Configure() has been called with TcpConfigData set to NULL and this function has not returned. Previous Close() call on this instance has not finished.
EFI_INVALID_PARAMETEROne ore more parameters are invalid.
EFI_OUT_OF_RESOURCESCould not allocate enough resource to finish the operation.
EFI_DEVICE_ERRORAny unexpected and not belonged to above category error.

Disconnecting a TCP connection gracefully or reset a TCP connection.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]CloseTokenPointer to the close token to return when operation finishes.
Return values:
EFI_SUCCESSThe operation completed successfully.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDOne or more of the following are TRUE: * Configure() has been called with TcpConfigData set to NULL, and this function has not returned. Previous Close() call on this instance has not finished.
EFI_INVALID_PARAMETEROne ore more parameters are invalid.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to finish the operation.
EFI_DEVICE_ERRORAny unexpected category error not belonging to those listed above.

Definition at line 573 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4Configure ( IN EFI_TCP4_PROTOCOL This,
IN EFI_TCP4_CONFIG_DATA *TcpConfigData  OPTIONAL 
)

Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]TcpConfigDataPointer to the configure data to configure the instance. Optional parameter that may be NULL.
Return values:
EFI_SUCCESSThe operational settings are set, changed, or reset successfully.
EFI_NO_MAPPINGWhen using a default address, configuration (through DHCP, BOOTP, RARP, etc.) is not finished.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_ACCESS_DENIEDConfiguring the TCP instance when it is already configured.
EFI_DEVICE_ERRORAn unexpected network or system error occurred.
EFI_UNSUPPORTEDOne or more of the control options are not supported in the implementation.
EFI_OUT_OF_RESOURCESCould not allocate enough system resources.

Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.

The Configure() function does the following: Initialize this EFI TCPv4 instance, i.e., initialize the communication end setting, specify active open or passive open for an instance. Reset this TCPv4 instance brutally, i.e., cancel all pending asynchronous tokens, flush transmission and receiving buffer directly without informing the communication peer. No other TCPv4 Protocol operation can be executed by this instance until it is configured properly. For an active TCP4 instance, after a proper configuration it may call Connect() to initiates the three-way handshake. For a passive TCP4 instance, its state will transit to Tcp4StateListen after configuration, and Accept() may be called to listen the incoming TCP connection request. If TcpConfigData is set to NULL, the instance is reset. Resetting process will be done brutally, the state machine will be set to Tcp4StateClosed directly, the receive queue and transmit queue will be flushed, and no traffic is allowed through this instance.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance.
TcpConfigDataPointer to the configure data to configure the instance.
Return values:
EFI_SUCCESSThe operational settings are set, changed, or reset successfully.
EFI_NO_MAPPINGWhen using a default address, configuration (through DHCP, BOOTP, RARP, etc.) is not finished.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_ACCESS_DENIEDConfiguring TCP instance when it is already configured.
EFI_DEVICE_ERRORAn unexpected network or system error occurred.
EFI_UNSUPPORTEDOne or more of the control options are not supported in the implementation.
EFI_OUT_OF_RESOURCESCould not allocate enough system resources.

Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]TcpConfigDataPointer to the configure data to configure the instance. Optional parameter that may be NULL.
Return values:
EFI_SUCCESSThe operational settings were set, changed, or reset successfully.
EFI_NO_MAPPINGWhen using a default address, configuration (through DHCP, BOOTP, RARP, etc.) is not finished.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_ACCESS_DENIEDConfiguring TCP instance when it is already configured.
EFI_DEVICE_ERRORAn unexpected network or system error occurred.
EFI_UNSUPPORTEDOne or more of the control options are not supported in the implementation.
EFI_OUT_OF_RESOURCESCould not allocate enough system resources.

Definition at line 152 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4Connect ( IN EFI_TCP4_PROTOCOL This,
IN EFI_TCP4_CONNECTION_TOKEN ConnectionToken 
)

Initiate a nonblocking TCP connection request for an active TCP instance.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]ConnectionTokenPointer to the connection token to return when the TCP three way handshake finishes.
Return values:
EFI_SUCCESSThe connection request is successfully initiated.
EFI_NOT_STARTEDThis EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDThe instance is not configured as an active one or it is not in Tcp4StateClosed state.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe driver can't allocate enough resources to initiate the active open.
EFI_DEVICE_ERRORAn unexpected system or network 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 Tcp4StateClosed state. The instance will transfer into Tcp4StateSynSent if the function returns EFI_SUCCESS. If TCP three way handshake succeeds, its state will become Tcp4StateEstablished, otherwise, the state will return to Tcp4StateClosed.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance
ConnectionTokenPointer to the connection token to return when the TCP three way handshake finishes.
Return values:
EFI_SUCCESSThe connection request is successfully initiated and the state of this TCPv4 instance has been changed to Tcp4StateSynSent.
EFI_NOT_STARTEDThis EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDThe instance is not configured as an active one or it is not in Tcp4StateClosed state.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe driver can't allocate enough resource to initiate the active open.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Initiate a non-blocking TCP connection request for an active TCP instance.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]ConnectionTokenPointer to the connection token to return when the TCP three way handshake finishes.
Return values:
EFI_SUCCESSThe connection request successfully initiated.
EFI_NOT_STARTEDThis EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_ACCESS_DENIEDThe instance is not configured as an active one, or it is not in Tcp4StateClosed state.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe driver can't allocate enough resources to initiate the active open.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Definition at line 318 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4GetModeData ( IN EFI_TCP4_PROTOCOL This,
OUT EFI_TCP4_CONNECTION_STATE *Tcp4State  OPTIONAL,
OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData  OPTIONAL,
OUT EFI_IP4_MODE_DATA *Ip4ModeData  OPTIONAL,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData  OPTIONAL,
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData  OPTIONAL 
)

Get the current operational status.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[out]Tcp4StatePointer to the buffer to receive the current TCP state. Optional parameter that may be NULL.
[out]Tcp4ConfigDataPointer to the buffer to receive the current TCP configuration. Optional parameter that may be NULL.
[out]Ip4ModeDataPointer to the buffer to receive the current IPv4 configuration. Optional parameter that may be NULL.
[out]MnpConfigDataPointer to the buffer to receive the current MNP configuration data indirectly used by the TCPv4 Instance. Optional parameter that may be NULL.
[out]SnpModeDataPointer to the buffer to receive the current SNP configuration data indirectly used by the TCPv4 Instance. Optional parameter that may be NULL.
Return values:
EFI_SUCCESSThe mode data was read.
EFI_NOT_STARTEDNo configuration data is available because this instance hasn't been started.
EFI_INVALID_PARAMETERThis is NULL.

Get the current operational status.

The GetModeData() function copies the current operational settings of this EFI TCPv4 Protocol instance into user-supplied buffers. This function can also be used to retrieve the operational setting of underlying drivers such as IPv4, MNP, or SNP.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance.
Tcp4StatePointer to the buffer to receive the current TCP state.
Tcp4ConfigDataPointer to the buffer to receive the current TCP configuration.
Ip4ModeDataPointer to the buffer to receive the current IPv4 configuration data used by the TCPv4 instance.
MnpConfigDataPointer to the buffer to receive the current MNP configuration data indirectly used by the TCPv4 Instance.
SnpModeDataPointer to the buffer to receive the current SNP configuration data indirectly used by the TCPv4 Instance.
Return values:
EFI_SUCCESSThe mode data was read.
EFI_NOT_STARTEDNo configuration data is available because this instance hasn't been started.
EFI_INVALID_PARAMETERThis is NULL.

Definition at line 84 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4Poll ( IN EFI_TCP4_PROTOCOL This)

Poll to receive incoming data and transmit outgoing segments.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
Return values:
EFI_SUCCESSIncoming or outgoing data was processed.
EFI_INVALID_PARAMETERThis is NULL.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
EFI_NOT_READYNo incoming or outgoing data was processed.
EFI_TIMEOUTData was dropped out of the transmission or receive queue. Consider increasing the polling rate.

Poll to receive incoming data and transmit outgoing segments.

The Poll() function increases the rate that data is moved between the network and application and can be called when the TCP instance is created successfully. Its use is optional. In some implementations, the periodical timer in the MNP driver may not poll the underlying communications device fast enough to avoid drop packets. Drivers and applications that are experiencing packet loss should try calling the Poll() function in a high frequency.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance.
Return values:
EFI_SUCCESSIncoming or outgoing data was processed.
EFI_INVALID_PARAMETERThis is NULL.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
EFI_NOT_READYNo incoming or outgoing data was processed.
EFI_TIMEOUTData was dropped out of the transmission or receive queue. Consider increasing the polling rate.

Definition at line 657 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4Receive ( IN EFI_TCP4_PROTOCOL This,
IN EFI_TCP4_IO_TOKEN Token 
)

Place an asynchronous receive request into the receiving queue.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]TokenPointer to a token that is associated with the receive data descriptor.
Return values:
EFI_SUCCESSThe receive completion token was cached.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe receive completion token could not be queued due to a lack of system resources.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
EFI_ACCESS_DENIEDOne or more of the following conditions is TRUE: A receive completion token with the same Token->CompletionToken.Event was already in the receive queue. * The current instance is in Tcp4StateClosed state. * The current instance is a passive one and it is in Tcp4StateListen state. * User has called Close() to disconnect this connection.
EFI_CONNECTION_FINThe communication peer has closed the connection and there is no buffered data in the receive buffer of this instance.
EFI_NOT_READYThe receive request could not be queued because the receive queue is full.

Place an asynchronous receive request into the receiving queue.

The Receive() function places a completion token into the receive packet queue. This function is always asynchronous. The caller must allocate the Token->CompletionToken.Event and the FragmentBuffer used to receive data. He also must fill the DataLength which represents the whole length of all FragmentBuffer. When the receive operation completes, the EFI TCPv4 Protocol driver updates the Token->CompletionToken.Status and Token->Packet.RxData fields and the Token->CompletionToken.Event is signaled. If got data the data and its length will be copy into the FragmentTable, in the same time the full length of received data will be recorded in the DataLength fields. Providing a proper notification function and context for the event will enable the user to receive the notification and receiving status. That notification function is guaranteed to not be re-entered.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance.
TokenPointer to a token that is associated with the receive data descriptor.
Return values:
EFI_SUCCESSThe receive completion token was cached.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe receive completion token could not be queued due to a lack of system resources.
EFI_DEVICE_ERRORAn unexpected system or network error occurred. The EFI TCPv4 Protocol instance has been reset to startup defaults.
EFI_ACCESS_DENIEDOne or more of the following conditions is TRUE: A receive completion token with the same Token->CompletionToken.Event was already in the receive queue. The current instance is in Tcp4StateClosed state. The current instance is a passive one and it is in Tcp4StateListen state. User has called Close() to disconnect this connection.
EFI_CONNECTION_FINThe communication peer has closed the connection and there is no any buffered data in the receive buffer of this instance.
EFI_NOT_READYThe receive request could not be queued because the receive queue is full.

Place an asynchronous receive request into the receiving queue.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]TokenPointer to a token that is associated with the receive data descriptor.
Return values:
EFI_SUCCESSThe receive completion token was cached
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESThe receive completion token could not be queued due to a lack of system resources.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
EFI_ACCESS_DENIEDOne or more of the following conditions is TRUE: A receive completion token with the same Token->CompletionToken.Event was already in the receive queue. * The current instance is in Tcp4StateClosed state. * The current instance is a passive one and it is in Tcp4StateListen state. * User has called Close() to disconnect this connection.
EFI_CONNECTION_FINThe communication peer has closed the connection, and there is no any buffered data in the receive buffer of this instance.
EFI_NOT_READYThe receive request could not be queued because the receive queue is full.

Definition at line 506 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4Routes ( IN EFI_TCP4_PROTOCOL This,
IN BOOLEAN  DeleteRoute,
IN EFI_IPv4_ADDRESS SubnetAddress,
IN EFI_IPv4_ADDRESS SubnetMask,
IN EFI_IPv4_ADDRESS GatewayAddress 
)

Add or delete routing entries.

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]DeleteRouteIf TRUE, delete the specified route from routing table; if FALSE, add the specified route to routing table.
[in]SubnetAddressThe destination network.
[in]SubnetMaskThe subnet mask for the destination network.
[in]GatewayAddressThe gateway address for this route.
Return values:
EFI_SUCCESSThe operation completed successfully.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance has not been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (through DHCP, BOOTP, RARP, etc.) is not finished.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to add the entry to the routing table.
EFI_NOT_FOUNDThis route is not in the routing table.
EFI_ACCESS_DENIEDThis route is already in the routing table.
EFI_UNSUPPORTEDThe TCP driver does not support this operation.

Add or delete routing entries.

The Routes() function adds or deletes a route from the instance's routing table. The most specific route is selected by comparing the SubnetAddress with the destination IP address's arithmetical AND to the SubnetMask. The default route is added with both SubnetAddress and SubnetMask set to 0.0.0.0. The default route matches all destination IP addresses if there is no more specific route. Direct route is added with GatewayAddress set to 0.0.0.0. Packets are sent to the destination host if its address can be found in the Address Resolution Protocol (ARP) cache or it is on the local subnet. If the instance is configured to use default address, a direct route to the local network will be added automatically. Each TCP instance has its own independent routing table. Instance that uses the default IP address will have a copy of the EFI_IP4_CONFIG_PROTOCOL's routing table. The copy will be updated automatically whenever the IP driver reconfigures its instance. As a result, the previous modification to the instance's local copy will be lost. The priority of checking the route table is specific with IP implementation and every IP implementation must comply with RFC 1122.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance.
DeleteRouteIf TRUE, delete the specified route from routing table; if FALSE, add the specified route to routing table. DestinationAddress and SubnetMask are used as the keywords to search route entry.
SubnetAddressThe destination network.
SubnetMaskThe subnet mask for the destination network.
GatewayAddressThe gateway address for this route. It must be on the same subnet with the station address unless a direct route is specified.
Return values:
EFI_SUCCESSThe operation completed successfully.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance has not been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (through DHCP, BOOTP, RARP, etc.) is not finished.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to add the entry to the routing table.
EFI_NOT_FOUNDThis route is not in the routing table.
EFI_ACCESS_DENIEDThis route is already in the routing table.
EFI_UNSUPPORTEDThe TCP driver does not support this operation.

Definition at line 261 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp4Transmit ( IN EFI_TCP4_PROTOCOL This,
IN EFI_TCP4_IO_TOKEN Token 
)

Queues outgoing data into the transmit queue

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance
[in]TokenPointer to the completion token to queue to the transmit queue
Return values:
EFI_SUCCESSThe data has been queued for transmission
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_INVALID_PARAMETEROne or more parameters are invalid
EFI_ACCESS_DENIEDOne or more of the following conditions is TRUE: A transmit completion token with the same Token-> CompletionToken.Event was already in the transmission queue. * The current instance is in Tcp4StateClosed state * The current instance is a passive one and it is in Tcp4StateListen state. * User has called Close() to disconnect this connection.
EFI_NOT_READYThe completion token could not be queued because the transmit queue is full.
EFI_OUT_OF_RESOURCESCould not queue the transmit data because of a resource shortage.
EFI_NETWORK_UNREACHABLEThere is no route to the destination network or address.

Queues outgoing data into the transmit queue.

The Transmit() function queues a sending request to this TCPv4 instance along with the user data. The status of the token is updated and the event in the token will be signaled once the data is sent out or some error occurs.

Parameters:
ThisPointer to the EFI_TCP4_PROTOCOL instance
TokenPointer to the completion token to queue to the transmit queue
Return values:
EFI_SUCCESSThe data has been queued for transmission.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_ACCESS_DENIEDOne or more of the following conditions is TRUE: A transmit completion token with the same Token-> CompletionToken.Event was already in the transmission queue. The current instance is in Tcp4StateClosed state The current instance is a passive one and it is in Tcp4StateListen state. User has called Close() to disconnect this connection.
EFI_NOT_READYThe completion token could not be queued because the transmit queue is full.
EFI_OUT_OF_RESOURCESCould not queue the transmit data because of resource shortage.
EFI_NETWORK_UNREACHABLEThere is no route to the destination network or address.

Queues outgoing data into the transmit queue

Parameters:
[in]ThisPointer to the EFI_TCP4_PROTOCOL instance.
[in]TokenPointer to the completion token to queue to the transmit queue.
Return values:
EFI_SUCCESSThe data has been queued for transmission.
EFI_NOT_STARTEDThe EFI_TCP4_PROTOCOL instance hasn't been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_INVALID_PARAMETEROne or more parameters are invalid
EFI_ACCESS_DENIEDOne or more of the following conditions is TRUE: A transmit completion token with the same Token-> CompletionToken.Event was already in the transmission queue. * The current instance is in Tcp4StateClosed state. * The current instance is a passive one and it is in Tcp4StateListen state. * User has called Close() to disconnect this connection.
EFI_NOT_READYThe completion token could not be queued because the transmit queue is full.
EFI_OUT_OF_RESOURCESCould not queue the transmit data because of a resource shortage.
EFI_NETWORK_UNREACHABLEThere is no route to the destination network or address.

Definition at line 424 of file Tcp4Main.c.

EFI_STATUS EFIAPI Tcp6Accept ( IN EFI_TCP6_PROTOCOL This,
IN EFI_TCP6_LISTEN_TOKEN ListenToken 
)

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 the current TCP instance is in Tcp6StateListen state.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]ListenTokenPointer to the listen token to return when the operation finishes.
Return values:
EFI_SUCCESSThe listen token was been queued successfully.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_ACCESS_DENIEDOne 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_PARAMETEROne or more of the following are TRUE:

  • This is NULL.
  • ListenToken is NULL.
  • ListentToken->CompletionToken.Event is NULL.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to finish the operation.
EFI_DEVICE_ERRORAny unexpected error not belonging to the error categories given above.

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, when a user aborts the listen or when a connection is reset.

This function only can be called when a current TCP instance is in Tcp6StateListen state.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]ListenTokenPointer to the listen token to return when operation finishes.
Return values:
EFI_SUCCESSThe listen token queued successfully.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_ACCESS_DENIEDOne 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_PARAMETEROne or more of the following are TRUE:

  • This is NULL.
  • ListenToken is NULL.
  • ListentToken->CompletionToken.Event is NULL.
EFI_OUT_OF_RESOURCESCould not allocate enough resource to finish the operation.
EFI_DEVICE_ERRORAny unexpected error not belonging to a category listed above.

Definition at line 787 of file TcpMain.c.

EFI_STATUS EFIAPI Tcp6Cancel ( IN EFI_TCP6_PROTOCOL This,
IN EFI_TCP6_COMPLETION_TOKEN *Token  OPTIONAL 
)

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:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]TokenPointer to a token that has been issued by EFI_TCP6_PROTOCOL.Connect(), EFI_TCP6_PROTOCOL.Accept(), EFI_TCP6_PROTOCOL.Transmit() or EFI_TCP6_PROTOCOL.Receive(). If NULL, all pending tokens issued by above four functions will be aborted. Type EFI_TCP6_COMPLETION_TOKEN is defined in EFI_TCP_PROTOCOL.Connect().
Return values:
EFI_UNSUPPORTEDThe implementation does not support this function.

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:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]TokenPointer to a token that has been issued by EFI_TCP6_PROTOCOL.Connect(), EFI_TCP6_PROTOCOL.Accept(), EFI_TCP6_PROTOCOL.Transmit() or EFI_TCP6_PROTOCOL.Receive(). If NULL, all pending tokens issued by above four functions will be aborted. Type EFI_TCP6_COMPLETION_TOKEN is defined in EFI_TCP_PROTOCOL.Connect().
Return values:
EFI_UNSUPPORTEDThe implementation does not support this function.

Definition at line 1030 of file TcpMain.c.

EFI_STATUS EFIAPI Tcp6Close ( IN EFI_TCP6_PROTOCOL This,
IN EFI_TCP6_CLOSE_TOKEN CloseToken 
)

Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a nonblocking operation.

Initiate an asynchronous close token to the TCP driver. After Close() is called, any buffered transmission data will be sent by the 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]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]CloseTokenPointer to the close token to return when operation finishes.
Return values:
EFI_SUCCESSThe Close() was called successfully.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_ACCESS_DENIEDOne 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_PARAMETEROne or more of the following are TRUE:

  • This is NULL.
  • CloseToken is NULL.
  • CloseToken->CompletionToken.Event is NULL.
EFI_OUT_OF_RESOURCESCould not allocate enough resources to finish the operation.
EFI_DEVICE_ERRORAny unexpected error not belonging to the error categories given above.

Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a nonblocking operation.

Initiate an asynchronous close token to the TCP driver. After Close() is called, any buffered transmission data will be sent by the 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]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]CloseTokenPointer to the close token to return when operation finishes.
Return values:
EFI_SUCCESSThe Close() was called successfully.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_ACCESS_DENIEDOne 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_PARAMETEROne or more of the following are TRUE:

  • This is NULL.
  • CloseToken is NULL.
  • CloseToken->CompletionToken.Event is NULL.
EFI_OUT_OF_RESOURCESCould not allocate enough resource to finish the operation.
EFI_DEVICE_ERRORAny unexpected error not belonging to error categories given above.

Definition at line 983 of file TcpMain.c.

EFI_STATUS EFIAPI Tcp6Configure ( IN EFI_TCP6_PROTOCOL This,
IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData  OPTIONAL 
)

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]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]Tcp6ConfigDataPointer to the configure data to configure the instance. If Tcp6ConfigData is set to NULL, the instance is reset.
Return values:
EFI_SUCCESSThe operational settings were set, changed, or reset successfully.
EFI_NO_MAPPINGThe underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use.
EFI_INVALID_PARAMETEROne 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_DENIEDConfiguring TCP instance when it is configured without calling Configure() with NULL to reset it.
EFI_UNSUPPORTEDOne or more of the control options are not supported in the implementation.
EFI_OUT_OF_RESOURCESCould not allocate enough system resources when executing Configure().
EFI_DEVICE_ERRORAn unexpected network or system error occurred.

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 initiate a three-way handshake. For a passive TCP instance, its state transits 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. The 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]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]Tcp6ConfigDataPointer to the configure data to configure the instance. If Tcp6ConfigData is set to NULL, the instance is reset.
Return values:
EFI_SUCCESSThe operational settings were set, changed, or reset successfully.
EFI_NO_MAPPINGThe underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use.
EFI_INVALID_PARAMETEROne 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_DENIEDConfiguring a TCP instance when it is configured without calling Configure() with NULL to reset it.
EFI_UNSUPPORTEDOne or more of the control options are not supported in the implementation.
EFI_OUT_OF_RESOURCESCould not allocate enough system resources when executing Configure().
EFI_DEVICE_ERRORAn unexpected network or system error occurred.

Definition at line 646 of file TcpMain.c.

EFI_STATUS EFIAPI Tcp6Connect ( IN EFI_TCP6_PROTOCOL This,
IN EFI_TCP6_CONNECTION_TOKEN ConnectionToken 
)

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 an 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]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]ConnectionTokenPointer to the connection token to return when the TCP three-way handshake finishes.
Return values:
EFI_SUCCESSThe connection request successfully initiated and the state of this TCP instance has been changed to Tcp6StateSynSent.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_ACCESS_DENIEDOne or more of the following conditions are TRUE:

  • This instance is not configured as an active instance.
  • This instance is not in Tcp6StateClosed state.
EFI_INVALID_PARAMETEROne or more of the following are TRUE:

  • This is NULL.
  • ConnectionToken is NULL.
  • ConnectionToken->CompletionToken.Event is NULL.
EFI_OUT_OF_RESOURCESThe driver can't allocate enough resources to initiate the active open.
EFI_DEVICE_ERRORAn unexpected system or network 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 a 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 the Tcp6StateClosed state. The instance will transfer into Tcp6StateSynSent if the function returns EFI_SUCCESS. If a TCP three-way handshake succeeds, its state will become Tcp6StateEstablished. Otherwise, the state will return to Tcp6StateClosed.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]ConnectionTokenPointer to the connection token to return when the TCP three way handshake finishes.
Return values:
EFI_SUCCESSThe connection request successfully initiated and the state of this TCP instance has been changed to Tcp6StateSynSent.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_ACCESS_DENIEDOne 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_PARAMETEROne or more of the following are TRUE:

  • This is NULL.
  • ConnectionToken is NULL.
  • ConnectionToken->CompletionToken.Event is NULL.
EFI_OUT_OF_RESOURCESThe driver can't allocate enough resources to initiate the active open.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Definition at line 734 of file TcpMain.c.

EFI_STATUS EFIAPI Tcp6GetModeData ( IN EFI_TCP6_PROTOCOL This,
OUT EFI_TCP6_CONNECTION_STATE *Tcp6State  OPTIONAL,
OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData  OPTIONAL,
OUT EFI_IP6_MODE_DATA *Ip6ModeData  OPTIONAL,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData  OPTIONAL,
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData  OPTIONAL 
)

Get the current operational status.

The GetModeData() function copies the current operational settings of this EFI TCPv6 Protocol instance into user-supplied buffers. This function can also be used to retrieve the operational setting of underlying drivers such as IPv6, MNP, or SNP.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[out]Tcp6StateThe buffer in which the current TCP state is returned. Optional parameter that may be NULL.
[out]Tcp6ConfigDataThe buffer in which the current TCP configuration is returned. Optional parameter that may be NULL.
[out]Ip6ModeDataThe buffer in which the current IPv6 configuration data used by the TCP instance is returned. Optional parameter that may be NULL.
[out]MnpConfigDataThe buffer in which the current MNP configuration data used indirectly by the TCP instance is returned. Optional parameter that may be NULL.
[out]SnpModeDataThe buffer in which the current SNP mode data used indirectly by the TCP instance is returned. Optional parameter that may be NULL.
Return values:
EFI_SUCCESSThe mode data was read.
EFI_NOT_STARTEDNo configuration data is available because this instance hasn't been started.
EFI_INVALID_PARAMETERThis is NULL.

Get the current operational status.

The GetModeData() function copies the current operational settings of this EFI TCPv6 Protocol instance into user-supplied buffers. This function can also be used to retrieve the operational setting of underlying drivers such as IPv6, MNP, or SNP.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[out]Tcp6StateThe buffer in which the current TCP state is returned. Optional parameter that may be NULL.
[out]Tcp6ConfigDataThe buffer in which the current TCP configuration is returned. Optional parameter that may be NULL.
[out]Ip6ModeDataThe buffer in which the current IPv6 configuration data used by the TCP instance is returned. Optional parameter that may be NULL.
[out]MnpConfigDataThe buffer in which the current MNP configuration data indirectly used by the TCP instance is returned. Optional parameter that may be NULL.
[out]SnpModeDataThe buffer in which the current SNP mode data indirectly used by the TCP instance is returned. Optional parameter that may be NULL.
Return values:
EFI_SUCCESSThe mode data was read.
EFI_NOT_STARTEDNo configuration data is available because this instance hasn't been started.
EFI_INVALID_PARAMETERThis is NULL.

Definition at line 570 of file TcpMain.c.

EFI_STATUS EFIAPI Tcp6Poll ( IN EFI_TCP6_PROTOCOL This)

Poll to receive incoming data and transmit outgoing segments.

The Poll() function increases the rate that data is moved between the network and application and can be called when the TCP instance is created successfully. Its use is optional.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
Return values:
EFI_SUCCESSIncoming or outgoing data was processed.
EFI_INVALID_PARAMETERThis is NULL.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
EFI_NOT_READYNo incoming or outgoing data is processed.
EFI_TIMEOUTData was dropped out of the transmission or receive queue. Consider increasing the polling rate.

Poll to receive incoming data and transmit outgoing segments.

The Poll() function increases the rate that data is moved between the network and application, and can be called when the TCP instance is created successfully. Its use is optional.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
Return values:
EFI_SUCCESSIncoming or outgoing data was processed.
EFI_INVALID_PARAMETERThis is NULL.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
EFI_NOT_READYNo incoming or outgoing data is processed.
EFI_TIMEOUTData was dropped out of the transmission or receive queue. Consider increasing the polling rate.

Definition at line 1057 of file TcpMain.c.

EFI_STATUS EFIAPI Tcp6Receive ( IN EFI_TCP6_PROTOCOL This,
IN EFI_TCP6_IO_TOKEN Token 
)

Places an asynchronous receive request into the receiving queue.

The Receive() function places a completion token into the receive packet queue. This function is always asynchronous. The caller must allocate the Token->CompletionToken.Event and the FragmentBuffer used to receive data. The caller also must fill the DataLength, which represents the whole length of all FragmentBuffer. When the receive operation completes, the EFI TCPv6 Protocol driver updates the Token->CompletionToken.Status and Token->Packet.RxData fields, and the Token->CompletionToken.Event is signaled. If data is obtained, the data and its length will be copied into the FragmentTable. At the same time the full length of received data will be recorded in the DataLength fields. Providing a proper notification function and context for the event enables the user to receive the notification and receiving status. That notification function is guaranteed to not be re-entered.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]TokenPointer to a token that is associated with the receive data descriptor.
Return values:
EFI_SUCCESSThe receive completion token was cached.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_NO_MAPPINGThe underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:

  • This is NULL.
  • Token is NULL.
  • Token->CompletionToken.Event is NULL.
  • Token->Packet.RxData is NULL.
  • Token->Packet.RxData->DataLength is 0.
  • The Token->Packet.RxData->DataLength is not the sum of all FragmentBuffer length in FragmentTable.
EFI_OUT_OF_RESOURCESThe receive completion token could not be queued due to a lack of system resources (usually memory).
EFI_DEVICE_ERRORAn unexpected system or network error occurred. The EFI TCPv6 Protocol instance has been reset to startup defaults.
EFI_ACCESS_DENIEDOne or more of the following conditions is TRUE:

  • A receive completion token with the same Token->CompletionToken.Event was already in the receive queue.
  • The current instance is in Tcp6StateClosed state.
  • The current instance is a passive one and it is in Tcp6StateListen state.
  • The user has called Close() to disconnect this connection.
EFI_CONNECTION_FINThe communication peer has closed the connection, and there is no buffered data in the receive buffer of this instance.
EFI_NOT_READYThe receive request could not be queued because the receive queue is full.

Places an asynchronous receive request into the receiving queue.

The Receive() function places a completion token into the receive packet queue. This function is always asynchronous. The caller must allocate the Token->CompletionToken.Event and the FragmentBuffer used to receive data. The caller also must fill the DataLength that represents the whole length of all FragmentBuffer. When the receive operation completes, the EFI TCPv6 Protocol driver updates the Token->CompletionToken.Status and Token->Packet.RxData fields, and the Token->CompletionToken.Event is signaled. If data obtained, the data and its length will be copied into the FragmentTable; at the same time the full length of received data will be recorded in the DataLength fields. Providing a proper notification function and context for the event enables the user to receive the notification and receiving status. That notification function is guaranteed to not be re-entered.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]TokenPointer to a token that is associated with the receive data descriptor.
Return values:
EFI_SUCCESSThe receive completion token was cached.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_NO_MAPPINGThe underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:

  • This is NULL.
  • Token is NULL.
  • Token->CompletionToken.Event is NULL.
  • Token->Packet.RxData is NULL.
  • Token->Packet.RxData->DataLength is 0.
  • The Token->Packet.RxData->DataLength is not the sum of all FragmentBuffer length in FragmentTable.
EFI_OUT_OF_RESOURCESThe receive completion token could not be queued due to a lack of system resources (usually memory).
EFI_DEVICE_ERRORAn unexpected system or network error occurred. The EFI TCPv6 Protocol instance has been reset to startup defaults.
EFI_ACCESS_DENIEDOne or more of the following conditions is TRUE:

  • A receive completion token with the same Token->CompletionToken.Event was already in the receive queue.
  • The current instance is in Tcp6StateClosed state.
  • The current instance is a passive one and it is in Tcp6StateListen state.
  • User has called Close() to disconnect this connection.
EFI_CONNECTION_FINThe communication peer has closed the connection and there is no buffered data in the receive buffer of this instance.
EFI_NOT_READYThe receive request could not be queued because the receive queue is full.

Definition at line 922 of file TcpMain.c.

EFI_STATUS EFIAPI Tcp6Transmit ( IN EFI_TCP6_PROTOCOL This,
IN EFI_TCP6_IO_TOKEN Token 
)

Queues outgoing data into the transmit queue.

The Transmit() function queues a sending request to this TCP instance along with the user data. The status of the token is updated and the event in the token will be signaled once the data is sent out or some error occurs.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]TokenPointer to the completion token to queue to the transmit queue.
Return values:
EFI_SUCCESSThe data has been queued for transmission.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_NO_MAPPINGThe underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use.
EFI_INVALID_PARAMETEROne or more of the following are TRUE:

  • This is NULL.
  • Token is NULL.
  • Token->CompletionToken.Event is NULL.
  • Token->Packet.TxData is NULL.
  • Token->Packet.FragmentCount is zero.
  • Token->Packet.DataLength is not equal to the sum of fragment lengths.
EFI_ACCESS_DENIEDOne or more of the following conditions are TRUE:

  • A transmit completion token with the same Token-> CompletionToken.Event was already in the transmission queue.
  • The current instance is in Tcp6StateClosed state.
  • The current instance is a passive one and it is in Tcp6StateListen state.
  • User has called Close() to disconnect this connection.
EFI_NOT_READYThe completion token could not be queued because the transmit queue is full.
EFI_OUT_OF_RESOURCESCould not queue the transmit data because of a resource shortage.
EFI_NETWORK_UNREACHABLEThere is no route to the destination network or address.

Queues outgoing data into the transmit queue.

The Transmit() function queues a sending request to this TCP instance along with the user data. The status of the token is updated and the event in the token will be signaled once the data is sent out or an error occurs.

Parameters:
[in]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]TokenPointer to the completion token to queue to the transmit queue.
Return values:
EFI_SUCCESSThe data has been queued for transmission.
EFI_NOT_STARTEDThis EFI TCPv6 Protocol instance has not been configured.
EFI_NO_MAPPINGThe underlying IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use.
EFI_INVALID_PARAMETEROne or more of the following are TRUE:

  • This is NULL.
  • Token is NULL.
  • Token->CompletionToken.Event is NULL.
  • Token->Packet.TxData is NULL.
  • Token->Packet.FragmentCount is zero.
  • Token->Packet.DataLength is not equal to the sum of fragment lengths.
EFI_ACCESS_DENIEDOne or more of the following conditions are TRUE:

  • A transmit completion token with the same Token-> CompletionToken.Event was already in the transmission queue.
  • The current instance is in Tcp6StateClosed state.
  • The current instance is a passive one and it is in Tcp6StateListen state.
  • User has called Close() to disconnect this connection.
EFI_NOT_READYThe completion token could not be queued because the transmit queue is full.
EFI_OUT_OF_RESOURCESCould not queue the transmit data because of resource shortage.
EFI_NETWORK_UNREACHABLEThere is no route to the destination network or address.

Definition at line 842 of file TcpMain.c.


Variable Documentation

EFI Component Name Protocol

Definition at line 147 of file ComponentName.c.

EFI Component Name 2 Protocol

Definition at line 156 of file ComponentName.c.

Definition at line 18 of file Tcp4Driver.c.

Definition at line 19 of file TcpDriver.c.

Definition at line 30 of file Tcp4Misc.c.

Definition at line 25 of file Tcp4Misc.c.

Definition at line 20 of file Tcp4Misc.c.

Definition at line 32 of file Tcp4Misc.c.

Definition at line 17 of file Tcp4Timer.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines