MdePkg[all]  1.08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tcp6.h File Reference

Data Structures

struct  EFI_TCP6_SERVICE_POINT
 
struct  EFI_TCP6_VARIABLE_DATA
 
struct  EFI_TCP6_ACCESS_POINT
 
struct  EFI_TCP6_OPTION
 
struct  EFI_TCP6_CONFIG_DATA
 
struct  EFI_TCP6_COMPLETION_TOKEN
 
struct  EFI_TCP6_CONNECTION_TOKEN
 
struct  EFI_TCP6_LISTEN_TOKEN
 
struct  EFI_TCP6_FRAGMENT_DATA
 
struct  EFI_TCP6_RECEIVE_DATA
 
struct  EFI_TCP6_TRANSMIT_DATA
 
struct  EFI_TCP6_IO_TOKEN
 
struct  EFI_TCP6_CLOSE_TOKEN
 
struct  _EFI_TCP6_PROTOCOL
 

Macros

#define EFI_TCP6_SERVICE_BINDING_PROTOCOL_GUID
 
#define EFI_TCP6_PROTOCOL_GUID
 

Typedefs

typedef struct _EFI_TCP6_PROTOCOL EFI_TCP6_PROTOCOL
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_GET_MODE_DATA )(IN EFI_TCP6_PROTOCOL *This, OUT EFI_TCP6_CONNECTION_STATE *Tcp6State, OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData, OUT EFI_IP6_MODE_DATA *Ip6ModeData, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData)
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_CONFIGURE )(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData)
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_CONNECT )(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CONNECTION_TOKEN *ConnectionToken)
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_ACCEPT )(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_LISTEN_TOKEN *ListenToken)
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_TRANSMIT )(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_IO_TOKEN *Token)
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_RECEIVE )(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_IO_TOKEN *Token)
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_CLOSE )(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CLOSE_TOKEN *CloseToken)
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_CANCEL )(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_COMPLETION_TOKEN *Token)
 
typedef EFI_STATUS(EFIAPIEFI_TCP6_POLL )(IN EFI_TCP6_PROTOCOL *This)
 

Enumerations

enum  EFI_TCP6_CONNECTION_STATE {
  Tcp6StateClosed = 0, Tcp6StateListen = 1, Tcp6StateSynSent = 2, Tcp6StateSynReceived = 3,
  Tcp6StateEstablished = 4, Tcp6StateFinWait1 = 5, Tcp6StateFinWait2 = 6, Tcp6StateClosing = 7,
  Tcp6StateTimeWait = 8, Tcp6StateCloseWait = 9, Tcp6StateLastAck = 10
}
 

Variables

EFI_GUID gEfiTcp6ServiceBindingProtocolGuid
 
EFI_GUID gEfiTcp6ProtocolGuid
 

Detailed Description

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

Macro Definition Documentation

#define EFI_TCP6_PROTOCOL_GUID
Value:
{ \
0x46e44855, 0xbd60, 0x4ab7, {0xab, 0x0d, 0xa6, 0x79, 0xb9, 0x44, 0x7d, 0x77 } \
}
#define EFI_TCP6_SERVICE_BINDING_PROTOCOL_GUID
Value:
{ \
0xec20eb79, 0x6c1a, 0x4664, {0x9a, 0x0d, 0xd2, 0xe4, 0xcc, 0x16, 0xd6, 0x64 } \
}

Typedef Documentation

typedef EFI_STATUS(EFIAPI * EFI_TCP6_ACCEPT)(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 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 has 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 resource to finish the operation.
EFI_DEVICE_ERRORAny 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
[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_SUCCESSThe asynchronous I/O request is aborted and Token->Event is signaled.
EFI_INVALID_PARAMETERThis is NULL.
EFI_NOT_STARTEDThis instance hasn't been configured.
EFI_NOT_FOUNDThe 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_UNSUPPORTEDThe implementation does not support this function.
typedef EFI_STATUS(EFIAPI * EFI_TCP6_CLOSE)(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 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]ThisPointer to the EFI_TCP6_PROTOCOL instance.
[in]CloseTokenPointer to the close token to return when operation finishes.
Return values
EFI_SUCCESSThe Close() is 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 and not belonged to above category error.
typedef EFI_STATUS(EFIAPI * EFI_TCP6_CONFIGURE)(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData)

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 are 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.
typedef EFI_STATUS(EFIAPI * EFI_TCP6_CONNECT)(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 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]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 is 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 resource to initiate the active open.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.
typedef EFI_STATUS(EFIAPI * EFI_TCP6_GET_MODE_DATA)(IN EFI_TCP6_PROTOCOL *This, OUT EFI_TCP6_CONNECTION_STATE *Tcp6State, OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData, OUT EFI_IP6_MODE_DATA *Ip6ModeData, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData)

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.
[out]Tcp6ConfigDataThe buffer in which the current TCP configuration is returned.
[out]Ip6ModeDataThe buffer in which the current IPv6 configuration data used by the TCP instance is returned.
[out]MnpConfigDataThe buffer in which the current MNP configuration data used indirectly by the TCP instance is returned.
[out]SnpModeDataThe buffer in which the current SNP mode data used indirectly by the TCP instance is returned.
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.
typedef EFI_STATUS(EFIAPI * EFI_TCP6_POLL)(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.

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 got data 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 will enable 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 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.
typedef EFI_STATUS(EFIAPI * EFI_TCP6_TRANSMIT)(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 resource shortage.
EFI_NETWORK_UNREACHABLEThere is no route to the destination network or address.

Enumeration Type Documentation

EFI_TCP6_CONNECTION_STATE

Enumerator
Tcp6StateClosed 
Tcp6StateListen 
Tcp6StateSynSent 
Tcp6StateSynReceived 
Tcp6StateEstablished 
Tcp6StateFinWait1 
Tcp6StateFinWait2 
Tcp6StateClosing 
Tcp6StateTimeWait 
Tcp6StateCloseWait 
Tcp6StateLastAck 

Variable Documentation

EFI_GUID gEfiTcp6ProtocolGuid
EFI_GUID gEfiTcp6ServiceBindingProtocolGuid