]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/Tcp4.h
MdePkg FirmwareManagement.h: Fix typo EFI_SECURITY_VIOLATIO
[mirror_edk2.git] / MdePkg / Include / Protocol / Tcp4.h
index 2d7f788c649c4711749c7edfa06ffe6925ca38e8..e27581b1d87d622c25472f51b6c2699a15cc42db 100644 (file)
@@ -4,14 +4,17 @@
   and destroy child of the driver to communicate with other host using TCP protocol.\r
   The EFI TCPv4 Protocol provides services to send and receive data stream.\r
 \r
-  Copyright (c) 2006 - 2009, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.                                          \r
+    \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  @par Revision Reference:\r
+  This Protocol is introduced in UEFI Specification 2.0.\r
 \r
 **/\r
 \r
 \r
 typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL;\r
 \r
+///\r
+/// EFI_TCP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more.\r
+/// The definition in here is only present to provide backwards compatability.\r
+///\r
 typedef struct {\r
   EFI_HANDLE              InstanceHandle;\r
   EFI_IPv4_ADDRESS        LocalAddress;\r
@@ -40,6 +47,10 @@ typedef struct {
   UINT16                  RemotePort;\r
 } EFI_TCP4_SERVICE_POINT;\r
 \r
+///\r
+/// EFI_TCP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.\r
+/// The definition in here is only present to provide backwards compatability.\r
+///\r
 typedef struct {\r
   EFI_HANDLE              DriverHandle;\r
   UINT32                  ServiceCount;\r
@@ -115,6 +126,32 @@ typedef struct {
 } EFI_TCP4_COMPLETION_TOKEN;\r
 \r
 typedef struct {\r
+  ///\r
+  /// The Status in the CompletionToken will be set to one of\r
+  /// the following values if the active open succeeds or an unexpected\r
+  /// error happens:\r
+  /// EFI_SUCCESS:              The active open succeeds and the instance's\r
+  ///                           state is Tcp4StateEstablished.\r
+  /// EFI_CONNECTION_RESET:     The connect fails because the connection is reset\r
+  ///                           either by instance itself or the communication peer.\r
+  /// EFI_CONNECTION_REFUSED:   The connect fails because this connection is initiated with\r
+  ///                           an active open and the connection is refused.\r
+  /// EFI_ABORTED:              The active open is aborted.\r
+  /// EFI_TIMEOUT:              The connection establishment timer expires and\r
+  ///                           no more specific information is available.\r
+  /// EFI_NETWORK_UNREACHABLE:  The active open fails because\r
+  ///                           an ICMP network unreachable error is received.\r
+  /// EFI_HOST_UNREACHABLE:     The active open fails because an\r
+  ///                           ICMP host unreachable error is received.\r
+  /// EFI_PROTOCOL_UNREACHABLE: The active open fails\r
+  ///                           because an ICMP protocol unreachable error is received.\r
+  /// EFI_PORT_UNREACHABLE:     The connection establishment\r
+  ///                           timer times out and an ICMP port unreachable error is received.\r
+  /// EFI_ICMP_ERROR:           The connection establishment timer timeout and some other ICMP\r
+  ///                           error is received.\r
+  /// EFI_DEVICE_ERROR:         An unexpected system or network error occurred.\r
+  /// EFI_NO_MEDIA:             There was a media error.\r
+  ///\r
   EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r
 } EFI_TCP4_CONNECTION_TOKEN;\r
 \r
@@ -144,9 +181,42 @@ typedef struct {
 } EFI_TCP4_TRANSMIT_DATA;\r
 \r
 typedef struct {\r
+  ///\r
+  /// When transmission finishes or meets any unexpected error it will\r
+  /// be set to one of the following values:\r
+  /// EFI_SUCCESS:              The receiving or transmission operation\r
+  ///                           completes successfully.\r
+  /// EFI_CONNECTION_FIN:       The receiving operation fails because the communication peer\r
+  ///                           has closed the connection and there is no more data in the\r
+  ///                           receive buffer of the instance.\r
+  /// EFI_CONNECTION_RESET:     The receiving or transmission operation fails\r
+  ///                           because this connection is reset either by instance\r
+  ///                           itself or the communication peer.\r
+  /// EFI_ABORTED:              The receiving or transmission is aborted.\r
+  /// EFI_TIMEOUT:              The transmission timer expires and no more\r
+  ///                           specific information is available.\r
+  /// EFI_NETWORK_UNREACHABLE:  The transmission fails\r
+  ///                           because an ICMP network unreachable error is received.\r
+  /// EFI_HOST_UNREACHABLE:     The transmission fails because an\r
+  ///                           ICMP host unreachable error is received.\r
+  /// EFI_PROTOCOL_UNREACHABLE: The transmission fails\r
+  ///                           because an ICMP protocol unreachable error is received.\r
+  /// EFI_PORT_UNREACHABLE:     The transmission fails and an\r
+  ///                           ICMP port unreachable error is received.\r
+  /// EFI_ICMP_ERROR:           The transmission fails and some other\r
+  ///                           ICMP error is received.\r
+  /// EFI_DEVICE_ERROR:         An unexpected system or network error occurs.\r
+  /// EFI_NO_MEDIA:             There was a media error.\r
+  ///\r
   EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r
   union {\r
+    ///\r
+    /// When this token is used for receiving, RxData is a pointer to EFI_TCP4_RECEIVE_DATA.\r
+    ///\r
     EFI_TCP4_RECEIVE_DATA   *RxData;\r
+    ///\r
+    /// When this token is used for transmitting, TxData is a pointer to EFI_TCP4_TRANSMIT_DATA.\r
+    ///\r
     EFI_TCP4_TRANSMIT_DATA  *TxData;\r
   } Packet;\r
 } EFI_TCP4_IO_TOKEN;\r
@@ -163,14 +233,14 @@ typedef struct {
 /**\r
   Get the current operational status.\r
 \r
-  @param  This           Pointer to the EFI_TCP4_PROTOCOL instance.\r
-  @param  Tcp4State      Pointer to the buffer to receive the current TCP state.\r
-  @param  Tcp4ConfigData Pointer to the buffer to receive the current TCP configuration.\r
-  @param  Ip4ModeData    Pointer to the buffer to receive the current IPv4 configuration\r
+  @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Tcp4State      The pointer to the buffer to receive the current TCP state.\r
+  @param  Tcp4ConfigData The pointer to the buffer to receive the current TCP configuration.\r
+  @param  Ip4ModeData    The pointer to the buffer to receive the current IPv4 configuration\r
                          data used by the TCPv4 instance.\r
-  @param  MnpConfigData  Pointer to the buffer to receive the current MNP configuration\r
+  @param  MnpConfigData  The pointer to the buffer to receive the current MNP configuration\r
                          data used indirectly by the TCPv4 instance.\r
-  @param  SnpModeData    Pointer to the buffer to receive the current SNP configuration\r
+  @param  SnpModeData    The pointer to the buffer to receive the current SNP configuration\r
                          data used indirectly by the TCPv4 instance.\r
 \r
   @retval EFI_SUCCESS           The mode data was read.\r
@@ -182,19 +252,19 @@ typedef struct {
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_TCP4_GET_MODE_DATA)(\r
-  IN CONST  EFI_TCP4_PROTOCOL                  *This,\r
-  OUT       EFI_TCP4_CONNECTION_STATE          *Tcp4State      OPTIONAL,\r
-  OUT       EFI_TCP4_CONFIG_DATA               *Tcp4ConfigData OPTIONAL,\r
-  OUT       EFI_IP4_MODE_DATA                  *Ip4ModeData    OPTIONAL,\r
-  OUT       EFI_MANAGED_NETWORK_CONFIG_DATA    *MnpConfigData  OPTIONAL,\r
-  OUT       EFI_SIMPLE_NETWORK_MODE            *SnpModeData    OPTIONAL\r
+  IN   EFI_TCP4_PROTOCOL                  *This,\r
+  OUT  EFI_TCP4_CONNECTION_STATE          *Tcp4State      OPTIONAL,\r
+  OUT  EFI_TCP4_CONFIG_DATA               *Tcp4ConfigData OPTIONAL,\r
+  OUT  EFI_IP4_MODE_DATA                  *Ip4ModeData    OPTIONAL,\r
+  OUT  EFI_MANAGED_NETWORK_CONFIG_DATA    *MnpConfigData  OPTIONAL,\r
+  OUT  EFI_SIMPLE_NETWORK_MODE            *SnpModeData    OPTIONAL\r
   );\r
 \r
 /**\r
   Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.\r
 \r
-  @param  This           Pointer to the EFI_TCP4_PROTOCOL instance.\r
-  @param  Tcp4ConfigData Pointer to the configure data to configure the instance.\r
+  @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Tcp4ConfigData The pointer to the configure data to configure the instance.\r
 \r
   @retval EFI_SUCCESS           The operational settings are set, changed, or reset\r
                                 successfully.\r
@@ -221,7 +291,7 @@ EFI_STATUS
 /**\r
   Add or delete a route entry to the route table\r
 \r
-  @param  This           Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  This           The pointer to the EFI_TCP4_PROTOCOL instance.\r
   @param  DeleteRoute    Set it to TRUE to delete this route from the routing table. Set it to\r
                          FALSE to add this route to the routing table.\r
                          DestinationAddress and SubnetMask are used as the\r
@@ -264,8 +334,8 @@ EFI_STATUS
 /**\r
   Initiate a nonblocking TCP connection request for an active TCP instance.\r
 \r
-  @param  This                  Pointer to the EFI_TCP4_PROTOCOL instance.\r
-  @param  ConnectionToken       Pointer to the connection token to return when the TCP three\r
+  @param  This                  The pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  ConnectionToken       The pointer to the connection token to return when the TCP three\r
                                 way handshake finishes.\r
 \r
   @retval EFI_SUCCESS           The connection request is successfully initiated and the state\r
@@ -293,8 +363,8 @@ EFI_STATUS
 /**\r
   Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.\r
 \r
-  @param  This        Pointer to the EFI_TCP4_PROTOCOL instance.\r
-  @param  ListenToken Pointer to the listen token to return when operation finishes.\r
+  @param  This        The pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  ListenToken The pointer to the listen token to return when operation finishes.\r
 \r
   @retval EFI_SUCCESS           The listen token has been queued successfully.\r
   @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.\r
@@ -321,8 +391,8 @@ EFI_STATUS
 /**\r
   Queues outgoing data into the transmit queue.\r
 \r
-  @param  This  Pointer to the EFI_TCP4_PROTOCOL instance.\r
-  @param  Token Pointer to the completion token to queue to the transmit queue.\r
+  @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Token The pointer to the completion token to queue to the transmit queue.\r
 \r
   @retval EFI_SUCCESS             The data has been queued for transmission.\r
   @retval EFI_NOT_STARTED         This EFI TCPv4 Protocol instance has not been configured.\r
@@ -360,8 +430,8 @@ EFI_STATUS
 /**\r
   Places an asynchronous receive request into the receiving queue.\r
 \r
-  @param  This  Pointer to the EFI_TCP4_PROTOCOL instance.\r
-  @param  Token Pointer to a token that is associated with the receive data\r
+  @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Token The pointer to a token that is associated with the receive data\r
                 descriptor.\r
 \r
   @retval EFI_SUCCESS           The receive completion token was cached.\r
@@ -403,8 +473,8 @@ EFI_STATUS
   Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a\r
   nonblocking operation.\r
 \r
-  @param  This       Pointer to the EFI_TCP4_PROTOCOL instance.\r
-  @param  CloseToken Pointer to the close token to return when operation finishes.\r
+  @param  This       The pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  CloseToken The pointer to the close token to return when operation finishes.\r
 \r
   @retval EFI_SUCCESS           The Close() is called successfully.\r
   @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.\r
@@ -432,8 +502,8 @@ EFI_STATUS
 /**\r
   Abort an asynchronous connection, listen, transmission or receive request.\r
 \r
-  @param  This  Pointer to the EFI_TCP4_PROTOCOL instance.\r
-  @param  Token Pointer to a token that has been issued by\r
+  @param  This  The pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Token The pointer to a token that has been issued by\r
                 EFI_TCP4_PROTOCOL.Connect(),\r
                 EFI_TCP4_PROTOCOL.Accept(),\r
                 EFI_TCP4_PROTOCOL.Transmit() or\r
@@ -448,9 +518,10 @@ EFI_STATUS
   @retval  EFI_NOT_STARTED         This instance hasn't been configured.\r
   @retval  EFI_NO_MAPPING          When using the default address, configuration\r
                                    (DHCP, BOOTP,RARP, etc.) hasn't finished yet.\r
-  @retval  EFI_NOT_FOUND           The asynchronous I/O request isn't found in the \r
-                                   transmission or receive queue. It has either \r
+  @retval  EFI_NOT_FOUND           The asynchronous I/O request isn't found in the\r
+                                   transmission or receive queue. It has either\r
                                    completed or wasn't issued by Transmit() and Receive().\r
+  @retval  EFI_UNSUPPORTED         The implementation does not support this function.\r
 \r
 **/\r
 typedef\r
@@ -464,7 +535,7 @@ EFI_STATUS
 /**\r
   Poll to receive incoming data and transmit outgoing segments.\r
 \r
-  @param  This Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  This The pointer to the EFI_TCP4_PROTOCOL instance.\r
 \r
   @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
   @retval  EFI_INVALID_PARAMETER This is NULL.\r
@@ -481,10 +552,10 @@ EFI_STATUS
   );\r
 \r
 ///\r
-/// The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by \r
-/// any network drivers or applications to send or receive data stream. \r
-/// It can either listen on a specified port as a service or actively connected \r
-/// to remote peer as a client. Each instance has its own independent settings, \r
+/// The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by\r
+/// any network drivers or applications to send or receive data stream.\r
+/// It can either listen on a specified port as a service or actively connected\r
+/// to remote peer as a client. Each instance has its own independent settings,\r
 /// such as the routing table.\r
 ///\r
 struct _EFI_TCP4_PROTOCOL {\r