2 iSCSI Tcp4 IO related definitions.
4 Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
5 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.
15 #ifndef _ISCSI_TCP4_IO_H_
16 #define _ISCSI_TCP4_IO_H_
18 #include <Library/NetLib.h>
19 #include <Protocol/Tcp4.h>
21 typedef struct _TCP4_IO_CONFIG_DATA
{
22 EFI_IPv4_ADDRESS LocalIp
;
23 EFI_IPv4_ADDRESS SubnetMask
;
24 EFI_IPv4_ADDRESS Gateway
;
26 EFI_IPv4_ADDRESS RemoteIp
;
28 } TCP4_IO_CONFIG_DATA
;
30 typedef struct _TCP4_IO
{
32 EFI_HANDLE Controller
;
35 EFI_TCP4_PROTOCOL
*Tcp4
;
37 EFI_TCP4_CONNECTION_TOKEN ConnToken
;
38 EFI_TCP4_IO_TOKEN TxToken
;
39 EFI_TCP4_IO_TOKEN RxToken
;
40 EFI_TCP4_CLOSE_TOKEN CloseToken
;
49 Create a TCP socket with the specified configuration data.
51 @param[in] Image The handle of the driver image.
52 @param[in] Controller The handle of the controller.
53 @param[in] ConfigData The Tcp4 configuration data.
54 @param[in] Tcp4Io The Tcp4Io.
56 @retval EFI_SUCCESS The TCP socket is created and configured.
57 @retval Others Failed to create the TCP socket or configure it.
62 IN EFI_HANDLE Controller
,
63 IN TCP4_IO_CONFIG_DATA
*ConfigData
,
70 @param[in] Tcp4Io The Tcp4Io which wraps the socket to be destroyeds.
78 Connect to the other endpoint of the TCP socket.
80 @param[in, out] Tcp4Io The Tcp4Io wrapping the TCP socket.
81 @param[in] Timeout The time to wait for connection done.
83 @retval EFI_SUCCESS Connect to the other endpoint of the TCP socket successfully.
84 @retval EFI_TIMEOUT Failed to connect to the other endpoint of the TCP socket in the specified time period.
85 @retval Others Other errors as indicated.
89 IN OUT TCP4_IO
*Tcp4Io
,
96 @param[in, out] Tcp4Io The Tcp4Io wrapping the TCP socket.
100 IN OUT TCP4_IO
*Tcp4Io
104 Transmit the Packet to the other endpoint of the socket.
106 @param[in] Tcp4Io The Tcp4Io wrapping the TCP socket.
107 @param[in] Packet The packet to transmit.
109 @retval EFI_SUCCESS The packet is trasmitted.
110 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
111 @retval Others Other errors as indicated.
120 Receive data from the socket.
122 @param[in] Tcp4Io The Tcp4Io which wraps the socket to be destroyed.
123 @param[in] Packet The buffer to hold the data copy from the soket rx buffer.
124 @param[in] AsyncMode Is this receive asyncronous or not.
125 @param[in] Timeout The time to wait for receiving the amount of data the Packet
128 @retval EFI_SUCCESS The required amount of data is received from the socket.
129 @retval EFI_OUT_OF_RESOURCES Failed to allocate momery.
130 @retval EFI_TIMEOUT Failed to receive the required amount of data in the
131 specified time period.
132 @retval Others Other errors as indicated.
138 IN BOOLEAN AsyncMode
,