iPXE
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Tcp4.h File Reference

EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create and destroy child of the driver to communicate with other host using TCP protocol. More...

#include <ipxe/efi/Protocol/Ip4.h>

Go to the source code of this file.

Data Structures

struct  EFI_TCP4_SERVICE_POINT
 EFI_TCP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more. More...
 
struct  EFI_TCP4_VARIABLE_DATA
 EFI_TCP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more. More...
 
struct  EFI_TCP4_ACCESS_POINT
 
struct  EFI_TCP4_OPTION
 
struct  EFI_TCP4_CONFIG_DATA
 
struct  EFI_TCP4_COMPLETION_TOKEN
 
struct  EFI_TCP4_CONNECTION_TOKEN
 
struct  EFI_TCP4_LISTEN_TOKEN
 
struct  EFI_TCP4_FRAGMENT_DATA
 
struct  EFI_TCP4_RECEIVE_DATA
 
struct  EFI_TCP4_TRANSMIT_DATA
 
struct  EFI_TCP4_IO_TOKEN
 
struct  EFI_TCP4_CLOSE_TOKEN
 
struct  _EFI_TCP4_PROTOCOL
 The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by any network drivers or applications to send or receive data stream. More...
 

Macros

#define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID
 
#define EFI_TCP4_PROTOCOL_GUID
 

Typedefs

typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_GET_MODE_DATA) (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. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_CONFIGURE) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL)
 Initialize or brutally reset the operational parameters for this EFI TCPv4 instance. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_ROUTES) (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 a route entry to the route table. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_CONNECT) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken)
 Initiate a nonblocking TCP connection request for an active TCP instance. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_ACCEPT) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_LISTEN_TOKEN *ListenToken)
 Listen on the passive instance to accept an incoming connection request. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_TRANSMIT) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token)
 Queues outgoing data into the transmit queue. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_RECEIVE) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token)
 Places an asynchronous receive request into the receiving queue. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_CLOSE) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CLOSE_TOKEN *CloseToken)
 Disconnecting a TCP connection gracefully or reset a TCP connection. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_CANCEL) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL)
 Abort an asynchronous connection, listen, transmission or receive request. More...
 
typedef EFI_STATUS(EFIAPIEFI_TCP4_POLL) (IN EFI_TCP4_PROTOCOL *This)
 Poll to receive incoming data and transmit outgoing segments. More...
 

Enumerations

enum  EFI_TCP4_CONNECTION_STATE {
  Tcp4StateClosed = 0, Tcp4StateListen = 1, Tcp4StateSynSent = 2, Tcp4StateSynReceived = 3,
  Tcp4StateEstablished = 4, Tcp4StateFinWait1 = 5, Tcp4StateFinWait2 = 6, Tcp4StateClosing = 7,
  Tcp4StateTimeWait = 8, Tcp4StateCloseWait = 9, Tcp4StateLastAck = 10
}
 TCP4 connnection state. More...
 

Functions

 FILE_LICENCE (BSD2_PATENT)
 

Variables

EFI_GUID gEfiTcp4ServiceBindingProtocolGuid
 
EFI_GUID gEfiTcp4ProtocolGuid
 

Detailed Description

EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create and destroy child of the driver to communicate with other host using TCP protocol.

The EFI TCPv4 Protocol provides services to send and receive data stream.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
This Protocol is introduced in UEFI Specification 2.0.

Definition in file Tcp4.h.

Macro Definition Documentation

◆ EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID

#define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID
Value:
{ \
0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \
}

Definition at line 22 of file Tcp4.h.

◆ EFI_TCP4_PROTOCOL_GUID

#define EFI_TCP4_PROTOCOL_GUID
Value:
{ \
0x65530BC7, 0xA359, 0x410f, {0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } \
}

Definition at line 27 of file Tcp4.h.

Typedef Documentation

◆ EFI_TCP4_PROTOCOL

Definition at line 32 of file Tcp4.h.

◆ EFI_TCP4_GET_MODE_DATA

Get the current operational status.

Parameters
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
Tcp4StateThe pointer to the buffer to receive the current TCP state.
Tcp4ConfigDataThe pointer to the buffer to receive the current TCP configuration.
Ip4ModeDataThe pointer to the buffer to receive the current IPv4 configuration data used by the TCPv4 instance.
MnpConfigDataThe pointer to the buffer to receive the current MNP configuration data used indirectly by the TCPv4 instance.
SnpModeDataThe pointer to the buffer to receive the current SNP configuration data used indirectly by the TCPv4 instance.
Return values
EFI_SUCCESSThe mode data was read.
EFI_INVALID_PARAMETERThis is NULL.
EFI_NOT_STARTEDNo configuration data is available because this instance hasn't been started.

Definition at line 250 of file Tcp4.h.

◆ EFI_TCP4_CONFIGURE

