TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6Impl.c File Reference
#include "Ip6Impl.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI EfiIp6GetModeData (IN EFI_IP6_PROTOCOL *This, OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
 
BOOLEAN Ip6IsValidAddress (IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip, IN BOOLEAN Flag)
 
BOOLEAN Ip6IsIllegalProtocol (IN UINT8 Protocol)
 
VOID Ip6InitProtocol (IN IP6_SERVICE *IpSb, IN OUT IP6_PROTOCOL *IpInstance)
 
EFI_STATUS Ip6ConfigProtocol (IN OUT IP6_PROTOCOL *IpInstance, IN EFI_IP6_CONFIG_DATA *Config)
 
EFI_STATUS Ip6CleanProtocol (IN OUT IP6_PROTOCOL *IpInstance)
 
EFI_STATUS Ip6ServiceConfigMnp (IN IP6_SERVICE *IpSb, IN BOOLEAN Force)
 
EFI_STATUS EFIAPI EfiIp6Configure (IN EFI_IP6_PROTOCOL *This, IN EFI_IP6_CONFIG_DATA *Ip6ConfigData OPTIONAL)
 
EFI_STATUS EFIAPI EfiIp6Groups (IN EFI_IP6_PROTOCOL *This, IN BOOLEAN JoinFlag, IN EFI_IPv6_ADDRESS *GroupAddress OPTIONAL)
 
EFI_STATUS EFIAPI EfiIp6Routes (IN EFI_IP6_PROTOCOL *This, IN BOOLEAN DeleteRoute, IN EFI_IPv6_ADDRESS *Destination OPTIONAL, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL)
 
EFI_STATUS EFIAPI EfiIp6Neighbors (IN EFI_IP6_PROTOCOL *This, IN BOOLEAN DeleteFlag, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL, IN UINT32 Timeout, IN BOOLEAN Override)
 
EFI_STATUS EFIAPI Ip6TokenExist (IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Context)
 
EFI_STATUS Ip6TxTokenValid (IN EFI_IP6_COMPLETION_TOKEN *Token)
 
VOID EFIAPI Ip6FreeTxToken (IN VOID *Context)
 
VOID Ip6OnPacketSent (IN NET_BUF *Packet, IN EFI_STATUS IoStatus, IN UINT32 Flag, IN VOID *Context)
 
EFI_STATUS EFIAPI EfiIp6Transmit (IN EFI_IP6_PROTOCOL *This, IN EFI_IP6_COMPLETION_TOKEN *Token)
 
EFI_STATUS EFIAPI EfiIp6Receive (IN EFI_IP6_PROTOCOL *This, IN EFI_IP6_COMPLETION_TOKEN *Token)
 
EFI_STATUS EFIAPI Ip6CancelTxTokens (IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Context)
 
EFI_STATUS EFIAPI Ip6CancelRxTokens (IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Context)
 
EFI_STATUS Ip6Cancel (IN IP6_PROTOCOL *IpInstance, IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL)
 
EFI_STATUS EFIAPI EfiIp6Cancel (IN EFI_IP6_PROTOCOL *This, IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL)
 
EFI_STATUS EFIAPI EfiIp6Poll (IN EFI_IP6_PROTOCOL *This)
 

Variables

EFI_IPSEC2_PROTOCOLmIpSec = NULL
 
EFI_IP6_PROTOCOL mEfiIp6ProtocolTemplete
 

Detailed Description

Implementation of EFI_IP6_PROTOCOL protocol interfaces.

