MdeModulePkg/Include/Library/TcpIoLib.h File Reference
|
Data Structures |
struct | TCP4_IO_CONFIG_DATA |
struct | TCP6_IO_CONFIG_DATA |
union | TCP_IO_CONFIG_DATA |
union | TCP_IO_PROTOCOL |
union | TCP_IO_CONNECTION_TOKEN |
union | TCP_IO_IO_TOKEN |
union | TCP_IO_CLOSE_TOKEN |
union | TCP_IO_LISTEN_TOKEN |
struct | TCP_IO |
Defines |
#define | TCP_VERSION_4 IP_VERSION_4 |
#define | TCP_VERSION_6 IP_VERSION_6 |
#define | TCP_GET_MAPPING_TIMEOUT 100000000U |
Functions |
EFI_STATUS EFIAPI | TcpIoCreateSocket (IN EFI_HANDLE Image, IN EFI_HANDLE Controller, IN UINT8 TcpVersion, IN TCP_IO_CONFIG_DATA *ConfigData, OUT TCP_IO *TcpIo) |
VOID EFIAPI | TcpIoDestroySocket (IN TCP_IO *TcpIo) |
EFI_STATUS EFIAPI | TcpIoConnect (IN OUT TCP_IO *TcpIo, IN EFI_EVENT Timeout) |
EFI_STATUS EFIAPI | TcpIoAccept (IN OUT TCP_IO *TcpIo, IN EFI_EVENT Timeout) |
VOID EFIAPI | TcpIoReset (IN OUT TCP_IO *TcpIo) |
EFI_STATUS EFIAPI | TcpIoTransmit (IN TCP_IO *TcpIo, IN NET_BUF *Packet) |
EFI_STATUS EFIAPI | TcpIoReceive (IN OUT TCP_IO *TcpIo, IN NET_BUF *Packet, IN BOOLEAN AsyncMode, IN EFI_EVENT Timeout) |
Detailed Description
This library is used to share code between UEFI network stack modules. It provides the helper routines to access TCP service.
Copyright (c) 2010 - 2011, 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.
Define Documentation
#define TCP_GET_MAPPING_TIMEOUT 100000000U |
#define TCP_VERSION_4 IP_VERSION_4 |
#define TCP_VERSION_6 IP_VERSION_6 |
Function Documentation
EFI_STATUS EFIAPI TcpIoAccept |
( |
IN OUT TCP_IO * |
TcpIo, |
|
|
IN EFI_EVENT |
Timeout | |
|
) |
| | |
Accept the incomding request from the other endpoint of the TCP socket.
- Parameters:
-
[in,out] | TcpIo | The TcpIo wrapping the TCP socket. |
[in] | Timeout | The time to wait for connection done. |
- Return values:
-
| EFI_SUCCESS | Connect to the other endpoint of the TCP socket successfully. |
| EFI_INVALID_PARAMETER | One or more parameters are invalid. |
| EFI_UNSUPPORTED | One or more of the control options are not supported in the implementation. |
| EFI_TIMEOUT | Failed to connect to the other endpoint of the TCP socket in the specified time period. |
| Others | Other errors as indicated. |
EFI_STATUS EFIAPI TcpIoConnect |
( |
IN OUT TCP_IO * |
TcpIo, |
|
|
IN EFI_EVENT |
Timeout | |
|
) |
| | |
Connect to the other endpoint of the TCP socket.
- Parameters:
-
[in,out] | TcpIo | The TcpIo wrapping the TCP socket. |
[in] | Timeout | The time to wait for connection done. |
- Return values:
-
| EFI_SUCCESS | Connect to the other endpoint of the TCP socket successfully. |
| EFI_TIMEOUT | Failed to connect to the other endpoint of the TCP socket in the specified time period. |
| EFI_INVALID_PARAMETER | One or more parameters are invalid. |
| EFI_UNSUPPORTED | One or more of the control options are not supported in the implementation. |
| Others | Other errors as indicated. |
EFI_STATUS EFIAPI TcpIoCreateSocket |
( |
IN EFI_HANDLE |
Image, |
|
|
IN EFI_HANDLE |
Controller, |
|
|
IN UINT8 |
TcpVersion, |
|
|
IN TCP_IO_CONFIG_DATA * |
ConfigData, |
|
|
OUT TCP_IO * |
TcpIo | |
|
) |
| | |
Create a TCP socket with the specified configuration data.
- Parameters:
-
[in] | Image | The handle of the driver image. |
[in] | Controller | The handle of the controller. |
[in] | TcpVersion | The version of Tcp, TCP_VERSION_4 or TCP_VERSION_6. |
[in] | ConfigData | The Tcp configuration data. |
[out] | TcpIo | The TcpIo. |
- Return values:
-
| EFI_SUCCESS | The TCP socket is created and configured. |
| EFI_INVALID_PARAMETER | One or more parameters are invalid. |
| EFI_UNSUPPORTED | One or more of the control options are not supported in the implementation. |
| EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
| Others | Failed to create the TCP socket or configure it. |
VOID EFIAPI TcpIoDestroySocket |
( |
IN TCP_IO * |
TcpIo |
) |
|
Destroy the socket.
- Parameters:
-
[in] | TcpIo | The TcpIo which wraps the socket to be destroyed. |
EFI_STATUS EFIAPI TcpIoReceive |
( |
IN OUT TCP_IO * |
TcpIo, |
|
|
IN NET_BUF * |
Packet, |
|
|
IN BOOLEAN |
AsyncMode, |
|
|
IN EFI_EVENT |
Timeout | |
|
) |
| | |
Receive data from the socket.
- Parameters:
-
[in,out] | TcpIo | The TcpIo which wraps the socket to be destroyed. |
[in] | Packet | The buffer to hold the data copy from the socket rx buffer. |
[in] | AsyncMode | Is this receive asyncronous or not. |
[in] | Timeout | The time to wait for receiving the amount of data the Packet can hold. |
- Return values:
-
| EFI_SUCCESS | The required amount of data is received from the socket. |
| EFI_INVALID_PARAMETER | One or more parameters are invalid. |
| EFI_DEVICE_ERROR | An unexpected network or system error occurred. |
| EFI_OUT_OF_RESOURCES | Failed to allocate momery. |
| EFI_TIMEOUT | Failed to receive the required amount of data in the specified time period. |
| Others | Other errors as indicated. |
VOID EFIAPI TcpIoReset |
( |
IN OUT TCP_IO * |
TcpIo |
) |
|
Reset the socket.
- Parameters:
-
[in,out] | TcpIo | The TcpIo wrapping the TCP socket. |
EFI_STATUS EFIAPI TcpIoTransmit |
( |
IN TCP_IO * |
TcpIo, |
|
|
IN NET_BUF * |
Packet | |
|
) |
| | |
Transmit the Packet to the other endpoint of the socket.
- Parameters:
-
[in] | TcpIo | The TcpIo wrapping the TCP socket. |
[in] | Packet | The packet to transmit. |
- Return values:
-
| EFI_SUCCESS | The packet is trasmitted. |
| EFI_INVALID_PARAMETER | One or more parameters are invalid. |
| EFI_UNSUPPORTED | One or more of the control options are not supported in the implementation. |
| EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
| EFI_DEVICE_ERROR | An unexpected network or system error occurred. |
| Others | Other errors as indicated. |