]>
Commit | Line | Data |
---|---|---|
12618416 | 1 | /**\r |
2 | IScsi Tcp4 IO related definitions.\r | |
6a690e23 | 3 | \r |
9cb8724d | 4 | Copyright (c) 2004 - 2008, Intel Corporation\r |
7a444476 | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
6a690e23 | 12 | \r |
13 | Module Name:\r | |
14 | \r | |
15 | IScsiTcp4Io.h\r | |
16 | \r | |
17 | Abstract:\r | |
18 | \r | |
12618416 | 19 | IScsi Tcp4 IO related definitions.\r |
6a690e23 | 20 | \r |
12618416 | 21 | **/\r |
6a690e23 | 22 | \r |
23 | #ifndef _ISCSI_TCP4_IO_H_\r | |
24 | #define _ISCSI_TCP4_IO_H_\r | |
25 | \r | |
26 | #include <Library/NetLib.h>\r | |
9cb8724d | 27 | #include <Protocol/Tcp4.h>\r |
6a690e23 | 28 | \r |
29 | typedef struct _TCP4_IO_CONFIG_DATA {\r | |
30 | EFI_IPv4_ADDRESS LocalIp;\r | |
31 | EFI_IPv4_ADDRESS SubnetMask;\r | |
32 | EFI_IPv4_ADDRESS Gateway;\r | |
33 | \r | |
34 | EFI_IPv4_ADDRESS RemoteIp;\r | |
35 | UINT16 RemotePort;\r | |
36 | } TCP4_IO_CONFIG_DATA;\r | |
37 | \r | |
38 | typedef struct _TCP4_IO {\r | |
39 | EFI_HANDLE Image;\r | |
40 | EFI_HANDLE Controller;\r | |
41 | \r | |
42 | EFI_HANDLE Handle;\r | |
43 | EFI_TCP4_PROTOCOL *Tcp4;\r | |
44 | \r | |
45 | EFI_TCP4_CONNECTION_TOKEN ConnToken;\r | |
46 | EFI_TCP4_IO_TOKEN TxToken;\r | |
47 | EFI_TCP4_IO_TOKEN RxToken;\r | |
48 | EFI_TCP4_CLOSE_TOKEN CloseToken;\r | |
49 | \r | |
50 | BOOLEAN IsConnDone;\r | |
51 | BOOLEAN IsTxDone;\r | |
52 | BOOLEAN IsRxDone;\r | |
53 | BOOLEAN IsCloseDone;\r | |
54 | } TCP4_IO;\r | |
55 | \r | |
12618416 | 56 | /**\r |
57 | Create a TCP socket with the specified configuration data. \r | |
58 | \r | |
59 | @param Image[in] The handle of the driver image.\r | |
60 | \r | |
61 | @param Controller[in] The handle of the controller.\r | |
62 | \r | |
63 | @param ConfigData[in] The Tcp4 configuration data.\r | |
64 | \r | |
65 | @param Tcp4Io[in] The Tcp4Io.\r | |
66 | \r | |
67 | @retval EFI_SUCCESS The TCP socket is created and configured.\r | |
68 | \r | |
69 | @retval Other Failed to create the TCP socket or configure it.\r | |
70 | \r | |
71 | **/\r | |
6a690e23 | 72 | EFI_STATUS\r |
73 | Tcp4IoCreateSocket (\r | |
74 | IN EFI_HANDLE Image,\r | |
75 | IN EFI_HANDLE Controller,\r | |
76 | IN TCP4_IO_CONFIG_DATA *ConfigData,\r | |
77 | IN TCP4_IO *Tcp4Io\r | |
78 | );\r | |
79 | \r | |
12618416 | 80 | /**\r |
81 | Destroy the socket. \r | |
82 | \r | |
83 | @param[in] Tcp4Io The Tcp4Io which wraps the socket to be destroyeds.\r | |
84 | \r | |
85 | @retval None.\r | |
86 | \r | |
87 | **/\r | |
6a690e23 | 88 | VOID\r |
89 | Tcp4IoDestroySocket (\r | |
90 | IN TCP4_IO *Tcp4Io\r | |
91 | );\r | |
92 | \r | |
12618416 | 93 | /**\r |
94 | Connect to the other endpoint of the TCP socket.\r | |
95 | \r | |
96 | @param Tcp4Io[in] The Tcp4Io wrapping the TCP socket.\r | |
97 | \r | |
98 | @param Timeout[in] The time to wait for connection done.\r | |
99 | \r | |
100 | @retval None.\r | |
101 | \r | |
102 | **/\r | |
6a690e23 | 103 | EFI_STATUS\r |
104 | Tcp4IoConnect (\r | |
105 | IN TCP4_IO *Tcp4Io,\r | |
106 | IN EFI_EVENT Timeout\r | |
107 | );\r | |
108 | \r | |
12618416 | 109 | /**\r |
110 | Reset the socket.\r | |
111 | \r | |
112 | @param Tcp4Io[in] The Tcp4Io wrapping the TCP socket.\r | |
113 | \r | |
114 | @retval None.\r | |
115 | \r | |
116 | **/\r | |
6a690e23 | 117 | VOID\r |
118 | Tcp4IoReset (\r | |
119 | IN TCP4_IO *Tcp4Io\r | |
120 | );\r | |
121 | \r | |
12618416 | 122 | /**\r |
123 | Transmit the Packet to the other endpoint of the socket.\r | |
124 | \r | |
125 | @param Tcp4Io[in] The Tcp4Io wrapping the TCP socket.\r | |
126 | \r | |
127 | @param Packet[in] The packet to transmit\r | |
128 | \r | |
129 | @retval EFI_SUCCESS The packet is trasmitted.\r | |
130 | \r | |
131 | @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r | |
132 | \r | |
133 | **/\r | |
6a690e23 | 134 | EFI_STATUS\r |
135 | Tcp4IoTransmit (\r | |
136 | IN TCP4_IO *Tcp4Io,\r | |
137 | IN NET_BUF *Packet\r | |
138 | );\r | |
139 | \r | |
12618416 | 140 | /**\r |
141 | Receive data from the socket.\r | |
142 | \r | |
143 | @param Tcp4Io[in] The Tcp4Io which wraps the socket to be destroyeds.\r | |
144 | \r | |
145 | @param Packet[in] The buffer to hold the data copy from the soket rx buffer.\r | |
146 | \r | |
147 | @param AsyncMode[in] Is this receive asyncronous or not.\r | |
148 | \r | |
149 | @param Timeout[in] The time to wait for receiving the amount of data the Packet\r | |
150 | can hold.\r | |
151 | \r | |
152 | @retval EFI_SUCCESS The required amount of data is received from the socket.\r | |
153 | \r | |
154 | @retval EFI_OUT_OF_RESOURCES Failed to allocate momery.\r | |
155 | \r | |
156 | @retval EFI_TIMEOUT Failed to receive the required amount of data in the\r | |
157 | specified time period.\r | |
158 | \r | |
159 | **/\r | |
6a690e23 | 160 | EFI_STATUS\r |
161 | Tcp4IoReceive (\r | |
162 | IN TCP4_IO *Tcp4Io,\r | |
163 | IN NET_BUF *Packet,\r | |
164 | IN BOOLEAN AsyncMode,\r | |
165 | IN EFI_EVENT Timeout\r | |
166 | );\r | |
167 | \r | |
168 | #endif\r |