]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. import Ip6.h, Ip6Config.h and Tcp6.h.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 17 Aug 2009 09:22:26 +0000 (09:22 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 17 Aug 2009 09:22:26 +0000 (09:22 +0000)
2. refine comments in Ip4.h and Tcp4.h.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9081 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Protocol/Ip4.h
MdePkg/Include/Protocol/Ip6.h [new file with mode: 0644]
MdePkg/Include/Protocol/Ip6Config.h [new file with mode: 0644]
MdePkg/Include/Protocol/Tcp4.h
MdePkg/Include/Protocol/Tcp6.h [new file with mode: 0644]

index beb114a6e51090390a26485a613703947aa1dc70..dbc9ad6b1e04fc22289396d43bc6561b5d9a278f 100644 (file)
@@ -5,11 +5,11 @@
   sections:\r
   - EFI IPv4 Service Binding Protocol\r
   - EFI IPv4 Variable\r
-  - EFI IPv4 Protocol The EFI IPv4 Protocol provides basic\r
-    network IPv4 packet I/O services, which includes support for\r
-    a subset of the Internet Control Message Protocol (ICMP) and\r
-    may include support for the Internet Group Management\r
-    Protocol (IGMP).\r
+  - EFI IPv4 Protocol\r
+  The EFI IPv4 Protocol provides basic network IPv4 packet I/O services,\r
+  which includes support foR a subset of the Internet Control Message \r
+  Protocol (ICMP) and may include support for the Internet Group Management\r
+  Protocol (IGMP).\r
   \r
   Copyright (c) 2006 - 2009, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
@@ -353,7 +353,7 @@ EFI_STATUS
                                 - This is NULL.\r
                                 - JoinFlag is TRUE and GroupAddress is NULL.\r
                                 - GroupAddress is not NULL and *GroupAddress is\r
-                                not a multicast IPv4 address.\r
+                                  not a multicast IPv4 address.\r
   @retval EFI_NOT_STARTED       This instance has not been started.\r
   @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
                                 RARP, etc.) is not finished yet.\r
@@ -420,7 +420,7 @@ EFI_STATUS
   @retval EFI_OUT_OF_RESOURCES   Could not add the entry to the routing table.\r
   @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
   @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
-                                  DeleteRoute is FALSE).\r
+                                 DeleteRoute is FALSE).\r
                                  \r
 **/\r
 typedef \r
@@ -495,7 +495,7 @@ EFI_STATUS
                                 resources (usually memory).\r
   @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
                                 The EFI IPv4 Protocol instance has been reset to startup defaults.\r
-                                EFI_ACCESS_DENIED The receive completion token with the same Token.Event was already\r
+  @retval EFI_ACCESS_DENIED     The receive completion token with the same Token.Event was already\r
                                 in the receive queue.\r
   @retval EFI_NOT_READY         The receive request could not be queued because the receive queue is full.\r
   @retval EFI_ICMP_ERROR        An ICMP error packet was received.\r
@@ -526,7 +526,7 @@ EFI_STATUS
                 defined in EFI_IP4_PROTOCOL.Transmit().\r
 \r
   @retval EFI_SUCCESS           The asynchronous I/O request was aborted and\r
-                                Token.->Event was signaled. When Token is NULL, all\r
+                                Token->Event was signaled. When Token is NULL, all\r
                                 pending requests were aborted and their events were signaled.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
   @retval EFI_NOT_STARTED       This instance has not been started.\r