(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ip6Impl.c.

Function Documentation

◆ EfiIp6Cancel()

EFI_STATUS EFIAPI EfiIp6Cancel ( IN EFI_IP6_PROTOCOL This,
IN EFI_IP6_COMPLETION_TOKEN *Token  OPTIONAL 
)

Abort an asynchronous transmit or receive request.

The Cancel() function is used to abort a pending transmit or receive request. If the token is in the transmit or receive request queues, after calling this function, Token->Status will be set to EFI_ABORTED, and then Token->Event will be signaled. If the token is not in one of the queues, which usually means the asynchronous operation has completed, this function will not signal the token, and EFI_NOT_FOUND is returned.

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
[in]TokenPointer to a token that has been issued by EFI_IP6_PROTOCOL.Transmit() or EFI_IP6_PROTOCOL.Receive(). If NULL, all pending tokens are aborted. Type EFI_IP6_COMPLETION_TOKEN is defined in EFI_IP6_PROTOCOL.Transmit().
Return values
EFI_SUCCESSThe asynchronous I/O request was aborted and Token->Event was signaled. When Token is NULL, all pending requests were aborted, and their events were signaled.
EFI_INVALID_PARAMETERThis is NULL.
EFI_NOT_STARTEDThis instance has not been started.
EFI_NOT_FOUNDWhen Token is not NULL, the asynchronous I/O request was not found in the transmit or receive queue. It has either completed or was not issued by Transmit() and Receive().
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Definition at line 1748 of file Ip6Impl.c.

◆ EfiIp6Configure()

EFI_STATUS EFIAPI EfiIp6Configure ( IN EFI_IP6_PROTOCOL This,
IN EFI_IP6_CONFIG_DATA *Ip6ConfigData  OPTIONAL 
)

Assigns an IPv6 address and subnet mask to this EFI IPv6 Protocol driver instance.

The Configure() function is used to set, change, or reset the operational parameters and filter settings for this EFI IPv6 Protocol instance. Until these parameters have been set, no network traffic can be sent or received by this instance. Once the parameters have been reset (by calling this function with Ip6ConfigData set to NULL), no more traffic can be sent or received until these parameters have been set again. Each EFI IPv6 Protocol instance can be started and stopped independently of each other by enabling or disabling their receive filter settings with the Configure() function.

If Ip6ConfigData.StationAddress is a valid non-zero IPv6 unicast address, it is required to be one of the currently configured IPv6 addresses listed in the EFI IPv6 drivers, or else EFI_INVALID_PARAMETER will be returned. If Ip6ConfigData.StationAddress is unspecified, the IPv6 driver will bind a source address according to the source address selection algorithm. Clients could frequently call GetModeData() to check get currently configured IPv6 address list in the EFI IPv6 driver. If both Ip6ConfigData.StationAddress and Ip6ConfigData.Destination are unspecified, when transmitting the packet afterwards, the source address filled in each outgoing IPv6 packet is decided based on the destination of this packet.

If operational parameters are reset or changed, any pending transmit and receive requests will be cancelled. Their completion token status will be set to EFI_ABORTED and their events will be signaled.

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
[in]Ip6ConfigDataPointer to the EFI IPv6 Protocol configuration data structure. If NULL, reset the configuration data.
Return values
EFI_SUCCESSThe driver instance was successfully opened.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:
  • This is NULL.
  • Ip6ConfigData.StationAddress is neither zero nor a unicast IPv6 address.
  • Ip6ConfigData.StationAddress is neither zero nor one of the configured IP addresses in the EFI IPv6 driver.
  • Ip6ConfigData.DefaultProtocol is illegal.
EFI_OUT_OF_RESOURCESThe EFI IPv6 Protocol driver instance data could not be allocated.
EFI_NO_MAPPINGThe IPv6 driver was responsible for choosing a source address for this instance, but no source address was available for use.
EFI_ALREADY_STARTEDThe interface is already open and must be stopped before the IPv6 address or prefix length can be changed.
EFI_DEVICE_ERRORAn unexpected system or network error occurred. The EFI IPv6 Protocol driver instance was not opened.
EFI_UNSUPPORTEDDefault protocol specified through Ip6ConfigData.DefaultProtocol isn't supported.

Definition at line 610 of file Ip6Impl.c.

◆ EfiIp6GetModeData()

EFI_STATUS EFIAPI EfiIp6GetModeData ( IN EFI_IP6_PROTOCOL This,
OUT EFI_IP6_MODE_DATA *Ip6ModeData  OPTIONAL,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData  OPTIONAL,
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData  OPTIONAL 
)

Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.

The GetModeData() function returns the current operational mode data for this driver instance. The data fields in EFI_IP6_MODE_DATA are read only. This function is used optionally to retrieve the operational mode data of underlying networks or drivers.

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
[out]Ip6ModeDataPointer to the EFI IPv6 Protocol mode data structure.
[out]MnpConfigDataPointer to the managed network configuration data structure.
[out]SnpModeDataPointer to the simple network mode data structure.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_INVALID_PARAMETERThis is NULL.
EFI_OUT_OF_RESOURCESThe required mode data could not be allocated.

Definition at line 46 of file Ip6Impl.c.

◆ EfiIp6Groups()

EFI_STATUS EFIAPI EfiIp6Groups ( IN EFI_IP6_PROTOCOL This,
IN BOOLEAN  JoinFlag,
IN EFI_IPv6_ADDRESS *GroupAddress  OPTIONAL 
)

Joins and leaves multicast groups.

The Groups() function is used to join and leave multicast group sessions. Joining a group will enable reception of matching multicast packets. Leaving a group will disable reception of matching multicast packets. Source-Specific Multicast isn't required to be supported.

If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
[in]JoinFlagSet to TRUE to join the multicast group session, and FALSE to leave.
[in]GroupAddressPointer to the IPv6 multicast address. This is an optional parameter that may be NULL.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_INVALID_PARAMETEROne or more of the following is TRUE:
  • This is NULL.
  • JoinFlag is TRUE and GroupAddress is NULL.
  • GroupAddress is not NULL and *GroupAddress is not a multicast IPv6 address.
  • GroupAddress is not NULL and *GroupAddress is in the range of SSM destination address.
EFI_NOT_STARTEDThis instance has not been started.
EFI_OUT_OF_RESOURCESSystem resources could not be allocated.
EFI_UNSUPPORTEDThis EFI IPv6 Protocol implementation does not support multicast groups.
EFI_ALREADY_STARTEDThe group address is already in the group table (when JoinFlag is TRUE).
EFI_NOT_FOUNDThe group address is not in the group table (when JoinFlag is FALSE).
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Definition at line 740 of file Ip6Impl.c.

◆ EfiIp6Neighbors()

EFI_STATUS EFIAPI EfiIp6Neighbors ( IN EFI_IP6_PROTOCOL This,
IN BOOLEAN  DeleteFlag,
IN EFI_IPv6_ADDRESS TargetIp6Address,
IN EFI_MAC_ADDRESS *TargetLinkAddress  OPTIONAL,
IN UINT32  Timeout,
IN BOOLEAN  Override 
)

Add or delete Neighbor cache entries.

The Neighbors() function is used to add, update, or delete an entry from neighbor cache. IPv6 neighbor cache entries are typically inserted and updated by the network protocol driver as network traffic is processed. Most neighbor cache entries will timeout and be deleted if the network traffic stops. Neighbor cache entries that were inserted by Neighbors() may be static (will not timeout) or dynamic (will timeout).

The implementation should follow the neighbor cache timeout mechanism which is defined in RFC4861. The default neighbor cache timeout value should be tuned for the expected network environment

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
[in]DeleteFlagSet to TRUE to delete the specified cache entry, set to FALSE to add (or update, if it already exists and Override is TRUE) the specified cache entry. TargetIp6Address is used as the key to find the requested cache entry.
[in]TargetIp6AddressPointer to the Target IPv6 address.
[in]TargetLinkAddressPointer to the link-layer address of the target. Ignored if NULL.
[in]TimeoutTime in 100-ns units that this entry will remain in the neighbor cache, it will be deleted after Timeout. A value of zero means that the entry is permanent. A non-zero value means that the entry is dynamic.
[in]OverrideIf TRUE, the cached link-layer address of the matching entry will be overridden and updated; if FALSE, EFI_ACCESS_DENIED will be returned if a corresponding cache entry already existed.
Return values
EFI_SUCCESSThe data has been queued for transmission.
EFI_NOT_STARTEDThis instance has not been started.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:
  • This is NULL.
  • TargetIpAddress is NULL.
  • *TargetLinkAddress is invalid when not NULL.
  • *TargetIpAddress is not a valid unicast IPv6 address.
  • *TargetIpAddress is one of the local configured IPv6 addresses.
EFI_OUT_OF_RESOURCESCould not add the entry to the neighbor cache.
EFI_NOT_FOUNDThis entry is not in the neighbor cache (when DeleteFlag is TRUE or when DeleteFlag is FALSE while TargetLinkAddress is NULL.).
EFI_ACCESS_DENIEDThe to-be-added entry is already defined in the neighbor cache, and that entry is tagged as un-overridden (when Override is FALSE).

Definition at line 937 of file Ip6Impl.c.

◆ EfiIp6Poll()

EFI_STATUS EFIAPI EfiIp6Poll ( IN EFI_IP6_PROTOCOL This)

Polls for incoming data packets, and processes outgoing data packets.

The Poll() function polls for incoming data packets and processes outgoing data packets. Network drivers and applications can call the EFI_IP6_PROTOCOL.Poll() function to increase the rate that data packets are moved between the communications device and the transmit and receive queues.

In some systems the periodic timer event may not poll the underlying communications device fast enough to transmit and/or receive all data packets without missing incoming packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should try calling the EFI_IP6_PROTOCOL.Poll() function more often.

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
Return values
EFI_SUCCESSIncoming or outgoing data was processed.
EFI_NOT_STARTEDThis EFI IPv6 Protocol instance has not been started.
EFI_INVALID_PARAMETERThis is NULL.
EFI_DEVICE_ERRORAn unexpected system error or network error occurred.
EFI_NOT_READYNo incoming or outgoing data was processed.
EFI_TIMEOUTData was dropped out of the transmit and/or receive queue. Consider increasing the polling rate.

Definition at line 1804 of file Ip6Impl.c.

◆ EfiIp6Receive()

EFI_STATUS EFIAPI EfiIp6Receive ( IN EFI_IP6_PROTOCOL This,
IN EFI_IP6_COMPLETION_TOKEN Token 
)

Places a receiving request into the receiving queue.

The Receive() function places a completion token into the receive packet queue. This function is always asynchronous.

The Token.Event field in the completion token must be filled in by the caller and cannot be NULL. When the receive operation completes, the EFI IPv6 Protocol driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event is signaled.

Current Udp implementation creates an IP child for each Udp child. It initiates a asynchronous receive immediately no matter whether there is no mapping or not. Therefore, disable the returning EFI_NO_MAPPING for now. To enable it, the following check must be performed:

if (NetIp6IsUnspecifiedAddr (&Config->StationAddress) && IP6_NO_MAPPING (IpInstance)) { Status = EFI_NO_MAPPING; goto Exit; }

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
[in]TokenPointer to a token that is associated with the receive data descriptor.
Return values
EFI_SUCCESSThe receive completion token was cached.
EFI_NOT_STARTEDThis EFI IPv6 Protocol instance has not been started.
EFI_NO_MAPPINGWhen IP6 driver responsible for binding source address to this instance, while no source address is available for use.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:
  • This is NULL.
  • Token is NULL.
  • Token.Event is NULL.
EFI_OUT_OF_RESOURCESThe receive completion token could not be queued due to a lack of system resources (usually memory).
EFI_DEVICE_ERRORAn unexpected system or network error occurred. The EFI IPv6 Protocol instance has been reset to startup defaults.
EFI_ACCESS_DENIEDThe receive completion token with the same Token.Event was already in the receive queue.
EFI_NOT_READYThe receive request could not be queued because the receive queue is full.

Definition at line 1481 of file Ip6Impl.c.

◆ EfiIp6Routes()

EFI_STATUS EFIAPI EfiIp6Routes ( IN EFI_IP6_PROTOCOL This,
IN BOOLEAN  DeleteRoute,
IN EFI_IPv6_ADDRESS *Destination  OPTIONAL,
IN UINT8  PrefixLength,
IN EFI_IPv6_ADDRESS *GatewayAddress  OPTIONAL 
)

Adds and deletes routing table entries.

The Routes() function adds a route to, or deletes a route from, the routing table.

Routes are determined by comparing the leftmost PrefixLength bits of Destination with the destination IPv6 address arithmetically. The gateway address must be on the same subnet as the configured station address.

The default route is added with Destination and PrefixLength both set to all zeros. The default route matches all destination IPv6 addresses that do not match any other routes.

All EFI IPv6 Protocol instances share a routing table.

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
[in]DeleteRouteSet to TRUE to delete this route from the routing table. Set to FALSE to add this route to the routing table. Destination, PrefixLength and Gateway are used as the key to each route entry.
[in]DestinationThe address prefix of the subnet that needs to be routed. This is an optional parameter that may be NULL.
[in]PrefixLengthThe prefix length of Destination. Ignored if Destination is NULL.
[in]GatewayAddressThe unicast gateway IPv6 address for this route. This is an optional parameter that may be NULL.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_NOT_STARTEDThe driver instance has not been started.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE:
  • This is NULL.
  • When DeleteRoute is TRUE, both Destination and GatewayAddress are NULL.
  • When DeleteRoute is FALSE, either Destination or GatewayAddress is NULL.
  • *GatewayAddress is not a valid unicast IPv6 address.
  • *GatewayAddress is one of the local configured IPv6 addresses.
EFI_OUT_OF_RESOURCESCould not add the entry to the routing table.
EFI_NOT_FOUNDThis route is not in the routing table (when DeleteRoute is TRUE).
EFI_ACCESS_DENIEDThe route is already defined in the routing table (when DeleteRoute is FALSE).

Definition at line 825 of file Ip6Impl.c.

◆ EfiIp6Transmit()

EFI_STATUS EFIAPI EfiIp6Transmit ( IN EFI_IP6_PROTOCOL This,
IN EFI_IP6_COMPLETION_TOKEN Token 
)

Places outgoing data packets into the transmit queue.

The Transmit() function places a sending request in the transmit queue of this EFI IPv6 Protocol instance. Whenever the packet in the token is sent out or some errors occur, the event in the token will be signaled, and the status is updated.

Parameters
[in]ThisPointer to the EFI_IP6_PROTOCOL instance.
[in]TokenPointer to the transmit token.
Return values
EFI_SUCCESSThe data has been queued for transmission.
EFI_NOT_STARTEDThis instance has not been started.
EFI_NO_MAPPINGThe IPv6 driver was responsible for choosing a source address for this transmission, but no source address was available for use.
EFI_INVALID_PARAMETEROne or more of the following is TRUE:
  • This is NULL.
  • Token is NULL.
  • Token.Event is NULL.
  • Token.Packet.TxData is NULL.
  • Token.Packet.ExtHdrsLength is not zero and Token.Packet.ExtHdrs is NULL.
  • Token.Packet.FragmentCount is zero.
  • One or more of the Token.Packet.TxData. FragmentTable[].FragmentLength fields is zero.
  • One or more of the Token.Packet.TxData. FragmentTable[].FragmentBuffer fields is NULL.
  • Token.Packet.TxData.DataLength is zero or not equal to the sum of fragment lengths.
  • Token.Packet.TxData.DestinationAddress is non zero when DestinationAddress is configured as non-zero when doing Configure() for this EFI IPv6 protocol instance.
  • Token.Packet.TxData.DestinationAddress is unspecified when DestinationAddress is unspecified when doing Configure() for this EFI IPv6 protocol instance.
EFI_ACCESS_DENIEDThe transmit completion token with the same Token. Event was already in the transmit queue.
EFI_NOT_READYThe completion token could not be queued because the transmit queue is full.
EFI_NOT_FOUNDNot route is found to destination address.
EFI_OUT_OF_RESOURCESCould not queue the transmit data.
EFI_BUFFER_TOO_SMALLToken.Packet.TxData.TotalDataLength is too short to transmit.
EFI_BAD_BUFFER_SIZEIf Token.Packet.TxData.DataLength is beyond the maximum that which can be described through the Fragment Offset field in Fragment header when performing fragmentation.
EFI_DEVICE_ERRORAn unexpected system or network error occurred.

Definition at line 1238 of file Ip6Impl.c.

◆ Ip6Cancel()

EFI_STATUS Ip6Cancel ( IN IP6_PROTOCOL IpInstance,
IN EFI_IP6_COMPLETION_TOKEN *Token  OPTIONAL 
)

Cancel the user's receive/transmit request. It is the worker function of EfiIp6Cancel API.

Parameters
[in]IpInstanceThe IP6 child.
[in]TokenThe token to cancel. If NULL, all token will be cancelled.
Return values
EFI_SUCCESSThe token is cancelled.
EFI_NOT_FOUNDThe token isn't found on either the transmit/receive queue.
EFI_DEVICE_ERRORNot all tokens are cancelled when Token is NULL.

Definition at line 1660 of file Ip6Impl.c.

◆ Ip6CancelRxTokens()

EFI_STATUS EFIAPI Ip6CancelRxTokens ( IN NET_MAP Map,
IN NET_MAP_ITEM Item,
IN VOID *  Context 
)

Cancel the receive request. This is simple, because it is only enqueued in our local receive map.

Parameters
[in]MapThe IP6 child's receive queue.
[in]ItemCurrent receive request to cancel.
[in]ContextThe user's token to cancel.
Return values
EFI_SUCCESSContinue to check the next receive request on the queue.
EFI_ABORTEDThe user's token (token != NULL) has been cancelled.

Definition at line 1616 of file Ip6Impl.c.

◆ Ip6CancelTxTokens()

EFI_STATUS EFIAPI Ip6CancelTxTokens ( IN NET_MAP Map,
IN NET_MAP_ITEM Item,
IN VOID *  Context 
)

Cancel the transmitted but not recycled packet. If a matching token is found, it will call Ip6CancelPacket to cancel the packet. Ip6CancelPacket cancels all the fragments of the packet. When all the fragments are freed, the IP6_TXTOKEN_WRAP is deleted from the Map, and user's event is signalled. Because Ip6CancelPacket and other functions are all called in line, after Ip6CancelPacket returns, the Item has been freed.

Parameters
[in]MapThe IP6 child's transmit queue.
[in]ItemThe current transmitted packet to test.
[in]ContextThe user's token to cancel.
Return values
EFI_SUCCESSContinue to check the next Item.
EFI_ABORTEDThe user's Token (Token != NULL) is cancelled.

Definition at line 1560 of file Ip6Impl.c.

◆ Ip6CleanProtocol()

EFI_STATUS Ip6CleanProtocol ( IN OUT IP6_PROTOCOL IpInstance)

Clean up the IP6 child, and release all the resources used by it.

Parameters
[in,out]IpInstanceThe IP6 child to clean up.
Return values
EFI_SUCCESSThe IP6 child is cleaned up.
EFI_DEVICE_ERRORSome resources failed to be released.

Definition at line 444 of file Ip6Impl.c.

◆ Ip6ConfigProtocol()

EFI_STATUS Ip6ConfigProtocol ( IN OUT IP6_PROTOCOL IpInstance,
IN EFI_IP6_CONFIG_DATA Config 
)

Configure the IP6 child. If the child is already configured, change the configuration parameter. Otherwise, configure it for the first time. The caller should validate the configuration before deliver them to it. It also don't do configure NULL.

Parameters
[in,out]IpInstanceThe IP6 child to configure.
[in]ConfigThe configure data.
Return values
EFI_SUCCESSThe IP6 child is successfully configured.
EFI_DEVICE_ERRORFailed to free the pending transive or to configure underlying MNP, or other errors.
EFI_NO_MAPPINGThe IP6 child is configured to use the default address, but the default address hasn't been configured. The IP6 child doesn't need to be reconfigured when the default address is configured.
EFI_OUT_OF_RESOURCESNo more memory space is available.
otherOther error occurs.

Definition at line 343 of file Ip6Impl.c.

◆ Ip6FreeTxToken()

VOID EFIAPI Ip6FreeTxToken ( IN VOID *  Context)

The callback function for the net buffer which wraps the user's transmit token. Although this function seems simple, there are some subtle aspects. When user requests the IP to transmit a packet by passing it a token, the token is wrapped in an IP6_TXTOKEN_WRAP and the data is wrapped in an net buffer. The net buffer's Free function is set to Ip6FreeTxToken. The Token and token wrap are added to the IP child's TxToken map. Then the buffer is passed to Ip6Output for transmission. If an error happened before that, the buffer is freed, which in turn frees the token wrap. The wrap may have been added to the TxToken map or not, and the user's event shouldn't be fired because we are still in the EfiIp6Transmit. If the buffer has been sent by Ip6Output, it should be removed from the TxToken map and user's event signaled. The token wrap and buffer are bound together. Check the comments in Ip6Output for information about IP fragmentation.

Parameters
[in]ContextThe token's wrap.

Definition at line 1117 of file Ip6Impl.c.

◆ Ip6InitProtocol()

VOID Ip6InitProtocol ( IN IP6_SERVICE IpSb,
IN OUT IP6_PROTOCOL IpInstance 
)

Initialize the IP6_PROTOCOL structure to the unconfigured states.

Parameters
[in]IpSbThe IP6 service instance.
[in,out]IpInstanceThe IP6 child instance.

Definition at line 299 of file Ip6Impl.c.

◆ Ip6IsIllegalProtocol()

BOOLEAN Ip6IsIllegalProtocol ( IN UINT8  Protocol)

Validate whether the value of protocol is illegal or not. Protocol is the 'Next Header' field in the last IPv6 extension header, or basic IPv6 header is there's no extension header.

Parameters
[in]ProtocolDefault value of 'Next Header'
Return values
TRUEThe protocol is illegal.
FALSEThe protocol is legal.

Definition at line 276 of file Ip6Impl.c.

◆ Ip6IsValidAddress()

BOOLEAN Ip6IsValidAddress ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS Ip,
IN BOOLEAN  Flag 
)

