+++ /dev/null
-/** @file\r
- iSCSI Tcp4 IO related definitions.\r
-\r
-Copyright (c) 2004 - 2018, 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\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
-**/\r
-\r
-#ifndef _ISCSI_TCP4_IO_H_\r
-#define _ISCSI_TCP4_IO_H_\r
-\r
-#include <Library/NetLib.h>\r
-#include <Protocol/Tcp4.h>\r
-\r
-typedef struct _TCP4_IO_CONFIG_DATA {\r
- EFI_IPv4_ADDRESS LocalIp;\r
- EFI_IPv4_ADDRESS SubnetMask;\r
- EFI_IPv4_ADDRESS Gateway;\r
-\r
- EFI_IPv4_ADDRESS RemoteIp;\r
- UINT16 RemotePort;\r
-} TCP4_IO_CONFIG_DATA;\r
-\r
-typedef struct _TCP4_IO {\r
- EFI_HANDLE Image;\r
- EFI_HANDLE Controller;\r
-\r
- EFI_HANDLE Handle;\r
- EFI_TCP4_PROTOCOL *Tcp4;\r
-\r
- EFI_TCP4_CONNECTION_TOKEN ConnToken;\r
- EFI_TCP4_IO_TOKEN TxToken;\r
- EFI_TCP4_IO_TOKEN RxToken;\r
- EFI_TCP4_CLOSE_TOKEN CloseToken;\r
-\r
- BOOLEAN IsConnDone;\r
- BOOLEAN IsTxDone;\r
- BOOLEAN IsRxDone;\r
- BOOLEAN IsCloseDone;\r
-} TCP4_IO;\r
-\r
-/**\r
- Create a TCP socket with the specified configuration data.\r
-\r
- @param[in] Image The handle of the driver image.\r
- @param[in] Controller The handle of the controller.\r
- @param[in] ConfigData The Tcp4 configuration data.\r
- @param[in] Tcp4Io The Tcp4Io.\r
-\r
- @retval EFI_SUCCESS The TCP socket is created and configured.\r
- @retval Others Failed to create the TCP socket or configure it.\r
-**/\r
-EFI_STATUS\r
-Tcp4IoCreateSocket (\r
- IN EFI_HANDLE Image,\r
- IN EFI_HANDLE Controller,\r
- IN TCP4_IO_CONFIG_DATA *ConfigData,\r
- IN TCP4_IO *Tcp4Io\r
- );\r
-\r
-/**\r
- Destroy the socket.\r
-\r
- @param[in] Tcp4Io The Tcp4Io which wraps the socket to be destroyeds.\r
-**/\r
-VOID\r
-Tcp4IoDestroySocket (\r
- IN TCP4_IO *Tcp4Io\r
- );\r
-\r
-/**\r
- Connect to the other endpoint of the TCP socket.\r
-\r
- @param[in, out] Tcp4Io The Tcp4Io wrapping the TCP socket.\r
- @param[in] Timeout The time to wait for connection done.\r
-\r
- @retval EFI_SUCCESS Connect to the other endpoint of the TCP socket successfully.\r
- @retval EFI_TIMEOUT Failed to connect to the other endpoint of the TCP socket in the specified time period.\r
- @retval Others Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-Tcp4IoConnect (\r
- IN OUT TCP4_IO *Tcp4Io,\r
- IN EFI_EVENT Timeout\r
- );\r
-\r
-/**\r
- Reset the socket.\r
-\r
- @param[in, out] Tcp4Io The Tcp4Io wrapping the TCP socket.\r
-**/\r
-VOID\r
-Tcp4IoReset (\r
- IN OUT TCP4_IO *Tcp4Io\r
- );\r
-\r
-/**\r
- Transmit the Packet to the other endpoint of the socket.\r
-\r
- @param[in] Tcp4Io The Tcp4Io wrapping the TCP socket.\r
- @param[in] Packet The packet to transmit.\r
-\r
- @retval EFI_SUCCESS The packet is trasmitted.\r
- @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
- @retval Others Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-Tcp4IoTransmit (\r
- IN TCP4_IO *Tcp4Io,\r
- IN NET_BUF *Packet\r
- );\r
-\r
-/**\r
- Receive data from the socket.\r
-\r
- @param[in] Tcp4Io The Tcp4Io which wraps the socket to be destroyed.\r
- @param[in] Packet The buffer to hold the data copy from the soket rx buffer.\r
- @param[in] AsyncMode Is this receive asyncronous or not.\r
- @param[in] Timeout The time to wait for receiving the amount of data the Packet\r
- can hold.\r
-\r
- @retval EFI_SUCCESS The required amount of data is received from the socket.\r
- @retval EFI_OUT_OF_RESOURCES Failed to allocate momery.\r
- @retval EFI_TIMEOUT Failed to receive the required amount of data in the\r
- specified time period.\r
- @retval Others Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-Tcp4IoReceive (\r
- IN TCP4_IO *Tcp4Io,\r
- IN NET_BUF *Packet,\r
- IN BOOLEAN AsyncMode,\r
- IN EFI_EVENT Timeout\r
- );\r
-\r
-#endif\r