]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/TcpIoLib.h
MdeModulePkg: Add match2 opcode support in SetupBrowserDxe and sample code in DriverS...
[mirror_edk2.git] / MdeModulePkg / Include / Library / TcpIoLib.h
index 050f14b28f918c7302744bc19237df726542c5a8..2871f6747ea0b775c094cfa6d1576a6b758d5bea 100644 (file)
@@ -2,7 +2,7 @@
   This library is used to share code between UEFI network stack modules.\r
   It provides the helper routines to access TCP service.\r
 \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
 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<BR>\r
@@ -11,23 +11,23 @@ http://opensource.org/licenses/bsd-license.php
 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
-**/
-
-#ifndef _TCP_IO_H_
+**/\r
+\r
+#ifndef _TCP_IO_H_\r
 #define _TCP_IO_H_\r
 \r
 \r
 #include <Protocol/Tcp4.h>\r
 #include <Protocol/Tcp6.h>\r
 \r
-#include <Library/NetLib.h>
+#include <Library/NetLib.h>\r
 \r
 #define TCP_VERSION_4 IP_VERSION_4\r
 #define TCP_VERSION_6 IP_VERSION_6\r
 \r
-///
-/// 10 seconds
-///
+///\r
+/// 10 seconds\r
+///\r
 #define TCP_GET_MAPPING_TIMEOUT 100000000U\r
 \r
 \r
@@ -40,12 +40,12 @@ typedef struct {
   EFI_IPv4_ADDRESS          RemoteIp;\r
   UINT16                    RemotePort;\r
   BOOLEAN                   ActiveFlag;\r
-} TCP4_IO_CONFIG_DATA;
+} TCP4_IO_CONFIG_DATA;\r
 \r
-typedef struct {
+typedef struct {\r
   UINT16                    StationPort;\r
   EFI_IPv6_ADDRESS          RemoteIp;\r
-  UINT16                    RemotePort;
+  UINT16                    RemotePort;\r
   BOOLEAN                   ActiveFlag;\r
 } TCP6_IO_CONFIG_DATA;\r
 \r
@@ -112,33 +112,34 @@ typedef struct {
   \r
   @retval EFI_SUCCESS            The TCP socket is created and configured.\r
   @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
-  @retval EFI_UNSUPPORTED        One or more of the control options are not
+  @retval EFI_UNSUPPORTED        One or more of the control options are not\r
                                  supported in the implementation.\r
+  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
   @retval Others                 Failed to create the TCP socket or configure it.\r
 \r
 **/\r
-EFI_STATUS
+EFI_STATUS\r
 EFIAPI\r
-TcpIoCreateSocket (
-  IN EFI_HANDLE             Image,
+TcpIoCreateSocket (\r
+  IN EFI_HANDLE             Image,\r
   IN EFI_HANDLE             Controller,\r
-  IN UINT8                  TcpVersion,
-  IN TCP_IO_CONFIG_DATA     *ConfigData,
-  OUT TCP_IO                *TcpIo
-  );
-
-/**
-  Destroy the socket. 
-
-  @param[in]  TcpIo The TcpIo which wraps the socket to be destroyed.
-
-**/
-VOID
+  IN UINT8                  TcpVersion,\r
+  IN TCP_IO_CONFIG_DATA     *ConfigData,\r
+  OUT TCP_IO                *TcpIo\r
+  );\r
+\r
+/**\r
+  Destroy the socket. \r
+\r
+  @param[in]  TcpIo The TcpIo which wraps the socket to be destroyed.\r
+\r
+**/\r
+VOID\r
 EFIAPI\r
-TcpIoDestroySocket (
-  IN TCP_IO                 *TcpIo
-  );
-
+TcpIoDestroySocket (\r
+  IN TCP_IO                 *TcpIo\r
+  );\r
+\r
 /**\r
   Connect to the other endpoint of the TCP socket.\r
 \r
@@ -155,12 +156,12 @@ TcpIoDestroySocket (
   @retval Others                 Other errors as indicated.\r
 \r
 **/\r
-EFI_STATUS
+EFI_STATUS\r
 EFIAPI\r
-TcpIoConnect (
-  IN OUT TCP_IO             *TcpIo,
-  IN     EFI_EVENT          Timeout
-  );
+TcpIoConnect (\r
+  IN OUT TCP_IO             *TcpIo,\r
+  IN     EFI_EVENT          Timeout\r
+  );\r
 \r
 /**\r
   Accept the incomding request from the other endpoint of the TCP socket.\r
@@ -186,19 +187,19 @@ TcpIoAccept (
   IN OUT TCP_IO             *TcpIo,\r
   IN     EFI_EVENT          Timeout\r
   );\r
-  
-/**
-  Reset the socket.
-
-  @param[in, out]  TcpIo The TcpIo wrapping the TCP socket.
-
-**/
-VOID
+  \r
+/**\r
+  Reset the socket.\r
+\r
+  @param[in, out]  TcpIo The TcpIo wrapping the TCP socket.\r
+\r
+**/\r
+VOID\r
 EFIAPI\r
-TcpIoReset (
-  IN OUT TCP_IO             *TcpIo
-  );
-
+TcpIoReset (\r
+  IN OUT TCP_IO             *TcpIo\r
+  );\r
+\r
 /**\r
   Transmit the Packet to the other endpoint of the socket.\r
 \r
@@ -214,13 +215,13 @@ TcpIoReset (
   @retval Others                 Other errors as indicated.\r
 \r
 **/\r
-EFI_STATUS
+EFI_STATUS\r
 EFIAPI\r
-TcpIoTransmit (
-  IN TCP_IO                 *TcpIo,
-  IN NET_BUF                *Packet
-  );
-
+TcpIoTransmit (\r
+  IN TCP_IO                 *TcpIo,\r
+  IN NET_BUF                *Packet\r
+  );\r
+\r
 /**\r
   Receive data from the socket.\r
 \r
@@ -239,14 +240,14 @@ TcpIoTransmit (
   @retval Others                 Other errors as indicated.\r
 \r
 **/\r
-EFI_STATUS
+EFI_STATUS\r
 EFIAPI\r
-TcpIoReceive (
-  IN OUT TCP_IO             *TcpIo,
-  IN     NET_BUF            *Packet,
-  IN     BOOLEAN            AsyncMode,
-  IN     EFI_EVENT          Timeout
-  );
+TcpIoReceive (\r
+  IN OUT TCP_IO             *TcpIo,\r
+  IN     NET_BUF            *Packet,\r
+  IN     BOOLEAN            AsyncMode,\r
+  IN     EFI_EVENT          Timeout\r
+  );\r
 \r
 #endif\r
 \r