]>
Commit | Line | Data |
---|---|---|
bdb140d7 | 1 | /** @file\r |
2 | EFI TCPv6(Transmission Control Protocol version 6) Protocol Definition\r | |
3 | The EFI TCPv6 Service Binding Protocol is used to locate EFI TCPv6 Protocol drivers to create\r | |
4 | and destroy child of the driver to communicate with other host using TCP protocol.\r | |
5 | The EFI TCPv6 Protocol provides services to send and receive data stream.\r | |
6 | \r | |
7 | Copyright (c) 2008 - 2009, Intel Corporation\r | |
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 | |
12 | \r | |
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 | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __EFI_TCP6_PROTOCOL_H__\r | |
19 | #define __EFI_TCP6_PROTOCOL_H__\r | |
20 | \r | |
bdb140d7 | 21 | #include <Protocol/ManagedNetwork.h>\r |
22 | #include <Protocol/Ip6.h>\r | |
23 | \r | |
24 | #define EFI_TCP6_SERVICE_BINDING_PROTOCOL_GUID \\r | |
25 | { \\r | |
26 | 0xec20eb79, 0x6c1a, 0x4664, {0x9a, 0x0d, 0xd2, 0xe4, 0xcc, 0x16, 0xd6, 0x64 } \\r | |
27 | }\r | |
28 | \r | |
29 | #define EFI_TCP6_PROTOCOL_GUID \\r | |
30 | { \\r | |
31 | 0x46e44855, 0xbd60, 0x4ab7, {0xab, 0x0d, 0xa6, 0x79, 0xb9, 0x44, 0x7d, 0x77 } \\r | |
32 | }\r | |
33 | \r | |
34 | \r | |
35 | typedef struct _EFI_TCP6_PROTOCOL EFI_TCP6_PROTOCOL;\r | |
36 | \r | |
bdb140d7 | 37 | ///\r |
38 | /// EFI_TCP6_SERVICE_POINT\r | |
39 | ///\r | |
40 | typedef struct {\r | |
41 | ///\r | |
42 | /// The EFI TCPv6 Protocol instance handle that is using this \r | |
43 | /// address/port pair.\r | |
44 | ///\r | |
45 | EFI_HANDLE InstanceHandle;\r | |
46 | /// \r | |
47 | /// The local IPv6 address to which this TCP instance is bound. Set \r | |
48 | /// to 0::/128, if this TCP instance is configured to listen on all \r | |
49 | /// available source addresses.\r | |
50 | /// \r | |
51 | EFI_IPv6_ADDRESS LocalAddress;\r | |
52 | /// \r | |
53 | /// The local port number in host byte order.\r | |
54 | /// \r | |
55 | UINT16 LocalPort;\r | |
56 | /// \r | |
57 | /// The remote IPv6 address. It may be 0::/128 if this TCP instance is \r | |
58 | /// not connected to any remote host. \r | |
59 | /// \r | |
60 | EFI_IPv6_ADDRESS RemoteAddress;\r | |
61 | /// \r | |
62 | /// The remote port number in host byte order. It may be zero if this \r | |
63 | /// TCP instance is not connected to any remote host.\r | |
64 | /// \r | |
65 | UINT16 RemotePort;\r | |
66 | } EFI_TCP6_SERVICE_POINT;\r | |
67 | \r | |
68 | /// \r | |
69 | /// EFI_TCP6_VARIABLE_DATA\r | |
70 | ///\r | |
71 | typedef struct {\r | |
72 | EFI_HANDLE DriverHandle; ///< The handle of the driver that creates this entry.\r | |
73 | UINT32 ServiceCount; ///< The number of address/port pairs following this data structure.\r | |
74 | EFI_TCP6_SERVICE_POINT Services[1]; ///< List of address/port pairs that are currently in use.\r | |
75 | } EFI_TCP6_VARIABLE_DATA;\r | |
76 | \r | |
77 | ///\r | |
78 | /// EFI_TCP6_ACCESS_POINT\r | |
79 | ///\r | |
80 | typedef struct {\r | |
81 | /// \r | |
82 | /// The local IP address assigned to this TCP instance. The EFI \r | |
83 | /// TCPv6 driver will only deliver incoming packets whose \r | |
84 | /// destination addresses exactly match the IP address. Set to zero to \r | |
85 | /// let the underlying IPv6 driver choose a source address. If not zero \r | |
86 | /// it must be one of the configured IP addresses in the underlying \r | |
87 | /// IPv6 driver.\r | |
88 | /// \r | |
89 | EFI_IPv6_ADDRESS StationAddress;\r | |
90 | /// \r | |
91 | /// The local port number to which this EFI TCPv6 Protocol instance \r | |
92 | /// is bound. If the instance doesn't care the local port number, set \r | |
93 | /// StationPort to zero to use an ephemeral port.\r | |
94 | /// \r | |
95 | UINT16 StationPort;\r | |
96 | /// \r | |
97 | /// The remote IP address to which this EFI TCPv6 Protocol instance \r | |
98 | /// is connected. If ActiveFlag is FALSE (i.e. a passive TCPv6 \r | |
99 | /// instance), the instance only accepts connections from the \r | |
100 | /// RemoteAddress. If ActiveFlag is TRUE the instance will \r | |
101 | /// connect to the RemoteAddress, i.e., outgoing segments will be \r | |
102 | /// sent to this address and only segments from this address will be \r | |
103 | /// delivered to the application. When ActiveFlag is FALSE, it \r | |
104 | /// can be set to zero and means that incoming connection requests \r | |
105 | /// from any address will be accepted.\r | |
106 | /// \r | |
107 | EFI_IPv6_ADDRESS RemoteAddress;\r | |
108 | /// \r | |
109 | /// The remote port to which this EFI TCPv6 Protocol instance \r | |
110 | /// connects or from which connection request will be accepted by \r | |
111 | /// this EFI TCPv6 Protocol instance. If ActiveFlag is FALSE it \r | |
112 | /// can be zero and means that incoming connection request from \r | |
113 | /// any port will be accepted. Its value can not be zero when \r | |
114 | /// ActiveFlag is TRUE.\r | |
115 | /// \r | |
116 | UINT16 RemotePort;\r | |
117 | /// \r | |
118 | /// Set it to TRUE to initiate an active open. Set it to FALSE to \r | |
119 | /// initiate a passive open to act as a server.\r | |
120 | /// \r | |
121 | BOOLEAN ActiveFlag;\r | |
122 | } EFI_TCP6_ACCESS_POINT;\r | |
123 | \r | |
124 | ///\r | |
125 | /// EFI_TCP6_OPTION\r | |
126 | ///\r | |
127 | typedef struct {\r | |
128 | /// \r | |
129 | /// The size of the TCP receive buffer.\r | |
130 | /// \r | |
131 | UINT32 ReceiveBufferSize;\r | |
132 | /// \r | |
133 | /// The size of the TCP send buffer.\r | |
134 | /// \r | |
135 | UINT32 SendBufferSize;\r | |
136 | /// \r | |
137 | /// The length of incoming connect request queue for a passive \r | |
138 | /// instance. When set to zero, the value is implementation specific.\r | |
139 | /// \r | |
140 | UINT32 MaxSynBackLog;\r | |
141 | /// \r | |
142 | /// The maximum seconds a TCP instance will wait for before a TCP \r | |
143 | /// connection established. When set to zero, the value is \r | |
144 | /// implementation specific.\r | |
145 | /// \r | |
146 | UINT32 ConnectionTimeout;\r | |
147 | ///\r | |
148 | ///The number of times TCP will attempt to retransmit a packet on \r | |
149 | ///an established connection. When set to zero, the value is \r | |
150 | ///implementation specific.\r | |
151 | ///\r | |
152 | UINT32 DataRetries;\r | |
153 | /// \r | |
154 | /// How many seconds to wait in the FIN_WAIT_2 states for a final \r | |
155 | /// FIN flag before the TCP instance is closed. This timeout is in \r | |
156 | /// effective only if the application has called Close() to \r | |
157 | /// disconnect the connection completely. It is also called \r | |
158 | /// FIN_WAIT_2 timer in other implementations. When set to zero, \r | |
159 | /// it should be disabled because the FIN_WAIT_2 timer itself is \r | |
160 | /// against the standard. The default value is 60.\r | |
161 | /// \r | |
162 | UINT32 FinTimeout;\r | |
163 | /// \r | |
164 | /// How many seconds to wait in TIME_WAIT state before the TCP \r | |
165 | /// instance is closed. The timer is disabled completely to provide a \r | |
166 | /// method to close the TCP connection quickly if it is set to zero. It \r | |
167 | /// is against the related RFC documents.\r | |
168 | /// \r | |
169 | UINT32 TimeWaitTimeout;\r | |
170 | /// \r | |
171 | /// The maximum number of TCP keep-alive probes to send before \r | |
172 | /// giving up and resetting the connection if no response from the \r | |
173 | /// other end. Set to zero to disable keep-alive probe.\r | |
174 | /// \r | |
175 | UINT32 KeepAliveProbes;\r | |
176 | /// \r | |
177 | /// The number of seconds a connection needs to be idle before TCP \r | |
178 | /// sends out periodical keep-alive probes. When set to zero, the \r | |
179 | /// value is implementation specific. It should be ignored if keep-\r | |
180 | /// alive probe is disabled.\r | |
181 | /// \r | |
182 | UINT32 KeepAliveTime;\r | |
183 | /// \r | |
184 | /// The number of seconds between TCP keep-alive probes after the \r | |
185 | /// periodical keep-alive probe if no response. When set to zero, the \r | |
186 | /// value is implementation specific. It should be ignored if keep-\r | |
187 | /// alive probe is disabled.\r | |
188 | /// \r | |
189 | UINT32 KeepAliveInterval;\r | |
190 | /// \r | |
191 | /// Set it to TRUE to enable the Nagle algorithm as defined in \r | |
192 | /// RFC896. Set it to FALSE to disable it.\r | |
193 | /// \r | |
194 | BOOLEAN EnableNagle;\r | |
195 | /// \r | |
196 | /// Set it to TRUE to enable TCP timestamps option as defined in \r | |
197 | /// RFC1323. Set to FALSE to disable it.\r | |
198 | /// \r | |
199 | BOOLEAN EnableTimeStamp;\r | |
200 | /// \r | |
201 | /// Set it to TRUE to enable TCP window scale option as defined in \r | |
202 | /// RFC1323. Set it to FALSE to disable it. \r | |
203 | /// \r | |
204 | BOOLEAN EnableWindowScaling;\r | |
205 | /// \r | |
206 | /// Set it to TRUE to enable selective acknowledge mechanism \r | |
207 | /// described in RFC 2018. Set it to FALSE to disable it. \r | |
208 | /// Implementation that supports SACK can optionally support \r | |
209 | /// DSAK as defined in RFC 2883.\r | |
210 | /// \r | |
211 | BOOLEAN EnableSelectiveAck;\r | |
212 | /// \r | |
213 | /// Set it to TRUE to enable path MTU discovery as defined in \r | |
214 | /// RFC 1191. Set to FALSE to disable it.\r | |
215 | /// \r | |
216 | BOOLEAN EnablePathMtuDiscovery;\r | |
217 | } EFI_TCP6_OPTION;\r | |
218 | \r | |
219 | ///\r | |
220 | /// EFI_TCP6_CONFIG_DATA\r | |
221 | ///\r | |
222 | typedef struct {\r | |
223 | ///\r | |
224 | /// TrafficClass field in transmitted IPv6 packets.\r | |
225 | ///\r | |
226 | UINT8 TrafficClass;\r | |
227 | ///\r | |
228 | /// HopLimit field in transmitted IPv6 packets.\r | |
229 | ///\r | |
230 | UINT8 HopLimit;\r | |
231 | ///\r | |
232 | /// Used to specify TCP communication end settings for a TCP instance. \r | |
233 | ///\r | |
234 | EFI_TCP6_ACCESS_POINT AccessPoint;\r | |
235 | ///\r | |
236 | /// Used to configure the advance TCP option for a connection. If set \r | |
237 | /// to NULL, implementation specific options for TCP connection will be used.\r | |
238 | ///\r | |
239 | EFI_TCP6_OPTION *ControlOption;\r | |
240 | } EFI_TCP6_CONFIG_DATA;\r | |
241 | \r | |
242 | ///\r | |
243 | /// EFI_TCP6_CONNECTION_STATE\r | |
244 | ///\r | |
245 | typedef enum {\r | |
246 | Tcp6StateClosed = 0,\r | |
247 | Tcp6StateListen = 1,\r | |
248 | Tcp6StateSynSent = 2,\r | |
249 | Tcp6StateSynReceived = 3,\r | |
250 | Tcp6StateEstablished = 4,\r | |
251 | Tcp6StateFinWait1 = 5,\r | |
252 | Tcp6StateFinWait2 = 6,\r | |
253 | Tcp6StateClosing = 7,\r | |
254 | Tcp6StateTimeWait = 8,\r | |
255 | Tcp6StateCloseWait = 9,\r | |
256 | Tcp6StateLastAck = 10\r | |
257 | } EFI_TCP6_CONNECTION_STATE;\r | |
258 | \r | |
259 | ///\r | |
260 | /// EFI_TCP6_COMPLETION_TOKEN\r | |
261 | /// is used as a common header for various asynchronous tokens. \r | |
262 | ///\r | |
263 | typedef struct {\r | |
264 | ///\r | |
265 | /// The Event to signal after request is finished and Status field is \r | |
266 | /// updated by the EFI TCPv6 Protocol driver. \r | |
267 | /// \r | |
268 | EFI_EVENT Event;\r | |
269 | ///\r | |
270 | /// The result of the completed operation. \r | |
271 | ///\r | |
272 | EFI_STATUS Status;\r | |
273 | } EFI_TCP6_COMPLETION_TOKEN;\r | |
274 | \r | |
275 | ///\r | |
276 | /// EFI_TCP6_CONNECTION_TOKEN\r | |
277 | /// will be set if the active open succeeds or an unexpected\r | |
278 | /// error happens.\r | |
279 | ///\r | |
280 | typedef struct {\r | |
281 | ///\r | |
282 | /// The Status in the CompletionToken will be set to one of \r | |
283 | /// the following values if the active open succeeds or an unexpected \r | |
284 | /// error happens:\r | |
285 | /// EFI_SUCCESS: The active open succeeds and the instance's \r | |
286 | /// state is Tcp6StateEstablished.\r | |
287 | /// EFI_CONNECTION_RESET: The connect fails because the connection is reset\r | |
288 | /// either by instance itself or the communication peer.\r | |
289 | /// EFI_ABORTED: The active open is aborted.\r | |
290 | /// EFI_TIMEOUT: The connection establishment timer expires and \r | |
291 | /// no more specific information is available.\r | |
292 | /// EFI_NETWORK_UNREACHABLE: The active open fails because \r | |
293 | /// an ICMP network unreachable error is received. \r | |
294 | /// EFI_HOST_UNREACHABLE: The active open fails because an \r | |
295 | /// ICMP host unreachable error is received. \r | |
296 | /// EFI_PROTOCOL_UNREACHABLE: The active open fails \r | |
297 | /// because an ICMP protocol unreachable error is received.\r | |
298 | /// EFI_PORT_UNREACHABLE: The connection establishment \r | |
299 | /// timer times out and an ICMP port unreachable error is received.\r | |
300 | /// EFI_ICMP_ERROR: The connection establishment timer times \r | |
301 | /// out and some other ICMP error is received.\r | |
302 | /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r | |
303 | /// EFI_SECURITY_VIOLATION: The active open was failed because of IPSec policy check.\r | |
304 | /// \r | |
305 | EFI_TCP6_COMPLETION_TOKEN CompletionToken;\r | |
306 | } EFI_TCP6_CONNECTION_TOKEN;\r | |
307 | \r | |
308 | ///\r | |
309 | /// EFI_TCP6_LISTEN_TOKEN\r | |
310 | /// returns when list operation finishes.\r | |
311 | ///\r | |
312 | typedef struct {\r | |
313 | ///\r | |
314 | /// The Status in CompletionToken will be set to the \r | |
315 | /// following value if accept finishes:\r | |
316 | /// EFI_SUCCESS: A remote peer has successfully established a \r | |
317 | /// connection to this instance. A new TCP instance has also been \r | |
318 | /// created for the connection.\r | |
319 | /// EFI_CONNECTION_RESET: The accept fails because the connection is reset either\r | |
320 | /// by instance itself or communication peer.\r | |
321 | /// EFI_ABORTED: The accept request has been aborted.\r | |
322 | /// EFI_SECURITY_VIOLATION: The accept operation was failed because of IPSec policy check.\r | |
323 | ///\r | |
324 | EFI_TCP6_COMPLETION_TOKEN CompletionToken;\r | |
325 | EFI_HANDLE NewChildHandle;\r | |
326 | } EFI_TCP6_LISTEN_TOKEN;\r | |
327 | \r | |
328 | ///\r | |
329 | /// EFI_TCP6_FRAGMENT_DATA\r | |
330 | /// allows multiple receive or transmit buffers to be specified. The \r | |
331 | /// purpose of this structure is to provide scattered read and write.\r | |
332 | ///\r | |
333 | typedef struct {\r | |
334 | UINT32 FragmentLength; ///< Length of data buffer in the fragment.\r | |
335 | VOID *FragmentBuffer; ///< Pointer to the data buffer in the fragment.\r | |
336 | } EFI_TCP6_FRAGMENT_DATA;\r | |
337 | \r | |
338 | ///\r | |
339 | /// EFI_TCP6_RECEIVE_DATA\r | |
340 | /// When TCPv6 driver wants to deliver received data to the application, \r | |
341 | /// it will pick up the first queued receiving token, update its\r | |
342 | /// Token->Packet.RxData then signal the Token->CompletionToken.Event.\r | |
343 | ///\r | |
344 | typedef struct {\r | |
345 | ///\r | |
346 | /// Whether the data is urgent. When this flag is set, the instance is in \r | |
347 | /// urgent mode. \r | |
348 | ///\r | |
349 | BOOLEAN UrgentFlag;\r | |
350 | /// \r | |
351 | /// When calling Receive() function, it is the byte counts of all \r | |
352 | /// Fragmentbuffer in FragmentTable allocated by user. \r | |
353 | /// When the token is signaled by TCPv6 driver it is the length of \r | |
354 | /// received data in the fragments.\r | |
355 | /// \r | |
356 | UINT32 DataLength;\r | |
357 | /// \r | |
358 | /// Number of fragments.\r | |
359 | /// \r | |
360 | UINT32 FragmentCount;\r | |
361 | /// \r | |
362 | /// An array of fragment descriptors.\r | |
363 | /// \r | |
364 | EFI_TCP6_FRAGMENT_DATA FragmentTable[1];\r | |
365 | } EFI_TCP6_RECEIVE_DATA;\r | |
366 | \r | |
367 | ///\r | |
368 | /// EFI_TCP6_TRANSMIT_DATA\r | |
369 | /// The EFI TCPv6 Protocol user must fill this data structure before sending a packet.\r | |
370 | /// The packet may contain multiple buffers in non-continuous memory locations. \r | |
371 | ///\r | |
372 | typedef struct {\r | |
373 | /// \r | |
374 | /// Push If TRUE, data must be transmitted promptly, and the PUSH bit in \r | |
375 | /// the last TCP segment created will be set. If FALSE, data \r | |
376 | /// transmission may be delayed to combine with data from \r | |
377 | /// subsequent Transmit()s for efficiency.\r | |
378 | /// \r | |
379 | BOOLEAN Push;\r | |
380 | /// \r | |
381 | /// The data in the fragment table are urgent and urgent point is in \r | |
382 | /// effect if TRUE. Otherwise those data are NOT considered urgent.\r | |
383 | /// \r | |
384 | BOOLEAN Urgent;\r | |
385 | ///\r | |
386 | /// Length of the data in the fragments. \r | |
387 | ///\r | |
388 | UINT32 DataLength;\r | |
389 | ///\r | |
390 | /// Number of fragments.\r | |
391 | /// \r | |
392 | UINT32 FragmentCount;\r | |
393 | ///\r | |
394 | /// An array of fragment descriptors.\r | |
395 | ///\r | |
396 | EFI_TCP6_FRAGMENT_DATA FragmentTable[1];\r | |
397 | } EFI_TCP6_TRANSMIT_DATA;\r | |
398 | \r | |
399 | ///\r | |
400 | /// EFI_TCP6_IO_TOKEN\r | |
401 | /// returns When transmission finishes or meets any unexpected error. \r | |
402 | ///\r | |
403 | typedef struct {\r | |
404 | /// \r | |
405 | /// When transmission finishes or meets any unexpected error it will \r | |
406 | /// be set to one of the following values:\r | |
407 | /// EFI_SUCCESS: The receiving or transmission operation \r | |
408 | /// completes successfully.\r | |
409 | /// EFI_CONNECTION_RESET: The receiving or transmission operation fails\r | |
410 | /// because this connection is reset either by instance \r | |
411 | /// itself or the communication peer.\r | |
412 | /// EFI_ABORTED: The receiving or transmission is aborted.\r | |
413 | /// EFI_TIMEOUT: The transmission timer expires and no more \r | |
414 | /// specific information is available.\r | |
415 | /// EFI_NETWORK_UNREACHABLE: The transmission fails \r | |
416 | /// because an ICMP network unreachable error is received. \r | |
417 | /// EFI_HOST_UNREACHABLE: The transmission fails because an \r | |
418 | /// ICMP host unreachable error is received. \r | |
419 | /// EFI_PROTOCOL_UNREACHABLE: The transmission fails \r | |
420 | /// because an ICMP protocol unreachable error is received. \r | |
421 | /// EFI_PORT_UNREACHABLE: The transmission fails and an \r | |
422 | /// ICMP port unreachable error is received. \r | |
423 | /// EFI_ICMP_ERROR: The transmission fails and some other \r | |
424 | /// ICMP error is received. \r | |
425 | /// EFI_DEVICE_ERROR: An unexpected system or network error occurs.\r | |
426 | /// EFI_SECURITY_VIOLATION: The receiving or transmission \r | |
427 | /// operation was failed because of IPSec policy check\r | |
428 | ///\r | |
429 | EFI_TCP6_COMPLETION_TOKEN CompletionToken;\r | |
430 | union {\r | |
431 | ///\r | |
432 | /// When this token is used for receiving, RxData is a pointer to \r | |
433 | /// EFI_TCP6_RECEIVE_DATA.\r | |
434 | ///\r | |
435 | EFI_TCP6_RECEIVE_DATA *RxData;\r | |
436 | /// \r | |
437 | /// When this token is used for transmitting, TxData is a pointer to \r | |
438 | /// EFI_TCP6_TRANSMIT_DATA.\r | |
439 | ///\r | |
440 | EFI_TCP6_TRANSMIT_DATA *TxData;\r | |
441 | } Packet;\r | |
442 | } EFI_TCP6_IO_TOKEN;\r | |
443 | \r | |
444 | ///\r | |
445 | /// EFI_TCP6_CLOSE_TOKEN\r | |
446 | /// returns when close operation finishes.\r | |
447 | ///\r | |
448 | typedef struct {\r | |
449 | ///\r | |
450 | /// When close finishes or meets any unexpected error it will be set \r | |
451 | /// to one of the following values:\r | |
452 | /// EFI_SUCCESS: The close operation completes successfully.\r | |
453 | /// EFI_ABORTED: User called configure with NULL without close stopping.\r | |
454 | /// EFI_SECURITY_VIOLATION: The close operation was failed because of IPSec policy check.\r | |
455 | /// \r | |
456 | EFI_TCP6_COMPLETION_TOKEN CompletionToken;\r | |
457 | /// \r | |
458 | /// Abort the TCP connection on close instead of the standard TCP \r | |
459 | /// close process when it is set to TRUE. This option can be used to \r | |
460 | /// satisfy a fast disconnect.\r | |
461 | /// \r | |
462 | BOOLEAN AbortOnClose;\r | |
463 | } EFI_TCP6_CLOSE_TOKEN;\r | |
464 | \r | |
465 | /**\r | |
466 | Get the current operational status.\r | |
467 | \r | |
468 | The GetModeData() function copies the current operational settings of this EFI TCPv6\r | |
469 | Protocol instance into user-supplied buffers. This function can also be used to retrieve\r | |
470 | the operational setting of underlying drivers such as IPv6, MNP, or SNP.\r | |
471 | \r | |
472 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
473 | @param[out] Tcp6State The buffer in which the current TCP state is returned.\r | |
474 | @param[out] Tcp6ConfigData The buffer in which the current TCP configuration is returned. \r | |
475 | @param[out] Ip6ModeData The buffer in which the current IPv6 configuration data used by \r | |
476 | the TCP instance is returned. \r | |
477 | @param[out] MnpConfigData The buffer in which the current MNP configuration data used \r | |
478 | indirectly by the TCP instance is returned.\r | |
479 | @param[out] SnpModeData The buffer in which the current SNP mode data used indirectly by \r | |
480 | the TCP instance is returned.\r | |
481 | \r | |
482 | @retval EFI_SUCCESS The mode data was read.\r | |
483 | @retval EFI_NOT_STARTED No configuration data is available because this instance hasn't\r | |
484 | been started.\r | |
485 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
486 | \r | |
487 | **/\r | |
488 | typedef\r | |
489 | EFI_STATUS\r | |
5e6f3ee2 | 490 | (EFIAPI *EFI_TCP6_GET_MODE_DATA)(\r |
bdb140d7 | 491 | IN EFI_TCP6_PROTOCOL *This,\r |
492 | OUT EFI_TCP6_CONNECTION_STATE *Tcp6State OPTIONAL,\r | |
493 | OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL,\r | |
494 | OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,\r | |
495 | OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r | |
496 | OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r | |
497 | );\r | |
498 | \r | |
499 | /**\r | |
500 | Initialize or brutally reset the operational parameters for this EFI TCPv6 instance.\r | |
501 | \r | |
502 | The Configure() function does the following:\r | |
503 | - Initialize this TCP instance, i.e., initialize the communication end settings and\r | |
504 | specify active open or passive open for an instance.\r | |
505 | - Reset this TCP instance brutally, i.e., cancel all pending asynchronous tokens, flush \r | |
506 | transmission and receiving buffer directly without informing the communication peer.\r | |
507 | \r | |
508 | No other TCPv6 Protocol operation except Poll() can be executed by this instance until\r | |
509 | it is configured properly. For an active TCP instance, after a proper configuration it\r | |
510 | may call Connect() to initiates the three-way handshake. For a passive TCP instance, \r | |
511 | its state will transit to Tcp6StateListen after configuration, and Accept() may be \r | |
512 | called to listen the incoming TCP connection requests. If Tcp6ConfigData is set to NULL,\r | |
513 | the instance is reset. Resetting process will be done brutally, the state machine will\r | |
514 | be set to Tcp6StateClosed directly, the receive queue and transmit queue will be flushed,\r | |
515 | and no traffic is allowed through this instance. \r | |
516 | \r | |
517 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
518 | @param[in] Tcp6ConfigData Pointer to the configure data to configure the instance.\r | |
519 | If Tcp6ConfigData is set to NULL, the instance is reset.\r | |
520 | \r | |
521 | @retval EFI_SUCCESS The operational settings are set, changed, or reset\r | |
522 | successfully.\r | |
523 | @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source \r | |
524 | address for this instance, but no source address was available for \r | |
525 | use.\r | |
526 | @retval EFI_INVALID_PARAMETER One or more of the following conditions are TRUE:\r | |
527 | - This is NULL.\r | |
528 | - Tcp6ConfigData->AccessPoint.StationAddress is neither zero nor \r | |
529 | one of the configured IP addresses in the underlying IPv6 driver.\r | |
530 | - Tcp6ConfigData->AccessPoint.RemoteAddress isn't a valid unicast \r | |
531 | IPv6 address.\r | |
532 | - Tcp6ConfigData->AccessPoint.RemoteAddress is zero or \r | |
533 | Tcp6ConfigData->AccessPoint.RemotePort is zero when \r | |
534 | Tcp6ConfigData->AccessPoint.ActiveFlag is TRUE.\r | |
535 | - A same access point has been configured in other TCP \r | |
536 | instance properly.\r | |
537 | @retval EFI_ACCESS_DENIED Configuring TCP instance when it is configured without\r | |
538 | calling Configure() with NULL to reset it.\r | |
539 | @retval EFI_UNSUPPORTED One or more of the control options are not supported in\r | |
540 | the implementation.\r | |
541 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when\r | |
542 | executing Configure().\r | |
543 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
544 | \r | |
545 | **/\r | |
546 | typedef\r | |
547 | EFI_STATUS\r | |
5e6f3ee2 | 548 | (EFIAPI *EFI_TCP6_CONFIGURE)(\r |
bdb140d7 | 549 | IN EFI_TCP6_PROTOCOL *This,\r |
550 | IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL\r | |
551 | );\r | |
552 | \r | |
553 | /**\r | |
554 | Initiate a nonblocking TCP connection request for an active TCP instance.\r | |
555 | \r | |
556 | The Connect() function will initiate an active open to the remote peer configured\r | |
557 | in current TCP instance if it is configured active. If the connection succeeds or\r | |
558 | fails due to any error, the ConnectionToken->CompletionToken.Event will be signaled\r | |
559 | and ConnectionToken->CompletionToken.Status will be updated accordingly. This \r | |
560 | function can only be called for the TCP instance in Tcp6StateClosed state. The \r | |
561 | instance will transfer into Tcp6StateSynSent if the function returns EFI_SUCCESS. \r | |
562 | If TCP three-way handshake succeeds, its state will become Tcp6StateEstablished,\r | |
563 | otherwise, the state will return to Tcp6StateClosed.\r | |
564 | \r | |
565 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
566 | @param[in] ConnectionToken Pointer to the connection token to return when the TCP three\r | |
567 | way handshake finishes.\r | |
568 | \r | |
569 | @retval EFI_SUCCESS The connection request is successfully initiated and the state of \r | |
570 | this TCP instance has been changed to Tcp6StateSynSent.\r | |
571 | @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.\r | |
572 | @retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE:\r | |
573 | - This instance is not configured as an active one.\r | |
574 | - This instance is not in Tcp6StateClosed state.\r | |
575 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
576 | - This is NULL.\r | |
577 | - ConnectionToken is NULL.\r | |
578 | - ConnectionToken->CompletionToken.Event is NULL.\r | |
579 | @retval EFI_OUT_OF_RESOURCES The driver can't allocate enough resource to initiate the active open.\r | |
580 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
581 | \r | |
582 | **/\r | |
583 | typedef\r | |
584 | EFI_STATUS\r | |
5e6f3ee2 | 585 | (EFIAPI *EFI_TCP6_CONNECT)(\r |
bdb140d7 | 586 | IN EFI_TCP6_PROTOCOL *This,\r |
587 | IN EFI_TCP6_CONNECTION_TOKEN *ConnectionToken\r | |
588 | );\r | |
589 | \r | |
590 | /**\r | |
591 | Listen on the passive instance to accept an incoming connection request. This is a \r | |
592 | nonblocking operation.\r | |
593 | \r | |
594 | The Accept() function initiates an asynchronous accept request to wait for an incoming \r | |
595 | connection on the passive TCP instance. If a remote peer successfully establishes a \r | |
596 | connection with this instance, a new TCP instance will be created and its handle will\r | |
597 | be returned in ListenToken->NewChildHandle. The newly created instance is configured\r | |
598 | by inheriting the passive instance's configuration and is ready for use upon return.\r | |
599 | The new instance is in the Tcp6StateEstablished state.\r | |
600 | \r | |
601 | The ListenToken->CompletionToken.Event will be signaled when a new connection is \r | |
602 | accepted, user aborts the listen or connection is reset. \r | |
603 | \r | |
604 | This function only can be called when current TCP instance is in Tcp6StateListen state. \r | |
605 | \r | |
606 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
607 | @param[in] ListenToken Pointer to the listen token to return when operation finishes.\r | |
608 | \r | |
609 | \r | |
610 | @retval EFI_SUCCESS The listen token has been queued successfully.\r | |
611 | @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.\r | |
612 | @retval EFI_ACCESS_DENIED One or more of the following are TRUE:\r | |
613 | - This instance is not a passive instance.\r | |
614 | - This instance is not in Tcp6StateListen state.\r | |
615 | - The same listen token has already existed in the listen\r | |
616 | token queue of this TCP instance.\r | |
617 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
618 | - This is NULL.\r | |
619 | - ListenToken is NULL.\r | |
620 | - ListentToken->CompletionToken.Event is NULL.\r | |
621 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r | |
622 | @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.\r | |
623 | \r | |
624 | **/\r | |
625 | typedef\r | |
626 | EFI_STATUS\r | |
5e6f3ee2 | 627 | (EFIAPI *EFI_TCP6_ACCEPT)(\r |
bdb140d7 | 628 | IN EFI_TCP6_PROTOCOL *This,\r |
629 | IN EFI_TCP6_LISTEN_TOKEN *ListenToken\r | |
630 | );\r | |
631 | \r | |
632 | /**\r | |
633 | Queues outgoing data into the transmit queue.\r | |
634 | \r | |
635 | The Transmit() function queues a sending request to this TCP instance along with the\r | |
636 | user data. The status of the token is updated and the event in the token will be \r | |
637 | signaled once the data is sent out or some error occurs.\r | |
638 | \r | |
639 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
640 | @param[in] Token Pointer to the completion token to queue to the transmit queue.\r | |
641 | \r | |
642 | @retval EFI_SUCCESS The data has been queued for transmission.\r | |
643 | @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.\r | |
644 | @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a \r | |
645 | source address for this instance, but no source address was \r | |
646 | available for use.\r | |
647 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
648 | - This is NULL.\r | |
649 | - Token is NULL.\r | |
650 | - Token->CompletionToken.Event is NULL.\r | |
651 | - Token->Packet.TxData is NULL.\r | |
652 | - Token->Packet.FragmentCount is zero.\r | |
653 | - Token->Packet.DataLength is not equal to the sum of fragment lengths.\r | |
654 | @retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE:\r | |
655 | - A transmit completion token with the same Token-> \r | |
656 | CompletionToken.Event was already in the \r | |
657 | transmission queue.\r | |
658 | - The current instance is in Tcp6StateClosed state.\r | |
659 | - The current instance is a passive one and it is in \r | |
660 | Tcp6StateListen state.\r | |
661 | - User has called Close() to disconnect this connection.\r | |
662 | @retval EFI_NOT_READY The completion token could not be queued because the\r | |
663 | transmit queue is full.\r | |
664 | @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data because of resource\r | |
665 | shortage.\r | |
666 | @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.\r | |
667 | \r | |
668 | **/\r | |
669 | typedef\r | |
670 | EFI_STATUS\r | |
5e6f3ee2 | 671 | (EFIAPI *EFI_TCP6_TRANSMIT)(\r |
bdb140d7 | 672 | IN EFI_TCP6_PROTOCOL *This,\r |
673 | IN EFI_TCP6_IO_TOKEN *Token\r | |
674 | );\r | |
675 | \r | |
676 | /**\r | |
677 | Places an asynchronous receive request into the receiving queue.\r | |
678 | \r | |
679 | The Receive() function places a completion token into the receive packet queue. This \r | |
680 | function is always asynchronous. The caller must allocate the Token->CompletionToken.Event\r | |
681 | and the FragmentBuffer used to receive data. The caller also must fill the DataLength which \r | |
682 | represents the whole length of all FragmentBuffer. When the receive operation completes, the \r | |
683 | EFI TCPv6 Protocol driver updates the Token->CompletionToken.Status and Token->Packet.RxData\r | |
684 | fields and the Token->CompletionToken.Event is signaled. If got data the data and its length\r | |
685 | will be copied into the FragmentTable, at the same time the full length of received data will\r | |
686 | be recorded in the DataLength fields. Providing a proper notification function and context\r | |
687 | for the event will enable the user to receive the notification and receiving status. That \r | |
688 | notification function is guaranteed to not be re-entered.\r | |
689 | \r | |
690 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
691 | @param[in] Token Pointer to a token that is associated with the receive data\r | |
692 | descriptor.\r | |
693 | \r | |
694 | @retval EFI_SUCCESS The receive completion token was cached.\r | |
695 | @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.\r | |
696 | @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source \r | |
697 | address for this instance, but no source address was available for use.\r | |
698 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
699 | - This is NULL.\r | |
700 | - Token is NULL.\r | |
701 | - Token->CompletionToken.Event is NULL.\r | |
702 | - Token->Packet.RxData is NULL.\r | |
703 | - Token->Packet.RxData->DataLength is 0.\r | |
704 | - The Token->Packet.RxData->DataLength is not the \r | |
705 | sum of all FragmentBuffer length in FragmentTable.\r | |
706 | @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of\r | |
707 | system resources (usually memory).\r | |
708 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. \r | |
709 | The EFI TCPv6 Protocol instance has been reset to startup defaults.\r | |
710 | @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:\r | |
711 | - A receive completion token with the same Token->CompletionToken.Event\r | |
712 | was already in the receive queue.\r | |
713 | - The current instance is in Tcp6StateClosed state.\r | |
714 | - The current instance is a passive one and it is in \r | |
715 | Tcp6StateListen state.\r | |
716 | - User has called Close() to disconnect this connection.\r | |
717 | @retval EFI_CONNECTION_FIN The communication peer has closed the connection and there is no \r | |
718 | any buffered data in the receive buffer of this instance\r | |
719 | @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.\r | |
720 | \r | |
721 | **/\r | |
722 | typedef\r | |
723 | EFI_STATUS\r | |
5e6f3ee2 | 724 | (EFIAPI *EFI_TCP6_RECEIVE)(\r |
bdb140d7 | 725 | IN EFI_TCP6_PROTOCOL *This,\r |
726 | IN EFI_TCP6_IO_TOKEN *Token\r | |
727 | );\r | |
728 | \r | |
729 | /**\r | |
730 | Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a\r | |
731 | nonblocking operation.\r | |
732 | \r | |
733 | Initiate an asynchronous close token to TCP driver. After Close() is called, any buffered \r | |
734 | transmission data will be sent by TCP driver and the current instance will have a graceful close \r | |
735 | working flow described as RFC 793 if AbortOnClose is set to FALSE, otherwise, a rest packet \r | |
736 | will be sent by TCP driver to fast disconnect this connection. When the close operation completes \r | |
737 | successfully the TCP instance is in Tcp6StateClosed state, all pending asynchronous \r | |
738 | operations are signaled and any buffers used for TCP network traffic are flushed.\r | |
739 | \r | |
740 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
741 | @param[in] CloseToken Pointer to the close token to return when operation finishes.\r | |
742 | \r | |
743 | @retval EFI_SUCCESS The Close() is called successfully.\r | |
744 | @retval EFI_NOT_STARTED This EFI TCPv6 Protocol instance has not been configured.\r | |
745 | @retval EFI_ACCESS_DENIED One or more of the following are TRUE:\r | |
746 | - CloseToken or CloseToken->CompletionToken.Event is already in use.\r | |
747 | - Previous Close() call on this instance has not finished.\r | |
748 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
749 | - This is NULL.\r | |
750 | - CloseToken is NULL.\r | |
751 | - CloseToken->CompletionToken.Event is NULL.\r | |
752 | @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r | |
753 | @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.\r | |
754 | \r | |
755 | **/\r | |
756 | typedef\r | |
757 | EFI_STATUS\r | |
5e6f3ee2 | 758 | (EFIAPI *EFI_TCP6_CLOSE)(\r |
bdb140d7 | 759 | IN EFI_TCP6_PROTOCOL *This,\r |
760 | IN EFI_TCP6_CLOSE_TOKEN *CloseToken\r | |
761 | );\r | |
762 | \r | |
763 | /**\r | |
764 | Abort an asynchronous connection, listen, transmission or receive request.\r | |
765 | \r | |
766 | The Cancel() function aborts a pending connection, listen, transmit or \r | |
767 | receive request.\r | |
768 | \r | |
769 | If Token is not NULL and the token is in the connection, listen, transmission\r | |
770 | or receive queue when it is being cancelled, its Token->Status will be set \r | |
771 | to EFI_ABORTED and then Token->Event will be signaled.\r | |
772 | \r | |
773 | If the token is not in one of the queues, which usually means that the \r | |
774 | asynchronous operation has completed, EFI_NOT_FOUND is returned.\r | |
775 | \r | |
776 | If Token is NULL all asynchronous token issued by Connect(), Accept(),\r | |
777 | Transmit() and Receive() will be aborted.\r | |
778 | \r | |
779 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
780 | @param[in] Token Pointer to a token that has been issued by\r | |
781 | EFI_TCP6_PROTOCOL.Connect(),\r | |
782 | EFI_TCP6_PROTOCOL.Accept(),\r | |
783 | EFI_TCP6_PROTOCOL.Transmit() or\r | |
784 | EFI_TCP6_PROTOCOL.Receive(). If NULL, all pending\r | |
785 | tokens issued by above four functions will be aborted. Type\r | |
786 | EFI_TCP6_COMPLETION_TOKEN is defined in\r | |
787 | EFI_TCP_PROTOCOL.Connect().\r | |
788 | \r | |
789 | @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event \r | |
790 | is signaled. \r | |
791 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
792 | @retval EFI_NOT_STARTED This instance hasn't been configured.\r | |
793 | @retval EFI_NOT_FOUND The asynchronous I/O request isn't found in the transmission or \r | |
794 | receive queue. It has either completed or wasn't issued by \r | |
795 | Transmit() and Receive().\r | |
796 | \r | |
797 | **/\r | |
798 | typedef\r | |
799 | EFI_STATUS\r | |
5e6f3ee2 | 800 | (EFIAPI *EFI_TCP6_CANCEL)(\r |
bdb140d7 | 801 | IN EFI_TCP6_PROTOCOL *This,\r |
802 | IN EFI_TCP6_COMPLETION_TOKEN *Token OPTIONAL\r | |
803 | );\r | |
804 | \r | |
805 | /**\r | |
806 | Poll to receive incoming data and transmit outgoing segments.\r | |
807 | \r | |
808 | The Poll() function increases the rate that data is moved between the network\r | |
809 | and application and can be called when the TCP instance is created successfully.\r | |
810 | Its use is optional.\r | |
811 | \r | |
812 | @param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.\r | |
813 | \r | |
814 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
815 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
816 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
817 | @retval EFI_NOT_READY No incoming or outgoing data is processed.\r | |
818 | @retval EFI_TIMEOUT Data was dropped out of the transmission or receive queue.\r | |
819 | Consider increasing the polling rate.\r | |
820 | \r | |
821 | **/\r | |
822 | typedef\r | |
823 | EFI_STATUS\r | |
5e6f3ee2 | 824 | (EFIAPI *EFI_TCP6_POLL)(\r |
bdb140d7 | 825 | IN EFI_TCP6_PROTOCOL *This\r |
826 | );\r | |
827 | \r | |
828 | ///\r | |
829 | /// EFI_TCP6_PROTOCOL \r | |
830 | /// defines the EFI TCPv6 Protocol child to be used by any network drivers or\r | |
831 | /// applications to send or receive data stream. It can either listen on a \r | |
832 | /// specified port as a service or actively connect to remote peer as a client.\r | |
833 | /// Each instance has its own independent settings. \r | |
834 | ///\r | |
5e6f3ee2 | 835 | struct _EFI_TCP6_PROTOCOL {\r |
bdb140d7 | 836 | EFI_TCP6_GET_MODE_DATA GetModeData;\r |
837 | EFI_TCP6_CONFIGURE Configure;\r | |
838 | EFI_TCP6_CONNECT Connect;\r | |
839 | EFI_TCP6_ACCEPT Accept;\r | |
840 | EFI_TCP6_TRANSMIT Transmit;\r | |
841 | EFI_TCP6_RECEIVE Receive;\r | |
842 | EFI_TCP6_CLOSE Close;\r | |
843 | EFI_TCP6_CANCEL Cancel;\r | |
844 | EFI_TCP6_POLL Poll;\r | |
5e6f3ee2 | 845 | };\r |
bdb140d7 | 846 | \r |
847 | extern EFI_GUID gEfiTcp6ServiceBindingProtocolGuid;\r | |
848 | extern EFI_GUID gEfiTcp6ProtocolGuid;\r | |
849 | \r | |
850 | #endif\r | |
851 | \r |