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
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
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
\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
@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
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
@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
@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