]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
bdb140d7 | 2 | EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition\r |
d1f95000 | 3 | The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create\r |
d01c093a | 4 | and destroy child of the driver to communicate with other host using TCP protocol.\r |
5 | The EFI TCPv4 Protocol provides services to send and receive data stream.\r | |
d1f95000 | 6 | \r |
bdb140d7 | 7 | Copyright (c) 2006 - 2009, Intel Corporation\r |
d01c093a | 8 | All rights reserved. This program and the accompanying materials\r |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
d1f95000 | 12 | \r |
d01c093a | 13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
d1f95000 | 15 | \r |
d1f95000 | 16 | **/\r |
17 | \r | |
18 | #ifndef __EFI_TCP4_PROTOCOL_H__\r | |
19 | #define __EFI_TCP4_PROTOCOL_H__\r | |
20 | \r | |
21 | #include <Protocol/Ip4.h>\r | |
22 | \r | |
23 | #define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID \\r | |
24 | { \\r | |
25 | 0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \\r | |
26 | }\r | |
27 | \r | |
28 | #define EFI_TCP4_PROTOCOL_GUID \\r | |
29 | { \\r | |
30 | 0x65530BC7, 0xA359, 0x410f, {0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } \\r | |
31 | }\r | |
32 | \r | |
33 | typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL;\r | |
34 | \r | |
35 | typedef struct {\r | |
8377875b | 36 | EFI_HANDLE InstanceHandle;\r |
d1f95000 | 37 | EFI_IPv4_ADDRESS LocalAddress;\r |
38 | UINT16 LocalPort;\r | |
39 | EFI_IPv4_ADDRESS RemoteAddress;\r | |
40 | UINT16 RemotePort;\r | |
41 | } EFI_TCP4_SERVICE_POINT;\r | |
42 | \r | |
43 | typedef struct {\r | |
44 | EFI_HANDLE DriverHandle;\r | |
45 | UINT32 ServiceCount;\r | |
46 | EFI_TCP4_SERVICE_POINT Services[1];\r | |
47 | } EFI_TCP4_VARIABLE_DATA;\r | |
48 | \r | |
49 | typedef struct {\r | |
50 | BOOLEAN UseDefaultAddress;\r | |
51 | EFI_IPv4_ADDRESS StationAddress;\r | |
52 | EFI_IPv4_ADDRESS SubnetMask;\r | |
53 | UINT16 StationPort;\r | |
54 | EFI_IPv4_ADDRESS RemoteAddress;\r | |
55 | UINT16 RemotePort;\r | |
56 | BOOLEAN ActiveFlag;\r | |
57 | } EFI_TCP4_ACCESS_POINT;\r | |
58 | \r | |
59 | typedef struct {\r | |
d01c093a | 60 | UINT32 ReceiveBufferSize;\r |
61 | UINT32 SendBufferSize;\r | |
62 | UINT32 MaxSynBackLog;\r | |
63 | UINT32 ConnectionTimeout;\r | |
64 | UINT32 DataRetries;\r | |
65 | UINT32 FinTimeout;\r | |
66 | UINT32 TimeWaitTimeout;\r | |
67 | UINT32 KeepAliveProbes;\r | |
68 | UINT32 KeepAliveTime;\r | |
69 | UINT32 KeepAliveInterval;\r | |
d1f95000 | 70 | BOOLEAN EnableNagle;\r |
71 | BOOLEAN EnableTimeStamp;\r | |
72 | BOOLEAN EnableWindowScaling;\r | |
73 | BOOLEAN EnableSelectiveAck;\r | |
74 | BOOLEAN EnablePathMtuDiscovery;\r | |
75 | } EFI_TCP4_OPTION;\r | |
76 | \r | |
77 | typedef struct {\r | |
78 | //\r | |
79 | // I/O parameters\r | |
80 | //\r | |
81 | UINT8 TypeOfService;\r | |
82 | UINT8 TimeToLive;\r | |
83 | \r | |
84 | //\r | |
85 | // Access Point\r | |
86 | //\r | |
87 | EFI_TCP4_ACCESS_POINT AccessPoint;\r | |
d01c093a | 88 | \r |
89 | //\r | |
90 | // TCP Control Options\r | |
91 | //\r | |
d1f95000 | 92 | EFI_TCP4_OPTION *ControlOption;\r |
93 | } EFI_TCP4_CONFIG_DATA;\r | |
94 | \r | |
9319d2c2 LG |
95 | ///\r |
96 | /// TCP4 connnection state\r | |
97 | ///\r | |
d1f95000 | 98 | typedef enum {\r |
99 | Tcp4StateClosed = 0,\r | |
100 | Tcp4StateListen = 1,\r | |
101 | Tcp4StateSynSent = 2,\r | |
102 | Tcp4StateSynReceived = 3,\r | |
103 | Tcp4StateEstablished = 4,\r | |
104 | Tcp4StateFinWait1 = 5,\r | |
105 | Tcp4StateFinWait2 = 6,\r | |
106 | Tcp4StateClosing = 7,\r | |
107 | Tcp4StateTimeWait = 8,\r | |
108 | Tcp4StateCloseWait = 9,\r | |
109 | Tcp4StateLastAck = 10\r | |
110 | } EFI_TCP4_CONNECTION_STATE;\r | |
111 | \r | |
112 | typedef struct {\r | |
113 | EFI_EVENT Event;\r | |
114 | EFI_STATUS Status;\r | |
115 | } EFI_TCP4_COMPLETION_TOKEN;\r | |
116 | \r | |
117 | typedef struct {\r | |
118 | EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r | |
119 | } EFI_TCP4_CONNECTION_TOKEN;\r | |
120 | \r | |
121 | typedef struct {\r | |
122 | EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r | |
123 | EFI_HANDLE NewChildHandle;\r | |
124 | } EFI_TCP4_LISTEN_TOKEN;\r | |
125 | \r | |
126 | typedef struct {\r | |
d01c093a | 127 | UINT32 FragmentLength;\r |
128 | VOID *FragmentBuffer;\r | |
d1f95000 | 129 | } EFI_TCP4_FRAGMENT_DATA;\r |
130 | \r | |
131 | typedef struct {\r | |
132 | BOOLEAN UrgentFlag;\r | |
d01c093a | 133 | UINT32 DataLength;\r |
134 | UINT32 FragmentCount;\r | |
d1f95000 | 135 | EFI_TCP4_FRAGMENT_DATA FragmentTable[1];\r |
d01c093a | 136 | } EFI_TCP4_RECEIVE_DATA;\r |
d1f95000 | 137 | \r |
d01c093a | 138 | typedef struct {\r |
d1f95000 | 139 | BOOLEAN Push;\r |
140 | BOOLEAN Urgent;\r | |
d01c093a | 141 | UINT32 DataLength;\r |
142 | UINT32 FragmentCount;\r | |
d1f95000 | 143 | EFI_TCP4_FRAGMENT_DATA FragmentTable[1];\r |
144 | } EFI_TCP4_TRANSMIT_DATA;\r | |
145 | \r | |
146 | typedef struct {\r | |
147 | EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r | |
148 | union {\r | |
149 | EFI_TCP4_RECEIVE_DATA *RxData;\r | |
150 | EFI_TCP4_TRANSMIT_DATA *TxData;\r | |
151 | } Packet;\r | |
152 | } EFI_TCP4_IO_TOKEN;\r | |
153 | \r | |
154 | typedef struct {\r | |
155 | EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r | |
156 | BOOLEAN AbortOnClose;\r | |
157 | } EFI_TCP4_CLOSE_TOKEN;\r | |
158 | \r | |
159 | //\r | |
160 | // Interface definition for TCP4 protocol\r | |
161 | //\r | |
162 | \r | |
163 | /**\r | |
164 | Get the current operational status.\r | |
165 | \r | |
166 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
167 | @param Tcp4State Pointer to the buffer to receive the current TCP state.\r | |
168 | @param Tcp4ConfigData Pointer to the buffer to receive the current TCP configuration.\r | |
169 | @param Ip4ModeData Pointer to the buffer to receive the current IPv4 configuration\r | |
170 | data used by the TCPv4 instance.\r | |
171 | @param MnpConfigData Pointer to the buffer to receive the current MNP configuration\r | |
172 | data used indirectly by the TCPv4 instance.\r | |
173 | @param SnpModeData Pointer to the buffer to receive the current SNP configuration\r | |
174 | data used indirectly by the TCPv4 instance.\r | |
175 | \r | |
176 | @retval EFI_SUCCESS The mode data was read.\r | |
177 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
178 | @retval EFI_NOT_STARTED No configuration data is available because this instance hasn't\r | |
179 | been started.\r | |
180 | \r | |
181 | **/\r | |
182 | typedef\r | |
183 | EFI_STATUS\r | |
8b13229b | 184 | (EFIAPI *EFI_TCP4_GET_MODE_DATA)(\r |
d1f95000 | 185 | IN CONST EFI_TCP4_PROTOCOL *This,\r |
186 | OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL,\r | |
187 | OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL,\r | |
188 | OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,\r | |
189 | OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r | |
190 | OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r | |
ed66e1bc | 191 | );\r |
d01c093a | 192 | \r |
d1f95000 | 193 | /**\r |
194 | Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.\r | |
195 | \r | |
196 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
197 | @param Tcp4ConfigData Pointer to the configure data to configure the instance.\r | |
198 | \r | |
199 | @retval EFI_SUCCESS The operational settings are set, changed, or reset\r | |
200 | successfully.\r | |
201 | @retval EFI_INVALID_PARAMETER Some parameter is invalid.\r | |
202 | @retval EFI_NO_MAPPING When using a default address, configuration (through\r | |
203 | DHCP, BOOTP, RARP, etc.) is not finished yet.\r | |
204 | @retval EFI_ACCESS_DENIED Configuring TCP instance when it is configured without\r | |
205 | calling Configure() with NULL to reset it.\r | |
206 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
207 | @retval EFI_UNSUPPORTED One or more of the control options are not supported in\r | |
208 | the implementation.\r | |
209 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when\r | |
210 | executing Configure().\r | |
211 | \r | |
212 | **/\r | |
213 | typedef\r | |
214 | EFI_STATUS\r | |
8b13229b | 215 | (EFIAPI *EFI_TCP4_CONFIGURE)(\r |
d1f95000 | 216 | IN EFI_TCP4_PROTOCOL *This,\r |
217 | IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL\r | |
ed66e1bc | 218 | );\r |
d01c093a | 219 | \r |
d1f95000 | 220 | \r |
221 | /**\r | |
222 | Add or delete a route entry to the route table\r | |
223 | \r | |
224 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
225 | @param DeleteRoute Set it to TRUE to delete this route from the routing table. Set it to\r | |
226 | FALSE to add this route to the routing table.\r | |
227 | DestinationAddress and SubnetMask are used as the\r | |
228 | keywords to search route entry.\r | |
229 | @param SubnetAddress The destination network.\r | |
230 | @param SubnetMask The subnet mask of the destination network.\r | |
231 | @param GatewayAddress The gateway address for this route. It must be on the same\r | |
232 | subnet with the station address unless a direct route is specified.\r | |
233 | \r | |
234 | @retval EFI_SUCCESS The operation completed successfully.\r | |
235 | @retval EFI_NOT_STARTED The EFI TCPv4 Protocol instance has not been configured.\r | |
236 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r | |
237 | RARP, etc.) is not finished yet.\r | |
238 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
239 | - This is NULL.\r | |
240 | - SubnetAddress is NULL.\r | |
241 | - SubnetMask is NULL.\r | |
242 | - GatewayAddress is NULL.\r | |
243 | - *SubnetAddress is not NULL a valid subnet address.\r | |
244 | - *SubnetMask is not a valid subnet mask.\r | |
245 | - *GatewayAddress is not a valid unicast IP address or it\r | |
246 | is not in the same subnet.\r | |
247 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resources to add the entry to the\r | |
248 | routing table.\r | |
249 | @retval EFI_NOT_FOUND This route is not in the routing table.\r | |
250 | @retval EFI_ACCESS_DENIED The route is already defined in the routing table.\r | |
251 | @retval EFI_UNSUPPORTED The TCP driver does not support this operation.\r | |
252 | \r | |
253 | **/\r | |
254 | typedef\r | |
255 | EFI_STATUS\r | |
8b13229b | 256 | (EFIAPI *EFI_TCP4_ROUTES)(\r |
d1f95000 | 257 | IN EFI_TCP4_PROTOCOL *This,\r |
258 | IN BOOLEAN DeleteRoute,\r | |
259 | IN EFI_IPv4_ADDRESS *SubnetAddress,\r | |
260 | IN EFI_IPv4_ADDRESS *SubnetMask,\r | |
261 | IN EFI_IPv4_ADDRESS *GatewayAddress\r | |
ed66e1bc | 262 | );\r |
d1f95000 | 263 | \r |
264 | /**\r | |
265 | Initiate a nonblocking TCP connection request for an active TCP instance.\r | |
266 | \r | |
267 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
268 | @param ConnectionToken Pointer to the connection token to return when the TCP three\r | |
269 | way handshake finishes.\r | |
d01c093a | 270 | \r |
d1f95000 | 271 | @retval EFI_SUCCESS The connection request is successfully initiated and the state\r |
bdb140d7 | 272 | of this TCPv4 instance has been changed to Tcp4StateSynSent.\r |
d1f95000 | 273 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r |
274 | @retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE:\r | |
275 | - This instance is not configured as an active one.\r | |
276 | - This instance is not in Tcp4StateClosed state.\r | |
277 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
278 | - This is NULL.\r | |
279 | - ConnectionToken is NULL.\r | |
280 | - ConnectionToken->CompletionToken.Event is NULL.\r | |
bdb140d7 | 281 | @retval EFI_OUT_OF_RESOURCES The driver can't allocate enough resource to initiate the activ eopen.\r |
d1f95000 | 282 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r |
283 | \r | |
284 | **/\r | |
285 | typedef\r | |
286 | EFI_STATUS\r | |
8b13229b | 287 | (EFIAPI *EFI_TCP4_CONNECT)(\r |
d1f95000 | 288 | IN EFI_TCP4_PROTOCOL *This,\r |
289 | IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken\r | |
ed66e1bc | 290 | );\r |
d01c093a | 291 | \r |
d1f95000 | 292 | \r |
293 | /**\r | |
294 | Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.\r | |
295 | \r | |
296 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
297 | @param ListenToken Pointer to the listen token to return when operation finishes.\r | |
298 | \r | |
299 | @retval EFI_SUCCESS The listen token has been queued successfully.\r | |
300 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r | |
301 | @retval EFI_ACCESS_DENIED One or more of the following are TRUE:\r | |
302 | - This instance is not a passive instance.\r | |
303 | - This instance is not in Tcp4StateListen state.\r | |
304 | - The same listen token has already existed in the listen\r | |
305 | token queue of this TCP instance.\r | |
306 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
307 | - This is NULL.\r | |
308 | - ListenToken is NULL.\r | |
309 | - ListentToken->CompletionToken.Event is NULL.\r | |
f754f721 | 310 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r |
311 | @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.\r | |
d1f95000 | 312 | \r |
313 | **/\r | |
314 | typedef\r | |
315 | EFI_STATUS\r | |
8b13229b | 316 | (EFIAPI *EFI_TCP4_ACCEPT)(\r |
d1f95000 | 317 | IN EFI_TCP4_PROTOCOL *This,\r |
318 | IN EFI_TCP4_LISTEN_TOKEN *ListenToken\r | |
ed66e1bc | 319 | );\r |
d1f95000 | 320 | \r |
321 | /**\r | |
322 | Queues outgoing data into the transmit queue.\r | |
323 | \r | |
324 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
325 | @param Token Pointer to the completion token to queue to the transmit queue.\r | |
326 | \r | |
327 | @retval EFI_SUCCESS The data has been queued for transmission.\r | |
328 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r | |
329 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r | |
330 | RARP, etc.) is not finished yet.\r | |
331 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
332 | - This is NULL.\r | |
333 | - Token is NULL.\r | |
334 | - Token->CompletionToken.Event is NULL.\r | |
335 | - Token->Packet.TxData is NULL L.\r | |
336 | - Token->Packet.FragmentCount is zero.\r | |
337 | - Token->Packet.DataLength is not equal to the sum of fragment lengths.\r | |
338 | @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:\r | |
339 | - A transmit completion token with the same Token->CompletionToken.Event\r | |
340 | was already in the transmission queue.\r | |
341 | - The current instance is in Tcp4StateClosed state.\r | |
342 | - The current instance is a passive one and it is in\r | |
343 | Tcp4StateListen state.\r | |
344 | - User has called Close() to disconnect this connection.\r | |
345 | @retval EFI_NOT_READY The completion token could not be queued because the\r | |
346 | transmit queue is full.\r | |
347 | @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data because of resource\r | |
348 | shortage.\r | |
349 | @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.\r | |
350 | \r | |
351 | **/\r | |
352 | typedef\r | |
353 | EFI_STATUS\r | |
8b13229b | 354 | (EFIAPI *EFI_TCP4_TRANSMIT)(\r |
d1f95000 | 355 | IN EFI_TCP4_PROTOCOL *This,\r |
356 | IN EFI_TCP4_IO_TOKEN *Token\r | |
ed66e1bc | 357 | );\r |
d1f95000 | 358 | \r |
359 | \r | |
360 | /**\r | |
361 | Places an asynchronous receive request into the receiving queue.\r | |
362 | \r | |
363 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
364 | @param Token Pointer to a token that is associated with the receive data\r | |
365 | descriptor.\r | |
366 | \r | |
367 | @retval EFI_SUCCESS The receive completion token was cached.\r | |
368 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r | |
369 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP,\r | |
370 | etc.) is not finished yet.\r | |
371 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
372 | - This is NULL.\r | |
373 | - Token is NULL.\r | |
374 | - Token->CompletionToken.Event is NULL.\r | |
375 | - Token->Packet.RxData is NULL.\r | |
376 | - Token->Packet.RxData->DataLength is 0.\r | |
377 | - The Token->Packet.RxData->DataLength is not\r | |
378 | the sum of all FragmentBuffer length in FragmentTable.\r | |
379 | @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of\r | |
380 | system resources (usually memory).\r | |
381 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
382 | @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:\r | |
383 | - A receive completion token with the same Token-\r | |
384 | >CompletionToken.Event was already in the receive\r | |
385 | queue.\r | |
386 | - The current instance is in Tcp4StateClosed state.\r | |
387 | - The current instance is a passive one and it is in\r | |
388 | Tcp4StateListen state.\r | |
389 | - User has called Close() to disconnect this connection.\r | |
390 | @retval EFI_CONNECTION_FIN The communication peer has closed the connection and there is\r | |
f754f721 | 391 | no any buffered data in the receive buffer of this instance.\r |
d1f95000 | 392 | @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.\r |
393 | \r | |
394 | **/\r | |
395 | typedef\r | |
396 | EFI_STATUS\r | |
8b13229b | 397 | (EFIAPI *EFI_TCP4_RECEIVE)(\r |
d1f95000 | 398 | IN EFI_TCP4_PROTOCOL *This,\r |
399 | IN EFI_TCP4_IO_TOKEN *Token\r | |
ed66e1bc | 400 | );\r |
d01c093a | 401 | \r |
d1f95000 | 402 | /**\r |
403 | Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a\r | |
d01c093a | 404 | nonblocking operation.\r |
d1f95000 | 405 | \r |
406 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
407 | @param CloseToken Pointer to the close token to return when operation finishes.\r | |
408 | \r | |
409 | @retval EFI_SUCCESS The Close() is called successfully.\r | |
410 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r | |
411 | @retval EFI_ACCESS_DENIED One or more of the following are TRUE:\r | |
412 | - Configure() has been called with\r | |
413 | TcpConfigData set to NULL and this function has\r | |
414 | not returned.\r | |
415 | - Previous Close() call on this instance has not\r | |
416 | finished.\r | |
417 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
418 | - This is NULL.\r | |
419 | - CloseToken is NULL.\r | |
420 | - CloseToken->CompletionToken.Event is NULL.\r | |
f754f721 | 421 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r |
422 | @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.\r | |
d1f95000 | 423 | \r |
424 | **/\r | |
425 | typedef\r | |
426 | EFI_STATUS\r | |
8b13229b | 427 | (EFIAPI *EFI_TCP4_CLOSE)(\r |
d1f95000 | 428 | IN EFI_TCP4_PROTOCOL *This,\r |
429 | IN EFI_TCP4_CLOSE_TOKEN *CloseToken\r | |
ed66e1bc | 430 | );\r |
d1f95000 | 431 | \r |
432 | /**\r | |
433 | Abort an asynchronous connection, listen, transmission or receive request.\r | |
434 | \r | |
435 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
436 | @param Token Pointer to a token that has been issued by\r | |
437 | EFI_TCP4_PROTOCOL.Connect(),\r | |
438 | EFI_TCP4_PROTOCOL.Accept(),\r | |
439 | EFI_TCP4_PROTOCOL.Transmit() or\r | |
440 | EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending\r | |
441 | tokens issued by above four functions will be aborted. Type\r | |
442 | EFI_TCP4_COMPLETION_TOKEN is defined in\r | |
443 | EFI_TCP4_PROTOCOL.Connect().\r | |
444 | \r | |
bdb140d7 | 445 | @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event\r |
446 | is signaled.\r | |
447 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
448 | @retval EFI_NOT_STARTED This instance hasn't been configured.\r | |
449 | @retval EFI_NO_MAPPING When using the default address, configuration\r | |
450 | (DHCP, BOOTP,RARP, etc.) hasn't finished yet.\r | |
451 | @retval EFI_NOT_FOUND The asynchronous I/O request isn't found in the \r | |
452 | transmission or receive queue. It has either \r | |
453 | completed or wasn't issued by Transmit() and Receive().\r | |
d1f95000 | 454 | \r |
455 | **/\r | |
456 | typedef\r | |
457 | EFI_STATUS\r | |
8b13229b | 458 | (EFIAPI *EFI_TCP4_CANCEL)(\r |
d1f95000 | 459 | IN EFI_TCP4_PROTOCOL *This,\r |
460 | IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL\r | |
ed66e1bc | 461 | );\r |
d1f95000 | 462 | \r |
463 | \r | |
464 | /**\r | |
465 | Poll to receive incoming data and transmit outgoing segments.\r | |
466 | \r | |
467 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
468 | \r | |
469 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
470 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
471 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
472 | @retval EFI_NOT_READY No incoming or outgoing data is processed.\r | |
473 | @retval EFI_TIMEOUT Data was dropped out of the transmission or receive queue.\r | |
474 | Consider increasing the polling rate.\r | |
475 | \r | |
476 | **/\r | |
477 | typedef\r | |
478 | EFI_STATUS\r | |
8b13229b | 479 | (EFIAPI *EFI_TCP4_POLL)(\r |
d1f95000 | 480 | IN EFI_TCP4_PROTOCOL *This\r |
ed66e1bc | 481 | );\r |
d1f95000 | 482 | \r |
44717a39 | 483 | ///\r |
484 | /// The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by \r | |
485 | /// any network drivers or applications to send or receive data stream. \r | |
486 | /// It can either listen on a specified port as a service or actively connected \r | |
487 | /// to remote peer as a client. Each instance has its own independent settings, \r | |
488 | /// such as the routing table.\r | |
489 | ///\r | |
d1f95000 | 490 | struct _EFI_TCP4_PROTOCOL {\r |
491 | EFI_TCP4_GET_MODE_DATA GetModeData;\r | |
492 | EFI_TCP4_CONFIGURE Configure;\r | |
493 | EFI_TCP4_ROUTES Routes;\r | |
494 | EFI_TCP4_CONNECT Connect;\r | |
495 | EFI_TCP4_ACCEPT Accept;\r | |
496 | EFI_TCP4_TRANSMIT Transmit;\r | |
497 | EFI_TCP4_RECEIVE Receive;\r | |
498 | EFI_TCP4_CLOSE Close;\r | |
499 | EFI_TCP4_CANCEL Cancel;\r | |
500 | EFI_TCP4_POLL Poll;\r | |
501 | };\r | |
502 | \r | |
503 | #define EFI_CONNECTION_FIN EFIERR (104)\r | |
504 | #define EFI_CONNECTION_RESET EFIERR (105)\r | |
505 | #define EFI_CONNECTION_REFUSED EFIERR (106)\r | |
506 | \r | |
507 | extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid;\r | |
508 | extern EFI_GUID gEfiTcp4ProtocolGuid;\r | |
509 | \r | |
510 | #endif\r |