Validate that Ipv6 address is OK to be used as station address or next hop address/ neighbor.

Parameters
[in]IpSbThe IP6 service instance.
[in]IpThe IPv6 address to validate.
[in]FlagIf TRUE, validate if the address is OK to be used as station address. If FALSE, validate if the address is OK to be used as the next hop address/ neighbor.
Return values
TRUEThe Ip address is valid and could be used.
FALSEInvalid Ip address.

Definition at line 244 of file Ip6Impl.c.

◆ Ip6OnPacketSent()

VOID Ip6OnPacketSent ( IN NET_BUF Packet,
IN EFI_STATUS  IoStatus,
IN UINT32  Flag,
IN VOID *  Context 
)

The callback function to Ip6Output to update the transmit status.

Parameters
[in]PacketThe user's transmit packet.
[in]IoStatusThe result of the transmission.
[in]FlagNot used during transmission.
[in]ContextThe token's wrap.

Definition at line 1165 of file Ip6Impl.c.

◆ Ip6ServiceConfigMnp()

EFI_STATUS Ip6ServiceConfigMnp ( IN IP6_SERVICE IpSb,
IN BOOLEAN  Force 
)

Configure the MNP parameter used by IP. The IP driver uses one MNP child to transmit/receive frames. By default, it configures MNP to receive unicast/multicast/broadcast. Also, it will enable/disable the promiscuous receive according to whether there is IP child enable that or not. If Force is FALSE, it will iterate through all the IP children to check whether the promiscuous receive setting has been changed. If it hasn't been changed, it won't reconfigure the MNP. If Force is TRUE, the MNP is configured whether that is changed or not.

