2 IScsi Tcp4 IO related definitions.
4 Copyright (c) 2004 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 IScsi Tcp4 IO related definitions.
23 #ifndef _ISCSI_TCP4_IO_H_
24 #define _ISCSI_TCP4_IO_H_
26 #include <Library/NetLib.h>
27 #include <Protocol/Tcp4.h>
29 typedef struct _TCP4_IO_CONFIG_DATA
{
30 EFI_IPv4_ADDRESS LocalIp
;
31 EFI_IPv4_ADDRESS SubnetMask
;
32 EFI_IPv4_ADDRESS Gateway
;
34 EFI_IPv4_ADDRESS RemoteIp
;
36 } TCP4_IO_CONFIG_DATA
;
38 typedef struct _TCP4_IO
{
40 EFI_HANDLE Controller
;
43 EFI_TCP4_PROTOCOL
*Tcp4
;
45 EFI_TCP4_CONNECTION_TOKEN ConnToken
;
46 EFI_TCP4_IO_TOKEN TxToken
;
47 EFI_TCP4_IO_TOKEN RxToken
;
48 EFI_TCP4_CLOSE_TOKEN CloseToken
;
57 Create a TCP socket with the specified configuration data.
59 @param Image[in] The handle of the driver image.
61 @param Controller[in] The handle of the controller.
63 @param ConfigData[in] The Tcp4 configuration data.
65 @param Tcp4Io[in] The Tcp4Io.
67 @retval EFI_SUCCESS The TCP socket is created and configured.
69 @retval Other Failed to create the TCP socket or configure it.
75 IN EFI_HANDLE Controller
,
76 IN TCP4_IO_CONFIG_DATA
*ConfigData
,
83 @param[in] Tcp4Io The Tcp4Io which wraps the socket to be destroyeds.
94 Connect to the other endpoint of the TCP socket.
96 @param Tcp4Io[in] The Tcp4Io wrapping the TCP socket.
98 @param Timeout[in] The time to wait for connection done.
112 @param Tcp4Io[in] The Tcp4Io wrapping the TCP socket.
123 Transmit the Packet to the other endpoint of the socket.
125 @param Tcp4Io[in] The Tcp4Io wrapping the TCP socket.
127 @param Packet[in] The packet to transmit
129 @retval EFI_SUCCESS The packet is trasmitted.
131 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
141 Receive data from the socket.
143 @param Tcp4Io[in] The Tcp4Io which wraps the socket to be destroyeds.
145 @param Packet[in] The buffer to hold the data copy from the soket rx buffer.
147 @param AsyncMode[in] Is this receive asyncronous or not.
149 @param Timeout[in] The time to wait for receiving the amount of data the Packet
152 @retval EFI_SUCCESS The required amount of data is received from the socket.
154 @retval EFI_OUT_OF_RESOURCES Failed to allocate momery.
156 @retval EFI_TIMEOUT Failed to receive the required amount of data in the
157 specified time period.
164 IN BOOLEAN AsyncMode
,