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