]>
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 |
5899caf0 | 16 | @par Revision Reference: \r |
17 | This Protocol is introduced in UEFI Specification 2.0\r | |
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 | |
36 | typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL;\r | |
37 | \r | |
38 | typedef 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 | |
46 | typedef 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 | |
52 | typedef 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 | |
62 | typedef 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 | |
80 | typedef 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 | 101 | typedef 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 | |
115 | typedef struct {\r | |
116 | EFI_EVENT Event;\r | |
117 | EFI_STATUS Status;\r | |
118 | } EFI_TCP4_COMPLETION_TOKEN;\r | |
119 | \r | |
120 | typedef struct {\r | |
121 | EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r | |
122 | } EFI_TCP4_CONNECTION_TOKEN;\r | |
123 | \r | |
124 | typedef struct {\r | |
125 | EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r | |
126 | EFI_HANDLE NewChildHandle;\r | |
127 | } EFI_TCP4_LISTEN_TOKEN;\r | |
128 | \r | |
129 | typedef struct {\r | |
d01c093a | 130 | UINT32 FragmentLength;\r |
131 | VOID *FragmentBuffer;\r | |
d1f95000 | 132 | } EFI_TCP4_FRAGMENT_DATA;\r |
133 | \r | |
134 | typedef struct {\r | |
135 | BOOLEAN UrgentFlag;\r | |
d01c093a | 136 | UINT32 DataLength;\r |
137 | UINT32 FragmentCount;\r | |
d1f95000 | 138 | EFI_TCP4_FRAGMENT_DATA FragmentTable[1];\r |
d01c093a | 139 | } EFI_TCP4_RECEIVE_DATA;\r |
d1f95000 | 140 | \r |
d01c093a | 141 | typedef struct {\r |
d1f95000 | 142 | BOOLEAN Push;\r |
143 | BOOLEAN Urgent;\r | |
d01c093a | 144 | UINT32 DataLength;\r |
145 | UINT32 FragmentCount;\r | |
d1f95000 | 146 | EFI_TCP4_FRAGMENT_DATA FragmentTable[1];\r |
147 | } EFI_TCP4_TRANSMIT_DATA;\r | |
148 | \r | |
149 | typedef struct {\r | |
150 | EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r | |
151 | union {\r | |
152 | EFI_TCP4_RECEIVE_DATA *RxData;\r | |
153 | EFI_TCP4_TRANSMIT_DATA *TxData;\r | |
154 | } Packet;\r | |
155 | } EFI_TCP4_IO_TOKEN;\r | |
156 | \r | |
157 | typedef struct {\r | |
158 | EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r | |
159 | BOOLEAN AbortOnClose;\r | |
160 | } EFI_TCP4_CLOSE_TOKEN;\r | |
161 | \r | |
162 | //\r | |
163 | // Interface definition for TCP4 protocol\r | |
164 | //\r | |
165 | \r | |
166 | /**\r | |
167 | Get the current operational status.\r | |
168 | \r | |
169 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
170 | @param Tcp4State Pointer to the buffer to receive the current TCP state.\r | |
171 | @param Tcp4ConfigData Pointer to the buffer to receive the current TCP configuration.\r | |
172 | @param Ip4ModeData Pointer to the buffer to receive the current IPv4 configuration\r | |
173 | data used by the TCPv4 instance.\r | |
174 | @param MnpConfigData Pointer to the buffer to receive the current MNP configuration\r | |
175 | data used indirectly by the TCPv4 instance.\r | |
176 | @param SnpModeData Pointer to the buffer to receive the current SNP configuration\r | |
177 | data used indirectly by the TCPv4 instance.\r | |
178 | \r | |
179 | @retval EFI_SUCCESS The mode data was read.\r | |
180 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
181 | @retval EFI_NOT_STARTED No configuration data is available because this instance hasn't\r | |
182 | been started.\r | |
183 | \r | |
184 | **/\r | |
185 | typedef\r | |
186 | EFI_STATUS\r | |
8b13229b | 187 | (EFIAPI *EFI_TCP4_GET_MODE_DATA)(\r |
d1f95000 | 188 | IN CONST EFI_TCP4_PROTOCOL *This,\r |
189 | OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL,\r | |
190 | OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL,\r | |
191 | OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,\r | |
192 | OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r | |
193 | OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r | |
ed66e1bc | 194 | );\r |
d01c093a | 195 | \r |
d1f95000 | 196 | /**\r |
197 | Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.\r | |
198 | \r | |
199 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
200 | @param Tcp4ConfigData Pointer to the configure data to configure the instance.\r | |
201 | \r | |
202 | @retval EFI_SUCCESS The operational settings are set, changed, or reset\r | |
203 | successfully.\r | |
204 | @retval EFI_INVALID_PARAMETER Some parameter is invalid.\r | |
205 | @retval EFI_NO_MAPPING When using a default address, configuration (through\r | |
206 | DHCP, BOOTP, RARP, etc.) is not finished yet.\r | |
207 | @retval EFI_ACCESS_DENIED Configuring TCP instance when it is configured without\r | |
208 | calling Configure() with NULL to reset it.\r | |
209 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
210 | @retval EFI_UNSUPPORTED One or more of the control options are not supported in\r | |
211 | the implementation.\r | |
212 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when\r | |
213 | executing Configure().\r | |
214 | \r | |
215 | **/\r | |
216 | typedef\r | |
217 | EFI_STATUS\r | |
8b13229b | 218 | (EFIAPI *EFI_TCP4_CONFIGURE)(\r |
d1f95000 | 219 | IN EFI_TCP4_PROTOCOL *This,\r |
220 | IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL\r | |
ed66e1bc | 221 | );\r |
d01c093a | 222 | \r |
d1f95000 | 223 | \r |
224 | /**\r | |
225 | Add or delete a route entry to the route table\r | |
226 | \r | |
227 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
228 | @param DeleteRoute Set it to TRUE to delete this route from the routing table. Set it to\r | |
229 | FALSE to add this route to the routing table.\r | |
230 | DestinationAddress and SubnetMask are used as the\r | |
231 | keywords to search route entry.\r | |
232 | @param SubnetAddress The destination network.\r | |
233 | @param SubnetMask The subnet mask of the destination network.\r | |
234 | @param GatewayAddress The gateway address for this route. It must be on the same\r | |
235 | subnet with the station address unless a direct route is specified.\r | |
236 | \r | |
237 | @retval EFI_SUCCESS The operation completed successfully.\r | |
238 | @retval EFI_NOT_STARTED The EFI TCPv4 Protocol instance has not been configured.\r | |
239 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r | |
240 | RARP, etc.) is not finished yet.\r | |
241 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
242 | - This is NULL.\r | |
243 | - SubnetAddress is NULL.\r | |
244 | - SubnetMask is NULL.\r | |
245 | - GatewayAddress is NULL.\r | |
246 | - *SubnetAddress is not NULL a valid subnet address.\r | |
247 | - *SubnetMask is not a valid subnet mask.\r | |
248 | - *GatewayAddress is not a valid unicast IP address or it\r | |
249 | is not in the same subnet.\r | |
250 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resources to add the entry to the\r | |
251 | routing table.\r | |
252 | @retval EFI_NOT_FOUND This route is not in the routing table.\r | |
253 | @retval EFI_ACCESS_DENIED The route is already defined in the routing table.\r | |
254 | @retval EFI_UNSUPPORTED The TCP driver does not support this operation.\r | |
255 | \r | |
256 | **/\r | |
257 | typedef\r | |
258 | EFI_STATUS\r | |
8b13229b | 259 | (EFIAPI *EFI_TCP4_ROUTES)(\r |
d1f95000 | 260 | IN EFI_TCP4_PROTOCOL *This,\r |
261 | IN BOOLEAN DeleteRoute,\r | |
262 | IN EFI_IPv4_ADDRESS *SubnetAddress,\r | |
263 | IN EFI_IPv4_ADDRESS *SubnetMask,\r | |
264 | IN EFI_IPv4_ADDRESS *GatewayAddress\r | |
ed66e1bc | 265 | );\r |
d1f95000 | 266 | \r |
267 | /**\r | |
268 | Initiate a nonblocking TCP connection request for an active TCP instance.\r | |
269 | \r | |
270 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
271 | @param ConnectionToken Pointer to the connection token to return when the TCP three\r | |
272 | way handshake finishes.\r | |
d01c093a | 273 | \r |
d1f95000 | 274 | @retval EFI_SUCCESS The connection request is successfully initiated and the state\r |
bdb140d7 | 275 | of this TCPv4 instance has been changed to Tcp4StateSynSent.\r |
d1f95000 | 276 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r |
277 | @retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE:\r | |
278 | - This instance is not configured as an active one.\r | |
279 | - This instance is not in Tcp4StateClosed state.\r | |
280 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
281 | - This is NULL.\r | |
282 | - ConnectionToken is NULL.\r | |
283 | - ConnectionToken->CompletionToken.Event is NULL.\r | |
bdb140d7 | 284 | @retval EFI_OUT_OF_RESOURCES The driver can't allocate enough resource to initiate the activ eopen.\r |
d1f95000 | 285 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r |
286 | \r | |
287 | **/\r | |
288 | typedef\r | |
289 | EFI_STATUS\r | |
8b13229b | 290 | (EFIAPI *EFI_TCP4_CONNECT)(\r |
d1f95000 | 291 | IN EFI_TCP4_PROTOCOL *This,\r |
292 | IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken\r | |
ed66e1bc | 293 | );\r |
d01c093a | 294 | \r |
d1f95000 | 295 | \r |
296 | /**\r | |
297 | Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.\r | |
298 | \r | |
299 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
300 | @param ListenToken Pointer to the listen token to return when operation finishes.\r | |
301 | \r | |
302 | @retval EFI_SUCCESS The listen token has been queued successfully.\r | |
303 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r | |
304 | @retval EFI_ACCESS_DENIED One or more of the following are TRUE:\r | |
305 | - This instance is not a passive instance.\r | |
306 | - This instance is not in Tcp4StateListen state.\r | |
307 | - The same listen token has already existed in the listen\r | |
308 | token queue of this TCP instance.\r | |
309 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
310 | - This is NULL.\r | |
311 | - ListenToken is NULL.\r | |
312 | - ListentToken->CompletionToken.Event is NULL.\r | |
f754f721 | 313 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r |
314 | @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.\r | |
d1f95000 | 315 | \r |
316 | **/\r | |
317 | typedef\r | |
318 | EFI_STATUS\r | |
8b13229b | 319 | (EFIAPI *EFI_TCP4_ACCEPT)(\r |
d1f95000 | 320 | IN EFI_TCP4_PROTOCOL *This,\r |
321 | IN EFI_TCP4_LISTEN_TOKEN *ListenToken\r | |
ed66e1bc | 322 | );\r |
d1f95000 | 323 | \r |
324 | /**\r | |
325 | Queues outgoing data into the transmit queue.\r | |
326 | \r | |
327 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
328 | @param Token Pointer to the completion token to queue to the transmit queue.\r | |
329 | \r | |
330 | @retval EFI_SUCCESS The data has been queued for transmission.\r | |
331 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r | |
332 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r | |
333 | RARP, etc.) is not finished yet.\r | |
334 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
335 | - This is NULL.\r | |
336 | - Token is NULL.\r | |
337 | - Token->CompletionToken.Event is NULL.\r | |
338 | - Token->Packet.TxData is NULL L.\r | |
339 | - Token->Packet.FragmentCount is zero.\r | |
340 | - Token->Packet.DataLength is not equal to the sum of fragment lengths.\r | |
341 | @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:\r | |
342 | - A transmit completion token with the same Token->CompletionToken.Event\r | |
343 | was already in the transmission queue.\r | |
344 | - The current instance is in Tcp4StateClosed state.\r | |
345 | - The current instance is a passive one and it is in\r | |
346 | Tcp4StateListen state.\r | |
347 | - User has called Close() to disconnect this connection.\r | |
348 | @retval EFI_NOT_READY The completion token could not be queued because the\r | |
349 | transmit queue is full.\r | |
350 | @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data because of resource\r | |
351 | shortage.\r | |
352 | @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.\r | |
353 | \r | |
354 | **/\r | |
355 | typedef\r | |
356 | EFI_STATUS\r | |
8b13229b | 357 | (EFIAPI *EFI_TCP4_TRANSMIT)(\r |
d1f95000 | 358 | IN EFI_TCP4_PROTOCOL *This,\r |
359 | IN EFI_TCP4_IO_TOKEN *Token\r | |
ed66e1bc | 360 | );\r |
d1f95000 | 361 | \r |
362 | \r | |
363 | /**\r | |
364 | Places an asynchronous receive request into the receiving queue.\r | |
365 | \r | |
366 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
367 | @param Token Pointer to a token that is associated with the receive data\r | |
368 | descriptor.\r | |
369 | \r | |
370 | @retval EFI_SUCCESS The receive completion token was cached.\r | |
371 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r | |
372 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP,\r | |
373 | etc.) is not finished yet.\r | |
374 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
375 | - This is NULL.\r | |
376 | - Token is NULL.\r | |
377 | - Token->CompletionToken.Event is NULL.\r | |
378 | - Token->Packet.RxData is NULL.\r | |
379 | - Token->Packet.RxData->DataLength is 0.\r | |
380 | - The Token->Packet.RxData->DataLength is not\r | |
381 | the sum of all FragmentBuffer length in FragmentTable.\r | |
382 | @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of\r | |
383 | system resources (usually memory).\r | |
384 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
385 | @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:\r | |
386 | - A receive completion token with the same Token-\r | |
387 | >CompletionToken.Event was already in the receive\r | |
388 | queue.\r | |
389 | - The current instance is in Tcp4StateClosed state.\r | |
390 | - The current instance is a passive one and it is in\r | |
391 | Tcp4StateListen state.\r | |
392 | - User has called Close() to disconnect this connection.\r | |
393 | @retval EFI_CONNECTION_FIN The communication peer has closed the connection and there is\r | |
f754f721 | 394 | no any buffered data in the receive buffer of this instance.\r |
d1f95000 | 395 | @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.\r |
396 | \r | |
397 | **/\r | |
398 | typedef\r | |
399 | EFI_STATUS\r | |
8b13229b | 400 | (EFIAPI *EFI_TCP4_RECEIVE)(\r |
d1f95000 | 401 | IN EFI_TCP4_PROTOCOL *This,\r |
402 | IN EFI_TCP4_IO_TOKEN *Token\r | |
ed66e1bc | 403 | );\r |
d01c093a | 404 | \r |
d1f95000 | 405 | /**\r |
406 | Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a\r | |
d01c093a | 407 | nonblocking operation.\r |
d1f95000 | 408 | \r |
409 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
410 | @param CloseToken Pointer to the close token to return when operation finishes.\r | |
411 | \r | |
412 | @retval EFI_SUCCESS The Close() is called successfully.\r | |
413 | @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.\r | |
414 | @retval EFI_ACCESS_DENIED One or more of the following are TRUE:\r | |
415 | - Configure() has been called with\r | |
416 | TcpConfigData set to NULL and this function has\r | |
417 | not returned.\r | |
418 | - Previous Close() call on this instance has not\r | |
419 | finished.\r | |
420 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
421 | - This is NULL.\r | |
422 | - CloseToken is NULL.\r | |
423 | - CloseToken->CompletionToken.Event is NULL.\r | |
f754f721 | 424 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r |
425 | @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.\r | |
d1f95000 | 426 | \r |
427 | **/\r | |
428 | typedef\r | |
429 | EFI_STATUS\r | |
8b13229b | 430 | (EFIAPI *EFI_TCP4_CLOSE)(\r |
d1f95000 | 431 | IN EFI_TCP4_PROTOCOL *This,\r |
432 | IN EFI_TCP4_CLOSE_TOKEN *CloseToken\r | |
ed66e1bc | 433 | );\r |
d1f95000 | 434 | \r |
435 | /**\r | |
436 | Abort an asynchronous connection, listen, transmission or receive request.\r | |
437 | \r | |
438 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
439 | @param Token Pointer to a token that has been issued by\r | |
440 | EFI_TCP4_PROTOCOL.Connect(),\r | |
441 | EFI_TCP4_PROTOCOL.Accept(),\r | |
442 | EFI_TCP4_PROTOCOL.Transmit() or\r | |
443 | EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending\r | |
444 | tokens issued by above four functions will be aborted. Type\r | |
445 | EFI_TCP4_COMPLETION_TOKEN is defined in\r | |
446 | EFI_TCP4_PROTOCOL.Connect().\r | |
447 | \r | |
bdb140d7 | 448 | @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event\r |
449 | is signaled.\r | |
450 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
451 | @retval EFI_NOT_STARTED This instance hasn't been configured.\r | |
452 | @retval EFI_NO_MAPPING When using the default address, configuration\r | |
453 | (DHCP, BOOTP,RARP, etc.) hasn't finished yet.\r | |
454 | @retval EFI_NOT_FOUND The asynchronous I/O request isn't found in the \r | |
455 | transmission or receive queue. It has either \r | |
456 | completed or wasn't issued by Transmit() and Receive().\r | |
d1f95000 | 457 | \r |
458 | **/\r | |
459 | typedef\r | |
460 | EFI_STATUS\r | |
8b13229b | 461 | (EFIAPI *EFI_TCP4_CANCEL)(\r |
d1f95000 | 462 | IN EFI_TCP4_PROTOCOL *This,\r |
463 | IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL\r | |
ed66e1bc | 464 | );\r |
d1f95000 | 465 | \r |
466 | \r | |
467 | /**\r | |
468 | Poll to receive incoming data and transmit outgoing segments.\r | |
469 | \r | |
470 | @param This Pointer to the EFI_TCP4_PROTOCOL instance.\r | |
471 | \r | |
472 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
473 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
474 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
475 | @retval EFI_NOT_READY No incoming or outgoing data is processed.\r | |
476 | @retval EFI_TIMEOUT Data was dropped out of the transmission or receive queue.\r | |
477 | Consider increasing the polling rate.\r | |
478 | \r | |
479 | **/\r | |
480 | typedef\r | |
481 | EFI_STATUS\r | |
8b13229b | 482 | (EFIAPI *EFI_TCP4_POLL)(\r |
d1f95000 | 483 | IN EFI_TCP4_PROTOCOL *This\r |
ed66e1bc | 484 | );\r |
d1f95000 | 485 | \r |
44717a39 | 486 | ///\r |
487 | /// The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by \r | |
488 | /// any network drivers or applications to send or receive data stream. \r | |
489 | /// It can either listen on a specified port as a service or actively connected \r | |
490 | /// to remote peer as a client. Each instance has its own independent settings, \r | |
491 | /// such as the routing table.\r | |
492 | ///\r | |
d1f95000 | 493 | struct _EFI_TCP4_PROTOCOL {\r |
494 | EFI_TCP4_GET_MODE_DATA GetModeData;\r | |
495 | EFI_TCP4_CONFIGURE Configure;\r | |
496 | EFI_TCP4_ROUTES Routes;\r | |
497 | EFI_TCP4_CONNECT Connect;\r | |
498 | EFI_TCP4_ACCEPT Accept;\r | |
499 | EFI_TCP4_TRANSMIT Transmit;\r | |
500 | EFI_TCP4_RECEIVE Receive;\r | |
501 | EFI_TCP4_CLOSE Close;\r | |
502 | EFI_TCP4_CANCEL Cancel;\r | |
503 | EFI_TCP4_POLL Poll;\r | |
504 | };\r | |
505 | \r | |
d1f95000 | 506 | extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid;\r |
507 | extern EFI_GUID gEfiTcp4ProtocolGuid;\r | |
508 | \r | |
509 | #endif\r |