Parameters
[in]IpSbThe IP6 service instance that is to be changed.
[in]ForceForce the configuration or not.
Return values
EFI_SUCCESSThe MNP successfully configured/reconfigured.
OthersConfiguration failed.

Definition at line 502 of file Ip6Impl.c.

◆ Ip6TokenExist()

EFI_STATUS EFIAPI Ip6TokenExist ( IN NET_MAP Map,
IN NET_MAP_ITEM Item,
IN VOID *  Context 
)

Check whether the user's token or event has already been enqueue on IP6's list.

Parameters
[in]MapThe container of either user's transmit or receive token.
[in]ItemCurrent item to check against.
[in]ContextThe Token to check against.
Return values
EFI_ACCESS_DENIEDThe token or event has already been enqueued in IP
EFI_SUCCESSThe current item isn't the same token/event as the context.

Definition at line 1013 of file Ip6Impl.c.

◆ Ip6TxTokenValid()

EFI_STATUS Ip6TxTokenValid ( IN EFI_IP6_COMPLETION_TOKEN Token)

Validate the user's token against the current station address.

Parameters
[in]TokenUser's token to validate.
Return values
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_BAD_BUFFER_SIZEThe user's option/data is too long.
EFI_SUCCESSThe token is OK.

Definition at line 1043 of file Ip6Impl.c.