diff --git a/MdePkg/Include/Protocol/Ip6.h b/MdePkg/Include/Protocol/Ip6.h
new file mode 100644 (file)
index 0000000..0857fca
--- /dev/null
@@ -0,0 +1,912 @@
+/** @file\r
+  \r
+  This file defines the EFI IPv6 (Internet Protocol version 6)\r
+  Protocol interface. It is split into the following three main\r
+  sections:\r
+  - EFI IPv6 Service Binding Protocol\r
+  - EFI IPv6 Variable\r
+  - EFI IPv6 Protocol\r
+  The EFI IPv6 Protocol provides basic network IPv6 packet I/O services,\r
+  which includes support for Neighbor Discovery Protocol (ND), Multicast\r
+  Listener Discovery Protocol (MLD), and a subset of the Internet Control\r
+  Message Protocol (ICMPv6).\r
+  \r
+  Copyright (c) 2008 - 2009, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+**/\r
+\r
+#ifndef __EFI_IP6_PROTOCOL_H__\r
+#define __EFI_IP6_PROTOCOL_H__\r
+\r
+#include <Protocol/ManagedNetwork.h>\r
+\r
+\r
+#define EFI_IP6_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0xec835dd3, 0xfe0f, 0x617b, {0xa6, 0x21, 0xb3, 0x50, 0xc3, 0xe1, 0x33, 0x88 } \\r
+  }\r
+\r
+#define EFI_IP6_PROTOCOL_GUID \\r
+  { \\r
+    0x2c8759d5, 0x5c2d, 0x66ef, {0x92, 0x5f, 0xb6, 0x6c, 0x10, 0x19, 0x57, 0xe2 } \\r
+  }\r
+\r
+typedef struct _EFI_IP6_PROTOCOL EFI_IP6_PROTOCOL;\r
+\r
+///\r
+/// ICMPv6 type definitions for error messages\r
+///\r
+///@{\r
+#define ICMP_V6_DEST_UNREACHABLE                 0x1\r
+#define ICMP_V6_PACKET_TOO_BIG                   0x2\r
+#define ICMP_V6_TIME_EXCEEDED                    0x3\r
+#define ICMP_V6_PARAMETER_PROBLEM                0x4\r
+///@}\r
+\r
+///\r
+/// ICMPv6 type definition for informational messages\r
+///\r
+///@{\r
+#define ICMP_V6_ECHO_REQUEST                     0x80\r
+#define ICMP_V6_ECHO_REPLY                       0x81\r
+#define ICMP_V6_LISTENER_QUERY                   0x82\r
+#define ICMP_V6_LISTENER_REPORT                  0x83\r
+#define ICMP_V6_LISTENER_DONE                    0x84\r
+#define ICMP_V6_ROUTER_SOLICIT                   0x85\r
+#define ICMP_V6_ROUTER_ADVERTISE                 0x86\r
+#define ICMP_V6_NEIGHBOR_SOLICIT                 0x87\r
+#define ICMP_V6_NEIGHBOR_ADVERTISE               0x88\r
+#define ICMP_V6_REDIRECT                         0x89\r
+#define ICMP_V6_LISTENER_REPORT_2                0x8F\r
+///@}\r
+\r
+///\r
+/// ICMPv6 code definitions for ICMP_V6_DEST_UNREACHABLE\r
+///\r
+///@{\r
+#define ICMP_V6_NO_ROUTE_TO_DEST                 0x0\r
+#define ICMP_V6_COMM_PROHIBITED                  0x1\r
+#define ICMP_V6_BEYOND_SCOPE                     0x2\r
+#define ICMP_V6_ADDR_UNREACHABLE                 0x3 \r
+#define ICMP_V6_PORT_UNREACHABLE                 0x4\r
+#define ICMP_V6_SOURCE_ADDR_FAILED               0x5\r
+#define ICMP_V6_ROUTE_REJECTED                   0x6\r
+///@}\r
+       \r
+///\r
+/// ICMPv6 code definitions for ICMP_V6_TIME_EXCEEDED\r
+///\r
+///@{\r
+#define ICMP_V6_TIMEOUT_HOP_LIMIT                0x0\r
+#define ICMP_V6_TIMEOUT_REASSEMBLE               0x1\r
+///@}\r
+       \r
+///\r
+/// ICMPv6 code definitions for ICMP_V6_PARAMETER_PROBLEM\r
+///\r
+///@{\r
+#define ICMP_V6_ERRONEOUS_HEADER                 0x0\r
+#define ICMP_V6_UNRECOGNIZE_NEXT_HDR             0x1\r
+#define ICMP_V6_UNRECOGNIZE_OPTION               0x2\r
+///@}\r
+\r
+///\r
+/// EFI_IP6_CONFIG_DATA\r
+/// is used to report and change IPv6 session parameters.\r
+///\r
+typedef struct {\r
+  /// \r
+  /// For the IPv6 packet to send and receive, this is the default value \r
+  /// of the 'Next Header' field in the last IPv6 extension header or in \r
+  /// the IPv6 header if there are no extension headers. Ignored when \r
+  /// AcceptPromiscuous is TRUE.\r
+  /// \r
+  UINT8                   DefaultProtocol;\r
+  /// \r
+  /// Set to TRUE to receive all IPv6 packets that get through the \r
+  /// receive filters.  \r
+  /// Set to FALSE to receive only the DefaultProtocol IPv6 \r
+  /// packets that get through the receive filters. Ignored when \r
+  /// AcceptPromiscuous is TRUE.\r
+  /// \r
+  BOOLEAN                 AcceptAnyProtocol;\r
+  /// \r
+  /// Set to TRUE to receive ICMP error report packets. Ignored when \r
+  /// AcceptPromiscuous or AcceptAnyProtocol is TRUE.\r
+  /// \r
+  BOOLEAN                 AcceptIcmpErrors;\r
+  /// \r
+  /// Set to TRUE to receive all IPv6 packets that are sent to any \r
+  /// hardware address or any protocol address. Set to FALSE to stop \r
+  /// receiving all promiscuous IPv6 packets.\r
+  /// \r
+  BOOLEAN                 AcceptPromiscuous;\r
+  /// \r
+  /// The destination address of the packets that will be transmitted. \r
+  /// Ignored if it is unspecified.\r
+  /// \r
+  EFI_IPv6_ADDRESS        DestinationAddress;\r
+  /// \r
+  /// The station IPv6 address that will be assigned to this EFI IPv6 \r
+  /// Protocol instance. This field can be set and changed only when \r
+  /// the EFI IPv6 driver is transitioning from the stopped to the started \r
+  /// states. If the StationAddress is specified, the EFI IPv6 Protocol \r
+  /// driver will deliver only incoming IPv6 packets whose destination \r
+  /// matches this IPv6 address exactly. The StationAddress is required \r
+  /// to be one of currently configured IPv6 addresses. An address \r
+  /// containing all zeroes is also accepted as a special case. Under this \r
+  /// situation, the IPv6 driver is responsible for binding a source \r
+  /// address to this EFI IPv6 protocol instance according to the source \r
+  /// address selection algorithm. Only incoming packets destined to \r
+  /// the selected address will be delivered to the user.  And the \r
+  /// selected station address can be retrieved through later \r
+  /// GetModeData() call. If no address is available for selecting, \r
+  /// EFI_NO_MAPPING will be returned, and the station address will \r
+  /// only be successfully bound to this EFI IPv6 protocol instance \r
+  /// after IP6ModeData.IsConfigured changed to TRUE.\r
+  /// \r
+  EFI_IPv6_ADDRESS        StationAddress; \r
+  /// \r
+  /// TrafficClass field in transmitted IPv6 packets. Default value \r
+  /// is zero.\r
+  /// \r
+  UINT8                   TrafficClass;\r
+  /// \r
+  /// HopLimit field in transmitted IPv6 packets. \r
+  /// \r
+  UINT8                   HopLimit;\r
+  /// \r
+  /// FlowLabel field in transmitted IPv6 packets. Default value is \r
+  /// zero.\r
+  /// \r
+  UINT32                  FlowLabel;\r
+  /// \r
+  /// The timer timeout value (number of microseconds) for the \r
+  /// receive timeout event to be associated with each assembled \r
+  /// packet. Zero means do not drop assembled packets.\r
+  /// \r
+  UINT32                  ReceiveTimeout;\r
+  /// \r
+  /// The timer timeout value (number of microseconds) for the \r
+  /// transmit timeout event to be associated with each outgoing \r
+  /// packet. Zero means do not drop outgoing packets.\r
+  /// \r
+  UINT32                  TransmitTimeout;\r
+} EFI_IP6_CONFIG_DATA;\r
+\r
+///\r
+/// EFI_IP6_ADDRESS_INFO\r
+///\r
+typedef struct {\r
+  EFI_IPv6_ADDRESS        Address;       ///< The IPv6 address.\r
+  UINT8                   PrefixLength;  ///< The length of the prefix associated with the Address. \r
+} EFI_IP6_ADDRESS_INFO;\r
+\r
+///\r
+/// EFI_IP6_ROUTE_TABLE\r
+/// is the entry structure that is used in routing tables\r
+/// \r
+typedef struct {\r
+  ///\r
+  /// The IPv6 address of the gateway to be used as the next hop for \r
+  /// packets to this prefix. If the IPv6 address is all zeros, then the \r
+  /// prefix is on-link.\r
+  ///\r
+  EFI_IPv6_ADDRESS        Gateway;    \r
+  ///\r
+  /// The destination prefix to be routed.\r
+  ///\r
+  EFI_IPv6_ADDRESS        Destination;  \r
+  ///\r
+  /// The length of the prefix associated with the Destination.\r
+  ///\r
+  UINT8                   PrefixLength;\r
+} EFI_IP6_ROUTE_TABLE;\r
+\r
+///\r
+/// EFI_IP6_NEIGHBOR_STATE\r
+///\r
+typedef enum {\r
+  ///\r
+  /// Address resolution is being performed on this entry. Specially, \r
+  /// Neighbor Solicitation has been sent to the solicited-node \r
+  /// multicast address of the target, but corresponding Neighbor \r
+  /// Advertisement has not been received.\r
+  ///\r
+  EfiNeighborInComplete, \r
+  ///\r
+  /// Positive confirmation was received that the forward path to the \r
+  /// neighbor was functioning properly.\r
+  ///\r
+  EfiNeighborReachable,\r
+  ///\r
+  ///Reachable Time has elapsed since the last positive confirmation \r
+  ///was received. In this state, the forward path to the neighbor was \r
+  ///functioning properly.\r
+  ///\r
+  EfiNeighborStale,\r
+  ///\r
+  /// This state is an optimization that gives upper-layer protocols \r
+  /// additional time to provide reachability confirmation.\r
+  ///\r
+  EfiNeighborDelay,\r
+  ///\r
+  /// A reachability confirmation is actively sought by retransmitting \r
+  /// Neighbor Solicitations every RetransTimer milliseconds until a \r
+  /// reachability confirmation is received.\r
+  ///\r
+  EfiNeighborProbe\r
+} EFI_IP6_NEIGHBOR_STATE;\r
+\r
+///\r
+/// EFI_IP6_NEIGHBOR_CACHE\r
+/// is the entry structure that is used in neighbor cache. It records a set \r
+/// of entries about individual neighbors to which traffic has been sent recently. \r
+///\r
+typedef struct {\r
+  EFI_IPv6_ADDRESS        Neighbor;    ///< The on-link unicast/anycast IP address of the neighbor.\r
+  EFI_MAC_ADDRESS         LinkAddress; ///< Link-layer address of the neighbor. \r
+  EFI_IP6_NEIGHBOR_STATE  State;       ///< State of this neighbor cache entry. \r
+} EFI_IP6_NEIGHBOR_CACHE;\r
+\r
+///\r
+/// EFI_IP6_ICMP_TYPE\r
+/// is used to describe those ICMP messages that are supported by this EFI \r
+/// IPv6 Protocol driver.\r
+///\r
+typedef struct {\r
+  UINT8                   Type;   ///< The type of ICMP message.\r
+  UINT8                   Code;   ///< The code of the ICMP message.\r
+} EFI_IP6_ICMP_TYPE;                       \r
+\r
+///\r
+/// EFI_IP6_MODE_DATA\r
+///\r
+typedef struct {  \r
+  ///\r
+  /// Set to TRUE after this EFI IPv6 Protocol instance is started. \r
+  /// All other fields in this structure are undefined until this field is TRUE. \r
+  /// Set to FALSE when the EFI IPv6 Protocol instance is stopped.\r
+  /// \r
+  BOOLEAN                 IsStarted;\r
+  ///\r
+  /// The maximum packet size, in bytes, of the packet which the upper layer driver could feed.\r
+  ///\r
+  UINT32                  MaxPacketSize;\r
+  /// \r
+  /// Current configuration settings. Undefined until IsStarted is TRUE.\r
+  ///\r
+  EFI_IP6_CONFIG_DATA     ConfigData;\r
+  /// \r
+  /// Set to TRUE when the EFI IPv6 Protocol instance is configured. \r
+  /// The instance is configured when it has a station address and \r
+  /// corresponding prefix length. \r
+  /// Set to FALSE when the EFI IPv6 Protocol instance is not configured.\r
+  ///\r
+  BOOLEAN                 IsConfigured;\r
+  /// \r
+  /// Number of configured IPv6 addresses on this interface. \r
+  ///\r
+  UINT32                  AddressCount;\r
+  /// \r
+  /// List of currently configured IPv6 addresses and corresponding \r
+  /// prefix lengths assigned to this interface. It is caller's \r
+  /// responsibility to free this buffer.\r
+  /// \r
+  EFI_IP6_ADDRESS_INFO    *AddressList;\r
+  /// \r
+  /// Number of joined multicast groups. Undefined until \r
+  /// IsConfigured is TRUE.\r
+  ///\r
+  UINT32                  GroupCount;\r
+  /// \r
+  /// List of joined multicast group addresses. It is caller's \r
+  /// responsibility to free this buffer. Undefined until \r
+  /// IsConfigured is TRUE.\r
+  ///\r
+  EFI_IPv6_ADDRESS        *GroupTable;\r
+  /// \r
+  /// Number of entries in the routing table. Undefined until \r
+  /// IsConfigured is TRUE.\r
+  ///\r
+  UINT32                  RouteCount;\r
+  /// \r
+  /// Routing table entries. It is caller's responsibility to free this buffer.\r
+  ///\r
+  EFI_IP6_ROUTE_TABLE     *RouteTable;\r
+  ///\r
+  /// Number of entries in the neighbor cache. Undefined until \r
+  /// IsConfigured is TRUE.\r
+  ///\r
+  UINT32                  NeighborCount;\r
+  /// \r
+  /// Neighbor cache entries. It is caller's responsibility to free this \r
+  /// buffer. Undefined until IsConfigured is TRUE. \r
+  ///\r
+  EFI_IP6_NEIGHBOR_CACHE  *NeighborCache;  \r
+  /// \r
+  /// Number of entries in the prefix table. Undefined until \r
+  /// IsConfigured is TRUE.\r
+  ///\r
+  UINT32                  PrefixCount;\r
+  /// \r
+  /// On-link Prefix table entries. It is caller's responsibility to free this \r
+  /// buffer. Undefined until IsConfigured is TRUE. \r
+  ///\r
+  EFI_IP6_ADDRESS_INFO    *PrefixTable;\r
+  /// \r
+  /// Number of entries in the supported ICMP types list.\r
+  ///\r
+  UINT32                  IcmpTypeCount;\r
+  /// \r
+  /// Array of ICMP types and codes that are supported by this EFI \r
+  /// IPv6 Protocol driver. It is caller's responsibility to free this \r
+  /// buffer.\r
+  ///\r
+  EFI_IP6_ICMP_TYPE       *IcmpTypeList;\r
+} EFI_IP6_MODE_DATA;\r
+\r
+///\r
+/// EFI_IP6_HEADER\r
+/// The fields in the IPv6 header structure are defined in the Internet\r
+/// Protocol version6 specification.\r
+///\r
+#pragma pack(1)\r
+typedef struct _EFI_IP6_HEADER {\r
+  UINT8                   TrafficClassH:4;\r
+  UINT8                   Version:4;\r
+  UINT8                   FlowLabelH:4;\r
+  UINT8                   TrafficClassL:4;  \r
+  UINT16                  FlowLabelL;\r
+  UINT16                  PayloadLength;\r
+  UINT8                   NextHeader;\r
+  UINT8                   HopLimit;\r
+  EFI_IPv6_ADDRESS        SourceAddress;\r
+  EFI_IPv6_ADDRESS        DestinationAddress;\r
+} EFI_IP6_HEADER;\r
+#pragma pack\r
+\r
+///\r
+/// EFI_IP6_FRAGMENT_DATA\r
+/// describes the location and length of the IPv6 packet \r
+/// fragment to transmit or that has been received.\r
+///\r
+typedef struct _EFI_IP6_FRAGMENT_DATA {\r
+  UINT32                  FragmentLength;  ///< Length of fragment data. This field may not be set to zero.\r
+  VOID                    *FragmentBuffer; ///< Pointer to fragment data. This field may not be set to NULL.\r
+} EFI_IP6_FRAGMENT_DATA;\r
+\r
+///\r
+/// EFI_IP6_RECEIVE_DATA\r
+///\r
+typedef struct _EFI_IP6_RECEIVE_DATA {\r
+  /// \r
+  /// Time when the EFI IPv6 Protocol driver accepted the packet. \r
+  /// Ignored if it is zero.\r
+  /// \r
+  EFI_TIME                TimeStamp;\r
+  /// \r
+  /// After this event is signaled, the receive data structure is released \r
+  /// and must not be referenced.\r
+  /// \r
+  EFI_EVENT               RecycleSignal;\r
+  ///\r
+  ///Length of the IPv6 packet headers, including both the IPv6 \r
+  ///header and any extension headers. \r
+  ///\r
+  UINT32                  HeaderLength;\r
+  /// \r
+  /// Pointer to the IPv6 packet header. If the IPv6 packet was \r
+  /// fragmented, this argument is a pointer to the header in the first \r
+  /// fragment. \r
+  /// \r
+  EFI_IP6_HEADER          *Header;\r
+  /// \r
+  /// Sum of the lengths of IPv6 packet buffers in FragmentTable. May \r
+  /// be zero.\r
+  /// \r
+  UINT32                  DataLength;\r
+  /// \r
+  /// Number of IPv6 payload fragments. May be zero.\r
+  /// \r
+  UINT32                  FragmentCount;\r
+  /// \r
+  /// Array of payload fragment lengths and buffer pointers.\r
+  /// \r
+  EFI_IP6_FRAGMENT_DATA   FragmentTable[1];\r
+} EFI_IP6_RECEIVE_DATA;\r
+\r
+///\r
+/// EFI_IP6_OVERRIDE_DATA\r
+/// The information and flags in the override data structure will override \r
+/// default parameters or settings for one Transmit() function call.                                                                     \r
+///\r
+typedef struct _EFI_IP6_OVERRIDE_DATA {\r
+  UINT8                   Protocol;   ///< Protocol type override.\r
+  UINT8                   HopLimit;   ///< Hop-Limit override.\r
+  UINT32                  FlowLabel;  ///< Flow-Label override.\r
+} EFI_IP6_OVERRIDE_DATA;\r
+          \r
+///\r
+/// EFI_IP6_TRANSMIT_DATA \r
+///\r
+typedef struct _EFI_IP6_TRANSMIT_DATA {   \r
+  /// \r
+  /// The destination IPv6 address.  If it is unspecified, \r
+  /// ConfigData.DestinationAddress will be used instead.\r
+  /// \r
+  EFI_IPv6_ADDRESS        DestinationAddress;\r
+  /// \r
+  /// If not NULL, the IPv6 transmission control override data.\r
+  /// \r
+  EFI_IP6_OVERRIDE_DATA   *OverrideData;\r
+  /// \r
+  /// Total length in byte of the IPv6 extension headers specified in \r
+  /// ExtHdrs.\r
+  /// \r
+  UINT32                  ExtHdrsLength;\r
+  /// \r
+  /// Pointer to the IPv6 extension headers. The IP layer will append \r
+  /// the required extension headers if they are not specified by \r
+  /// ExtHdrs. Ignored if ExtHdrsLength is zero.\r
+  /// \r
+  VOID                    *ExtHdrs;\r
+  /// \r
+  /// The protocol of first extension header in ExtHdrs. Ignored if \r
+  /// ExtHdrsLength is zero.\r
+  /// \r
+  UINT8                   NextHeader;\r
+  ///   \r
+  /// Total length in bytes of the FragmentTable data to transmit.\r
+  /// \r
+  UINT32                  DataLength;\r
+  /// \r
+  /// Number of entries in the fragment data table.\r
+  /// \r
+  UINT32                  FragmentCount;\r
+  /// \r
+  /// Start of the fragment data table.\r
+  /// \r
+  EFI_IP6_FRAGMENT_DATA   FragmentTable[1];\r
+} EFI_IP6_TRANSMIT_DATA;\r
+\r
+///\r
+/// EFI_IP6_COMPLETION_TOKEN\r
+/// structures are used for both transmit and receive operations.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// This Event will be signaled after the Status field is updated by \r
+  /// the EFI IPv6 Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.\r
+  ///\r
+  EFI_EVENT               Event;\r
+  ///\r
+  /// Will be set to one of the following values:\r
+  /// - EFI_SUCCESS:  The receive or transmit completed \r
+  ///   successfully.\r
+  /// - EFI_ABORTED:  The receive or transmit was aborted\r
+  /// - EFI_TIMEOUT:  The transmit timeout expired.\r
+  /// - EFI_ICMP_ERROR:  An ICMP error packet was received.\r
+  /// - EFI_DEVICE_ERROR:  An unexpected system or network \r
+  ///   error occurred.\r
+  /// - EFI_SECURITY_VIOLATION: The transmit or receive was \r
+  ///   failed because of an IPsec policy check.\r
+  ///\r
+  EFI_STATUS              Status;\r
+  union {\r
+    ///\r
+    /// When the Token is used for receiving, RxData is a pointer to the EFI_IP6_RECEIVE_DATA.\r
+    ///\r
+    EFI_IP6_RECEIVE_DATA  *RxData;\r
+    ///\r
+    /// When the Token is used for transmitting, TxData is a pointer to the EFI_IP6_TRANSMIT_DATA.\r
+    ///\r
+    EFI_IP6_TRANSMIT_DATA *TxData;\r
+  } Packet;\r
+} EFI_IP6_COMPLETION_TOKEN;\r
+\r
+/**\r
+  Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.\r
+  \r
+  The GetModeData() function returns the current operational mode data for this driver instance. \r
+  The data fields in EFI_IP6_MODE_DATA are read only. This function is used optionally to \r
+  retrieve the operational mode data of underlying networks or drivers..\r
+\r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+  @param[out] Ip6ModeData        Pointer to the EFI IPv6 Protocol mode data structure.\r
+  @param[out] MnpConfigData      Pointer to the managed network configuration data structure.\r
+  @param[out] SnpModeData        Pointer to the simple network mode data structure.\r
+                                 \r
+  @retval EFI_SUCCESS            The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER  This is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   The required mode data could not be allocated.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_GET_MODE_DATA) (\r
+  IN EFI_IP6_PROTOCOL                 *This,\r
+  OUT EFI_IP6_MODE_DATA               *Ip6ModeData     OPTIONAL,\r
+  OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData   OPTIONAL,\r
+  OUT EFI_SIMPLE_NETWORK_MODE         *SnpModeData     OPTIONAL\r
+  );\r
+\r
+/**\r
+  Assigns an IPv6 address and subnet mask to this EFI IPv6 Protocol driver instance.\r
+  \r
+  The Configure() function is used to set, change, or reset the operational parameters and filter \r
+  settings for this EFI IPv6 Protocol instance. Until these parameters have been set, no network traffic \r
+  can be sent or received by this instance. Once the parameters have been reset (by calling this \r
+  function with Ip6ConfigData set to NULL), no more traffic can be sent or received until these \r
+  parameters have been set again. Each EFI IPv6 Protocol instance can be started and stopped \r
+  independently of each other by enabling or disabling their receive filter settings with the \r
+  Configure() function.\r
+  \r
+  If Ip6ConfigData.StationAddress is a valid non-zero IPv6 unicast address, it is required \r
+  to be one of the currently configured IPv6 addresses list in the EFI IPv6 drivers, or else \r
+  EFI_INVALID_PARAMETER will be returned. If Ip6ConfigData.StationAddress is \r
+  unspecified, the IPv6 driver will bind a source address according to the source address selection \r
+  algorithm. Clients could frequently call GetModeData() to check get currently configured IPv6 \r
+  address list in the EFI IPv6 driver. If both Ip6ConfigData.StationAddress and \r
+  Ip6ConfigData.Destination are unspecified, when transmitting the packet afterwards, the \r
+  source address filled in each outgoing IPv6 packet is decided based on the destination of this packet. .\r
+  \r
+  If operational parameters are reset or changed, any pending transmit and receive requests will be \r
+  cancelled. Their completion token status will be set to EFI_ABORTED and their events will be \r
+  signaled.\r
+\r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+  @param[in]  Ip6ConfigData      Pointer to the EFI IPv6 Protocol configuration data structure.\r
+                                 \r
+  @retval EFI_SUCCESS            The driver instance was successfully opened.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - Ip6ConfigData.StationAddress is neither zero nor \r
+                                   a unicast IPv6 address.\r
+                                 - Ip6ConfigData.StationAddress is neither zero nor \r
+                                   one of the configured IP addresses in the EFI IPv6 driver.\r
+                                 - Ip6ConfigData.DefaultProtocol is illegal. \r
+  @retval EFI_OUT_OF_RESOURCES   The EFI IPv6 Protocol driver instance data could not be allocated.\r
+  @retval EFI_NO_MAPPING         The IPv6 driver was responsible for choosing a source address for \r
+                                 this instance, but no source address was available for use. \r
+  @retval EFI_ALREADY_STARTED    The interface is already open and must be stopped before the IPv6 \r
+                                 address or prefix length can be changed.\r
+  @retval EFI_DEVICE_ERROR       An unexpected system or network error occurred. The EFI IPv6 \r
+                                 Protocol driver instance is not opened.\r
+  @retval EFI_UNSUPPORTED        Default protocol specified through \r
+                                 Ip6ConfigData.DefaulProtocol isn't supported.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_CONFIGURE) (\r
+  IN EFI_IP6_PROTOCOL            *This,\r
+  IN EFI_IP6_CONFIG_DATA         *Ip6ConfigData OPTIONAL\r
+  );\r
+\r
+/**\r
+  Joins and leaves multicast groups.\r
+  \r
+  The Groups() function is used to join and leave multicast group sessions. Joining a group will \r
+  enable reception of matching multicast packets. Leaving a group will disable reception of matching \r
+  multicast packets. Source-Specific Multicast isn't required to be supported.\r
+  \r
+  If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.\r
+\r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+  @param[in]  JoinFlag           Set to TRUE to join the multicast group session and FALSE to leave.\r
+  @param[in]  GroupAddress       Pointer to the IPv6 multicast address.\r
+                                 \r
+  @retval EFI_SUCCESS            The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following is TRUE:\r
+                                 - This is NULL.\r
+                                 - JoinFlag is TRUE and GroupAddress is NULL.\r
+                                 - GroupAddress is not NULL and *GroupAddress is\r
+                                   not a multicast IPv6 address.  \r
+                                 - GroupAddress is not NULL and *GroupAddress is in the \r
+                                   range of SSM destination address.\r
+  @retval EFI_NOT_STARTED        This instance has not been started.\r
+  @retval EFI_OUT_OF_RESOURCES   System resources could not be allocated.\r
+  @retval EFI_UNSUPPORTED        This EFI IPv6 Protocol implementation does not support multicast groups.\r
+  @retval EFI_ALREADY_STARTED    The group address is already in the group table (when\r
+                                 JoinFlag is TRUE).\r
+  @retval EFI_NOT_FOUND          The group address is not in the group table (when JoinFlag is FALSE).\r
+  @retval EFI_DEVICE_ERROR       An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_GROUPS) (\r
+  IN EFI_IP6_PROTOCOL            *This,\r
+  IN BOOLEAN                     JoinFlag,\r
+  IN EFI_IPv6_ADDRESS            *GroupAddress  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Adds and deletes routing table entries.\r
+\r
+  The Routes() function adds a route to or deletes a route from the routing table.\r
+  \r
+  Routes are determined by comparing the leftmost PrefixLength bits of Destination with \r
+  the destination IPv6 address arithmetically. The gateway address must be on the same subnet as the\r
+  configured station address.\r
+  \r
+  The default route is added with Destination and PrefixLegth both set to all zeros. The \r
+  default route matches all destination IPv6 addresses that do not match any other routes.\r
+\r
+  All EFI IPv6 Protocol instances share a routing table.\r
+  \r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+  @param[in]  DeleteRoute        Set to TRUE to delete this route from the routing table. Set to \r
+                                 FALSE to add this route to the routing table. Destination, \r
+                                 PrefixLength and Gateway are used as the key to each \r
+                                 route entry.\r
+  @param[in]  Destination        The address prefix of the subnet that needs to be routed.\r
+  @param[in]  PrefixLength       The prefix length of Destination. Ignored if Destination \r
+                                 is NULL.\r
+  @param[in]  GatewayAddress     The unicast gateway IPv6 address for this route.\r
+\r
+  @retval EFI_SUCCESS            The operation completed successfully.\r
+  @retval EFI_NOT_STARTED        The driver instance has not been started.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - When DeleteRoute is TRUE, both Destination and \r
+                                   GatewayAddress are NULL.\r
+                                 - When DeleteRoute is FALSE, either Destination or \r
+                                   GatewayAddress is NULL.\r
+                                 - *GatewayAddress is not a valid unicast IPv6 address.\r
+                                 - *GatewayAddress is one of the local configured IPv6 \r
+                                   addresses.\r
+  @retval EFI_OUT_OF_RESOURCES   Could not add the entry to the routing table.\r
+  @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
+  @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
+                                 DeleteRoute is FALSE).\r
+                                 \r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_ROUTES) (\r
+  IN EFI_IP6_PROTOCOL            *This,\r
+  IN BOOLEAN                     DeleteRoute,\r
+  IN EFI_IPv6_ADDRESS            *Destination, OPTIONAL\r
+  IN UINT8                       PrefixLength,\r
+  IN EFI_IPv6_ADDRESS            *GatewayAddress OPTIONAL \r
+  );\r
+\r
+/**\r
+  Add or delete Neighbor cache entries.\r
+\r
+  The Neighbors() function is used to add, update, or delete an entry from neighbor cache. \r
+  IPv6 neighbor cache entries are typically inserted and updated by the network protocol driver as \r
+  network traffic is processed. Most neighbor cache entries will time out and be deleted if the network \r
+  traffic stops. Neighbor cache entries that were inserted by Neighbors() may be static (will not \r
+  timeout) or dynamic (will time out).\r
+       \r
+  The implementation should follow the neighbor cache timeout mechanism which is defined in \r
+  RFC4861. The default neighbor cache timeout value should be tuned for the expected network \r
+  environment\r
+\r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+  @param[in]  DeleteFlag         Set to TRUE to delete the specified cache entry, set to FALSE to \r
+                                 add (or update, if it already exists and Override is TRUE) the \r
+                                 specified cache entry. TargetIp6Address is used as the key \r
+                                 to find the requested cache entry.\r
+  @param[in]  TargetIp6Address   Pointer to Target IPv6 address.\r
+  @param[in]  TargetLinkAddress  Pointer to link-layer address of the target. Ignored if NULL. \r
+  @param[in]  Timeout            Time in 100-ns units that this entry will remain in the neighbor \r
+                                 cache, it will be deleted after Timeout. A value of zero means that \r
+                                 the entry is permanent. A non-zero value means that the entry is \r
+                                 dynamic. \r
+  @param[in]  Override           If TRUE, the cached link-layer address of the matching entry will \r
+                                 be overridden and updated; if FALSE, EFI_ACCESS_DENIED \r
+                                 will be returned if a corresponding cache entry already existed.\r
+\r
+  @retval  EFI_SUCCESS           The data has been queued for transmission.\r
+  @retval  EFI_NOT_STARTED       This instance has not been started.\r
+  @retval  EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - TargetIpAddress is NULL.\r
+                                 - *TargetLinkAddress is invalid when not NULL.\r
+                                 - *TargetIpAddress is not a valid unicast IPv6 address.\r
+                                 - *TargetIpAddress is one of the local configured IPv6 \r
+                                   addresses.\r
+  @retval  EFI_OUT_OF_RESOURCES  Could not add the entry to the neighbor cache.\r
+  @retval  EFI_NOT_FOUND         This entry is not in the neighbor cache (when DeleteFlag  is \r
+                                 TRUE or when DeleteFlag  is FALSE while \r
+                                 TargetLinkAddress is NULL.).\r
+  @retval  EFI_ACCESS_DENIED     The to-be-added entry is already defined in the neighbor cache, \r
+                                 and that entry is tagged as un-overridden (when DeleteFlag \r
+                                 is FALSE).\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_NEIGHBORS) (\r
+  IN EFI_IP6_PROTOCOL            *This,\r
+  IN BOOLEAN                     DeleteFlag,\r
+  IN EFI_IPv6_ADDRESS            *TargetIp6Address,\r
+  IN EFI_MAC_ADDRESS             *TargetLinkAddress,\r
+  IN UINT32                      Timeout,\r
+  IN BOOLEAN                     Override\r
+  );\r
+\r
+/**\r
+  Places outgoing data packets into the transmit queue.\r
+\r
+  The Transmit() function places a sending request in the transmit queue of this\r
+  EFI IPv6 Protocol instance. Whenever the packet in the token is sent out or some\r
+  errors occur, the event in the token will be signaled and the status is updated.\r
+\r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+  @param[in]  Token              Pointer to the transmit token.\r
+\r
+  @retval  EFI_SUCCESS           The data has been queued for transmission.\r
+  @retval  EFI_NOT_STARTED       This instance has not been started.\r
+  @retval  EFI_NO_MAPPING        The IPv6 driver was responsible for choosing a source address for \r
+                                 this transmission, but no source address was available for use.\r
+  @retval  EFI_INVALID_PARAMETER One or more of the following is TRUE:\r
+                                 - This is NULL.\r
+                                 - Token is NULL.\r
+                                 - Token.Event is NULL.\r
+                                 - Token.Packet.TxData is NULL.\r
+                                 - Token.Packet.ExtHdrsLength is not zero and Token.Packet.ExtHdrs is NULL.\r
+                                 - Token.Packet.FragmentCount is zero.\r
+                                 - One or more of the Token.Packet.TxData.FragmentTable[].FragmentLength fields is zero.\r
+                                 - One or more of the Token.Packet.TxData.FragmentTable[].FragmentBuffer fields is NULL.\r
+                                 - Token.Packet.TxData.DataLength is zero or not equal to the sum of fragment lengths.\r
+                                 - Token.Packet.TxData.DestinationAddress is non-zero when DestinationAddress is configured as \r
+                                   non-zero when doing Configure() for this EFI IPv6 protocol instance.\r
+                                 - Token.Packet.TxData.DestinationAddress is unspecified when DestinationAddress is unspecified \r
+                                   when doing Configure() for this EFI IPv6 protocol instance.\r
+  @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event\r
+                                 was already in the transmit queue.\r
+  @retval  EFI_NOT_READY         The completion token could not be queued because the transmit\r
+                                 queue is full. \r
+  @retval  EFI_NOT_FOUND         Not route is found to destination address.\r
+  @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
+  @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too\r
+                                 short to transmit.\r
+  @retval  EFI_BAD_BUFFER_SIZE   If Token.Packet.TxData.DataLength is beyond the \r
+                                 maximum that which can be described through the Fragment Offset\r
+                                 field in Fragment header when performing fragmentation.\r
+  @retval EFI_DEVICE_ERROR       An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_TRANSMIT) (\r
+  IN EFI_IP6_PROTOCOL            *This,\r
+  IN EFI_IP6_COMPLETION_TOKEN    *Token\r
+  );\r
+\r
+/**\r
+  Places a receiving request into the receiving queue.\r
+  \r
+  The Receive() function places a completion token into the receive packet queue.\r
+  This function is always asynchronous.\r
+  \r
+  The Token.Event field in the completion token must be filled in by the caller\r
+  and cannot be NULL. When the receive operation completes, the EFI IPv6 Protocol\r
+  driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event\r
+  is signaled.\r
+\r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+  @param]in]  Token              Pointer to a token that is associated with the receive data descriptor.\r
+                                 \r
+  @retval EFI_SUCCESS            The receive completion token was cached.\r
+  @retval EFI_NOT_STARTED        This EFI IPv6 Protocol instance has not been started.\r
+  @retval EFI_NO_MAPPING         When IP6 driver responsible for binding source address to this instance, \r
+                                 while no source address is available for use.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - Token is NULL.\r
+                                 - Token.Event is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   The receive completion token could not be queued due to a lack of system\r
+                                 resources (usually memory).\r
+  @retval EFI_DEVICE_ERROR       An unexpected system or network error occurred.\r
+                                 The EFI IPv6 Protocol instance has been reset to startup defaults.\r
+  @retval EFI_ACCESS_DENIED      The receive completion token with the same Token.Event was already\r
+                                 in the receive queue.\r
+  @retval EFI_NOT_READY          The receive request could not be queued because the receive queue is full.\r
+                                 \r
+**/                              \r
+typedef                          \r
+EFI_STATUS                       \r
+(EFIAPI *EFI_IP6_RECEIVE) (      \r
+  IN EFI_IP6_PROTOCOL            *This,\r
+  IN EFI_IP6_COMPLETION_TOKEN    *Token\r
+  );\r
+\r
+/**\r
+  Abort an asynchronous transmit or receive request.\r
+  \r
+  The Cancel() function is used to abort a pending transmit or receive request.\r
+  If the token is in the transmit or receive request queues, after calling this\r
+  function, Token->Status will be set to EFI_ABORTED and then Token->Event will\r
+  be signaled. If the token is not in one of the queues, which usually means the\r
+  asynchronous operation has completed, this function will not signal the token\r
+  and EFI_NOT_FOUND is returned.\r
+\r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+  @param[in]  Token              Pointer to a token that has been issued by\r
+                                 EFI_IP6_PROTOCOL.Transmit() or\r
+                                 EFI_IP6_PROTOCOL.Receive(). If NULL, all pending\r
+                                 tokens are aborted. Type EFI_IP6_COMPLETION_TOKEN is\r
+                                 defined in EFI_IP6_PROTOCOL.Transmit().\r
+                                 \r
+  @retval EFI_SUCCESS            The asynchronous I/O request was aborted and\r
+                                 Token->Event was signaled. When Token is NULL, all\r
+                                 pending requests were aborted and their events were signaled.\r
+  @retval EFI_INVALID_PARAMETER  This is NULL.\r
+  @retval EFI_NOT_STARTED        This instance has not been started.\r
+  @retval EFI_NOT_FOUND          When Token is not NULL, the asynchronous I/O request was\r
+                                 not found in the transmit or receive queue. It has either completed\r
+                                 or was not issued by Transmit() and Receive().\r
+  @retval EFI_DEVICE_ERROR       An unexpected system or network error occurred.\r
+                                 \r
+**/                              \r
+typedef                          \r
+EFI_STATUS                       \r
+(EFIAPI *EFI_IP6_CANCEL)(        \r
+  IN EFI_IP6_PROTOCOL            *This,\r
+  IN EFI_IP6_COMPLETION_TOKEN    *Token    OPTIONAL\r
+  );\r
+\r
+/**\r
+  Polls for incoming data packets and processes outgoing data packets.\r
+  \r
+  The Poll() function polls for incoming data packets and processes outgoing data\r
+  packets. Network drivers and applications can call the EFI_IP6_PROTOCOL.Poll()\r
+  function to increase the rate that data packets are moved between the communications\r
+  device and the transmit and receive queues.\r
+  \r
+  In some systems the periodic timer event may not poll the underlying communications\r
+  device fast enough to transmit and/or receive all data packets without missing\r
+  incoming packets or dropping outgoing packets. Drivers and applications that are\r
+  experiencing packet loss should try calling the EFI_IP6_PROTOCOL.Poll() function\r
+  more often.\r
+\r
+  @param[in]  This               Pointer to the EFI_IP6_PROTOCOL instance.\r
+\r
+  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
+  @retval  EFI_NOT_STARTED       This EFI IPv6 Protocol instance has not been started.\r
+  @retval  EFI_INVALID_PARAMETER This is NULL.\r
+  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval  EFI_NOT_READY         No incoming or outgoing data is processed.\r
+  @retval  EFI_TIMEOUT           Data was dropped out of the transmit and/or receive queue.\r
+                                 Consider increasing the polling rate.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_POLL) (\r
+  IN EFI_IP6_PROTOCOL            *This\r
+  );\r
+\r
+///\r
+/// The EFI IPv6 Protocol implements a simple packet-oriented interface that can be\r
+/// used by drivers, daemons, and applications to transmit and receive network packets.\r
+///\r
+typedef struct _EFI_IP6_PROTOCOL {\r
+  EFI_IP6_GET_MODE_DATA   GetModeData;\r
+  EFI_IP6_CONFIGURE       Configure;\r
+  EFI_IP6_GROUPS          Groups;\r
+  EFI_IP6_ROUTES          Routes;\r
+  EFI_IP6_NEIGHBORS       Neighbors;\r
+  EFI_IP6_TRANSMIT        Transmit;\r
+  EFI_IP6_RECEIVE         Receive;\r
+  EFI_IP6_CANCEL          Cancel;\r
+  EFI_IP6_POLL            Poll;\r
+} EFI_IP6_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiIp6ServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiIp6ProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/Ip6Config.h b/MdePkg/Include/Protocol/Ip6Config.h
new file mode 100644 (file)
index 0000000..2182e4b
--- /dev/null
@@ -0,0 +1,369 @@
+/** @file\r
+  This file provides a definition of the EFI IPv6 Configuration\r
+  Protocol.\r
+\r
+Copyright (c) 2008 - 2009, Intel Corporation.<BR>\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at<BR>\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+#ifndef __EFI_IP6CONFIG_PROTOCOL_H__\r
+#define __EFI_IP6CONFIG_PROTOCOL_H__\r
+\r
+#include <Protocol/Ip6.h>\r
+\r
+#define EFI_IP6_CONFIG_PROTOCOL_GUID \\r
+  { \\r
+    0x937fe521, 0x95ae, 0x4d1a, {0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a } \\r
+  }\r
+\r
+typedef struct _EFI_IP6_CONFIG_PROTOCOL EFI_IP6_CONFIG_PROTOCOL;\r
+\r
+///\r
+/// EFI_IP6_CONFIG_DATA_TYPE\r
+///\r
+typedef enum {         \r
+  /// \r
+  /// The interface information of the communication \r
+  /// device this EFI IPv6 Configuration Protocol instance manages. \r
+  /// This type of data is read only.The corresponding Data is of type \r
+  /// EFI_IP6_CONFIG_INTERFACE_INFO.\r
+  /// \r
+  Ip6ConfigDataTypeInterfaceInfo,\r
+  /// \r
+  /// The alternative interface ID for the \r
+  /// communication device this EFI IPv6 Configuration Protocol \r
+  /// instance manages if the link local IPv6 address generated from \r
+  /// the interfaced ID based on the default source the EFI IPv6 \r
+  /// Protocol uses is a duplicate address. The length of the interface \r
+  /// ID is 64 bit. The corresponding Data is of type \r
+  /// EFI_IP6_CONFIG_INTERFACE_ID.\r
+  /// \r
+  Ip6ConfigDataTypeAltInterfaceId,\r
+  /// \r
+  /// The general configuration policy for the EFI IPv6 network \r
+  /// stack running on the communication device this EFI IPv6 \r
+  /// Configuration Protocol instance manages. The policy will affect \r
+  /// other configuration settings. The corresponding Data is of type \r
+  /// EFI_IP6_CONFIG_POLICY.\r
+  ///\r
+  Ip6ConfigDataTypePolicy,\r
+  /// \r
+  /// The number of consecutive \r
+  /// Neighbor Solicitation messages sent while performing Duplicate \r
+  /// Address Detection on a tentative address. A value of zero \r
+  /// indicates that Duplicate Address Detection will not be performed \r
+  /// on tentative addresses. The corresponding Data is of type \r
+  /// EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS.\r
+  /// \r
+  Ip6ConfigDataTypeDupAddrDetectTransmits,\r
+  /// \r
+  /// The station addresses set manually for the EFI \r
+  /// IPv6 network stack. It is only configurable when the policy is \r
+  /// Ip6ConfigPolicyManual. The corresponding Data is a \r
+  /// pointer to an array of EFI_IPv6_ADDRESS instances.\r
+  /// \r
+  Ip6ConfigDataTypeManualAddress,\r
+  /// \r
+  /// The gateway addresses set manually for the EFI IPv6 \r
+  /// network stack running on the communication device this EFI \r
+  /// IPv6 Configuration Protocol manages. It is not configurable when \r
+  /// the policy is Ip6ConfigPolicyAutomatic. The gateway \r
+  /// addresses must be unicast IPv6 addresses. The corresponding \r
+  /// Data is a pointer to an array of EFI_IPv6_ADDRESS instances.\r
+  /// \r
+  Ip6ConfigDataTypeGateway,\r
+  /// \r
+  /// The DNS server list for the EFI IPv6 network stack \r
+  /// running on the communication device this EFI IPv6 \r
+  /// Configuration Protocol manages. It is not configurable when the \r
+  /// policy is Ip6ConfigPolicyAutomatic.The DNS server \r
+  /// addresses must be unicast IPv6 addresses. The corresponding \r
+  /// Data is a pointer to an array of EFI_IPv6_ADDRESS instances.\r
+  /// \r
+  Ip6ConfigDataTypeDnsServer,\r
+  ///\r
+  /// The number of this enumeration memebers.\r
+  ///\r
+  Ip6ConfigDataTypeMaximum\r
+} EFI_IP6_CONFIG_DATA_TYPE;\r
+\r
+///\r
+/// EFI_IP6_CONFIG_INTERFACE_INFO\r
+/// describes the operational state of the interface this \r
+/// EFI IPv6 Configuration Protocol instance manages.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// The name of the interface. It is a NULL-terminated Unicode string.\r
+  ///\r
+  CHAR16                Name[32];\r
+  /// \r
+  /// The interface type of the network interface.\r
+  /// \r
+  UINT8                 IfType;\r
+  /// \r
+  /// The size, in bytes, of the network interface's hardware address.\r
+  /// \r
+  UINT32                HwAddressSize;\r
+  /// \r
+  /// The hardware address for the network interface.\r
+  /// \r
+  EFI_MAC_ADDRESS       HwAddress;\r
+  /// \r
+  /// Number of EFI_IP6_ADDRESS_INFO structures pointed to by AddressInfo.\r
+  /// \r
+  UINT32                AddressInfoCount;\r
+  /// \r
+  /// Pointer to an array of EFI_IP6_ADDRESS_INFO instances \r
+  /// which contain the local IPv6 addresses and the corresponding \r
+  /// prefix length information. Set to NULL if AddressInfoCount \r
+  /// is zero.\r
+  /// \r
+  EFI_IP6_ADDRESS_INFO  *AddressInfo;\r
+  /// \r
+  /// Number of route table entries in the following RouteTable.\r
+  /// \r
+  UINT32                RouteCount;\r
+  /// \r
+  /// The route table of the IPv6 network stack runs on this interface. \r
+  /// Set to NULL if RouteCount is zero. \r
+  /// \r
+  EFI_IP6_ROUTE_TABLE   *RouteTable;\r
+} EFI_IP6_CONFIG_INTERFACE_INFO;\r
+\r
+///\r
+/// EFI_IP6_CONFIG_INTERFACE_ID\r
+/// describes the 64-bit interface ID.\r
+///\r
+typedef struct {\r
+  UINT8                 Id[8];\r
+} EFI_IP6_CONFIG_INTERFACE_ID;\r
+\r
+///\r
+/// EFI_IP6_CONFIG_POLICY\r
+/// defines the general configuration policy the EFI IPv6 \r
+/// Configuration Protocol supports.\r
+///\r
+typedef enum {\r
+  ///\r
+  /// Under this policy, the IpI6ConfigDataTypeManualAddress, \r
+  /// Ip6ConfigDataTypeGateway and Ip6ConfigDataTypeDnsServer\r
+  /// configuration data are required to be set manually. \r
+  /// The EFI IPv6 Protocol will get all required configuration\r
+  /// such as address, prefix and gateway settings from the EFI\r
+  /// IPv6 Configuration protocol.\r
+  ///\r
+  Ip6ConfigPolicyManual,      \r
+  /// \r
+  /// Under this policy, the IpI6ConfigDataTypeManualAddress, \r
+  /// Ip6ConfigDataTypeGateway and Ip6ConfigDataTypeDnsServer\r
+  /// configuration data are not allowed to set via SetData().\r
+  /// All of these configurations are retrieved from some auto\r
+  /// configuration mechanism. \r
+  /// The EFI IPv6 Protocol will use the IPv6 stateless address \r
+  /// autoconfiguration mechanism and/or the IPv6 stateful address \r
+  /// autoconfiguration mechanism described in the related RFCs to \r
+  /// get address and other configuration information\r
+  /// \r
+  Ip6ConfigPolicyAutomatic\r
+} EFI_IP6_CONFIG_POLICY;\r
+\r
+///\r
+/// EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS\r
+/// describes the number of consecutive Neighbor Solicitation messages sent\r
+/// while performing Duplicate Address Detection on a tentative address. \r
+/// The default value for a newly detected communication device is 1.\r
+///\r
+typedef struct {\r
+  UINT32    DupAddrDetectTransmits;  ///< The number of consecutive Neighbor Solicitation messages sent.\r
+} EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS;           \r
+\r
+///\r
+/// EFI_IP6_CONFIG_MANUAL_ADDRESS\r
+/// is used to set the station address information for the EFI IPv6 network\r
+/// stack manually when the policy is Ip6ConfigPolicyManual.\r
+///\r
+typedef struct {\r
+  EFI_IPv6_ADDRESS      Address;       ///< The IPv6 unicast address.\r
+  BOOLEAN               IsAnycast;     ///< Set to TRUE if Address is anycast.\r
+  UINT8                 PrefixLength;  ///< The length, in bits, of the prefix associated with this Address.\r
+} EFI_IP6_CONFIG_MANUAL_ADDRESS;\r
+\r
+\r
+/**\r
+  Set the configuration for the EFI IPv6 network stack running on the communication\r
+  device this EFI IPv6 Configuration Protocol instance manages.\r
+  \r
+  This function is used to set the configuration data of type DataType for the EFI \r
+  IPv6 network stack running on the communication device this EFI IPv6 Configuration\r
+  Protocol instance manages.\r
+\r
+  The DataSize is used to calculate the count of structure instances in the Data for \r
+  some DataType that multiple structure instances are allowed.\r
+  \r
+  This function is always non-blocking. When setting some type of configuration data,\r
+  an asynchronous process is invoked to check the correctness of the data, such as \r
+  doing Duplicate Address Detection on the manually set local IPv6 addresses. \r
+  EFI_NOT_READY is returned immediately to indicate that such an asynchronous process\r
+  is invoked and the process is not finished yet. The caller willing to get the result\r
+  of the asynchronous process is required to call RegisterDataNotify() to register an\r
+  event on the specified configuration data. Once the event is signaled, the caller \r
+  can call GetData() to get back the configuration data in order to know the result.\r
+  For other types of configuration data that do not require an asynchronous configuration \r
+  process, the result of the operation is immediately returned.\r
+\r
+  @param[in]     This           Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r
+  @param[in]     DataType       The type of data to set.  \r
+  @param[in]     DataSize       Size of the buffer pointed to by Data in bytes.\r
+  @param[in]     Data           The data buffer to set. The type of the data buffer is\r
+                                associated with the DataType.\r
+  \r
+  @retval EFI_SUCCESS           The specified configuration data for the EFI IPv6 \r
+                                network stack is set successfully.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
+                                - This is NULL.\r
+                                - Data is NULL.\r
+                                - One or more fields in Data do not match the requirement of the \r
+                                  data type indicated by DataType. \r
+  @rerval EFI_WRITE_PROTECTED   The specified configuration data is read-only or the specified \r
+                                configuration data can not be set under the current policy\r
+  @retval EFI_ACCESS_DENIED     Another set operation on the specified configuration \r
+                                data is already in process.\r
+  @retval EFI_NOT_READY         An asynchronous process is invoked to set the specified\r
+                                configuration data and the process is not finished yet.\r
+  @retval EFI_BAD_BUFFER_SIZE   The DataSize does not match the size of the type \r
+                                indicated by DataType.\r
+  @retval EFI_UNSUPPORTED       This DataType is not supported.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system error or network error occurred.\r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_CONFIG_SET_DATA) (\r
+  IN EFI_IP6_CONFIG_PROTOCOL    *This,\r
+  IN EFI_IP6_CONFIG_DATA_TYPE   DataType,\r
+  IN UINTN                      DataSize,\r
+  IN VOID                       *Data\r
+  );\r
+\r
+/**\r
+  Get the configuration data for the EFI IPv6 network stack running on the communication\r
+  device this EFI IPv6 Configuration Protocol instance manages.\r
+  \r
+  This function returns the configuration data of type DataType for the EFI IPv6 network\r
+  stack running on the communication device this EFI IPv6 Configuration Protocol instance\r
+  manages.\r
+\r
+  The caller is responsible for allocating the buffer used to return the specified\r
+  configuration data and the required size will be returned to the caller if the size of\r
+  the buffer is too small. \r
+  \r
+  EFI_NOT_READY is returned if the specified configuration data is not ready due to an \r
+  already in progress asynchronous configuration process. The caller can call RegisterDataNotify()\r
+  to register an event on the specified configuration data. Once the asynchronous configuration\r
+  process is finished, the event will be signaled and a subsequent GetData() call will return \r
+  the specified configuration data.\r
+\r
+  @param[in]     This           Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r
+  @param[in]     DataType       The type of data to get.  \r
+  @param[in,out] DataSize       On input, in bytes, the size of Data. On output, in bytes, the \r
+                                size of buffer required to store the specified configuration data.\r
+  @param[in]     Data           The data buffer in which the configuration data is returned. The \r
+                                type of the data buffer is associated with the DataType.\r
+  \r
+  @retval EFI_SUCCESS           The specified configuration data is got successfully.\r
+  @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:\r
+                                - This is NULL.\r
+                                - DataSize is NULL.\r
+                                - Data is NULL if *DataSize is not zero.\r
+  @rerval EFI_BUFFER_TOO_SMALL  The size of Data is too small for the specified configuration data \r
+                                and the required size is returned in DataSize.\r
+  @retval EFI_NOT_READY         The specified configuration data is not ready due to an already in \r
+                                progress asynchronous configuration process.\r
+  @retval EFI_NOT_FOUND         The specified configuration data is not found.\r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_CONFIG_GET_DATA) (\r
+  IN EFI_IP6_CONFIG_PROTOCOL    *This,\r
+  IN EFI_IP6_CONFIG_DATA_TYPE   DataType,\r
+  IN OUT UINTN                  *DataSize,\r
+  IN VOID                       *Data   OPTIONAL\r
+  );\r
+\r
+/**\r
+  Register an event that is to be signaled whenever a configuration process on the specified\r
+  configuration data is done.\r
+  \r
+  This function registers an event that is to be signaled whenever a configuration process\r
+  on the specified configuration data is done. An event can be registered for different DataType\r
+  simultaneously and the caller is responsible for determining which type of configuration data\r
+  causes the signaling of the event in such case.\r
+\r
+  @param[in]     This           Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r
+  @param[in]     DataType       The type of data to unregister the event for.  \r
+  @param[in]     Event          The event to register. \r
+  \r
+  @retval EFI_SUCCESS           The notification event for the specified configuration data is \r
+                                registered.\r
+  @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.\r
+  @rerval EFI_UNSUPPORTED       The configuration data type specified by DataType is not \r
+                                supported.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_ACCESS_DENIED     The Event is already registered for the DataType.\r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_CONFIG_REGISTER_NOTIFY) (\r
+  IN EFI_IP6_CONFIG_PROTOCOL    *This,\r
+  IN EFI_IP6_CONFIG_DATA_TYPE   DataType,\r
+  IN EFI_EVENT                  Event\r
+  );\r
+\r
+/**\r
+  Remove a previously registered event for the specified configuration data.\r
+  \r
+  This function removes a previously registered event for the specified configuration data.\r
+\r
+  @param[in]     This           Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r
+  @param[in]     DataType       The type of data to remove the previously registered event for.  \r
+  @param[in]     Event          The event to unregister.\r
+  \r
+  @retval EFI_SUCCESS           The event registered for the specified configuration data is removed.\r
+  @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.\r
+  @rerval EFI_NOT_FOUND         The Event has not been registered for the specified \r
+                                DataType.\r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP6_CONFIG_UNREGISTER_NOTIFY) (\r
+  IN EFI_IP6_CONFIG_PROTOCOL    *This,\r
+  IN EFI_IP6_CONFIG_DATA_TYPE   DataType,\r
+  IN EFI_EVENT                  Event\r
+  );\r
+\r
+///\r
+/// The EFI_IP6_CONFIG_PROTOCOL provides the mechanism to set and get various\r
+/// types of configurations for the EFI IPv6 network stack.\r
+///\r
+typedef struct _EFI_IP6_CONFIG_PROTOCOL {\r
+  EFI_IP6_CONFIG_SET_DATA           SetData;\r
+  EFI_IP6_CONFIG_GET_DATA           GetData;\r
+  EFI_IP6_CONFIG_REGISTER_NOTIFY    RegisterDataNotify;\r
+  EFI_IP6_CONFIG_UNREGISTER_NOTIFY  UnregisterDataNotify;\r
+} EFI_IP6_CONFIG_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiIp6ConfigProtocolGuid;\r
+\r
+#endif\r
+\r
index d750fe9c788ba2ceb0c0dee81664373510613fe9..355afe1835b6568b9630cb7aceb994178abafb79 100644 (file)
@@ -1,10 +1,10 @@
 /** @file\r
-  EFI TCPv4 Protocol Definition\r
+  EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition\r
   The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create\r
   and destroy child of the driver to communicate with other host using TCP protocol.\r
   The EFI TCPv4 Protocol provides services to send and receive data stream.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation\r
+  Copyright (c) 2006 - 2009, Intel Corporation\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -269,8 +269,7 @@ EFI_STATUS
                                 way handshake finishes.\r
 \r
   @retval EFI_SUCCESS           The connection request is successfully initiated and the state\r
-                                - of this TCPv4 instance has been changed to\r
-                                - Tcp4StateSynSent.\r
+                                of this TCPv4 instance has been changed to Tcp4StateSynSent.\r
   @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.\r
   @retval EFI_ACCESS_DENIED     One or more of the following conditions are TRUE:\r
                                 - This instance is not configured as an active one.\r
@@ -279,7 +278,7 @@ EFI_STATUS
                                 - This is NULL.\r
                                 - ConnectionToken is NULL.\r
                                 - ConnectionToken->CompletionToken.Event is NULL.\r
-  @retval EFI_OUT_OF_RESOURCES  The driver can't allocate enough resource to initiate the activeopen.\r
+  @retval EFI_OUT_OF_RESOURCES  The driver can't allocate enough resource to initiate the activ eopen.\r
   @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
 \r
 **/\r
