]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Main.h
CommitLineData
83cbd279 1/** @file\r
dab714aa 2 TCP4 protocol services header file.\r
83cbd279 3\r
d1102dba 4Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials\r
83cbd279 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
dfc1f033 8http://opensource.org/licenses/bsd-license.php<BR>\r
83cbd279 9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
83cbd279 13**/\r
14\r
15#ifndef _TCP4_MAIN_H_\r
16#define _TCP4_MAIN_H_\r
17\r
18#include "Socket.h"\r
19\r
20#include "Tcp4Proto.h"\r
dab714aa 21#include "Tcp4Func.h"\r
83cbd279 22#include "Tcp4Driver.h"\r
23\r
24\r
25extern UINT16 mTcp4RandomPort;\r
dfc1f033 26extern CHAR16 *mTcpStateName[];\r
83cbd279 27\r
28//\r
29// Driver Produced Protocol Prototypes\r
30//\r
31\r
83cbd279 32//\r
33// Function prototype for the Tcp4 socket request handler\r
34//\r
dfc1f033 35/**\r
36 The procotol handler provided to the socket layer, used to\r
37 dispatch the socket level requests by calling the corresponding\r
38 TCP layer functions.\r
39\r
40 @param Sock Pointer to the socket of this TCP instance.\r
41 @param Request The code of this operation request.\r
42 @param Data Pointer to the operation specific data passed in\r
43 together with the operation request.\r
44\r
45 @retval EFI_SUCCESS The socket request is completed successfully.\r
46 @retval other The error status returned by the corresponding TCP\r
47 layer function.\r
48\r
49**/\r
83cbd279 50EFI_STATUS\r
51Tcp4Dispatcher (\r
52 IN SOCKET *Sock,\r
f6b7393c 53 IN UINT8 Request,\r
83cbd279 54 IN VOID *Data OPTIONAL\r
55 );\r
d1102dba 56\r
dfc1f033 57///\r
58/// TCP mode data\r
59///\r
83cbd279 60typedef struct _TCP4_MODE_DATA {\r
61 EFI_TCP4_CONNECTION_STATE *Tcp4State;\r
62 EFI_TCP4_CONFIG_DATA *Tcp4ConfigData;\r
63 EFI_IP4_MODE_DATA *Ip4ModeData;\r
64 EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData;\r
65 EFI_SIMPLE_NETWORK_MODE *SnpModeData;\r
66} TCP4_MODE_DATA;\r
67\r
dfc1f033 68///\r
69/// TCP route infomation data\r
70///\r
83cbd279 71typedef struct _TCP4_ROUTE_INFO {\r
72 BOOLEAN DeleteRoute;\r
73 EFI_IPv4_ADDRESS *SubnetAddress;\r
74 EFI_IPv4_ADDRESS *SubnetMask;\r
75 EFI_IPv4_ADDRESS *GatewayAddress;\r
76} TCP4_ROUTE_INFO;\r
77\r
216f7970 78typedef struct {\r
79 EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;\r
80 UINTN NumberOfChildren;\r
81 EFI_HANDLE *ChildHandleBuffer;\r
82} TCP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;\r
83\r
dfc1f033 84/**\r
85 Get the current operational status of a TCP instance.\r
d1102dba
LG
86\r
87 The GetModeData() function copies the current operational settings of this\r
88 EFI TCPv4 Protocol instance into user-supplied buffers. This function can\r
89 also be used to retrieve the operational setting of underlying drivers\r
dfc1f033 90 such as IPv4, MNP, or SNP.\r
91\r
92 @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r
93 @param Tcp4State Pointer to the buffer to receive the current TCP\r
94 state.\r
95 @param Tcp4ConfigData Pointer to the buffer to receive the current TCP\r
96 configuration.\r
d1102dba 97 @param Ip4ModeData Pointer to the buffer to receive the current IPv4\r
dfc1f033 98 configuration data used by the TCPv4 instance.\r
99 @param MnpConfigData Pointer to the buffer to receive the current MNP\r
100 configuration data indirectly used by the TCPv4\r
101 Instance.\r
102 @param SnpModeData Pointer to the buffer to receive the current SNP\r
103 configuration data indirectly used by the TCPv4\r
104 Instance.\r
105\r
106 @retval EFI_SUCCESS The mode data was read.\r
107 @retval EFI_NOT_STARTED No configuration data is available because this\r
108 instance hasn't been started.\r
109 @retval EFI_INVALID_PARAMETER This is NULL.\r
110\r
111**/\r
83cbd279 112EFI_STATUS\r
113EFIAPI\r
114Tcp4GetModeData (\r
db0f0d3c 115 IN EFI_TCP4_PROTOCOL *This,\r
116 OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL,\r
117 OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL,\r
118 OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,\r
119 OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r
120 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r
83cbd279 121 );\r
122\r
dfc1f033 123\r
124/**\r
125 Initialize or brutally reset the operational parameters for\r
126 this EFI TCPv4 instance.\r
d1102dba 127\r
dfc1f033 128 The Configure() function does the following:\r
d1102dba 129 * Initialize this EFI TCPv4 instance, i.e., initialize the communication end\r
dfc1f033 130 setting, specify active open or passive open for an instance.\r
d1102dba
LG
131 * Reset this TCPv4 instance brutally, i.e., cancel all pending asynchronous\r
132 tokens, flush transmission and receiving buffer directly without informing\r
dfc1f033 133 the communication peer.\r
d1102dba
LG
134 No other TCPv4 Protocol operation can be executed by this instance\r
135 until it is configured properly. For an active TCP4 instance, after a proper\r
136 configuration it may call Connect() to initiates the three-way handshake.\r
137 For a passive TCP4 instance, its state will transit to Tcp4StateListen after\r
138 configuration, and Accept() may be called to listen the incoming TCP connection\r
139 request. If TcpConfigData is set to NULL, the instance is reset. Resetting\r
140 process will be done brutally, the state machine will be set to Tcp4StateClosed\r
141 directly, the receive queue and transmit queue will be flushed, and no traffic is\r
dfc1f033 142 allowed through this instance.\r
143\r
144 @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r
145 @param TcpConfigData Pointer to the configure data to configure the\r
146 instance.\r
147\r
148 @retval EFI_SUCCESS The operational settings are set, changed, or\r
149 reset successfully.\r
150 @retval EFI_NO_MAPPING When using a default address, configuration\r
151 (through DHCP, BOOTP, RARP, etc.) is not\r
152 finished.\r
153 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
154 @retval EFI_ACCESS_DENIED Configuring TCP instance when it is already\r
155 configured.\r
156 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r
157 @retval EFI_UNSUPPORTED One or more of the control options are not\r
158 supported in the implementation.\r
159 @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources.\r
160\r
161**/\r
83cbd279 162EFI_STATUS\r
163EFIAPI\r
164Tcp4Configure (\r
85511ddf 165 IN EFI_TCP4_PROTOCOL *This,\r
dfc1f033 166 IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL\r
83cbd279 167 );\r
168\r
dfc1f033 169/**\r
170 Add or delete routing entries.\r
d1102dba 171\r
dfc1f033 172 The Routes() function adds or deletes a route from the instance's routing table.\r
d1102dba 173 The most specific route is selected by comparing the SubnetAddress with the\r
dfc1f033 174 destination IP address's arithmetical AND to the SubnetMask.\r
d1102dba 175 The default route is added with both SubnetAddress and SubnetMask set to 0.0.0.0.\r
dfc1f033 176 The default route matches all destination IP addresses if there is no more specific route.\r
d1102dba
LG
177 Direct route is added with GatewayAddress set to 0.0.0.0. Packets are sent to\r
178 the destination host if its address can be found in the Address Resolution Protocol (ARP)\r
179 cache or it is on the local subnet. If the instance is configured to use default\r
dfc1f033 180 address, a direct route to the local network will be added automatically.\r
d1102dba
LG
181 Each TCP instance has its own independent routing table. Instance that uses the\r
182 default IP address will have a copy of the EFI_IP4_CONFIG_PROTOCOL's routing table.\r
183 The copy will be updated automatically whenever the IP driver reconfigures its\r
184 instance. As a result, the previous modification to the instance's local copy\r
185 will be lost. The priority of checking the route table is specific with IP\r
dfc1f033 186 implementation and every IP implementation must comply with RFC 1122.\r
187\r
188 @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r
189 @param DeleteRoute If TRUE, delete the specified route from routing\r
190 table; if FALSE, add the specified route to\r
191 routing table.\r
d1102dba 192 DestinationAddress and SubnetMask are used as\r
dfc1f033 193 the keywords to search route entry.\r
194 @param SubnetAddress The destination network.\r
195 @param SubnetMask The subnet mask for the destination network.\r
d1102dba
LG
196 @param GatewayAddress The gateway address for this route.\r
197 It must be on the same subnet with the station\r
dfc1f033 198 address unless a direct route is specified.\r
d1102dba 199\r
dfc1f033 200 @retval EFI_SUCCESS The operation completed successfully.\r
201 @retval EFI_NOT_STARTED The EFI_TCP4_PROTOCOL instance has not been\r
202 configured.\r
203 @retval EFI_NO_MAPPING When using a default address, configuration\r
204 (through DHCP, BOOTP, RARP, etc.) is not\r
205 finished.\r
206 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
207 @retval EFI_OUT_OF_RESOURCES Could not allocate enough resources to add the\r
208 entry to the routing table.\r
209 @retval EFI_NOT_FOUND This route is not in the routing table.\r
210 @retval EFI_ACCESS_DENIED This route is already in the routing table.\r
211 @retval EFI_UNSUPPORTED The TCP driver does not support this operation.\r
212\r
213**/\r
83cbd279 214EFI_STATUS\r
215EFIAPI\r
216Tcp4Routes (\r
217 IN EFI_TCP4_PROTOCOL *This,\r
218 IN BOOLEAN DeleteRoute,\r
219 IN EFI_IPv4_ADDRESS *SubnetAddress,\r
220 IN EFI_IPv4_ADDRESS *SubnetMask,\r
221 IN EFI_IPv4_ADDRESS *GatewayAddress\r
222 );\r
223\r
dfc1f033 224/**\r
225 Initiate a nonblocking TCP connection request for an active TCP instance.\r
226\r
d1102dba
LG
227 The Connect() function will initiate an active open to the remote peer configured\r
228 in current TCP instance if it is configured active. If the connection succeeds\r
229 or fails due to any error, the ConnectionToken->CompletionToken.Event will be\r
230 signaled and ConnectionToken->CompletionToken.Status will be updated accordingly.\r
231 This function can only be called for the TCP instance in Tcp4StateClosed state.\r
232 The instance will transfer into Tcp4StateSynSent if the function returns EFI_SUCCESS.\r
233 If TCP three way handshake succeeds, its state will become Tcp4StateEstablished,\r
dfc1f033 234 otherwise, the state will return to Tcp4StateClosed.\r
d1102dba 235\r
dfc1f033 236 @param This Pointer to the EFI_TCP4_PROTOCOL instance\r
237 @param ConnectionToken Pointer to the connection token to return when\r
238 the TCP three way handshake finishes.\r
239\r
d1102dba
LG
240 @retval EFI_SUCCESS The connection request is successfully initiated\r
241 and the state of this TCPv4 instance has\r
dfc1f033 242 been changed to Tcp4StateSynSent.\r
243 @retval EFI_NOT_STARTED This EFI_TCP4_PROTOCOL instance hasn't been\r
244 configured.\r
245 @retval EFI_ACCESS_DENIED The instance is not configured as an active one\r
246 or it is not in Tcp4StateClosed state.\r
247 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
248 @retval EFI_OUT_OF_RESOURCES The driver can't allocate enough resource to\r
249 initiate the active open.\r
250 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
251\r
252**/\r
83cbd279 253EFI_STATUS\r
254EFIAPI\r
255Tcp4Connect (\r
256 IN EFI_TCP4_PROTOCOL *This,\r
257 IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken\r
258 );\r
259\r
dfc1f033 260/**\r
261 Listen on the passive instance to accept an incoming connection request.\r
262\r
d1102dba
LG
263 The Accept() function initiates an asynchronous accept request to wait for an\r
264 incoming connection on the passive TCP instance. If a remote peer successfully\r
265 establishes a connection with this instance, a new TCP instance will be created\r
266 and its handle will be returned in ListenToken->NewChildHandle. The newly created\r
267 instance is configured by inheriting the passive instance's configuration and is\r
dfc1f033 268 ready for use upon return. The instance is in the Tcp4StateEstablished state.\r
d1102dba
LG
269 The ListenToken->CompletionToken.Event will be signaled when a new connection\r
270 is accepted, user aborts the listen or connection is reset. This function only\r
dfc1f033 271 can be called when current TCP instance is in Tcp4StateListen state.\r
272\r
273 @param This Pointer to the EFI_TCP4_PROTOCOL instance\r
274 @param ListenToken Pointer to the listen token to return when\r
275 operation finishes.\r
276\r
277 @retval EFI_SUCCESS The listen token has been queued successfully.\r
278 @retval EFI_NOT_STARTED The EFI_TCP4_PROTOCOL instance hasn't been\r
279 configured.\r
280 @retval EFI_ACCESS_DENIED The instatnce is not a passive one or it is not\r
281 in Tcp4StateListen state or a same listen token\r
282 has already existed in the listen token queue of\r
283 this TCP instance.\r
284 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
285 @retval EFI_OUT_OF_RESOURCES Could not allocate enough resources to finish\r
286 the operation.\r
287 @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.\r
288\r
289**/\r
83cbd279 290EFI_STATUS\r
291EFIAPI\r
292Tcp4Accept (\r
293 IN EFI_TCP4_PROTOCOL *This,\r
294 IN EFI_TCP4_LISTEN_TOKEN *ListenToken\r
295 );\r
296\r
dfc1f033 297/**\r
298 Queues outgoing data into the transmit queue.\r
299\r
d1102dba
LG
300 The Transmit() function queues a sending request to this TCPv4 instance along\r
301 with the user data. The status of the token is updated and the event in the token\r
dfc1f033 302 will be signaled once the data is sent out or some error occurs.\r
303\r
304 @param This Pointer to the EFI_TCP4_PROTOCOL instance\r
305 @param Token Pointer to the completion token to queue to the\r
306 transmit queue\r
307\r
308 @retval EFI_SUCCESS The data has been queued for transmission.\r
309 @retval EFI_NOT_STARTED The EFI_TCP4_PROTOCOL instance hasn't been\r
310 configured.\r
311 @retval EFI_NO_MAPPING When using a default address, configuration\r
312 (DHCP, BOOTP, RARP, etc.) is not finished yet.\r
313 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
314 @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:\r
315 * A transmit completion token with the same\r
316 Token-> CompletionToken.Event was already in the\r
d1102dba
LG
317 transmission queue.\r
318 * The current instance is in Tcp4StateClosed state\r
319 * The current instance is a passive one and\r
320 it is in Tcp4StateListen state.\r
321 * User has called Close() to disconnect this\r
dfc1f033 322 connection.\r
323 @retval EFI_NOT_READY The completion token could not be queued because\r
324 the transmit queue is full.\r
325 @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data because of\r
326 resource shortage.\r
327 @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or\r
328 address.\r
329\r
330**/\r
83cbd279 331EFI_STATUS\r
332EFIAPI\r
333Tcp4Transmit (\r
334 IN EFI_TCP4_PROTOCOL *This,\r
335 IN EFI_TCP4_IO_TOKEN *Token\r
336 );\r
337\r
dfc1f033 338/**\r
339 Place an asynchronous receive request into the receiving queue.\r
340\r
d1102dba
LG
341 The Receive() function places a completion token into the receive packet queue.\r
342 This function is always asynchronous. The caller must allocate the\r
343 Token->CompletionToken.Event and the FragmentBuffer used to receive data. He also\r
344 must fill the DataLength which represents the whole length of all FragmentBuffer.\r
345 When the receive operation completes, the EFI TCPv4 Protocol driver updates the\r
346 Token->CompletionToken.Status and Token->Packet.RxData fields and the\r
347 Token->CompletionToken.Event is signaled. If got data the data and its length\r
348 will be copy into the FragmentTable, in the same time the full length of received\r
349 data will be recorded in the DataLength fields. Providing a proper notification\r
350 function and context for the event will enable the user to receive the notification\r
dfc1f033 351 and receiving status. That notification function is guaranteed to not be re-entered.\r
352\r
353 @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r
354 @param Token Pointer to a token that is associated with the\r
355 receive data descriptor.\r
356\r
357 @retval EFI_SUCCESS The receive completion token was cached.\r
358 @retval EFI_NOT_STARTED The EFI_TCP4_PROTOCOL instance hasn't been\r
359 configured.\r
360 @retval EFI_NO_MAPPING When using a default address, configuration\r
361 (DHCP, BOOTP, RARP, etc.) is not finished yet.\r
362 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
363 @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued\r
364 due to a lack of system resources.\r
365 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
d1102dba 366 The EFI TCPv4 Protocol instance has been reset\r
dfc1f033 367 to startup defaults.\r
368 @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:\r
369 * A receive completion token with the same\r
d1102dba
LG
370 Token->CompletionToken.Event was already in\r
371 the receive queue.\r
372 * The current instance is in Tcp4StateClosed state.\r
373 * The current instance is a passive one and it\r
374 is in Tcp4StateListen state.\r
375 * User has called Close() to disconnect this\r
dfc1f033 376 connection.\r
377 @retval EFI_CONNECTION_FIN The communication peer has closed the connection\r
378 and there is no any buffered data in the receive\r
379 buffer of this instance.\r
380 @retval EFI_NOT_READY The receive request could not be queued because\r
381 the receive queue is full.\r
382\r
383**/\r
83cbd279 384EFI_STATUS\r
85511ddf 385EFIAPI\r
83cbd279 386Tcp4Receive (\r
387 IN EFI_TCP4_PROTOCOL *This,\r
388 IN EFI_TCP4_IO_TOKEN *Token\r
389 );\r
390\r
dfc1f033 391/**\r
392 Disconnecting a TCP connection gracefully or reset a TCP connection.\r
393\r
d1102dba
LG
394 Initiate an asynchronous close token to TCP driver. After Close() is called,\r
395 any buffered transmission data will be sent by TCP driver and the current\r
396 instance will have a graceful close working flow described as RFC 793 if\r
397 AbortOnClose is set to FALSE, otherwise, a rest packet will be sent by TCP\r
398 driver to fast disconnect this connection. When the close operation completes\r
399 successfully the TCP instance is in Tcp4StateClosed state, all pending\r
400 asynchronous operation is signaled and any buffers used for TCP network traffic\r
dfc1f033 401 is flushed.\r
402\r
403 @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r
404 @param CloseToken Pointer to the close token to return when\r
405 operation finishes.\r
406\r
407 @retval EFI_SUCCESS The operation completed successfully.\r
408 @retval EFI_NOT_STARTED The EFI_TCP4_PROTOCOL instance hasn't been\r
409 configured.\r
d1102dba 410 @retval EFI_ACCESS_DENIED One or more of the following are TRUE:\r
dfc1f033 411 * Configure() has been called with TcpConfigData\r
412 set to NULL and this function has not returned.\r
413 * Previous Close() call on this instance has not\r
414 finished.\r
415 @retval EFI_INVALID_PARAMETER One ore more parameters are invalid.\r
416 @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the\r
417 operation.\r
418 @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above\r
419 category error.\r
420\r
421**/\r
83cbd279 422EFI_STATUS\r
423EFIAPI\r
424Tcp4Close (\r
425 IN EFI_TCP4_PROTOCOL *This,\r
426 IN EFI_TCP4_CLOSE_TOKEN *CloseToken\r
427 );\r
428\r
dfc1f033 429/**\r
430 Abort an asynchronous connection, listen, transmission or receive request.\r
431\r
d1102dba
LG
432 The Cancel() function aborts a pending connection, listen, transmit or receive\r
433 request. If Token is not NULL and the token is in the connection, listen,\r
434 transmission or receive queue when it is being cancelled, its Token->Status\r
435 will be set to EFI_ABORTED and then Token->Event will be signaled. If the token\r
436 is not in one of the queues, which usually means that the asynchronous operation\r
437 has completed, EFI_NOT_FOUND is returned. If Token is NULL all asynchronous token\r
dfc1f033 438 issued by Connect(), Accept(), Transmit() and Receive()will be aborted.\r
439 NOTE: It has not been implemented currently.\r
d1102dba 440\r
dfc1f033 441 @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r
442 @param Token Pointer to a token that has been issued by\r
443 Connect(), Accept(), Transmit() or Receive(). If\r
444 NULL, all pending tokens issued by above four\r
445 functions will be aborted.\r
d1102dba 446\r
dfc1f033 447 @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event\r
448 is signaled.\r
449 @retval EFI_INVALID_PARAMETER This is NULL.\r
450 @retval EFI_NOT_STARTED This instance hasn's been configured.\r
451 @retval EFI_NO_MAPPING When using the default address, configuration\r
452 (DHCP, BOOTP,RARP, etc.) hasn's finished yet.\r
d1102dba
LG
453 @retval EFI_NOT_FOUND The asynchronous I/O request isn's found in the\r
454 transmission or receive queue. It has either\r
dfc1f033 455 completed or wasn's issued by Transmit() and Receive().\r
456 @retval EFI_UNSUPPORTED The operation is not supported in current\r
457 implementation.\r
d1102dba 458\r
dfc1f033 459**/\r
83cbd279 460EFI_STATUS\r
461EFIAPI\r
462Tcp4Cancel (\r
85511ddf 463 IN EFI_TCP4_PROTOCOL *This,\r
dfc1f033 464 IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL\r
83cbd279 465 );\r
466\r
dfc1f033 467/**\r
468 Poll to receive incoming data and transmit outgoing segments.\r
469\r
d1102dba
LG
470 The Poll() function increases the rate that data is moved between the network\r
471 and application and can be called when the TCP instance is created successfully.\r
472 Its use is optional. In some implementations, the periodical timer in the MNP\r
473 driver may not poll the underlying communications device fast enough to avoid\r
474 drop packets. Drivers and applications that are experiencing packet loss should\r
dfc1f033 475 try calling the Poll() function in a high frequency.\r
476\r
477 @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r
478\r
479 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
480 @retval EFI_INVALID_PARAMETER This is NULL.\r
481 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
482 @retval EFI_NOT_READY No incoming or outgoing data was processed.\r
483 @retval EFI_TIMEOUT Data was dropped out of the transmission or\r
484 receive queue. Consider increasing the polling\r
485 rate.\r
486\r
487**/\r
83cbd279 488EFI_STATUS\r
489EFIAPI\r
490Tcp4Poll (\r
491 IN EFI_TCP4_PROTOCOL *This\r
492 );\r
493\r
494#endif\r