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