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