--- /dev/null
+/** @file\r
+ Implementation of EFI_IP6_PROTOCOL protocol interfaces and type definitions.\r
+\r
+ Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+\r
+ 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_IMPL_H__\r
+#define __EFI_IP6_IMPL_H__\r
+\r
+#include <Uefi.h>\r
+\r
+#include <Protocol/ServiceBinding.h>\r
+#include <Protocol/ManagedNetwork.h>\r
+#include <Protocol/IpSec.h>\r
+#include <Protocol/Ip6.h>\r
+#include <Protocol/Ip6Config.h>\r
+#include <Protocol/Dhcp6.h>\r
+#include <Protocol/DevicePath.h>\r
+#include <Protocol/HiiConfigRouting.h>\r
+#include <Protocol/HiiConfigAccess.h>\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/NetLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/DpcLib.h>\r
+#include <Library/HiiLib.h>\r
+#include <Library/UefiHiiServicesLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/PrintLib.h>\r
+\r
+#include <Guid/MdeModuleHii.h>\r
+\r
+#include "Ip6Common.h"\r
+#include "Ip6Driver.h"\r
+#include "Ip6Icmp.h"\r
+#include "Ip6If.h"\r
+#include "Ip6Input.h"\r
+#include "Ip6Mld.h"\r
+#include "Ip6Nd.h"\r
+#include "Ip6Option.h"\r
+#include "Ip6Output.h"\r
+#include "Ip6Route.h"\r
+#include "Ip6ConfigNv.h"\r
+#include "Ip6ConfigImpl.h"\r
+\r
+#define IP6_PROTOCOL_SIGNATURE SIGNATURE_32 ('I', 'P', '6', 'P')\r
+#define IP6_SERVICE_SIGNATURE SIGNATURE_32 ('I', 'P', '6', 'S')\r
+\r
+//\r
+// The state of IP6 protocol. It starts from UNCONFIGED. if it is\r
+// successfully configured, it goes to CONFIGED. if configure NULL\r
+// is called, it becomes UNCONFIGED again. If (partly) destroyed, it\r
+// becomes DESTROY.\r
+//\r
+#define IP6_STATE_UNCONFIGED 0\r
+#define IP6_STATE_CONFIGED 1\r
+#define IP6_STATE_DESTROY 2\r
+\r
+//\r
+// The state of IP6 service. It starts from UNSTARTED. It transits\r
+// to STARTED if autoconfigure is started. If default address is\r
+// configured, it becomes CONFIGED. and if partly destroyed, it goes\r
+// to DESTROY.\r
+//\r
+#define IP6_SERVICE_UNSTARTED 0\r
+#define IP6_SERVICE_STARTED 1\r
+#define IP6_SERVICE_CONFIGED 2\r
+#define IP6_SERVICE_DESTROY 3\r
+\r
+#define IP6_INSTANCE_FROM_PROTOCOL(Ip6) \\r
+ CR ((Ip6), IP6_PROTOCOL, Ip6Proto, IP6_PROTOCOL_SIGNATURE)\r
+\r
+#define IP6_SERVICE_FROM_PROTOCOL(Sb) \\r
+ CR ((Sb), IP6_SERVICE, ServiceBinding, IP6_SERVICE_SIGNATURE)\r
+\r
+#define IP6_NO_MAPPING(IpInstance) (!(IpInstance)->Interface->Configured)\r
+\r
+extern EFI_IPSEC_PROTOCOL *mIpSec;\r
+\r
+//\r
+// IP6_TXTOKEN_WRAP wraps the upper layer's transmit token.\r
+// The user's data is kept in the Packet. When fragment is\r
+// needed, each fragment of the Packet has a reference to the\r
+// Packet, no data is actually copied. The Packet will be\r
+// released when all the fragments of it have been recycled by\r
+// MNP. Upon then, the IP6_TXTOKEN_WRAP will be released, and\r
+// user's event signalled.\r
+//\r
+typedef struct {\r
+ IP6_PROTOCOL *IpInstance;\r
+ EFI_IP6_COMPLETION_TOKEN *Token;\r
+ EFI_EVENT IpSecRecycleSignal;\r
+ NET_BUF *Packet;\r
+ BOOLEAN Sent;\r
+ INTN Life;\r
+} IP6_TXTOKEN_WRAP;\r
+\r
+typedef struct {\r
+ EFI_EVENT IpSecRecycleSignal;\r
+ NET_BUF *Packet;\r
+} IP6_IPSEC_WRAP;\r
+\r
+//\r
+// IP6_RXDATA_WRAP wraps the data IP6 child delivers to the\r
+// upper layers. The received packet is kept in the Packet.\r
+// The Packet itself may be constructured from some fragments.\r
+// All the fragments of the Packet is organized by a\r
+// IP6_ASSEMBLE_ENTRY structure. If the Packet is recycled by\r
+// the upper layer, the assemble entry and its associated\r
+// fragments will be freed at last.\r
+//\r
+typedef struct {\r
+ LIST_ENTRY Link;\r
+ IP6_PROTOCOL *IpInstance;\r
+ NET_BUF *Packet;\r
+ EFI_IP6_RECEIVE_DATA RxData;\r
+} IP6_RXDATA_WRAP;\r
+\r
+struct _IP6_PROTOCOL {\r
+ UINT32 Signature;\r
+\r
+ EFI_IP6_PROTOCOL Ip6Proto;\r
+ EFI_HANDLE Handle;\r
+ INTN State;\r
+\r
+ IP6_SERVICE *Service;\r
+ LIST_ENTRY Link; // Link to all the IP protocol from the service\r
+\r
+ UINT8 PrefixLength; // PrefixLength of the configured station address.\r
+ //\r
+ // User's transmit/receive tokens, and received/deliverd packets\r
+ //\r
+ NET_MAP RxTokens;\r
+ NET_MAP TxTokens; // map between (User's Token, IP6_TXTOKE_WRAP)\r
+ LIST_ENTRY Received; // Received but not delivered packet\r
+ LIST_ENTRY Delivered; // Delivered and to be recycled packets\r
+ EFI_LOCK RecycleLock;\r
+\r
+ IP6_INTERFACE *Interface;\r
+ LIST_ENTRY AddrLink; // Ip instances with the same IP address.\r
+\r
+ EFI_IPv6_ADDRESS *GroupList; // stored in network order.\r
+ UINT32 GroupCount;\r
+\r
+ EFI_IP6_CONFIG_DATA ConfigData;\r
+};\r
+\r
+struct _IP6_SERVICE {\r
+ UINT32 Signature;\r
+ EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
+ INTN State;\r
+ BOOLEAN InDestroy;\r
+\r
+ //\r
+ // List of all the IP instances and interfaces, and default\r
+ // interface and route table and caches.\r
+ //\r
+ UINTN NumChildren;\r
+ LIST_ENTRY Children;\r
+\r
+ LIST_ENTRY Interfaces;\r
+\r
+ IP6_INTERFACE *DefaultInterface;\r
+ IP6_ROUTE_TABLE *RouteTable;\r
+\r
+ IP6_LINK_RX_TOKEN RecvRequest;\r
+\r
+ //\r
+ // Ip reassemble utilities and MLD data\r
+ //\r
+ IP6_ASSEMBLE_TABLE Assemble;\r
+ IP6_MLD_SERVICE_DATA MldCtrl;\r
+\r
+ EFI_IPv6_ADDRESS LinkLocalAddr;\r
+ BOOLEAN LinkLocalOk;\r
+ BOOLEAN LinkLocalDadFail;\r
+ BOOLEAN Dhcp6NeedStart;\r
+ BOOLEAN Dhcp6NeedInfoRequest;\r
+\r
+ //\r
+ // ND data\r
+ //\r
+ UINT8 CurHopLimit;\r
+ UINT32 LinkMTU;\r
+ UINT32 BaseReachableTime;\r
+ UINT32 ReachableTime;\r
+ UINT32 RetransTimer;\r
+ LIST_ENTRY NeighborTable;\r
+\r
+ LIST_ENTRY OnlinkPrefix;\r
+ LIST_ENTRY AutonomousPrefix;\r
+\r
+ LIST_ENTRY DefaultRouterList;\r
+ UINT32 RoundRobin;\r
+\r
+ UINT8 InterfaceIdLen;\r
+ UINT8 *InterfaceId;\r
+\r
+ BOOLEAN RouterAdvertiseReceived;\r
+ UINT8 SolicitTimer;\r
+ UINT32 Ticks;\r
+\r
+ //\r
+ // Low level protocol used by this service instance\r
+ //\r
+ EFI_HANDLE Image;\r
+ EFI_HANDLE Controller;\r
+\r
+ EFI_HANDLE MnpChildHandle;\r
+ EFI_MANAGED_NETWORK_PROTOCOL *Mnp;\r
+\r
+ EFI_MANAGED_NETWORK_CONFIG_DATA MnpConfigData;\r
+ EFI_SIMPLE_NETWORK_MODE SnpMode;\r
+\r
+ EFI_EVENT Timer;\r
+ EFI_EVENT FasterTimer;\r
+\r
+ //\r
+ // IPv6 Configuration Protocol instance\r
+ //\r
+ IP6_CONFIG_INSTANCE Ip6ConfigInstance;\r
+\r
+ //\r
+ // The string representation of the current mac address of the\r
+ // NIC this IP6_SERVICE works on.\r
+ //\r
+ CHAR16 *MacString;\r
+ UINT32 MaxPacketSize;\r
+ UINT32 OldMaxPacketSize;\r
+};\r
+\r
+/**\r
+ The callback function for the net buffer which wraps the user's\r
+ transmit token. Although this function seems simple,\r
+ there are some subtle aspects.\r
+ When a user requests the IP to transmit a packet by passing it a\r
+ token, the token is wrapped in an IP6_TXTOKEN_WRAP and the data\r
+ is wrapped in a net buffer. The net buffer's Free function is\r
+ set to Ip6FreeTxToken. The Token and token wrap are added to the\r
+ IP child's TxToken map. Then the buffer is passed to Ip6Output for\r
+ transmission. If an error occurs before that, the buffer\r
+ is freed, which in turn frees the token wrap. The wrap may\r
+ have been added to the TxToken map or not, and the user's event\r
+ shouldn't be signaled because we are still in the EfiIp6Transmit. If\r
+ the buffer has been sent by Ip6Output, it should be removed from\r
+ the TxToken map and the user's event signaled. The token wrap and buffer\r
+ are bound together. Refer to the comments in Ip6Output for information\r
+ about IP fragmentation.\r
+\r
+ @param[in] Context The token's wrap.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+Ip6FreeTxToken (\r
+ IN VOID *Context\r
+ );\r
+\r
+/**\r
+ Config the MNP parameter used by IP. The IP driver use one MNP\r
+ child to transmit/receive frames. By default, it configures MNP\r
+ to receive unicast/multicast/broadcast. And it will enable/disable\r
+ the promiscuous receive according to whether there is IP child\r
+ enable that or not. If Force is FALSE, it will iterate through\r
+ all the IP children to check whether the promiscuous receive\r
+ setting has been changed. If it hasn't been changed, it won't\r
+ reconfigure the MNP. If Force is TRUE, the MNP is configured\r
+ whether that is changed or not.\r
+\r
+ @param[in] IpSb The IP6 service instance that is to be changed.\r
+ @param[in] Force Force the configuration or not.\r
+\r
+ @retval EFI_SUCCESS The MNP successfully configured/reconfigured.\r
+ @retval Others The configuration failed.\r
+\r
+**/\r
+EFI_STATUS\r
+Ip6ServiceConfigMnp (\r
+ IN IP6_SERVICE *IpSb,\r
+ IN BOOLEAN Force\r
+ );\r
+\r
+/**\r
+ Cancel the user's receive/transmit request. It is the worker function of\r
+ EfiIp6Cancel API.\r
+\r
+ @param[in] IpInstance The IP6 child.\r
+ @param[in] Token The token to cancel. If NULL, all tokens will be\r
+ cancelled.\r
+\r
+ @retval EFI_SUCCESS The token was cancelled.\r
+ @retval EFI_NOT_FOUND The token isn't found on either the\r
+ transmit or receive queue.\r
+ @retval EFI_DEVICE_ERROR Not all tokens are cancelled when Token is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+Ip6Cancel (\r
+ IN IP6_PROTOCOL *IpInstance,\r
+ IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL\r
+ );\r
+\r
+/**\r
+ Initialize the IP6_PROTOCOL structure to the unconfigured states.\r
+\r
+ @param[in] IpSb The IP6 service instance.\r
+ @param[in, out] IpInstance The IP6 child instance.\r
+\r
+**/\r
+VOID\r
+Ip6InitProtocol (\r
+ IN IP6_SERVICE *IpSb,\r
+ IN OUT IP6_PROTOCOL *IpInstance\r
+ );\r
+\r
+/**\r
+ Clean up the IP6 child, release all the resources used by it.\r
+\r
+ @param[in, out] IpInstance The IP6 child to clean up.\r
+\r
+ @retval EFI_SUCCESS The IP6 child was cleaned up\r
+ @retval EFI_DEVICE_ERROR Some resources failed to be released.\r
+\r
+**/\r
+EFI_STATUS\r
+Ip6CleanProtocol (\r
+ IN OUT IP6_PROTOCOL *IpInstance\r
+ );\r
+\r
+//\r
+// EFI_IP6_PROTOCOL interface prototypes\r
+//\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 The pointer to the EFI_IP6_PROTOCOL instance.\r
+ @param[out] Ip6ModeData The pointer to the EFI IPv6 Protocol mode data structure.\r
+ @param[out] MnpConfigData The pointer to the managed network configuration data structure.\r
+ @param[out] SnpModeData The 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
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6GetModeData (\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 a currently configured IPv6.\r
+ If both Ip6ConfigData.StationAddress and Ip6ConfigData.Destination are unspecified, when\r
+ transmitting the packet afterwards, the source address filled in each outgoing IPv6 packet\r
+ 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 The pointer to the EFI_IP6_PROTOCOL instance.\r
+ @param[in] Ip6ConfigData The pointer to the EFI IPv6 Protocol configuration data structure.\r
+ If NULL, reset the configuration data.\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 was not opened.\r
+ @retval EFI_UNSUPPORTED Default protocol specified through\r
+ Ip6ConfigData.DefaulProtocol isn't supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6Configure (\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 The 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 The pointer to the IPv6 multicast address.\r
+ This is an optional parameter that may be NULL.\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
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6Groups (\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 The 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
+ This is an optional parameter that may be NULL.\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
+ This is an optional parameter that may be NULL.\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
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6Routes (\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 a 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 timeout 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 timeout).\r
+\r
+ The implementation should follow the neighbor cache timeout mechanism defined in\r
+ RFC4861. The default neighbor cache timeout value should be tuned for the expected network\r
+ environment.\r
+\r
+ @param[in] This The 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 The pointer to the Target IPv6 address.\r
+ @param[in] TargetLinkAddress The 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 exists.\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 Override\r
+ is FALSE).\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6Neighbors (\r
+ IN EFI_IP6_PROTOCOL *This,\r
+ IN BOOLEAN DeleteFlag,\r
+ IN EFI_IPv6_ADDRESS *TargetIp6Address,\r
+ IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL,\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 The pointer to the EFI_IP6_PROTOCOL instance.\r
+ @param[in] Token The 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\r
+ a source address for this transmission,\r
+ 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\r
+ Token.Packet.ExtHdrs is NULL.\r
+ - Token.Packet.FragmentCount is zero.\r
+ - One or more of the Token.Packet.TxData.\r
+ FragmentTable[].FragmentLength fields is zero.\r
+ - One or more of the Token.Packet.TxData.\r
+ FragmentTable[].FragmentBuffer fields is NULL.\r
+ - Token.Packet.TxData.DataLength is zero or not\r
+ equal to the sum of fragment lengths.\r
+ - Token.Packet.TxData.DestinationAddress is non-\r
+ zero when DestinationAddress is configured as\r
+ non-zero when doing Configure() for this\r
+ EFI IPv6 protocol instance.\r
+ - Token.Packet.TxData.DestinationAddress is\r
+ unspecified when DestinationAddress is unspecified\r
+ when doing Configure() for this EFI IPv6 protocol\r
+ instance.\r
+ @retval EFI_ACCESS_DENIED The transmit completion token with the same Token.\r
+ The event was already in the transmit queue.\r
+ @retval EFI_NOT_READY The completion token could not be queued because\r
+ the transmit queue is full.\r
+ @retval EFI_NOT_FOUND Not route is found to the 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\r
+ Fragment Offset field in Fragment header when\r
+ performing fragmentation.\r
+ @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6Transmit (\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
+ Current Udp implementation creates an IP child for each Udp child.\r
+ It initates a asynchronous receive immediately whether or not\r
+ there is no mapping. Therefore, disable the returning EFI_NO_MAPPING for now.\r
+ To enable it, the following check must be performed:\r
+\r
+ if (NetIp6IsUnspecifiedAddr (&Config->StationAddress) && IP6_NO_MAPPING (IpInstance)) {\r
+ Status = EFI_NO_MAPPING;\r
+ goto Exit;\r
+ }\r
+\r
+ @param[in] This The pointer to the EFI_IP6_PROTOCOL instance.\r
+ @param[in] Token The pointer to a token that is associated with the\r
+ 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
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6Receive (\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 The pointer to the EFI_IP6_PROTOCOL instance.\r
+ @param[in] Token The 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
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6Cancel (\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 The 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 was 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
+EFI_STATUS\r
+EFIAPI\r
+EfiIp6Poll (\r
+ IN EFI_IP6_PROTOCOL *This\r
+ );\r
+\r
+#endif\r