iPXE
Tcp4.h
Go to the documentation of this file.
00001 /** @file
00002   EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition
00003   The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create
00004   and destroy child of the driver to communicate with other host using TCP protocol.
00005   The EFI TCPv4 Protocol provides services to send and receive data stream.
00006 
00007 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
00008 This program and the accompanying materials are licensed and made available under
00009 the terms and conditions of the BSD License that accompanies this distribution.
00010 The full text of the license may be found at
00011 http://opensource.org/licenses/bsd-license.php.
00012 
00013 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00014 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00015 
00016   @par Revision Reference:
00017   This Protocol is introduced in UEFI Specification 2.0.
00018 
00019 **/
00020 
00021 #ifndef __EFI_TCP4_PROTOCOL_H__
00022 #define __EFI_TCP4_PROTOCOL_H__
00023 
00024 FILE_LICENCE ( BSD3 );
00025 
00026 #include <ipxe/efi/Protocol/Ip4.h>
00027 
00028 #define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID \
00029   { \
00030     0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \
00031   }
00032 
00033 #define EFI_TCP4_PROTOCOL_GUID \
00034   { \
00035     0x65530BC7, 0xA359, 0x410f, {0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } \
00036   }
00037 
00038 typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL;
00039 
00040 ///
00041 /// EFI_TCP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more.
00042 /// The definition in here is only present to provide backwards compatability.
00043 ///
00044 typedef struct {
00045   EFI_HANDLE              InstanceHandle;
00046   EFI_IPv4_ADDRESS        LocalAddress;
00047   UINT16                  LocalPort;
00048   EFI_IPv4_ADDRESS        RemoteAddress;
00049   UINT16                  RemotePort;
00050 } EFI_TCP4_SERVICE_POINT;
00051 
00052 ///
00053 /// EFI_TCP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.
00054 /// The definition in here is only present to provide backwards compatability.
00055 ///
00056 typedef struct {
00057   EFI_HANDLE              DriverHandle;
00058   UINT32                  ServiceCount;
00059   EFI_TCP4_SERVICE_POINT  Services[1];
00060 } EFI_TCP4_VARIABLE_DATA;
00061 
00062 typedef struct {
00063   BOOLEAN                 UseDefaultAddress;
00064   EFI_IPv4_ADDRESS        StationAddress;
00065   EFI_IPv4_ADDRESS        SubnetMask;
00066   UINT16                  StationPort;
00067   EFI_IPv4_ADDRESS        RemoteAddress;
00068   UINT16                  RemotePort;
00069   BOOLEAN                 ActiveFlag;
00070 } EFI_TCP4_ACCESS_POINT;
00071 
00072 typedef struct {
00073   UINT32                  ReceiveBufferSize;
00074   UINT32                  SendBufferSize;
00075   UINT32                  MaxSynBackLog;
00076   UINT32                  ConnectionTimeout;
00077   UINT32                  DataRetries;
00078   UINT32                  FinTimeout;
00079   UINT32                  TimeWaitTimeout;
00080   UINT32                  KeepAliveProbes;
00081   UINT32                  KeepAliveTime;
00082   UINT32                  KeepAliveInterval;
00083   BOOLEAN                 EnableNagle;
00084   BOOLEAN                 EnableTimeStamp;
00085   BOOLEAN                 EnableWindowScaling;
00086   BOOLEAN                 EnableSelectiveAck;
00087   BOOLEAN                 EnablePathMtuDiscovery;
00088 } EFI_TCP4_OPTION;
00089 
00090 typedef struct {
00091   //
00092   // I/O parameters
00093   //
00094   UINT8                   TypeOfService;
00095   UINT8                   TimeToLive;
00096 
00097   //
00098   // Access Point
00099   //
00100   EFI_TCP4_ACCESS_POINT   AccessPoint;
00101 
00102   //
00103   // TCP Control Options
00104   //
00105   EFI_TCP4_OPTION         *ControlOption;
00106 } EFI_TCP4_CONFIG_DATA;
00107 
00108 ///
00109 /// TCP4 connnection state
00110 ///
00111 typedef enum {
00112   Tcp4StateClosed         = 0,
00113   Tcp4StateListen         = 1,
00114   Tcp4StateSynSent        = 2,
00115   Tcp4StateSynReceived    = 3,
00116   Tcp4StateEstablished    = 4,
00117   Tcp4StateFinWait1       = 5,
00118   Tcp4StateFinWait2       = 6,
00119   Tcp4StateClosing        = 7,
00120   Tcp4StateTimeWait       = 8,
00121   Tcp4StateCloseWait      = 9,
00122   Tcp4StateLastAck        = 10
00123 } EFI_TCP4_CONNECTION_STATE;
00124 
00125 typedef struct {
00126   EFI_EVENT   Event;
00127   EFI_STATUS  Status;
00128 } EFI_TCP4_COMPLETION_TOKEN;
00129 
00130 typedef struct {
00131   ///
00132   /// The Status in the CompletionToken will be set to one of
00133   /// the following values if the active open succeeds or an unexpected
00134   /// error happens:
00135   /// EFI_SUCCESS:              The active open succeeds and the instance's
00136   ///                           state is Tcp4StateEstablished.
00137   /// EFI_CONNECTION_RESET:     The connect fails because the connection is reset
00138   ///                           either by instance itself or the communication peer.
00139   /// EFI_CONNECTION_REFUSED:   The connect fails because this connection is initiated with
00140   ///                           an active open and the connection is refused.
00141   /// EFI_ABORTED:              The active open is aborted.
00142   /// EFI_TIMEOUT:              The connection establishment timer expires and
00143   ///                           no more specific information is available.
00144   /// EFI_NETWORK_UNREACHABLE:  The active open fails because
00145   ///                           an ICMP network unreachable error is received.
00146   /// EFI_HOST_UNREACHABLE:     The active open fails because an
00147   ///                           ICMP host unreachable error is received.
00148   /// EFI_PROTOCOL_UNREACHABLE: The active open fails
00149   ///                           because an ICMP protocol unreachable error is received.
00150   /// EFI_PORT_UNREACHABLE:     The connection establishment
00151   ///                           timer times out and an ICMP port unreachable error is received.
00152   /// EFI_ICMP_ERROR:           The connection establishment timer timeout and some other ICMP
00153   ///                           error is received.
00154   /// EFI_DEVICE_ERROR:         An unexpected system or network error occurred.
00155   /// EFI_NO_MEDIA:             There was a media error.
00156   ///
00157   EFI_TCP4_COMPLETION_TOKEN CompletionToken;
00158 } EFI_TCP4_CONNECTION_TOKEN;
00159 
00160 typedef struct {
00161   EFI_TCP4_COMPLETION_TOKEN CompletionToken;
00162   EFI_HANDLE                NewChildHandle;
00163 } EFI_TCP4_LISTEN_TOKEN;
00164 
00165 typedef struct {
00166   UINT32 FragmentLength;
00167   VOID   *FragmentBuffer;
00168 } EFI_TCP4_FRAGMENT_DATA;
00169 
00170 typedef struct {
00171   BOOLEAN                   UrgentFlag;
00172   UINT32                    DataLength;
00173   UINT32                    FragmentCount;
00174   EFI_TCP4_FRAGMENT_DATA    FragmentTable[1];
00175 } EFI_TCP4_RECEIVE_DATA;
00176 
00177 typedef struct {
00178   BOOLEAN                   Push;
00179   BOOLEAN                   Urgent;
00180   UINT32                    DataLength;
00181   UINT32                    FragmentCount;
00182   EFI_TCP4_FRAGMENT_DATA    FragmentTable[1];
00183 } EFI_TCP4_TRANSMIT_DATA;
00184 
00185 typedef struct {
00186   ///
00187   /// When transmission finishes or meets any unexpected error it will
00188   /// be set to one of the following values:
00189   /// EFI_SUCCESS:              The receiving or transmission operation
00190   ///                           completes successfully.
00191   /// EFI_CONNECTION_FIN:       The receiving operation fails because the communication peer
00192   ///                           has closed the connection and there is no more data in the
00193   ///                           receive buffer of the instance.
00194   /// EFI_CONNECTION_RESET:     The receiving or transmission operation fails
00195   ///                           because this connection is reset either by instance
00196   ///                           itself or the communication peer.
00197   /// EFI_ABORTED:              The receiving or transmission is aborted.
00198   /// EFI_TIMEOUT:              The transmission timer expires and no more
00199   ///                           specific information is available.
00200   /// EFI_NETWORK_UNREACHABLE:  The transmission fails
00201   ///                           because an ICMP network unreachable error is received.
00202   /// EFI_HOST_UNREACHABLE:     The transmission fails because an
00203   ///                           ICMP host unreachable error is received.
00204   /// EFI_PROTOCOL_UNREACHABLE: The transmission fails
00205   ///                           because an ICMP protocol unreachable error is received.
00206   /// EFI_PORT_UNREACHABLE:     The transmission fails and an
00207   ///                           ICMP port unreachable error is received.
00208   /// EFI_ICMP_ERROR:           The transmission fails and some other
00209   ///                           ICMP error is received.
00210   /// EFI_DEVICE_ERROR:         An unexpected system or network error occurs.
00211   /// EFI_NO_MEDIA:             There was a media error.
00212   ///
00213   EFI_TCP4_COMPLETION_TOKEN CompletionToken;
00214   union {
00215     ///
00216     /// When this token is used for receiving, RxData is a pointer to EFI_TCP4_RECEIVE_DATA.
00217     ///
00218     EFI_TCP4_RECEIVE_DATA   *RxData;
00219     ///
00220     /// When this token is used for transmitting, TxData is a pointer to EFI_TCP4_TRANSMIT_DATA.
00221     ///
00222     EFI_TCP4_TRANSMIT_DATA  *TxData;
00223   } Packet;
00224 } EFI_TCP4_IO_TOKEN;
00225 
00226 typedef struct {
00227   EFI_TCP4_COMPLETION_TOKEN CompletionToken;
00228   BOOLEAN                   AbortOnClose;
00229 } EFI_TCP4_CLOSE_TOKEN;
00230 
00231 //
00232 // Interface definition for TCP4 protocol
00233 //
00234 
00235 /**
00236   Get the current operational status.
00237 
00238   @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.
00239   @param  Tcp4State      The pointer to the buffer to receive the current TCP state.
00240   @param  Tcp4ConfigData The pointer to the buffer to receive the current TCP configuration.
00241   @param  Ip4ModeData    The pointer to the buffer to receive the current IPv4 configuration
00242                          data used by the TCPv4 instance.
00243   @param  MnpConfigData  The pointer to the buffer to receive the current MNP configuration
00244                          data used indirectly by the TCPv4 instance.
00245   @param  SnpModeData    The pointer to the buffer to receive the current SNP configuration
00246                          data used indirectly by the TCPv4 instance.
00247 
00248   @retval EFI_SUCCESS           The mode data was read.
00249   @retval EFI_INVALID_PARAMETER This is NULL.
00250   @retval EFI_NOT_STARTED       No configuration data is available because this instance hasn't
00251                                  been started.
00252 
00253 **/
00254 typedef
00255 EFI_STATUS
00256 (EFIAPI *EFI_TCP4_GET_MODE_DATA)(
00257   IN   EFI_TCP4_PROTOCOL                  *This,
00258   OUT  EFI_TCP4_CONNECTION_STATE          *Tcp4State      OPTIONAL,
00259   OUT  EFI_TCP4_CONFIG_DATA               *Tcp4ConfigData OPTIONAL,
00260   OUT  EFI_IP4_MODE_DATA                  *Ip4ModeData    OPTIONAL,
00261   OUT  EFI_MANAGED_NETWORK_CONFIG_DATA    *MnpConfigData  OPTIONAL,
00262   OUT  EFI_SIMPLE_NETWORK_MODE            *SnpModeData    OPTIONAL
00263   );
00264 
00265 /**
00266   Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.
00267 
00268   @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.
00269   @param  Tcp4ConfigData The pointer to the configure data to configure the instance.
00270 
00271   @retval EFI_SUCCESS           The operational settings are set, changed, or reset
00272                                 successfully.
00273   @retval EFI_INVALID_PARAMETER Some parameter is invalid.
00274   @retval EFI_NO_MAPPING        When using a default address, configuration (through
00275                                 DHCP, BOOTP, RARP, etc.) is not finished yet.
00276   @retval EFI_ACCESS_DENIED     Configuring TCP instance when it is configured without
00277                                 calling Configure() with NULL to reset it.
00278   @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.
00279   @retval EFI_UNSUPPORTED       One or more of the control options are not supported in
00280                                 the implementation.
00281   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough system resources when
00282                                 executing Configure().
00283 
00284 **/
00285 typedef
00286 EFI_STATUS
00287 (EFIAPI *EFI_TCP4_CONFIGURE)(
00288   IN EFI_TCP4_PROTOCOL                   *This,
00289   IN EFI_TCP4_CONFIG_DATA                *TcpConfigData OPTIONAL
00290   );
00291 
00292 
00293 /**
00294   Add or delete a route entry to the route table
00295 
00296   @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.
00297   @param  DeleteRoute    Set it to TRUE to delete this route from the routing table. Set it to
00298                          FALSE to add this route to the routing table.
00299                          DestinationAddress and SubnetMask are used as the
00300                          keywords to search route entry.
00301   @param  SubnetAddress  The destination network.
00302   @param  SubnetMask     The subnet mask of the destination network.
00303   @param  GatewayAddress The gateway address for this route. It must be on the same
00304                          subnet with the station address unless a direct route is specified.
00305 
00306   @retval EFI_SUCCESS           The operation completed successfully.
00307   @retval EFI_NOT_STARTED       The EFI TCPv4 Protocol instance has not been configured.
00308   @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,
00309                                 RARP, etc.) is not finished yet.
00310   @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
00311                                 - This is NULL.
00312                                 - SubnetAddress is NULL.
00313                                 - SubnetMask is NULL.
00314                                 - GatewayAddress is NULL.
00315                                 - *SubnetAddress is not NULL a valid subnet address.
00316                                 - *SubnetMask is not a valid subnet mask.
00317                                 - *GatewayAddress is not a valid unicast IP address or it
00318                                 is not in the same subnet.
00319   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resources to add the entry to the
00320                                 routing table.
00321   @retval EFI_NOT_FOUND         This route is not in the routing table.
00322   @retval EFI_ACCESS_DENIED     The route is already defined in the routing table.
00323   @retval EFI_UNSUPPORTED       The TCP driver does not support this operation.
00324 
00325 **/
00326 typedef
00327 EFI_STATUS
00328 (EFIAPI *EFI_TCP4_ROUTES)(
00329   IN EFI_TCP4_PROTOCOL                   *This,
00330   IN BOOLEAN                             DeleteRoute,
00331   IN EFI_IPv4_ADDRESS                    *SubnetAddress,
00332   IN EFI_IPv4_ADDRESS                    *SubnetMask,
00333   IN EFI_IPv4_ADDRESS                    *GatewayAddress
00334   );
00335 
00336 /**
00337   Initiate a nonblocking TCP connection request for an active TCP instance.
00338 
00339   @param  This                  The pointer to the EFI_TCP4_PROTOCOL instance.
00340   @param  ConnectionToken       The pointer to the connection token to return when the TCP three
00341                                 way handshake finishes.
00342 
00343   @retval EFI_SUCCESS           The connection request is successfully initiated and the state
00344                                 of this TCPv4 instance has been changed to Tcp4StateSynSent.
00345   @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.
00346   @retval EFI_ACCESS_DENIED     One or more of the following conditions are TRUE:
00347                                 - This instance is not configured as an active one.
00348                                 - This instance is not in Tcp4StateClosed state.
00349   @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
00350                                 - This is NULL.
00351                                 - ConnectionToken is NULL.
00352                                 - ConnectionToken->CompletionToken.Event is NULL.
00353   @retval EFI_OUT_OF_RESOURCES  The driver can't allocate enough resource to initiate the activ eopen.
00354   @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.
00355 
00356 **/
00357 typedef
00358 EFI_STATUS
00359 (EFIAPI *EFI_TCP4_CONNECT)(
00360   IN EFI_TCP4_PROTOCOL                   *This,
00361   IN EFI_TCP4_CONNECTION_TOKEN           *ConnectionToken
00362   );
00363 
00364 
00365 /**
00366   Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.
00367 
00368   @param  This        The pointer to the EFI_TCP4_PROTOCOL instance.
00369   @param  ListenToken The pointer to the listen token to return when operation finishes.
00370 
00371   @retval EFI_SUCCESS           The listen token has been queued successfully.
00372   @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.
00373   @retval EFI_ACCESS_DENIED     One or more of the following are TRUE:
00374                                 - This instance is not a passive instance.
00375                                 - This instance is not in Tcp4StateListen state.
00376                                 - The same listen token has already existed in the listen
00377                                 token queue of this TCP instance.
00378   @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
00379                                 - This is NULL.
00380                                 - ListenToken is NULL.
00381                                 - ListentToken->CompletionToken.Event is NULL.
00382   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resource to finish the operation.
00383   @retval EFI_DEVICE_ERROR      Any unexpected and not belonged to above category error.
00384 
00385 **/
00386 typedef
00387 EFI_STATUS
00388 (EFIAPI *EFI_TCP4_ACCEPT)(
00389   IN EFI_TCP4_PROTOCOL                   *This,
00390   IN EFI_TCP4_LISTEN_TOKEN               *ListenToken
00391   );
00392 
00393 /**
00394   Queues outgoing data into the transmit queue.
00395 
00396   @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.
00397   @param  Token The pointer to the completion token to queue to the transmit queue.
00398 
00399   @retval EFI_SUCCESS             The data has been queued for transmission.
00400   @retval EFI_NOT_STARTED         This EFI TCPv4 Protocol instance has not been configured.
00401   @retval EFI_NO_MAPPING          When using a default address, configuration (DHCP, BOOTP,
00402                                   RARP, etc.) is not finished yet.
00403   @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:
00404                                   - This is NULL.
00405                                   - Token is NULL.
00406                                   - Token->CompletionToken.Event is NULL.
00407                                   - Token->Packet.TxData is NULL L.
00408                                   - Token->Packet.FragmentCount is zero.
00409                                   - Token->Packet.DataLength is not equal to the sum of fragment lengths.
00410   @retval EFI_ACCESS_DENIED       One or more of the following conditions is TRUE:
00411                                   - A transmit completion token with the same Token->CompletionToken.Event
00412                                   was already in the transmission queue.
00413                                   - The current instance is in Tcp4StateClosed state.
00414                                   - The current instance is a passive one and it is in
00415                                   Tcp4StateListen state.
00416                                   - User has called Close() to disconnect this connection.
00417   @retval EFI_NOT_READY           The completion token could not be queued because the
00418                                   transmit queue is full.
00419   @retval EFI_OUT_OF_RESOURCES    Could not queue the transmit data because of resource
00420                                   shortage.
00421   @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.
00422 
00423 **/
00424 typedef
00425 EFI_STATUS
00426 (EFIAPI *EFI_TCP4_TRANSMIT)(
00427   IN EFI_TCP4_PROTOCOL                   *This,
00428   IN EFI_TCP4_IO_TOKEN                   *Token
00429   );
00430 
00431 
00432 /**
00433   Places an asynchronous receive request into the receiving queue.
00434 
00435   @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.
00436   @param  Token The pointer to a token that is associated with the receive data
00437                 descriptor.
00438 
00439   @retval EFI_SUCCESS           The receive completion token was cached.
00440   @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.
00441   @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP, RARP,
00442                                 etc.) is not finished yet.
00443   @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
00444                                 - This is NULL.
00445                                 - Token is NULL.
00446                                 - Token->CompletionToken.Event is NULL.
00447                                 - Token->Packet.RxData is NULL.
00448                                 - Token->Packet.RxData->DataLength is 0.
00449                                 - The Token->Packet.RxData->DataLength is not
00450                                 the sum of all FragmentBuffer length in FragmentTable.
00451   @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of
00452                                system resources (usually memory).
00453   @retval EFI_DEVICE_ERROR     An unexpected system or network error occurred.
00454   @retval EFI_ACCESS_DENIED    One or more of the following conditions is TRUE:
00455                                - A receive completion token with the same Token-
00456                                >CompletionToken.Event was already in the receive
00457                                queue.
00458                                - The current instance is in Tcp4StateClosed state.
00459                                - The current instance is a passive one and it is in
00460                                Tcp4StateListen state.
00461                                - User has called Close() to disconnect this connection.
00462   @retval EFI_CONNECTION_FIN   The communication peer has closed the connection and there is
00463                                no any buffered data in the receive buffer of this instance.
00464   @retval EFI_NOT_READY        The receive request could not be queued because the receive queue is full.
00465 
00466 **/
00467 typedef
00468 EFI_STATUS
00469 (EFIAPI *EFI_TCP4_RECEIVE)(
00470   IN EFI_TCP4_PROTOCOL                   *This,
00471   IN EFI_TCP4_IO_TOKEN                   *Token
00472   );
00473 
00474 /**
00475   Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a
00476   nonblocking operation.
00477 
00478   @param  This       The pointer to the EFI_TCP4_PROTOCOL instance.
00479   @param  CloseToken The pointer to the close token to return when operation finishes.
00480 
00481   @retval EFI_SUCCESS           The Close() is called successfully.
00482   @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.
00483   @retval EFI_ACCESS_DENIED     One or more of the following are TRUE:
00484                                 - Configure() has been called with
00485                                 TcpConfigData set to NULL and this function has
00486                                 not returned.
00487                                 - Previous Close() call on this instance has not
00488                                 finished.
00489   @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
00490                                 - This is NULL.
00491                                 - CloseToken is NULL.
00492                                 - CloseToken->CompletionToken.Event is NULL.
00493   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resource to finish the operation.
00494   @retval EFI_DEVICE_ERROR      Any unexpected and not belonged to above category error.
00495 
00496 **/
00497 typedef
00498 EFI_STATUS
00499 (EFIAPI *EFI_TCP4_CLOSE)(
00500   IN EFI_TCP4_PROTOCOL                   *This,
00501   IN EFI_TCP4_CLOSE_TOKEN                *CloseToken
00502   );
00503 
00504 /**
00505   Abort an asynchronous connection, listen, transmission or receive request.
00506 
00507   @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.
00508   @param  Token The pointer to a token that has been issued by
00509                 EFI_TCP4_PROTOCOL.Connect(),
00510                 EFI_TCP4_PROTOCOL.Accept(),
00511                 EFI_TCP4_PROTOCOL.Transmit() or
00512                 EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending
00513                 tokens issued by above four functions will be aborted. Type
00514                 EFI_TCP4_COMPLETION_TOKEN is defined in
00515                 EFI_TCP4_PROTOCOL.Connect().
00516 
00517   @retval  EFI_SUCCESS             The asynchronous I/O request is aborted and Token->Event
00518                                    is signaled.
00519   @retval  EFI_INVALID_PARAMETER   This is NULL.
00520   @retval  EFI_NOT_STARTED         This instance hasn't been configured.
00521   @retval  EFI_NO_MAPPING          When using the default address, configuration
00522                                    (DHCP, BOOTP,RARP, etc.) hasn't finished yet.
00523   @retval  EFI_NOT_FOUND           The asynchronous I/O request isn't found in the
00524                                    transmission or receive queue. It has either
00525                                    completed or wasn't issued by Transmit() and Receive().
00526   @retval  EFI_UNSUPPORTED         The implementation does not support this function.
00527 
00528 **/
00529 typedef
00530 EFI_STATUS
00531 (EFIAPI *EFI_TCP4_CANCEL)(
00532   IN EFI_TCP4_PROTOCOL                   *This,
00533   IN EFI_TCP4_COMPLETION_TOKEN           *Token OPTIONAL
00534   );
00535 
00536 
00537 /**
00538   Poll to receive incoming data and transmit outgoing segments.
00539 
00540   @param  This The pointer to the EFI_TCP4_PROTOCOL instance.
00541 
00542   @retval  EFI_SUCCESS           Incoming or outgoing data was processed.
00543   @retval  EFI_INVALID_PARAMETER This is NULL.
00544   @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.
00545   @retval  EFI_NOT_READY         No incoming or outgoing data is processed.
00546   @retval  EFI_TIMEOUT           Data was dropped out of the transmission or receive queue.
00547                                  Consider increasing the polling rate.
00548 
00549 **/
00550 typedef
00551 EFI_STATUS
00552 (EFIAPI *EFI_TCP4_POLL)(
00553   IN EFI_TCP4_PROTOCOL                   *This
00554   );
00555 
00556 ///
00557 /// The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by
00558 /// any network drivers or applications to send or receive data stream.
00559 /// It can either listen on a specified port as a service or actively connected
00560 /// to remote peer as a client. Each instance has its own independent settings,
00561 /// such as the routing table.
00562 ///
00563 struct _EFI_TCP4_PROTOCOL {
00564   EFI_TCP4_GET_MODE_DATA                 GetModeData;
00565   EFI_TCP4_CONFIGURE                     Configure;
00566   EFI_TCP4_ROUTES                        Routes;
00567   EFI_TCP4_CONNECT                       Connect;
00568   EFI_TCP4_ACCEPT                        Accept;
00569   EFI_TCP4_TRANSMIT                      Transmit;
00570   EFI_TCP4_RECEIVE                       Receive;
00571   EFI_TCP4_CLOSE                         Close;
00572   EFI_TCP4_CANCEL                        Cancel;
00573   EFI_TCP4_POLL                          Poll;
00574 };
00575 
00576 extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid;
00577 extern EFI_GUID gEfiTcp4ProtocolGuid;
00578 
00579 #endif