Variable Documentation

◆ mEfiIp6ProtocolTemplete

EFI_IP6_PROTOCOL mEfiIp6ProtocolTemplete
Initial value:
= {
}
EFI_STATUS EFIAPI EfiIp6Receive(IN EFI_IP6_PROTOCOL *This, IN EFI_IP6_COMPLETION_TOKEN *Token)
Definition: Ip6Impl.c:1481
EFI_STATUS EFIAPI EfiIp6Transmit(IN EFI_IP6_PROTOCOL *This, IN EFI_IP6_COMPLETION_TOKEN *Token)
Definition: Ip6Impl.c:1238
EFI_STATUS EFIAPI EfiIp6Routes(IN EFI_IP6_PROTOCOL *This, IN BOOLEAN DeleteRoute, IN EFI_IPv6_ADDRESS *Destination OPTIONAL, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL)
Definition: Ip6Impl.c:825
EFI_STATUS EFIAPI EfiIp6Poll(IN EFI_IP6_PROTOCOL *This)
Definition: Ip6Impl.c:1804
EFI_STATUS EFIAPI EfiIp6Neighbors(IN EFI_IP6_PROTOCOL *This, IN BOOLEAN DeleteFlag, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL, IN UINT32 Timeout, IN BOOLEAN Override)
Definition: Ip6Impl.c:937
EFI_STATUS EFIAPI EfiIp6Groups(IN EFI_IP6_PROTOCOL *This, IN BOOLEAN JoinFlag, IN EFI_IPv6_ADDRESS *GroupAddress OPTIONAL)
Definition: Ip6Impl.c:740
EFI_STATUS EFIAPI EfiIp6GetModeData(IN EFI_IP6_PROTOCOL *This, OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
Definition: Ip6Impl.c:46
EFI_STATUS EFIAPI EfiIp6Configure(IN EFI_IP6_PROTOCOL *This, IN EFI_IP6_CONFIG_DATA *Ip6ConfigData OPTIONAL)
Definition: Ip6Impl.c:610
EFI_STATUS EFIAPI EfiIp6Cancel(IN EFI_IP6_PROTOCOL *This, IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL)
Definition: Ip6Impl.c:1748

Definition at line 15 of file Ip6Impl.c.

◆ mIpSec

Definition at line 13 of file Ip6Impl.c.