X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FInclude%2FProtocol%2FTcp4.h;h=d750fe9c788ba2ceb0c0dee81664373510613fe9;hp=11354b577ee9b3d904fb83637420af7d7fe7a285;hb=f754f721bf10508ca15c5c9243caa39c765662cf;hpb=511710d68f477e0210ae1830769e5d0cde4ea36a diff --git a/MdePkg/Include/Protocol/Tcp4.h b/MdePkg/Include/Protocol/Tcp4.h index 11354b577e..d750fe9c78 100644 --- a/MdePkg/Include/Protocol/Tcp4.h +++ b/MdePkg/Include/Protocol/Tcp4.h @@ -1,25 +1,25 @@ /** @file EFI TCPv4 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. + 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, 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 + Copyright (c) 2006 - 2008, 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. - - Module Name: Tcp4.h + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef __EFI_TCP4_PROTOCOL_H__ #define __EFI_TCP4_PROTOCOL_H__ +#include + #define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID \ { \ 0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \ @@ -33,6 +33,7 @@ typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL; typedef struct { + EFI_HANDLE InstanceHandle; EFI_IPv4_ADDRESS LocalAddress; UINT16 LocalPort; EFI_IPv4_ADDRESS RemoteAddress; @@ -41,7 +42,7 @@ typedef struct { typedef struct { EFI_HANDLE DriverHandle; - UINTN ServiceCount; + UINT32 ServiceCount; EFI_TCP4_SERVICE_POINT Services[1]; } EFI_TCP4_VARIABLE_DATA; @@ -56,16 +57,16 @@ typedef struct { } EFI_TCP4_ACCESS_POINT; typedef struct { - UINTN ReceiveBufferSize; - UINTN SendBufferSize; - UINTN MaxSynBackLog; - UINTN ConnectionTimeout; - UINTN DataRetries; - UINTN FinTimeout; - UINTN TimeWaitTimeout; - UINTN KeepAliveProbes; - UINTN KeepAliveTime; - UINTN KeepAliveInterval; + UINT32 ReceiveBufferSize; + UINT32 SendBufferSize; + UINT32 MaxSynBackLog; + UINT32 ConnectionTimeout; + UINT32 DataRetries; + UINT32 FinTimeout; + UINT32 TimeWaitTimeout; + UINT32 KeepAliveProbes; + UINT32 KeepAliveTime; + UINT32 KeepAliveInterval; BOOLEAN EnableNagle; BOOLEAN EnableTimeStamp; BOOLEAN EnableWindowScaling; @@ -84,13 +85,16 @@ typedef struct { // Access Point // EFI_TCP4_ACCESS_POINT AccessPoint; - - // - // TCP Control Options - // + + // + // TCP Control Options + // EFI_TCP4_OPTION *ControlOption; } EFI_TCP4_CONFIG_DATA; +/// +/// TCP4 connnection state +/// typedef enum { Tcp4StateClosed = 0, Tcp4StateListen = 1, @@ -120,22 +124,22 @@ typedef struct { } EFI_TCP4_LISTEN_TOKEN; typedef struct { - UINTN FragmentLength; - VOID *FragmentBuffer; + UINT32 FragmentLength; + VOID *FragmentBuffer; } EFI_TCP4_FRAGMENT_DATA; typedef struct { BOOLEAN UrgentFlag; - IN OUT UINTN DataLength; - UINTN FragmentCount; + UINT32 DataLength; + UINT32 FragmentCount; EFI_TCP4_FRAGMENT_DATA FragmentTable[1]; -} EFI_TCP4_RECEIVE_DATA; +} EFI_TCP4_RECEIVE_DATA; -typedef struct { +typedef struct { BOOLEAN Push; BOOLEAN Urgent; - UINTN DataLength; - UINTN FragmentCount; + UINT32 DataLength; + UINT32 FragmentCount; EFI_TCP4_FRAGMENT_DATA FragmentTable[1]; } EFI_TCP4_TRANSMIT_DATA; @@ -177,16 +181,15 @@ typedef struct { **/ typedef EFI_STATUS -(EFIAPI *EFI_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 - ) -; - +(EFIAPI *EFI_TCP4_GET_MODE_DATA)( + IN CONST 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 + ); + /** Initialize or brutally reset the operational parameters for this EFI TCPv4 instance. @@ -209,12 +212,11 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_CONFIGURE) ( +(EFIAPI *EFI_TCP4_CONFIGURE)( IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL - ) -; - + ); + /** Add or delete a route entry to the route table @@ -251,14 +253,13 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_ROUTES) ( +(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 - ) -; + ); /** Initiate a nonblocking TCP connection request for an active TCP instance. @@ -266,7 +267,7 @@ EFI_STATUS @param This Pointer to the EFI_TCP4_PROTOCOL instance. @param ConnectionToken Pointer to the connection token to return when the TCP three way handshake finishes. - + @retval EFI_SUCCESS The connection request is successfully initiated and the state - of this TCPv4 instance has been changed to - Tcp4StateSynSent. @@ -284,12 +285,11 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_CONNECT) ( +(EFIAPI *EFI_TCP4_CONNECT)( IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken - ) -; - + ); + /** Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation. @@ -314,11 +314,10 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_ACCEPT) ( +(EFIAPI *EFI_TCP4_ACCEPT)( IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_LISTEN_TOKEN *ListenToken - ) -; + ); /** Queues outgoing data into the transmit queue. @@ -353,11 +352,10 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_TRANSMIT) ( +(EFIAPI *EFI_TCP4_TRANSMIT)( IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token - ) -; + ); /** @@ -397,15 +395,14 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_RECEIVE) ( +(EFIAPI *EFI_TCP4_RECEIVE)( IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token - ) -; - + ); + /** Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a - nonblocking operation. + nonblocking operation. @param This Pointer to the EFI_TCP4_PROTOCOL instance. @param CloseToken Pointer to the close token to return when operation finishes. @@ -428,11 +425,10 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_CLOSE) ( +(EFIAPI *EFI_TCP4_CLOSE)( IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CLOSE_TOKEN *CloseToken - ) -; + ); /** Abort an asynchronous connection, listen, transmission or receive request. @@ -457,11 +453,10 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_CANCEL) ( +(EFIAPI *EFI_TCP4_CANCEL)( IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL - ) -; + ); /** @@ -479,11 +474,17 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_TCP4_POLL) ( +(EFIAPI *EFI_TCP4_POLL)( IN EFI_TCP4_PROTOCOL *This - ) -; - + ); + +/// +/// 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. +/// It can either listen on a specified port as a service or actively connected +/// to remote peer as a client. Each instance has its own independent settings, +/// such as the routing table. +/// struct _EFI_TCP4_PROTOCOL { EFI_TCP4_GET_MODE_DATA GetModeData; EFI_TCP4_CONFIGURE Configure;