Path: blob/main/sys/contrib/edk2/Include/Protocol/Ip6.h
96339 views
/** @file1This file defines the EFI IPv6 (Internet Protocol version 6)2Protocol interface. It is split into the following three main3sections:4- EFI IPv6 Service Binding Protocol5- EFI IPv6 Variable (deprecated in UEFI 2.4B)6- EFI IPv6 Protocol7The EFI IPv6 Protocol provides basic network IPv6 packet I/O services,8which includes support for Neighbor Discovery Protocol (ND), Multicast9Listener Discovery Protocol (MLD), and a subset of the Internet Control10Message Protocol (ICMPv6).1112Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>13SPDX-License-Identifier: BSD-2-Clause-Patent1415@par Revision Reference:16This Protocol is introduced in UEFI Specification 2.21718**/1920#ifndef __EFI_IP6_PROTOCOL_H__21#define __EFI_IP6_PROTOCOL_H__2223#include <Protocol/ManagedNetwork.h>2425#define EFI_IP6_SERVICE_BINDING_PROTOCOL_GUID \26{ \270xec835dd3, 0xfe0f, 0x617b, {0xa6, 0x21, 0xb3, 0x50, 0xc3, 0xe1, 0x33, 0x88 } \28}2930#define EFI_IP6_PROTOCOL_GUID \31{ \320x2c8759d5, 0x5c2d, 0x66ef, {0x92, 0x5f, 0xb6, 0x6c, 0x10, 0x19, 0x57, 0xe2 } \33}3435typedef struct _EFI_IP6_PROTOCOL EFI_IP6_PROTOCOL;3637///38/// EFI_IP6_ADDRESS_PAIR is deprecated in the UEFI 2.4B and should not be used any more.39/// The definition in here is only present to provide backwards compatability.40///41typedef struct {42///43/// The EFI IPv6 Protocol instance handle that is using this address/prefix pair.44///45EFI_HANDLE InstanceHandle;46///47/// IPv6 address in network byte order.48///49EFI_IPv6_ADDRESS Ip6Address;50///51/// The length of the prefix associated with the Ip6Address.52///53UINT8 PrefixLength;54} EFI_IP6_ADDRESS_PAIR;5556///57/// EFI_IP6_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more.58/// The definition in here is only present to provide backwards compatability.59///60typedef struct {61///62/// The handle of the driver that creates this entry.63///64EFI_HANDLE DriverHandle;65///66/// The number of IPv6 address pairs that follow this data structure.67///68UINT32 AddressCount;69///70/// List of IPv6 address pairs that are currently in use.71///72EFI_IP6_ADDRESS_PAIR AddressPairs[1];73} EFI_IP6_VARIABLE_DATA;7475///76/// ICMPv6 type definitions for error messages77///78///@{79#define ICMP_V6_DEST_UNREACHABLE 0x180#define ICMP_V6_PACKET_TOO_BIG 0x281#define ICMP_V6_TIME_EXCEEDED 0x382#define ICMP_V6_PARAMETER_PROBLEM 0x483///@}8485///86/// ICMPv6 type definition for informational messages87///88///@{89#define ICMP_V6_ECHO_REQUEST 0x8090#define ICMP_V6_ECHO_REPLY 0x8191#define ICMP_V6_LISTENER_QUERY 0x8292#define ICMP_V6_LISTENER_REPORT 0x8393#define ICMP_V6_LISTENER_DONE 0x8494#define ICMP_V6_ROUTER_SOLICIT 0x8595#define ICMP_V6_ROUTER_ADVERTISE 0x8696#define ICMP_V6_NEIGHBOR_SOLICIT 0x8797#define ICMP_V6_NEIGHBOR_ADVERTISE 0x8898#define ICMP_V6_REDIRECT 0x8999#define ICMP_V6_LISTENER_REPORT_2 0x8F100///@}101102///103/// ICMPv6 code definitions for ICMP_V6_DEST_UNREACHABLE104///105///@{106#define ICMP_V6_NO_ROUTE_TO_DEST 0x0107#define ICMP_V6_COMM_PROHIBITED 0x1108#define ICMP_V6_BEYOND_SCOPE 0x2109#define ICMP_V6_ADDR_UNREACHABLE 0x3110#define ICMP_V6_PORT_UNREACHABLE 0x4111#define ICMP_V6_SOURCE_ADDR_FAILED 0x5112#define ICMP_V6_ROUTE_REJECTED 0x6113///@}114115///116/// ICMPv6 code definitions for ICMP_V6_TIME_EXCEEDED117///118///@{119#define ICMP_V6_TIMEOUT_HOP_LIMIT 0x0120#define ICMP_V6_TIMEOUT_REASSEMBLE 0x1121///@}122123///124/// ICMPv6 code definitions for ICMP_V6_PARAMETER_PROBLEM125///126///@{127#define ICMP_V6_ERRONEOUS_HEADER 0x0128#define ICMP_V6_UNRECOGNIZE_NEXT_HDR 0x1129#define ICMP_V6_UNRECOGNIZE_OPTION 0x2130///@}131132///133/// EFI_IP6_CONFIG_DATA134/// is used to report and change IPv6 session parameters.135///136typedef struct {137///138/// For the IPv6 packet to send and receive, this is the default value139/// of the 'Next Header' field in the last IPv6 extension header or in140/// the IPv6 header if there are no extension headers. Ignored when141/// AcceptPromiscuous is TRUE.142///143UINT8 DefaultProtocol;144///145/// Set to TRUE to receive all IPv6 packets that get through the146/// receive filters.147/// Set to FALSE to receive only the DefaultProtocol IPv6148/// packets that get through the receive filters. Ignored when149/// AcceptPromiscuous is TRUE.150///151BOOLEAN AcceptAnyProtocol;152///153/// Set to TRUE to receive ICMP error report packets. Ignored when154/// AcceptPromiscuous or AcceptAnyProtocol is TRUE.155///156BOOLEAN AcceptIcmpErrors;157///158/// Set to TRUE to receive all IPv6 packets that are sent to any159/// hardware address or any protocol address. Set to FALSE to stop160/// receiving all promiscuous IPv6 packets.161///162BOOLEAN AcceptPromiscuous;163///164/// The destination address of the packets that will be transmitted.165/// Ignored if it is unspecified.166///167EFI_IPv6_ADDRESS DestinationAddress;168///169/// The station IPv6 address that will be assigned to this EFI IPv6170/// Protocol instance. This field can be set and changed only when171/// the EFI IPv6 driver is transitioning from the stopped to the started172/// states. If the StationAddress is specified, the EFI IPv6 Protocol173/// driver will deliver only incoming IPv6 packets whose destination174/// matches this IPv6 address exactly. The StationAddress is required175/// to be one of currently configured IPv6 addresses. An address176/// containing all zeroes is also accepted as a special case. Under this177/// situation, the IPv6 driver is responsible for binding a source178/// address to this EFI IPv6 protocol instance according to the source179/// address selection algorithm. Only incoming packets destined to180/// the selected address will be delivered to the user. And the181/// selected station address can be retrieved through later182/// GetModeData() call. If no address is available for selecting,183/// EFI_NO_MAPPING will be returned, and the station address will184/// only be successfully bound to this EFI IPv6 protocol instance185/// after IP6ModeData.IsConfigured changed to TRUE.186///187EFI_IPv6_ADDRESS StationAddress;188///189/// TrafficClass field in transmitted IPv6 packets. Default value190/// is zero.191///192UINT8 TrafficClass;193///194/// HopLimit field in transmitted IPv6 packets.195///196UINT8 HopLimit;197///198/// FlowLabel field in transmitted IPv6 packets. Default value is199/// zero.200///201UINT32 FlowLabel;202///203/// The timer timeout value (number of microseconds) for the204/// receive timeout event to be associated with each assembled205/// packet. Zero means do not drop assembled packets.206///207UINT32 ReceiveTimeout;208///209/// The timer timeout value (number of microseconds) for the210/// transmit timeout event to be associated with each outgoing211/// packet. Zero means do not drop outgoing packets.212///213UINT32 TransmitTimeout;214} EFI_IP6_CONFIG_DATA;215216///217/// EFI_IP6_ADDRESS_INFO218///219typedef struct {220EFI_IPv6_ADDRESS Address; ///< The IPv6 address.221UINT8 PrefixLength; ///< The length of the prefix associated with the Address.222} EFI_IP6_ADDRESS_INFO;223224///225/// EFI_IP6_ROUTE_TABLE226/// is the entry structure that is used in routing tables227///228typedef struct {229///230/// The IPv6 address of the gateway to be used as the next hop for231/// packets to this prefix. If the IPv6 address is all zeros, then the232/// prefix is on-link.233///234EFI_IPv6_ADDRESS Gateway;235///236/// The destination prefix to be routed.237///238EFI_IPv6_ADDRESS Destination;239///240/// The length of the prefix associated with the Destination.241///242UINT8 PrefixLength;243} EFI_IP6_ROUTE_TABLE;244245///246/// EFI_IP6_NEIGHBOR_STATE247///248typedef enum {249///250/// Address resolution is being performed on this entry. Specially,251/// Neighbor Solicitation has been sent to the solicited-node252/// multicast address of the target, but corresponding Neighbor253/// Advertisement has not been received.254///255EfiNeighborInComplete,256///257/// Positive confirmation was received that the forward path to the258/// neighbor was functioning properly.259///260EfiNeighborReachable,261///262/// Reachable Time has elapsed since the last positive confirmation263/// was received. In this state, the forward path to the neighbor was264/// functioning properly.265///266EfiNeighborStale,267///268/// This state is an optimization that gives upper-layer protocols269/// additional time to provide reachability confirmation.270///271EfiNeighborDelay,272///273/// A reachability confirmation is actively sought by retransmitting274/// Neighbor Solicitations every RetransTimer milliseconds until a275/// reachability confirmation is received.276///277EfiNeighborProbe278} EFI_IP6_NEIGHBOR_STATE;279280///281/// EFI_IP6_NEIGHBOR_CACHE282/// is the entry structure that is used in neighbor cache. It records a set283/// of entries about individual neighbors to which traffic has been sent recently.284///285typedef struct {286EFI_IPv6_ADDRESS Neighbor; ///< The on-link unicast/anycast IP address of the neighbor.287EFI_MAC_ADDRESS LinkAddress; ///< Link-layer address of the neighbor.288EFI_IP6_NEIGHBOR_STATE State; ///< State of this neighbor cache entry.289} EFI_IP6_NEIGHBOR_CACHE;290291///292/// EFI_IP6_ICMP_TYPE293/// is used to describe those ICMP messages that are supported by this EFI294/// IPv6 Protocol driver.295///296typedef struct {297UINT8 Type; ///< The type of ICMP message.298UINT8 Code; ///< The code of the ICMP message.299} EFI_IP6_ICMP_TYPE;300301///302/// EFI_IP6_MODE_DATA303///304typedef struct {305///306/// Set to TRUE after this EFI IPv6 Protocol instance is started.307/// All other fields in this structure are undefined until this field is TRUE.308/// Set to FALSE when the EFI IPv6 Protocol instance is stopped.309///310BOOLEAN IsStarted;311///312/// The maximum packet size, in bytes, of the packet which the upper layer driver could feed.313///314UINT32 MaxPacketSize;315///316/// Current configuration settings. Undefined until IsStarted is TRUE.317///318EFI_IP6_CONFIG_DATA ConfigData;319///320/// Set to TRUE when the EFI IPv6 Protocol instance is configured.321/// The instance is configured when it has a station address and322/// corresponding prefix length.323/// Set to FALSE when the EFI IPv6 Protocol instance is not configured.324///325BOOLEAN IsConfigured;326///327/// Number of configured IPv6 addresses on this interface.328///329UINT32 AddressCount;330///331/// List of currently configured IPv6 addresses and corresponding332/// prefix lengths assigned to this interface. It is caller's333/// responsibility to free this buffer.334///335EFI_IP6_ADDRESS_INFO *AddressList;336///337/// Number of joined multicast groups. Undefined until338/// IsConfigured is TRUE.339///340UINT32 GroupCount;341///342/// List of joined multicast group addresses. It is caller's343/// responsibility to free this buffer. Undefined until344/// IsConfigured is TRUE.345///346EFI_IPv6_ADDRESS *GroupTable;347///348/// Number of entries in the routing table. Undefined until349/// IsConfigured is TRUE.350///351UINT32 RouteCount;352///353/// Routing table entries. It is caller's responsibility to free this buffer.354///355EFI_IP6_ROUTE_TABLE *RouteTable;356///357/// Number of entries in the neighbor cache. Undefined until358/// IsConfigured is TRUE.359///360UINT32 NeighborCount;361///362/// Neighbor cache entries. It is caller's responsibility to free this363/// buffer. Undefined until IsConfigured is TRUE.364///365EFI_IP6_NEIGHBOR_CACHE *NeighborCache;366///367/// Number of entries in the prefix table. Undefined until368/// IsConfigured is TRUE.369///370UINT32 PrefixCount;371///372/// On-link Prefix table entries. It is caller's responsibility to free this373/// buffer. Undefined until IsConfigured is TRUE.374///375EFI_IP6_ADDRESS_INFO *PrefixTable;376///377/// Number of entries in the supported ICMP types list.378///379UINT32 IcmpTypeCount;380///381/// Array of ICMP types and codes that are supported by this EFI382/// IPv6 Protocol driver. It is caller's responsibility to free this383/// buffer.384///385EFI_IP6_ICMP_TYPE *IcmpTypeList;386} EFI_IP6_MODE_DATA;387388///389/// EFI_IP6_HEADER390/// The fields in the IPv6 header structure are defined in the Internet391/// Protocol version6 specification.392///393#pragma pack(1)394typedef struct _EFI_IP6_HEADER {395UINT8 TrafficClassH : 4;396UINT8 Version : 4;397UINT8 FlowLabelH : 4;398UINT8 TrafficClassL : 4;399UINT16 FlowLabelL;400UINT16 PayloadLength;401UINT8 NextHeader;402UINT8 HopLimit;403EFI_IPv6_ADDRESS SourceAddress;404EFI_IPv6_ADDRESS DestinationAddress;405} EFI_IP6_HEADER;406#pragma pack()407408///409/// EFI_IP6_FRAGMENT_DATA410/// describes the location and length of the IPv6 packet411/// fragment to transmit or that has been received.412///413typedef struct _EFI_IP6_FRAGMENT_DATA {414UINT32 FragmentLength; ///< Length of fragment data. This field may not be set to zero.415VOID *FragmentBuffer; ///< Pointer to fragment data. This field may not be set to NULL.416} EFI_IP6_FRAGMENT_DATA;417418///419/// EFI_IP6_RECEIVE_DATA420///421typedef struct _EFI_IP6_RECEIVE_DATA {422///423/// Time when the EFI IPv6 Protocol driver accepted the packet.424/// Ignored if it is zero.425///426EFI_TIME TimeStamp;427///428/// After this event is signaled, the receive data structure is released429/// and must not be referenced.430///431EFI_EVENT RecycleSignal;432///433/// Length of the IPv6 packet headers, including both the IPv6434/// header and any extension headers.435///436UINT32 HeaderLength;437///438/// Pointer to the IPv6 packet header. If the IPv6 packet was439/// fragmented, this argument is a pointer to the header in the first440/// fragment.441///442EFI_IP6_HEADER *Header;443///444/// Sum of the lengths of IPv6 packet buffers in FragmentTable. May445/// be zero.446///447UINT32 DataLength;448///449/// Number of IPv6 payload fragments. May be zero.450///451UINT32 FragmentCount;452///453/// Array of payload fragment lengths and buffer pointers.454///455EFI_IP6_FRAGMENT_DATA FragmentTable[1];456} EFI_IP6_RECEIVE_DATA;457458///459/// EFI_IP6_OVERRIDE_DATA460/// The information and flags in the override data structure will override461/// default parameters or settings for one Transmit() function call.462///463typedef struct _EFI_IP6_OVERRIDE_DATA {464UINT8 Protocol; ///< Protocol type override.465UINT8 HopLimit; ///< Hop-Limit override.466UINT32 FlowLabel; ///< Flow-Label override.467} EFI_IP6_OVERRIDE_DATA;468469///470/// EFI_IP6_TRANSMIT_DATA471///472typedef struct _EFI_IP6_TRANSMIT_DATA {473///474/// The destination IPv6 address. If it is unspecified,475/// ConfigData.DestinationAddress will be used instead.476///477EFI_IPv6_ADDRESS DestinationAddress;478///479/// If not NULL, the IPv6 transmission control override data.480///481EFI_IP6_OVERRIDE_DATA *OverrideData;482///483/// Total length in byte of the IPv6 extension headers specified in484/// ExtHdrs.485///486UINT32 ExtHdrsLength;487///488/// Pointer to the IPv6 extension headers. The IP layer will append489/// the required extension headers if they are not specified by490/// ExtHdrs. Ignored if ExtHdrsLength is zero.491///492VOID *ExtHdrs;493///494/// The protocol of first extension header in ExtHdrs. Ignored if495/// ExtHdrsLength is zero.496///497UINT8 NextHeader;498///499/// Total length in bytes of the FragmentTable data to transmit.500///501UINT32 DataLength;502///503/// Number of entries in the fragment data table.504///505UINT32 FragmentCount;506///507/// Start of the fragment data table.508///509EFI_IP6_FRAGMENT_DATA FragmentTable[1];510} EFI_IP6_TRANSMIT_DATA;511512///513/// EFI_IP6_COMPLETION_TOKEN514/// structures are used for both transmit and receive operations.515///516typedef struct {517///518/// This Event will be signaled after the Status field is updated by519/// the EFI IPv6 Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.520///521EFI_EVENT Event;522///523/// Will be set to one of the following values:524/// - EFI_SUCCESS: The receive or transmit completed525/// successfully.526/// - EFI_ABORTED: The receive or transmit was aborted527/// - EFI_TIMEOUT: The transmit timeout expired.528/// - EFI_ICMP_ERROR: An ICMP error packet was received.529/// - EFI_DEVICE_ERROR: An unexpected system or network530/// error occurred.531/// - EFI_SECURITY_VIOLATION: The transmit or receive was532/// failed because of an IPsec policy check.533/// - EFI_NO_MEDIA: There was a media error.534///535EFI_STATUS Status;536union {537///538/// When the Token is used for receiving, RxData is a pointer to the EFI_IP6_RECEIVE_DATA.539///540EFI_IP6_RECEIVE_DATA *RxData;541///542/// When the Token is used for transmitting, TxData is a pointer to the EFI_IP6_TRANSMIT_DATA.543///544EFI_IP6_TRANSMIT_DATA *TxData;545} Packet;546} EFI_IP6_COMPLETION_TOKEN;547548/**549Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.550551The GetModeData() function returns the current operational mode data for this driver instance.552The data fields in EFI_IP6_MODE_DATA are read only. This function is used optionally to553retrieve the operational mode data of underlying networks or drivers..554555@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.556@param[out] Ip6ModeData Pointer to the EFI IPv6 Protocol mode data structure.557@param[out] MnpConfigData Pointer to the managed network configuration data structure.558@param[out] SnpModeData Pointer to the simple network mode data structure.559560@retval EFI_SUCCESS The operation completed successfully.561@retval EFI_INVALID_PARAMETER This is NULL.562@retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.563564**/565typedef566EFI_STATUS567(EFIAPI *EFI_IP6_GET_MODE_DATA)(568IN EFI_IP6_PROTOCOL *This,569OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,570OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,571OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL572);573574/**575Assigns an IPv6 address and subnet mask to this EFI IPv6 Protocol driver instance.576577The Configure() function is used to set, change, or reset the operational parameters and filter578settings for this EFI IPv6 Protocol instance. Until these parameters have been set, no network traffic579can be sent or received by this instance. Once the parameters have been reset (by calling this580function with Ip6ConfigData set to NULL), no more traffic can be sent or received until these581parameters have been set again. Each EFI IPv6 Protocol instance can be started and stopped582independently of each other by enabling or disabling their receive filter settings with the583Configure() function.584585If Ip6ConfigData.StationAddress is a valid non-zero IPv6 unicast address, it is required586to be one of the currently configured IPv6 addresses list in the EFI IPv6 drivers, or else587EFI_INVALID_PARAMETER will be returned. If Ip6ConfigData.StationAddress is588unspecified, the IPv6 driver will bind a source address according to the source address selection589algorithm. Clients could frequently call GetModeData() to check get currently configured IPv6590address list in the EFI IPv6 driver. If both Ip6ConfigData.StationAddress and591Ip6ConfigData.Destination are unspecified, when transmitting the packet afterwards, the592source address filled in each outgoing IPv6 packet is decided based on the destination of this packet. .593594If operational parameters are reset or changed, any pending transmit and receive requests will be595cancelled. Their completion token status will be set to EFI_ABORTED and their events will be596signaled.597598@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.599@param[in] Ip6ConfigData Pointer to the EFI IPv6 Protocol configuration data structure.600601@retval EFI_SUCCESS The driver instance was successfully opened.602@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:603- This is NULL.604- Ip6ConfigData.StationAddress is neither zero nor605a unicast IPv6 address.606- Ip6ConfigData.StationAddress is neither zero nor607one of the configured IP addresses in the EFI IPv6 driver.608- Ip6ConfigData.DefaultProtocol is illegal.609@retval EFI_OUT_OF_RESOURCES The EFI IPv6 Protocol driver instance data could not be allocated.610@retval EFI_NO_MAPPING The IPv6 driver was responsible for choosing a source address for611this instance, but no source address was available for use.612@retval EFI_ALREADY_STARTED The interface is already open and must be stopped before the IPv6613address or prefix length can be changed.614@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI IPv6615Protocol driver instance is not opened.616@retval EFI_UNSUPPORTED Default protocol specified through617Ip6ConfigData.DefaulProtocol isn't supported.618619**/620typedef621EFI_STATUS622(EFIAPI *EFI_IP6_CONFIGURE)(623IN EFI_IP6_PROTOCOL *This,624IN EFI_IP6_CONFIG_DATA *Ip6ConfigData OPTIONAL625);626627/**628Joins and leaves multicast groups.629630The Groups() function is used to join and leave multicast group sessions. Joining a group will631enable reception of matching multicast packets. Leaving a group will disable reception of matching632multicast packets. Source-Specific Multicast isn't required to be supported.633634If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.635636@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.637@param[in] JoinFlag Set to TRUE to join the multicast group session and FALSE to leave.638@param[in] GroupAddress Pointer to the IPv6 multicast address.639640@retval EFI_SUCCESS The operation completed successfully.641@retval EFI_INVALID_PARAMETER One or more of the following is TRUE:642- This is NULL.643- JoinFlag is TRUE and GroupAddress is NULL.644- GroupAddress is not NULL and *GroupAddress is645not a multicast IPv6 address.646- GroupAddress is not NULL and *GroupAddress is in the647range of SSM destination address.648@retval EFI_NOT_STARTED This instance has not been started.649@retval EFI_OUT_OF_RESOURCES System resources could not be allocated.650@retval EFI_UNSUPPORTED This EFI IPv6 Protocol implementation does not support multicast groups.651@retval EFI_ALREADY_STARTED The group address is already in the group table (when652JoinFlag is TRUE).653@retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is FALSE).654@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.655656**/657typedef658EFI_STATUS659(EFIAPI *EFI_IP6_GROUPS)(660IN EFI_IP6_PROTOCOL *This,661IN BOOLEAN JoinFlag,662IN EFI_IPv6_ADDRESS *GroupAddress OPTIONAL663);664665/**666Adds and deletes routing table entries.667668The Routes() function adds a route to or deletes a route from the routing table.669670Routes are determined by comparing the leftmost PrefixLength bits of Destination with671the destination IPv6 address arithmetically. The gateway address must be on the same subnet as the672configured station address.673674The default route is added with Destination and PrefixLegth both set to all zeros. The675default route matches all destination IPv6 addresses that do not match any other routes.676677All EFI IPv6 Protocol instances share a routing table.678679@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.680@param[in] DeleteRoute Set to TRUE to delete this route from the routing table. Set to681FALSE to add this route to the routing table. Destination,682PrefixLength and Gateway are used as the key to each683route entry.684@param[in] Destination The address prefix of the subnet that needs to be routed.685@param[in] PrefixLength The prefix length of Destination. Ignored if Destination686is NULL.687@param[in] GatewayAddress The unicast gateway IPv6 address for this route.688689@retval EFI_SUCCESS The operation completed successfully.690@retval EFI_NOT_STARTED The driver instance has not been started.691@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:692- This is NULL.693- When DeleteRoute is TRUE, both Destination and694GatewayAddress are NULL.695- When DeleteRoute is FALSE, either Destination or696GatewayAddress is NULL.697- *GatewayAddress is not a valid unicast IPv6 address.698- *GatewayAddress is one of the local configured IPv6699addresses.700@retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.701@retval EFI_NOT_FOUND This route is not in the routing table (when DeleteRoute is TRUE).702@retval EFI_ACCESS_DENIED The route is already defined in the routing table (when703DeleteRoute is FALSE).704705**/706typedef707EFI_STATUS708(EFIAPI *EFI_IP6_ROUTES)(709IN EFI_IP6_PROTOCOL *This,710IN BOOLEAN DeleteRoute,711IN EFI_IPv6_ADDRESS *Destination OPTIONAL,712IN UINT8 PrefixLength,713IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL714);715716/**717Add or delete Neighbor cache entries.718719The Neighbors() function is used to add, update, or delete an entry from neighbor cache.720IPv6 neighbor cache entries are typically inserted and updated by the network protocol driver as721network traffic is processed. Most neighbor cache entries will time out and be deleted if the network722traffic stops. Neighbor cache entries that were inserted by Neighbors() may be static (will not723timeout) or dynamic (will time out).724725The implementation should follow the neighbor cache timeout mechanism which is defined in726RFC4861. The default neighbor cache timeout value should be tuned for the expected network727environment728729@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.730@param[in] DeleteFlag Set to TRUE to delete the specified cache entry, set to FALSE to731add (or update, if it already exists and Override is TRUE) the732specified cache entry. TargetIp6Address is used as the key733to find the requested cache entry.734@param[in] TargetIp6Address Pointer to Target IPv6 address.735@param[in] TargetLinkAddress Pointer to link-layer address of the target. Ignored if NULL.736@param[in] Timeout Time in 100-ns units that this entry will remain in the neighbor737cache, it will be deleted after Timeout. A value of zero means that738the entry is permanent. A non-zero value means that the entry is739dynamic.740@param[in] Override If TRUE, the cached link-layer address of the matching entry will741be overridden and updated; if FALSE, EFI_ACCESS_DENIED742will be returned if a corresponding cache entry already existed.743744@retval EFI_SUCCESS The data has been queued for transmission.745@retval EFI_NOT_STARTED This instance has not been started.746@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:747- This is NULL.748- TargetIpAddress is NULL.749- *TargetLinkAddress is invalid when not NULL.750- *TargetIpAddress is not a valid unicast IPv6 address.751- *TargetIpAddress is one of the local configured IPv6752addresses.753@retval EFI_OUT_OF_RESOURCES Could not add the entry to the neighbor cache.754@retval EFI_NOT_FOUND This entry is not in the neighbor cache (when DeleteFlag is755TRUE or when DeleteFlag is FALSE while756TargetLinkAddress is NULL.).757@retval EFI_ACCESS_DENIED The to-be-added entry is already defined in the neighbor cache,758and that entry is tagged as un-overridden (when DeleteFlag759is FALSE).760761**/762typedef763EFI_STATUS764(EFIAPI *EFI_IP6_NEIGHBORS)(765IN EFI_IP6_PROTOCOL *This,766IN BOOLEAN DeleteFlag,767IN EFI_IPv6_ADDRESS *TargetIp6Address,768IN EFI_MAC_ADDRESS *TargetLinkAddress,769IN UINT32 Timeout,770IN BOOLEAN Override771);772773/**774Places outgoing data packets into the transmit queue.775776The Transmit() function places a sending request in the transmit queue of this777EFI IPv6 Protocol instance. Whenever the packet in the token is sent out or some778errors occur, the event in the token will be signaled and the status is updated.779780@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.781@param[in] Token Pointer to the transmit token.782783@retval EFI_SUCCESS The data has been queued for transmission.784@retval EFI_NOT_STARTED This instance has not been started.785@retval EFI_NO_MAPPING The IPv6 driver was responsible for choosing a source address for786this transmission, but no source address was available for use.787@retval EFI_INVALID_PARAMETER One or more of the following is TRUE:788- This is NULL.789- Token is NULL.790- Token.Event is NULL.791- Token.Packet.TxData is NULL.792- Token.Packet.ExtHdrsLength is not zero and Token.Packet.ExtHdrs is NULL.793- Token.Packet.FragmentCount is zero.794- One or more of the Token.Packet.TxData.FragmentTable[].FragmentLength fields is zero.795- One or more of the Token.Packet.TxData.FragmentTable[].FragmentBuffer fields is NULL.796- Token.Packet.TxData.DataLength is zero or not equal to the sum of fragment lengths.797- Token.Packet.TxData.DestinationAddress is non-zero when DestinationAddress is configured as798non-zero when doing Configure() for this EFI IPv6 protocol instance.799- Token.Packet.TxData.DestinationAddress is unspecified when DestinationAddress is unspecified800when doing Configure() for this EFI IPv6 protocol instance.801@retval EFI_ACCESS_DENIED The transmit completion token with the same Token.Event802was already in the transmit queue.803@retval EFI_NOT_READY The completion token could not be queued because the transmit804queue is full.805@retval EFI_NOT_FOUND Not route is found to destination address.806@retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.807@retval EFI_BUFFER_TOO_SMALL Token.Packet.TxData.TotalDataLength is too808short to transmit.809@retval EFI_BAD_BUFFER_SIZE If Token.Packet.TxData.DataLength is beyond the810maximum that which can be described through the Fragment Offset811field in Fragment header when performing fragmentation.812@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.813814**/815typedef816EFI_STATUS817(EFIAPI *EFI_IP6_TRANSMIT)(818IN EFI_IP6_PROTOCOL *This,819IN EFI_IP6_COMPLETION_TOKEN *Token820);821822/**823Places a receiving request into the receiving queue.824825The Receive() function places a completion token into the receive packet queue.826This function is always asynchronous.827828The Token.Event field in the completion token must be filled in by the caller829and cannot be NULL. When the receive operation completes, the EFI IPv6 Protocol830driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event831is signaled.832833@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.834@param[in] Token Pointer to a token that is associated with the receive data descriptor.835836@retval EFI_SUCCESS The receive completion token was cached.837@retval EFI_NOT_STARTED This EFI IPv6 Protocol instance has not been started.838@retval EFI_NO_MAPPING When IP6 driver responsible for binding source address to this instance,839while no source address is available for use.840@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:841- This is NULL.842- Token is NULL.843- Token.Event is NULL.844@retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system845resources (usually memory).846@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.847The EFI IPv6 Protocol instance has been reset to startup defaults.848@retval EFI_ACCESS_DENIED The receive completion token with the same Token.Event was already849in the receive queue.850@retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.851852**/853typedef854EFI_STATUS855(EFIAPI *EFI_IP6_RECEIVE)(856IN EFI_IP6_PROTOCOL *This,857IN EFI_IP6_COMPLETION_TOKEN *Token858);859860/**861Abort an asynchronous transmit or receive request.862863The Cancel() function is used to abort a pending transmit or receive request.864If the token is in the transmit or receive request queues, after calling this865function, Token->Status will be set to EFI_ABORTED and then Token->Event will866be signaled. If the token is not in one of the queues, which usually means the867asynchronous operation has completed, this function will not signal the token868and EFI_NOT_FOUND is returned.869870@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.871@param[in] Token Pointer to a token that has been issued by872EFI_IP6_PROTOCOL.Transmit() or873EFI_IP6_PROTOCOL.Receive(). If NULL, all pending874tokens are aborted. Type EFI_IP6_COMPLETION_TOKEN is875defined in EFI_IP6_PROTOCOL.Transmit().876877@retval EFI_SUCCESS The asynchronous I/O request was aborted and878Token->Event was signaled. When Token is NULL, all879pending requests were aborted and their events were signaled.880@retval EFI_INVALID_PARAMETER This is NULL.881@retval EFI_NOT_STARTED This instance has not been started.882@retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was883not found in the transmit or receive queue. It has either completed884or was not issued by Transmit() and Receive().885@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.886887**/888typedef889EFI_STATUS890(EFIAPI *EFI_IP6_CANCEL)(891IN EFI_IP6_PROTOCOL *This,892IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL893);894895/**896Polls for incoming data packets and processes outgoing data packets.897898The Poll() function polls for incoming data packets and processes outgoing data899packets. Network drivers and applications can call the EFI_IP6_PROTOCOL.Poll()900function to increase the rate that data packets are moved between the communications901device and the transmit and receive queues.902903In some systems the periodic timer event may not poll the underlying communications904device fast enough to transmit and/or receive all data packets without missing905incoming packets or dropping outgoing packets. Drivers and applications that are906experiencing packet loss should try calling the EFI_IP6_PROTOCOL.Poll() function907more often.908909@param[in] This Pointer to the EFI_IP6_PROTOCOL instance.910911@retval EFI_SUCCESS Incoming or outgoing data was processed.912@retval EFI_NOT_STARTED This EFI IPv6 Protocol instance has not been started.913@retval EFI_INVALID_PARAMETER This is NULL.914@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.915@retval EFI_NOT_READY No incoming or outgoing data is processed.916@retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.917Consider increasing the polling rate.918919**/920typedef921EFI_STATUS922(EFIAPI *EFI_IP6_POLL)(923IN EFI_IP6_PROTOCOL *This924);925926///927/// The EFI IPv6 Protocol implements a simple packet-oriented interface that can be928/// used by drivers, daemons, and applications to transmit and receive network packets.929///930struct _EFI_IP6_PROTOCOL {931EFI_IP6_GET_MODE_DATA GetModeData;932EFI_IP6_CONFIGURE Configure;933EFI_IP6_GROUPS Groups;934EFI_IP6_ROUTES Routes;935EFI_IP6_NEIGHBORS Neighbors;936EFI_IP6_TRANSMIT Transmit;937EFI_IP6_RECEIVE Receive;938EFI_IP6_CANCEL Cancel;939EFI_IP6_POLL Poll;940};941942extern EFI_GUID gEfiIp6ServiceBindingProtocolGuid;943extern EFI_GUID gEfiIp6ProtocolGuid;944945#endif946947948