typedef EFI_STATUS(EFIAPI * EFI_TCP4_CONFIGURE) (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
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
Tcp4ConfigDataThe pointer to the configure data to configure the instance.
Return values
EFI_SUCCESSThe operational settings are set, changed, or reset successfully.
EFI_INVALID_PARAMETERSome parameter is invalid.
EFI_NO_MAPPINGWhen using a default address, configuration (through DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_ACCESS_DENIEDConfiguring TCP instance when it is configured without calling Configure() with NULL to reset it.
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 when executing Configure().

Definition at line 281 of file Tcp4.h.

◆ EFI_TCP4_ROUTES

typedef EFI_STATUS(EFIAPI * EFI_TCP4_ROUTES) (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 a route entry to the route table.

Parameters
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
DeleteRouteSet it to TRUE to delete this route from the routing table. Set it to FALSE to add this route to the routing table. DestinationAddress and SubnetMask are used as the keywords to search route entry.
SubnetAddressThe destination network.
SubnetMaskThe subnet mask of 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 TCPv4 Protocol instance has not been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:
  • This is NULL.
  • SubnetAddress is NULL.
  • SubnetMask is NULL.
  • GatewayAddress is NULL.
  • *SubnetAddress is not NULL a valid subnet address.
  • *SubnetMask is not a valid subnet mask.
  • *GatewayAddress is not a valid unicast IP address or it is not in the same subnet.
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_DENIEDThe route is already defined in the routing table.
EFI_UNSUPPORTEDThe TCP driver does not support this operation.

Definition at line 321 of file Tcp4.h.

◆ EFI_TCP4_CONNECT

typedef EFI_STATUS(EFIAPI * EFI_TCP4_CONNECT) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken)

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

Parameters
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
ConnectionTokenThe pointer 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 TCPv4 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 Tcp4StateClosed 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 activ eopen.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Definition at line 352 of file Tcp4.h.

◆ EFI_TCP4_ACCEPT

typedef EFI_STATUS(EFIAPI * EFI_TCP4_ACCEPT) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_LISTEN_TOKEN *ListenToken)

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

This is a nonblocking operation.

Parameters
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
ListenTokenThe pointer to the listen token to return when operation finishes.
Return values
EFI_SUCCESSThe listen token has been queued successfully.
EFI_NOT_STARTEDThis EFI TCPv4 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 Tcp4StateListen 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.

Definition at line 380 of file Tcp4.h.

◆ EFI_TCP4_TRANSMIT

typedef EFI_STATUS(EFIAPI * EFI_TCP4_TRANSMIT) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token)

Queues outgoing data into the transmit queue.

Parameters
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
TokenThe pointer to the completion token to queue to the transmit queue.
Return values
EFI_SUCCESSThe data has been queued for transmission.
EFI_NOT_STARTEDThis EFI TCPv4 Protocol instance has not been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
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 L.
  • 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 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.

Definition at line 418 of file Tcp4.h.

◆ EFI_TCP4_RECEIVE

typedef EFI_STATUS(EFIAPI * EFI_TCP4_RECEIVE) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token)

Places an asynchronous receive request into the receiving queue.

Parameters
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
TokenThe pointer to a token that is associated with the receive data descriptor.
Return values
EFI_SUCCESSThe receive completion token was cached.
EFI_NOT_STARTEDThis EFI TCPv4 Protocol instance has not been configured.
EFI_NO_MAPPINGWhen using a default address, configuration (DHCP, BOOTP, RARP, etc.) is not finished yet.
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.
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 460 of file Tcp4.h.

◆ EFI_TCP4_CLOSE

typedef EFI_STATUS(EFIAPI * EFI_TCP4_CLOSE) (IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CLOSE_TOKEN *CloseToken)

Disconnecting a TCP connection gracefully or reset a TCP connection.

This function is a nonblocking operation.

Parameters
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
CloseTokenThe pointer to the close token to return when operation finishes.
Return values
EFI_SUCCESSThe Close() is called successfully.
EFI_NOT_STARTEDThis EFI TCPv4 Protocol instance has not 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 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.

Definition at line 490 of file Tcp4.h.

◆ EFI_TCP4_CANCEL

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

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

Parameters
ThisThe pointer to the EFI_TCP4_PROTOCOL instance.
TokenThe pointer to a token that has been issued by EFI_TCP4_PROTOCOL.Connect(), EFI_TCP4_PROTOCOL.Accept(), EFI_TCP4_PROTOCOL.Transmit() or EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending tokens issued by above four functions will be aborted. Type EFI_TCP4_COMPLETION_TOKEN is defined in EFI_TCP4_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_NO_MAPPINGWhen using the default address, configuration (DHCP, BOOTP,RARP, etc.) hasn't finished yet.
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.

Definition at line 522 of file Tcp4.h.

◆ EFI_TCP4_POLL

typedef EFI_STATUS(EFIAPI * EFI_TCP4_POLL) (IN EFI_TCP4_PROTOCOL *This)

Poll to receive incoming data and transmit outgoing segments.

Parameters
ThisThe pointer 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 is processed.
EFI_TIMEOUTData was dropped out of the transmission or receive queue. Consider increasing the polling rate.

Definition at line 542 of file Tcp4.h.

Enumeration Type Documentation

◆ EFI_TCP4_CONNECTION_STATE

TCP4 connnection state.

Enumerator
Tcp4StateClosed 
Tcp4StateListen 
Tcp4StateSynSent 
Tcp4StateSynReceived 
Tcp4StateEstablished 
Tcp4StateFinWait1 
Tcp4StateFinWait2 
Tcp4StateClosing 
Tcp4StateTimeWait 
Tcp4StateCloseWait 
Tcp4StateLastAck 

Definition at line 105 of file Tcp4.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( BSD2_PATENT  )

Variable Documentation

◆ gEfiTcp4ServiceBindingProtocolGuid

EFI_GUID gEfiTcp4ServiceBindingProtocolGuid

◆ gEfiTcp4ProtocolGuid

EFI_GUID gEfiTcp4ProtocolGuid