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