@@ -443,12 +442,15 @@ EFI_STATUS
                 EFI_TCP4_COMPLETION_TOKEN is defined in\r
                 EFI_TCP4_PROTOCOL.Connect().\r
 \r
-  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
-  @retval  EFI_INVALID_PARAMETER This is NULL.\r
-  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
-  @retval  EFI_NOT_READY         No incoming or outgoing data is processed.\r
-  @retval  EFI_TIMEOUT           Data was dropped out of the transmission or receive queue.\r
-                                 Consider increasing the polling rate.\r
+  @retval  EFI_SUCCESS             The asynchronous I/O request is aborted and Token->Event\r
+                                   is signaled.\r
+  @retval  EFI_INVALID_PARAMETER   This is NULL.\r
+  @retval  EFI_NOT_STARTED         This instance hasn't been configured.\r
+  @retval  EFI_NO_MAPPING          When using the default address, configuration\r
+                                   (DHCP, BOOTP,RARP, etc.) hasn't finished yet.\r
+  @retval  EFI_NOT_FOUND           The asynchronous I/O request isn't found in the \r
+                                   transmission or receive queue. It has either \r
+                                   completed or wasn't issued by Transmit() and Receive().\r
 \r
 **/\r
 typedef\r
diff --git a/MdePkg/Include/Protocol/Tcp6.h b/MdePkg/Include/Protocol/Tcp6.h
new file mode 100644 (file)
index 0000000..d3f5382
--- /dev/null
@@ -0,0 +1,853 @@
+/** @file\r
+  EFI TCPv6(Transmission Control Protocol version 6) Protocol Definition\r
+  The EFI TCPv6 Service Binding Protocol is used to locate EFI TCPv6 Protocol drivers to create\r
+  and destroy child of the driver to communicate with other host using TCP protocol.\r
+  The EFI TCPv6 Protocol provides services to send and receive data stream.\r
+\r
+  Copyright (c) 2008 - 2009, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __EFI_TCP6_PROTOCOL_H__\r
+#define __EFI_TCP6_PROTOCOL_H__\r
+\r
+#include <Protocol/Snp.h>\r
+#include <Protocol/ManagedNetwork.h>\r
+#include <Protocol/Ip6.h>\r
+\r
+#define EFI_TCP6_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0xec20eb79, 0x6c1a, 0x4664, {0x9a, 0x0d, 0xd2, 0xe4, 0xcc, 0x16, 0xd6, 0x64 } \\r
+  }\r
+\r
+#define EFI_TCP6_PROTOCOL_GUID \\r
+  { \\r
+    0x46e44855, 0xbd60, 0x4ab7, {0xab, 0x0d, 0xa6, 0x79, 0xb9, 0x44, 0x7d, 0x77 } \\r
+  }\r
+\r
+\r
+typedef struct _EFI_TCP6_PROTOCOL EFI_TCP6_PROTOCOL;\r
+\r
+\r
+///\r
+/// EFI_TCP6_SERVICE_POINT\r
+///\r
+typedef struct {\r
+  ///\r
+  /// The EFI TCPv6 Protocol instance handle that is using this \r
+  /// address/port pair.\r
+  ///\r
+  EFI_HANDLE        InstanceHandle;\r
+  /// \r
+  /// The local IPv6 address to which this TCP instance is bound. Set \r
+  /// to 0::/128, if this TCP instance is configured to listen on all \r
+  /// available source addresses.\r
+  /// \r
+  EFI_IPv6_ADDRESS  LocalAddress;\r
+  /// \r
+  /// The local port number in host byte order.\r
+  /// \r
+  UINT16            LocalPort;\r
+  /// \r
+  /// The remote IPv6 address. It may be 0::/128 if this TCP instance is \r
+  /// not connected to any remote host. \r
+  /// \r
+  EFI_IPv6_ADDRESS  RemoteAddress;\r
+  /// \r
+  /// The remote port number in host byte order. It may be zero if this \r
+  /// TCP instance is not connected to any remote host.\r
+  /// \r
+  UINT16            RemotePort;\r
+} EFI_TCP6_SERVICE_POINT;\r
+\r
+/// \r
+/// EFI_TCP6_VARIABLE_DATA\r
+///\r
+typedef struct {\r
+  EFI_HANDLE             DriverHandle; ///< The handle of the driver that creates this entry.\r
+  UINT32                 ServiceCount; ///< The number of address/port pairs following this data structure.\r
+  EFI_TCP6_SERVICE_POINT Services[1];  ///< List of address/port pairs that are currently in use.\r
+} EFI_TCP6_VARIABLE_DATA;\r
+\r
+///\r
+/// EFI_TCP6_ACCESS_POINT\r
+///\r
+typedef struct {\r
+  /// \r
+  /// The local IP address assigned to this TCP instance. The EFI \r
+  /// TCPv6 driver will only deliver incoming packets whose \r
+  /// destination addresses exactly match the IP address. Set to zero to \r
+  /// let the underlying IPv6 driver choose a source address. If not zero \r
+  /// it must be one of the configured IP addresses in the underlying \r
+  /// IPv6 driver.\r
+  /// \r
+  EFI_IPv6_ADDRESS  StationAddress;\r
+  /// \r
+  /// The local port number to which this EFI TCPv6 Protocol instance \r
+  /// is bound. If the instance doesn't care the local port number, set \r
+  /// StationPort to zero to use an ephemeral port.\r
+  /// \r
+  UINT16            StationPort;\r
+  /// \r
+  /// The remote IP address to which this EFI TCPv6 Protocol instance \r
+  /// is connected. If ActiveFlag is FALSE (i.e. a passive TCPv6 \r
+  /// instance), the instance only accepts connections from the \r
+  /// RemoteAddress. If ActiveFlag is TRUE the instance will \r
+  /// connect to the RemoteAddress, i.e., outgoing segments will be \r
+  /// sent to this address and only segments from this address will be \r
+  /// delivered to the application. When ActiveFlag is FALSE, it \r
+  /// can be set to zero and means that incoming connection requests \r
+  /// from any address will be accepted.\r
+  /// \r
+  EFI_IPv6_ADDRESS  RemoteAddress;\r
+  /// \r
+  /// The remote port to which this EFI TCPv6 Protocol instance \r
+  /// connects or from which connection request will be accepted by \r
+  /// this EFI TCPv6 Protocol instance. If ActiveFlag is FALSE it \r
+  /// can be zero and means that incoming connection request from \r
+  /// any port will be accepted. Its value can not be zero when \r
+  /// ActiveFlag is TRUE.\r
+  /// \r
+  UINT16            RemotePort;\r
+  /// \r
+  /// Set it to TRUE to initiate an active open. Set it to FALSE to \r
+  /// initiate a passive open to act as a server.\r
+  /// \r
+  BOOLEAN           ActiveFlag;\r
+} EFI_TCP6_ACCESS_POINT;\r
+\r
+///\r
+/// EFI_TCP6_OPTION\r
+///\r
+typedef struct {\r
+  /// \r
+  /// The size of the TCP receive buffer.\r
+  /// \r
+  UINT32   ReceiveBufferSize;\r
+  /// \r
+  /// The size of the TCP send buffer.\r
+  /// \r
+  UINT32   SendBufferSize;\r
+  /// \r
+  /// The length of incoming connect request queue for a passive \r
+  /// instance. When set to zero, the value is implementation specific.\r
+  /// \r
+  UINT32   MaxSynBackLog;\r
+  /// \r
+  /// The maximum seconds a TCP instance will wait for before a TCP \r
+  /// connection established. When set to zero, the value is \r
+  /// implementation specific.\r
+  /// \r
+  UINT32   ConnectionTimeout;\r
+  ///\r
+  ///The number of times TCP will attempt to retransmit a packet on \r
+  ///an established connection. When set to zero, the value is \r
+  ///implementation specific.\r
+  ///\r
+  UINT32   DataRetries;\r
+  /// \r
+  /// How many seconds to wait in the FIN_WAIT_2 states for a final \r
+  /// FIN flag before the TCP instance is closed. This timeout is in \r
+  /// effective only if the application has called Close() to \r
+  /// disconnect the connection completely. It is also called \r
+  /// FIN_WAIT_2 timer in other implementations. When set to zero, \r
+  /// it should be disabled because the FIN_WAIT_2 timer itself is \r
+  /// against the standard. The default value is 60.\r
+  /// \r
+  UINT32   FinTimeout;\r
+  ///  \r
+  /// How many seconds to wait in TIME_WAIT state before the TCP \r
+  /// instance is closed. The timer is disabled completely to provide a \r
+  /// method to close the TCP connection quickly if it is set to zero. It \r
+  /// is against the related RFC documents.\r
+  /// \r
+  UINT32   TimeWaitTimeout;\r
+  /// \r
+  /// The maximum number of TCP keep-alive probes to send before \r
+  /// giving up and resetting the connection if no response from the \r
+  /// other end. Set to zero to disable keep-alive probe.\r
+  /// \r
+  UINT32   KeepAliveProbes;\r
+  /// \r
+  /// The number of seconds a connection needs to be idle before TCP \r
+  /// sends out periodical keep-alive probes. When set to zero, the \r
+  /// value is implementation specific. It should be ignored if keep-\r
+  /// alive probe is disabled.\r
+  /// \r
+  UINT32   KeepAliveTime;\r
+  /// \r
+  /// The number of seconds between TCP keep-alive probes after the \r
+  /// periodical keep-alive probe if no response. When set to zero, the \r
+  /// value is implementation specific. It should be ignored if keep-\r
+  /// alive probe is disabled.\r
+  /// \r
+  UINT32   KeepAliveInterval;\r
+  /// \r
+  /// Set it to TRUE to enable the Nagle algorithm as defined in \r
+  /// RFC896. Set it to FALSE to disable it.\r
+  /// \r
+  BOOLEAN  EnableNagle;\r
+  /// \r
+  /// Set it to TRUE to enable TCP timestamps option as defined in \r
+  /// RFC1323. Set to FALSE to disable it.\r
+  /// \r
+  BOOLEAN  EnableTimeStamp;\r
+  /// \r
+  /// Set it to TRUE to enable TCP window scale option as defined in \r
+  /// RFC1323. Set it to FALSE to disable it. \r
+  /// \r
+  BOOLEAN  EnableWindowScaling;\r
+  /// \r
+  /// Set it to TRUE to enable selective acknowledge mechanism \r
+  /// described in RFC 2018. Set it to FALSE to disable it. \r
+  /// Implementation that supports SACK can optionally support \r
+  /// DSAK as defined in RFC 2883.\r
+  /// \r
+  BOOLEAN  EnableSelectiveAck;\r
+  /// \r
+  /// Set it to TRUE to enable path MTU discovery as defined in \r
+  /// RFC 1191. Set to FALSE to disable it.\r
+  /// \r
+  BOOLEAN  EnablePathMtuDiscovery;\r
+} EFI_TCP6_OPTION;\r
+\r
+///\r
+/// EFI_TCP6_CONFIG_DATA\r
+///\r
+typedef struct {\r
+  ///\r
+  /// TrafficClass field in transmitted IPv6 packets.\r
+  ///\r
+  UINT8                 TrafficClass;\r
+  ///\r
+  /// HopLimit field in transmitted IPv6 packets.\r
+  ///\r
+  UINT8                 HopLimit;\r
+  ///\r
+  /// Used to specify TCP communication end settings for a TCP instance. \r
+  ///\r
+  EFI_TCP6_ACCESS_POINT AccessPoint;\r
+  ///\r
+  /// Used to configure the advance TCP option for a connection. If set \r
+  /// to NULL, implementation specific options for TCP connection will be used.\r
+  ///\r
+  EFI_TCP6_OPTION       *ControlOption;\r
+} EFI_TCP6_CONFIG_DATA;\r
+\r
+///\r
+/// EFI_TCP6_CONNECTION_STATE\r
+///\r
+typedef enum {\r
+  Tcp6StateClosed      = 0,\r
+  Tcp6StateListen      = 1,\r
+  Tcp6StateSynSent     = 2,\r
+  Tcp6StateSynReceived = 3,\r
+  Tcp6StateEstablished = 4,\r
+  Tcp6StateFinWait1    = 5,\r
+  Tcp6StateFinWait2    = 6,\r
+  Tcp6StateClosing     = 7,\r
+  Tcp6StateTimeWait    = 8,\r
+  Tcp6StateCloseWait   = 9,\r
+  Tcp6StateLastAck     = 10\r
+} EFI_TCP6_CONNECTION_STATE;\r
+\r
+///\r
+/// EFI_TCP6_COMPLETION_TOKEN\r
+/// is used as a common header for various asynchronous tokens. \r
+///\r
+typedef struct {\r
+  ///\r
+  /// The Event to signal after request is finished and Status field is \r
+  /// updated by the EFI TCPv6 Protocol driver. \r
+  /// \r
+  EFI_EVENT   Event;\r
+  ///\r
+  /// The result of the completed operation. \r
+  ///\r
+  EFI_STATUS  Status;\r
+} EFI_TCP6_COMPLETION_TOKEN;\r
+\r
+///\r
+/// EFI_TCP6_CONNECTION_TOKEN\r
+/// will be set if the active open succeeds or an unexpected\r
+/// error happens.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// The Status in the CompletionToken will be set to one of \r
+  /// the following values if the active open succeeds or an unexpected \r
+  /// error happens:\r
+  /// EFI_SUCCESS:              The active open succeeds and the instance's \r
+  ///                           state is Tcp6StateEstablished.\r
+  /// EFI_CONNECTION_RESET:     The connect fails because the connection is reset\r
+  ///                           either by instance itself or the communication peer.\r
+  /// EFI_ABORTED:              The active open is aborted.\r
+  /// EFI_TIMEOUT:              The connection establishment timer expires and \r
+  ///                           no more specific information is available.\r
+  /// EFI_NETWORK_UNREACHABLE:  The active open fails because \r
+  ///                           an ICMP network unreachable error is received. \r
+  /// EFI_HOST_UNREACHABLE:     The active open fails because an \r
+  ///                           ICMP host unreachable error is received. \r
+  /// EFI_PROTOCOL_UNREACHABLE: The active open fails \r
+  ///                           because an ICMP protocol unreachable error is received.\r
+  /// EFI_PORT_UNREACHABLE:     The connection establishment \r
+  ///                           timer times out and an ICMP port unreachable error is received.\r
+  /// EFI_ICMP_ERROR:           The connection establishment timer times \r
+  ///                           out and some other ICMP error is received.\r
+  /// EFI_DEVICE_ERROR:         An unexpected system or network error occurred.\r
+  /// EFI_SECURITY_VIOLATION:   The active open was failed because of IPSec policy check.\r
+  /// \r
+  EFI_TCP6_COMPLETION_TOKEN CompletionToken;\r
+} EFI_TCP6_CONNECTION_TOKEN;\r
+\r
+///\r
+/// EFI_TCP6_LISTEN_TOKEN\r
+/// returns when list operation finishes.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// The Status in CompletionToken will be set to the \r
+  /// following value if accept finishes:\r
+  /// EFI_SUCCESS:            A remote peer has successfully established a \r
+  ///                         connection to this instance. A new TCP instance has also been \r
+  ///                         created for the connection.\r
+  /// EFI_CONNECTION_RESET:   The accept fails because the connection is reset either\r
+  ///                         by instance itself or communication peer.\r
+  /// EFI_ABORTED:            The accept request has been aborted.\r
+  /// EFI_SECURITY_VIOLATION: The accept operation was failed because of IPSec policy check.\r
+  ///\r
+  EFI_TCP6_COMPLETION_TOKEN CompletionToken;\r
+  EFI_HANDLE                NewChildHandle;\r
+} EFI_TCP6_LISTEN_TOKEN;\r
+\r
+///\r
+/// EFI_TCP6_FRAGMENT_DATA\r
+/// allows multiple receive or transmit buffers to be specified. The \r
+/// purpose of this structure is to provide scattered read and write.\r
+///\r
+typedef struct {\r
+  UINT32 FragmentLength;   ///< Length of data buffer in the fragment.\r
+  VOID   *FragmentBuffer;  ///< Pointer to the data buffer in the fragment.\r
+} EFI_TCP6_FRAGMENT_DATA;\r
+\r
+///\r
+/// EFI_TCP6_RECEIVE_DATA\r
+/// When TCPv6 driver wants to deliver received data to the application, \r
+/// it will pick up the first queued receiving token, update its\r
+/// Token->Packet.RxData then signal the Token->CompletionToken.Event.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// Whether the data is urgent. When this flag is set, the instance is in \r
+  /// urgent mode. \r
+  ///\r
+  BOOLEAN                 UrgentFlag;\r
+  /// \r
+  /// When calling Receive() function, it is the byte counts of all \r
+  /// Fragmentbuffer in FragmentTable allocated by user. \r
+  /// When the token is signaled by TCPv6 driver it is the length of \r
+  /// received data in the fragments.\r
+  /// \r
+  UINT32                  DataLength;\r
+  /// \r
+  /// Number of fragments.\r
+  /// \r
+  UINT32                  FragmentCount;\r
+  /// \r
+  /// An array of fragment descriptors.\r
+  /// \r
+  EFI_TCP6_FRAGMENT_DATA  FragmentTable[1];\r
+} EFI_TCP6_RECEIVE_DATA;\r
+\r
+///\r
+/// EFI_TCP6_TRANSMIT_DATA\r
+/// The EFI TCPv6 Protocol user must fill this data structure before sending a packet.\r
+/// The packet may contain multiple buffers in non-continuous memory locations. \r
+///\r
+typedef struct {\r
+  /// \r
+  /// Push If TRUE, data must be transmitted promptly, and the PUSH bit in \r
+  /// the last TCP segment created will be set. If FALSE, data \r
+  /// transmission may be delayed to combine with data from \r
+  /// subsequent Transmit()s for efficiency.\r
+  /// \r
+  BOOLEAN                 Push;\r
+  /// \r
+  /// The data in the fragment table are urgent and urgent point is in \r
+  /// effect if TRUE. Otherwise those data are NOT considered urgent.\r
+  /// \r
+  BOOLEAN                 Urgent;\r
+  ///\r
+  /// Length of the data in the fragments. \r
+  ///\r
+  UINT32                  DataLength;\r
+  ///\r
+  /// Number of fragments.\r
+  /// \r
+  UINT32                  FragmentCount;\r
+  ///\r
+  /// An array of fragment descriptors.\r
+  ///\r
+  EFI_TCP6_FRAGMENT_DATA  FragmentTable[1];\r
+} EFI_TCP6_TRANSMIT_DATA;\r
+\r
+///\r
+/// EFI_TCP6_IO_TOKEN\r
+/// returns When transmission finishes or meets any unexpected error. \r
+///\r
+typedef struct {\r
+  /// \r
+  /// When transmission finishes or meets any unexpected error it will \r
+  /// be set to one of the following values:\r
+  /// EFI_SUCCESS:              The receiving or transmission operation \r
+  ///                           completes successfully.\r
+  /// EFI_CONNECTION_RESET:     The receiving or transmission operation fails\r
+  ///                           because this connection is reset either by instance \r
+  ///                           itself or the communication peer.\r
+  /// EFI_ABORTED:              The receiving or transmission is aborted.\r
+  /// EFI_TIMEOUT:              The transmission timer expires and no more \r
+  ///                           specific information is available.\r
+  /// EFI_NETWORK_UNREACHABLE:  The transmission fails \r
+  ///                           because an ICMP network unreachable error is received. \r
+  /// EFI_HOST_UNREACHABLE:     The transmission fails because an \r
+  ///                           ICMP host unreachable error is received. \r
+  /// EFI_PROTOCOL_UNREACHABLE: The transmission fails \r
+  ///                           because an ICMP protocol unreachable error is received. \r
+  /// EFI_PORT_UNREACHABLE:     The transmission fails and an \r
+  ///                           ICMP port unreachable error is received. \r
+  /// EFI_ICMP_ERROR:           The transmission fails and some other \r
+  ///                           ICMP error is received. \r
+  /// EFI_DEVICE_ERROR:         An unexpected system or network error occurs.\r
+  /// EFI_SECURITY_VIOLATION:   The receiving or transmission \r
+  ///                           operation was failed because of IPSec policy check\r
+  ///\r
+  EFI_TCP6_COMPLETION_TOKEN CompletionToken;\r
+  union {\r
+    ///\r
+    /// When this token is used for receiving, RxData is a pointer to \r
+    /// EFI_TCP6_RECEIVE_DATA.\r
+    ///\r
+    EFI_TCP6_RECEIVE_DATA   *RxData;\r
+    /// \r
+    /// When this token is used for transmitting, TxData is a pointer to \r
+    /// EFI_TCP6_TRANSMIT_DATA.\r
+    ///\r
+    EFI_TCP6_TRANSMIT_DATA  *TxData;\r
+  } Packet;\r
+} EFI_TCP6_IO_TOKEN;\r
+\r
+///\r
+/// EFI_TCP6_CLOSE_TOKEN\r
+/// returns when close operation finishes.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// When close finishes or meets any unexpected error it will be set \r
+  /// to one of the following values:\r
+  /// EFI_SUCCESS:            The close operation completes successfully.\r
+  /// EFI_ABORTED:            User called configure with NULL without close stopping.\r
+  /// EFI_SECURITY_VIOLATION: The close operation was failed because of IPSec policy check.\r
+  /// \r
+  EFI_TCP6_COMPLETION_TOKEN CompletionToken;\r
+  /// \r
+  /// Abort the TCP connection on close instead of the standard TCP \r
+  /// close process when it is set to TRUE. This option can be used to \r
+  /// satisfy a fast disconnect.\r
+  /// \r
+  BOOLEAN                   AbortOnClose;\r
+} EFI_TCP6_CLOSE_TOKEN;\r
+\r
+/**\r
+  Get the current operational status.\r
+        \r
+  The GetModeData() function copies the current operational settings of this EFI TCPv6\r
+  Protocol instance into user-supplied buffers. This function can also be used to retrieve\r
+  the operational setting of underlying drivers such as IPv6, MNP, or SNP.\r
+\r
+  @param[in]  This              Pointer to the EFI_TCP6_PROTOCOL instance.\r
+  @param[out] Tcp6State         The buffer in which the current TCP state is returned.\r
+  @param[out] Tcp6ConfigData    The buffer in which the current TCP configuration is returned. \r
+  @param[out] Ip6ModeData       The buffer in which the current IPv6 configuration data used by \r
+                                the TCP instance is returned. \r
+  @param[out] MnpConfigData     The buffer in which the current MNP configuration data used \r
+                                indirectly by the TCP instance is returned.\r
+  @param[out] SnpModeData       The buffer in which the current SNP mode data used indirectly by \r
+                                the TCP instance is returned.\r
+\r
+  @retval EFI_SUCCESS           The mode data was read.\r
+  @retval EFI_NOT_STARTED       No configuration data is available because this instance hasn't\r
+                                been started.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_GET_MODE_DATA) (\r
+  IN  EFI_TCP6_PROTOCOL                  *This,\r
+  OUT EFI_TCP6_CONNECTION_STATE          *Tcp6State OPTIONAL,\r
+  OUT EFI_TCP6_CONFIG_DATA               *Tcp6ConfigData OPTIONAL,\r
+  OUT EFI_IP6_MODE_DATA                  *Ip6ModeData OPTIONAL,\r
+  OUT EFI_MANAGED_NETWORK_CONFIG_DATA    *MnpConfigData OPTIONAL,\r
+  OUT EFI_SIMPLE_NETWORK_MODE            *SnpModeData OPTIONAL\r
+  );\r
+\r
+/**\r
+  Initialize or brutally reset the operational parameters for this EFI TCPv6 instance.\r
+\r
+  The Configure() function does the following:\r
+  - Initialize this TCP instance, i.e., initialize the communication end settings and\r
+    specify active open or passive open for an instance.\r
+  - Reset this TCP instance brutally, i.e., cancel all pending asynchronous tokens, flush \r
+    transmission and receiving buffer directly without informing the communication peer.\r
+\r
+  No other TCPv6 Protocol operation except Poll() can be executed by this instance until\r
+  it is configured properly. For an active TCP instance, after a proper configuration it\r
+  may call Connect() to initiates the three-way handshake. For a passive TCP instance, \r
+  its state will transit to Tcp6StateListen after configuration, and Accept() may be \r
+  called to listen the incoming TCP connection requests. If Tcp6ConfigData is set to NULL,\r
+  the instance is reset. Resetting process will be done brutally, the state machine will\r
+  be set to Tcp6StateClosed directly, the receive queue and transmit queue will be flushed,\r
+  and no traffic is allowed through this instance. \r
+\r
+  @param[in] This               Pointer to the EFI_TCP6_PROTOCOL instance.\r
+  @param[in] Tcp6ConfigData     Pointer to the configure data to configure the instance.\r
+                                If Tcp6ConfigData is set to NULL, the instance is reset.\r
+\r
+  @retval EFI_SUCCESS           The operational settings are set, changed, or reset\r
+                                successfully.\r
+  @retval EFI_NO_MAPPING        The underlying IPv6 driver was responsible for choosing a source \r
+                                address for this instance, but no source address was available for \r
+                                use.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions are TRUE:\r
+                                - This is NULL.\r
+                                - Tcp6ConfigData->AccessPoint.StationAddress is neither zero nor \r
+                                  one of the configured IP addresses in the underlying IPv6 driver.\r
+                                - Tcp6ConfigData->AccessPoint.RemoteAddress isn't a valid unicast \r
+                                  IPv6 address.\r
+                                - Tcp6ConfigData->AccessPoint.RemoteAddress is zero or \r
+                                  Tcp6ConfigData->AccessPoint.RemotePort is zero when \r
+                                  Tcp6ConfigData->AccessPoint.ActiveFlag is TRUE.\r
+                                - A same access point has been configured in other TCP \r
+                                  instance properly.\r
+  @retval EFI_ACCESS_DENIED     Configuring TCP instance when it is configured without\r
+                                calling Configure() with NULL to reset it.\r
+  @retval EFI_UNSUPPORTED       One or more of the control options are not supported in\r
+                                the implementation.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough system resources when\r
+                                executing Configure().\r
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_CONFIGURE) (\r
+  IN EFI_TCP6_PROTOCOL        *This,\r
+  IN EFI_TCP6_CONFIG_DATA     *Tcp6ConfigData OPTIONAL\r
+  );\r
+\r
+/**\r
+  Initiate a nonblocking TCP connection request for an active TCP instance.\r
+\r
+  The Connect() function will initiate an active open to the remote peer configured\r
+  in current TCP instance if it is configured active. If the connection succeeds or\r
+  fails due to any error, the ConnectionToken->CompletionToken.Event will be signaled\r
+  and ConnectionToken->CompletionToken.Status will be updated accordingly. This \r
+  function can only be called for the TCP instance in Tcp6StateClosed state. The \r
+  instance will transfer into Tcp6StateSynSent if the function returns EFI_SUCCESS. \r
+  If TCP three-way handshake succeeds, its state will become Tcp6StateEstablished,\r
+  otherwise, the state will return to Tcp6StateClosed.\r
+\r
+  @param[in] This                Pointer to the EFI_TCP6_PROTOCOL instance.\r
+  @param[in] ConnectionToken     Pointer to the connection token to return when the TCP three\r
+                                 way handshake finishes.\r
+\r
+  @retval EFI_SUCCESS            The connection request is successfully initiated and the state of \r
+                                 this TCP instance has been changed to Tcp6StateSynSent.\r
+  @retval EFI_NOT_STARTED        This EFI TCPv6 Protocol instance has not been configured.\r
+  @retval EFI_ACCESS_DENIED      One or more of the following conditions are TRUE:\r
+                                 - This instance is not configured as an active one.\r
+                                 - This instance is not in Tcp6StateClosed state.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following are TRUE:\r
+                                 - This is NULL.\r
+                                 - ConnectionToken is NULL.\r
+                                 - ConnectionToken->CompletionToken.Event is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   The driver can't allocate enough resource to initiate the active open.\r
+  @retval EFI_DEVICE_ERROR       An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_CONNECT) (\r
+  IN EFI_TCP6_PROTOCOL           *This,\r
+  IN EFI_TCP6_CONNECTION_TOKEN   *ConnectionToken\r
+  );\r
+\r
+/**\r
+  Listen on the passive instance to accept an incoming connection request. This is a \r
+  nonblocking operation.\r
\r
+  The Accept() function initiates an asynchronous accept request to wait for an incoming \r
+  connection on the passive TCP instance. If a remote peer successfully establishes a \r
+  connection with this instance, a new TCP instance will be created and its handle will\r
+  be returned in ListenToken->NewChildHandle. The newly created instance is configured\r
+  by inheriting the passive instance's configuration and is ready for use upon return.\r
+  The new instance is in the Tcp6StateEstablished state.\r
+\r
+  The ListenToken->CompletionToken.Event will be signaled when a new connection is \r
+  accepted, user aborts the listen or connection is reset. \r
+\r
+  This function only can be called when current TCP instance is in Tcp6StateListen state. \r
+\r
+  @param[in] This                Pointer to the EFI_TCP6_PROTOCOL instance.\r
+  @param[in] ListenToken         Pointer to the listen token to return when operation finishes.\r
+                                 \r
+                                 \r
+  @retval EFI_SUCCESS            The listen token has been queued successfully.\r
+  @retval EFI_NOT_STARTED        This EFI TCPv6 Protocol instance has not been configured.\r
+  @retval EFI_ACCESS_DENIED      One or more of the following are TRUE:\r
+                                 - This instance is not a passive instance.\r
+                                 - This instance is not in Tcp6StateListen state.\r
+                                 - The same listen token has already existed in the listen\r
+                                   token queue of this TCP instance.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following are TRUE:\r
+                                 - This is NULL.\r
+                                 - ListenToken is NULL.\r
+                                 - ListentToken->CompletionToken.Event is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   Could not allocate enough resource to finish the operation.\r
+  @retval EFI_DEVICE_ERROR       Any unexpected and not belonged to above category error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_ACCEPT) (\r
+  IN EFI_TCP6_PROTOCOL             *This,\r
+  IN EFI_TCP6_LISTEN_TOKEN         *ListenToken\r
+  );\r
+\r
+/**\r
+  Queues outgoing data into the transmit queue.\r
+\r
+  The Transmit() function queues a sending request to this TCP instance along with the\r
+  user data. The status of the token is updated and the event in the token will be \r
+  signaled once the data is sent out or some error occurs.\r
+\r
+  @param[in] This                 Pointer to the EFI_TCP6_PROTOCOL instance.\r
+  @param[in] Token                Pointer to the completion token to queue to the transmit queue.\r
+\r
+  @retval EFI_SUCCESS             The data has been queued for transmission.\r
+  @retval EFI_NOT_STARTED         This EFI TCPv6 Protocol instance has not been configured.\r
+  @retval EFI_NO_MAPPING          The underlying IPv6 driver was responsible for choosing a \r
+                                  source address for this instance, but no source address was \r
+                                  available for use.\r
+  @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
+                                  - This is NULL.\r
+                                  - Token is NULL.\r
+                                  - Token->CompletionToken.Event is NULL.\r
+                                  - Token->Packet.TxData is NULL.\r
+                                  - Token->Packet.FragmentCount is zero.\r
+                                  - Token->Packet.DataLength is not equal to the sum of fragment lengths.\r
+  @retval EFI_ACCESS_DENIED       One or more of the following conditions are TRUE:\r
+                                  - A transmit completion token with the same Token-> \r
+                                    CompletionToken.Event was already in the \r
+                                    transmission queue.\r
+                                  - The current instance is in Tcp6StateClosed state.\r
+                                  - The current instance is a passive one and it is in \r
+                                    Tcp6StateListen state.\r
+                                  - User has called Close() to disconnect this connection.\r
+  @retval EFI_NOT_READY           The completion token could not be queued because the\r
+                                  transmit queue is full.\r
+  @retval EFI_OUT_OF_RESOURCES    Could not queue the transmit data because of resource\r
+                                  shortage.\r
+  @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_TRANSMIT) (\r
+  IN EFI_TCP6_PROTOCOL            *This,\r
+  IN EFI_TCP6_IO_TOKEN            *Token\r
+  );\r
+\r
+/**\r
+  Places an asynchronous receive request into the receiving queue.\r
+\r
+  The Receive() function places a completion token into the receive packet queue. This \r
+  function is always asynchronous. The caller must allocate the Token->CompletionToken.Event\r
+  and the FragmentBuffer used to receive data. The caller also must fill the DataLength which \r
+  represents the whole length of all FragmentBuffer. When the receive operation completes, the \r
+  EFI TCPv6 Protocol driver updates the Token->CompletionToken.Status and Token->Packet.RxData\r
+  fields and the Token->CompletionToken.Event is signaled. If got data the data and its length\r
+  will be copied into the FragmentTable, at the same time the full length of received data will\r
+  be recorded in the DataLength fields. Providing a proper notification function and context\r
+  for the event will enable the user to receive the notification and receiving status. That \r
+  notification function is guaranteed to not be re-entered.\r
+\r
+  @param[in] This               Pointer to the EFI_TCP6_PROTOCOL instance.\r
+  @param[in] Token              Pointer to a token that is associated with the receive data\r
+                                descriptor.\r
+\r
+  @retval EFI_SUCCESS            The receive completion token was cached.\r
+  @retval EFI_NOT_STARTED        This EFI TCPv6 Protocol instance has not been configured.\r
+  @retval EFI_NO_MAPPING         The underlying IPv6 driver was responsible for choosing a source \r
+                                 address for this instance, but no source address was available for use.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - Token is NULL.\r
+                                 - Token->CompletionToken.Event is NULL.\r
+                                 - Token->Packet.RxData is NULL.\r
+                                 - Token->Packet.RxData->DataLength is 0.\r
+                                 - The Token->Packet.RxData->DataLength is not the \r
+                                   sum of all FragmentBuffer length in FragmentTable.\r
+  @retval EFI_OUT_OF_RESOURCES   The receive completion token could not be queued due to a lack of\r
+                                 system resources (usually memory).\r
+  @retval EFI_DEVICE_ERROR       An unexpected system or network error occurred. \r
+                                 The EFI TCPv6 Protocol instance has been reset to startup defaults.\r
+  @retval EFI_ACCESS_DENIED      One or more of the following conditions is TRUE:\r
+                                 - A receive completion token with the same Token->CompletionToken.Event\r
+                                   was already in the receive queue.\r
+                                 - The current instance is in Tcp6StateClosed state.\r
+                                 - The current instance is a passive one and it is in \r
+                                   Tcp6StateListen state.\r
+                                 - User has called Close() to disconnect this connection.\r
+  @retval EFI_CONNECTION_FIN     The communication peer has closed the connection and there is no \r
+                                 any buffered data in the receive buffer of this instance\r
+  @retval EFI_NOT_READY          The receive request could not be queued because the receive queue is full.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_RECEIVE) (\r
+  IN EFI_TCP6_PROTOCOL           *This,\r
+  IN EFI_TCP6_IO_TOKEN           *Token\r
+  );\r
+\r
+/**\r
+  Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a\r
+  nonblocking operation.\r
+\r
+  Initiate an asynchronous close token to TCP driver. After Close() is called, any buffered \r
+  transmission data will be sent by TCP driver and the current instance will have a graceful close \r
+  working flow described as RFC 793 if AbortOnClose is set to FALSE, otherwise, a rest packet \r
+  will be sent by TCP driver to fast disconnect this connection. When the close operation completes \r
+  successfully the TCP instance is in Tcp6StateClosed state, all pending asynchronous \r
+  operations are signaled and any buffers used for TCP network traffic are flushed.\r
+\r
+  @param[in] This                Pointer to the EFI_TCP6_PROTOCOL instance.\r
+  @param[in] CloseToken          Pointer to the close token to return when operation finishes.\r
+                                 \r
+  @retval EFI_SUCCESS            The Close() is called successfully.\r
+  @retval EFI_NOT_STARTED        This EFI TCPv6 Protocol instance has not been configured.\r
+  @retval EFI_ACCESS_DENIED      One or more of the following are TRUE:\r
+                                 - CloseToken or CloseToken->CompletionToken.Event is already in use.\r
+                                 - Previous Close() call on this instance has not finished.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following are TRUE:\r
+                                 - This is NULL.\r
+                                 - CloseToken is NULL.\r
+                                 - CloseToken->CompletionToken.Event is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   Could not allocate enough resource to finish the operation.\r
+  @retval EFI_DEVICE_ERROR       Any unexpected and not belonged to above category error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_CLOSE) (\r
+  IN EFI_TCP6_PROTOCOL           *This,\r
+  IN EFI_TCP6_CLOSE_TOKEN        *CloseToken\r
+  );\r
+\r
+/**\r
+  Abort an asynchronous connection, listen, transmission or receive request.\r
+\r
+  The Cancel() function aborts a pending connection, listen, transmit or \r
+  receive request.\r
+\r
+  If Token is not NULL and the token is in the connection, listen, transmission\r
+  or receive queue when it is being cancelled, its Token->Status will be set \r
+  to EFI_ABORTED and then Token->Event will be signaled.\r
+\r
+  If the token is not in one of the queues, which usually means that the \r
+  asynchronous operation has completed, EFI_NOT_FOUND is returned.\r
+\r
+  If Token is NULL all asynchronous token issued by Connect(), Accept(),\r
+  Transmit() and Receive() will be aborted.\r
+\r
+  @param[in] This                Pointer to the EFI_TCP6_PROTOCOL instance.\r
+  @param[in] Token               Pointer to a token that has been issued by\r
+                                 EFI_TCP6_PROTOCOL.Connect(),\r
+                                 EFI_TCP6_PROTOCOL.Accept(),\r
+                                 EFI_TCP6_PROTOCOL.Transmit() or\r
+                                 EFI_TCP6_PROTOCOL.Receive(). If NULL, all pending\r
+                                 tokens issued by above four functions will be aborted. Type\r
+                                 EFI_TCP6_COMPLETION_TOKEN is defined in\r
+                                 EFI_TCP_PROTOCOL.Connect().\r
+\r
+  @retval EFI_SUCCESS            The asynchronous I/O request is aborted and Token->Event \r
+                                 is signaled. \r
+  @retval EFI_INVALID_PARAMETER  This is NULL.\r
+  @retval EFI_NOT_STARTED        This instance hasn't been configured.\r
+  @retval EFI_NOT_FOUND          The asynchronous I/O request isn't found in the transmission or \r
+                                 receive queue. It has either completed or wasn't issued by \r
+                                 Transmit() and Receive().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_CANCEL) (\r
+  IN EFI_TCP6_PROTOCOL           *This,\r
+  IN EFI_TCP6_COMPLETION_TOKEN   *Token OPTIONAL\r
+  );\r
+\r
+/**\r
+  Poll to receive incoming data and transmit outgoing segments.\r
+\r
+  The Poll() function increases the rate that data is moved between the network\r
+  and application and can be called when the TCP instance is created successfully.\r
+  Its use is optional.\r
+\r
+  @param[in] This                Pointer to the EFI_TCP6_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS            Incoming or outgoing data was processed.\r
+  @retval EFI_INVALID_PARAMETER  This is NULL.\r
+  @retval EFI_DEVICE_ERROR       An unexpected system or network error occurred.\r
+  @retval EFI_NOT_READY          No incoming or outgoing data is processed.\r
+  @retval EFI_TIMEOUT            Data was dropped out of the transmission or receive queue.\r
+                                 Consider increasing the polling rate.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP6_POLL) (\r
+  IN EFI_TCP6_PROTOCOL        *This\r
+  );\r
+\r
+///\r
+/// EFI_TCP6_PROTOCOL \r
+/// defines the EFI TCPv6 Protocol child to be used by any network drivers or\r
+/// applications to send or receive data stream. It can either listen on a \r
+/// specified port as a service or actively connect to remote peer as a client.\r
+/// Each instance has its own independent settings. \r
+///\r
+typedef struct _EFI_TCP6_PROTOCOL {\r
+  EFI_TCP6_GET_MODE_DATA  GetModeData;\r
+  EFI_TCP6_CONFIGURE      Configure;\r
+  EFI_TCP6_CONNECT        Connect;\r
+  EFI_TCP6_ACCEPT         Accept;\r
+  EFI_TCP6_TRANSMIT       Transmit;\r
+  EFI_TCP6_RECEIVE        Receive;\r
+  EFI_TCP6_CLOSE          Close;\r
+  EFI_TCP6_CANCEL         Cancel;\r
+  EFI_TCP6_POLL           Poll;\r
+} EFI_TCP6_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiTcp6ServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiTcp6ProtocolGuid;\r
+\r
+#endif\r
+\r