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

Go to the source code of this file.

Functions

EFI_STATUS Ip6CandidateSource (IN IP6_SERVICE *IpSb, OUT LIST_ENTRY *SourceList, OUT UINT32 *SourceCount)
 
UINT8 Ip6CommonPrefixLen (IN EFI_IPv6_ADDRESS *AddressA, IN EFI_IPv6_ADDRESS *AddressB)
 
EFI_STATUS Ip6SelectSourceAddress (IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Destination, OUT EFI_IPv6_ADDRESS *Source)
 
IP6_INTERFACEIp6SelectInterface (IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Destination, IN OUT EFI_IPv6_ADDRESS *Source)
 
VOID Ip6SysPacketSent (NET_BUF *Packet, EFI_STATUS IoStatus, UINT32 LinkFlag, VOID *Context)
 
EFI_STATUS Ip6PrependHead (IN IP6_SERVICE *IpSb, IN NET_BUF *Packet, IN EFI_IP6_HEADER *Head, IN UINT16 FragmentOffset, IN UINT8 *ExtHdrs, IN UINT32 ExtHdrsLen, IN UINT8 LastHeader, IN UINT32 HeadLen)
 
EFI_STATUS Ip6Output (IN IP6_SERVICE *IpSb, IN IP6_INTERFACE *Interface OPTIONAL, IN IP6_PROTOCOL *IpInstance OPTIONAL, IN NET_BUF *Packet, IN EFI_IP6_HEADER *Head, IN UINT8 *ExtHdrs, IN UINT32 ExtHdrsLen, IN IP6_FRAME_CALLBACK Callback, IN VOID *Context)
 
BOOLEAN Ip6CancelPacketFragments (IN IP6_LINK_TX_TOKEN *Frame, IN VOID *Context)
 
VOID Ip6CancelFrames (IN IP6_INTERFACE *Interface, IN EFI_STATUS IoStatus, IN IP6_FRAME_TO_CANCEL FrameToCancel OPTIONAL, IN VOID *Context OPTIONAL)
 
VOID Ip6CancelPacket (IN IP6_INTERFACE *IpIf, IN NET_BUF *Packet, IN EFI_STATUS IoStatus)
 

Variables

UINT32 mIp6Id
 

Detailed Description

The internal functions and routines to transmit the IP6 packet.

Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.

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

Definition in file Ip6Output.c.

Function Documentation

◆ Ip6CancelFrames()

VOID Ip6CancelFrames ( IN IP6_INTERFACE Interface,
IN EFI_STATUS  IoStatus,
IN IP6_FRAME_TO_CANCEL FrameToCancel  OPTIONAL,
IN VOID *Context  OPTIONAL 
)

Remove all the frames on the interface that pass the FrameToCancel, either queued on ARP queues or that have already been delivered to MNP and not yet recycled.

Parameters
[in]InterfaceInterface to remove the frames from.
[in]IoStatusThe transmit status returned to the frames' callback.
[in]FrameToCancelFunction to select the frame to cancel; NULL to select all.
[in]ContextOpaque parameters passed to FrameToCancel. Ignored if FrameToCancel is NULL.

Definition at line 1024 of file Ip6Output.c.

◆ Ip6CancelPacket()

VOID Ip6CancelPacket ( IN IP6_INTERFACE IpIf,
IN NET_BUF Packet,
IN EFI_STATUS  IoStatus 
)

Cancel the Packet and all its fragments.

Parameters
[in]IpIfThe interface from which the Packet is sent.
[in]PacketThe Packet to cancel.
[in]IoStatusThe status returns to the sender.

Definition at line 1081 of file Ip6Output.c.

◆ Ip6CancelPacketFragments()

BOOLEAN Ip6CancelPacketFragments ( IN IP6_LINK_TX_TOKEN Frame,
IN VOID *  Context 
)

The filter function to find a packet and all its fragments. The packet's fragments have their Context set to the packet.

Parameters
[in]FrameThe frames hold by the low level interface.
[in]ContextContext to the function, which is the packet.
Return values
TRUEThis is the packet to cancel or its fragments.
FALSEThis is an unrelated packet.

Definition at line 999 of file Ip6Output.c.

◆ Ip6CandidateSource()

EFI_STATUS Ip6CandidateSource ( IN IP6_SERVICE IpSb,
OUT LIST_ENTRY SourceList,
OUT UINT32 *  SourceCount 
)

Output all the available source addresses to a list entry head SourceList. The number of source addresses are also returned.

Parameters
[in]IpSbPoints to an IP6 service binding instance.
[out]SourceListThe list entry head of all source addresses. It is the caller's responsibility to free the resources.
[out]SourceCountThe number of source addresses.
Return values
EFI_SUCCESSThe source addresses were copied to a list entry head SourceList.
EFI_OUT_OF_RESOURCESFailed to allocate resources to complete the operation.

Definition at line 30 of file Ip6Output.c.

◆ Ip6CommonPrefixLen()

UINT8 Ip6CommonPrefixLen ( IN EFI_IPv6_ADDRESS AddressA,
IN EFI_IPv6_ADDRESS AddressB 
)

Calculate how many bits are the same between two IPv6 addresses.

Parameters
[in]AddressAPoints to an IPv6 address.
[in]AddressBPoints to another IPv6 address.
Returns
The common bits of the AddressA and AddressB.

Definition at line 97 of file Ip6Output.c.

◆ Ip6Output()

EFI_STATUS Ip6Output ( IN IP6_SERVICE IpSb,
IN IP6_INTERFACE *Interface  OPTIONAL,
IN IP6_PROTOCOL *IpInstance  OPTIONAL,
IN NET_BUF Packet,
IN EFI_IP6_HEADER Head,
IN UINT8 *  ExtHdrs,
IN UINT32  ExtHdrsLen,
IN IP6_FRAME_CALLBACK  Callback,
IN VOID *  Context 
)

Transmit an IP6 packet. The packet comes either from the IP6 child's consumer (IpInstance != NULL) or the IP6 driver itself (IpInstance == NULL). It will route the packet, fragment it, then transmit all the fragments through an interface.

Parameters
[in]IpSbThe IP6 service instance to transmit the packet.
[in]InterfaceThe IP6 interface to transmit the packet. Ignored if NULL.
[in]IpInstanceThe IP6 child that issues the transmission. It is NULL if the packet is from the system.
[in]PacketThe user data to send, excluding the IP header.
[in]HeadThe caller supplied header. The caller should set the following header fields: NextHeader, HopLimit, Src, Dest, FlowLabel, PayloadLength. This function will fill in the Ver, TrafficClass.
[in]ExtHdrsThe extension headers to append to the IPv6 basic header.
[in]ExtHdrsLenThe length of the extension headers.
[in]CallbackThe callback function to issue when transmission completed.
[in]ContextThe opaque context for the callback.
Return values
EFI_INVALID_PARAMETERAny input parameter or the packet is invalid.
EFI_NO_MAPPINGThere is no interface to the destination.
EFI_NOT_FOUNDThere is no route to the destination.
EFI_SUCCESSThe packet successfully transmitted.
EFI_OUT_OF_RESOURCESFailed to finish the operation due to lack of resources.
OthersFailed to transmit the packet.

Definition at line 476 of file Ip6Output.c.

◆ Ip6PrependHead()

EFI_STATUS Ip6PrependHead ( IN IP6_SERVICE IpSb,
IN NET_BUF Packet,
IN EFI_IP6_HEADER Head,
IN UINT16  FragmentOffset,
IN UINT8 *  ExtHdrs,
IN UINT32  ExtHdrsLen,
IN UINT8  LastHeader,
IN UINT32  HeadLen 
)

Prefix an IP6 basic head and unfragmentable extension headers and a fragment header to the Packet. Used for IP6 fragmentation.

Parameters
[in]IpSbThe IP6 service instance to transmit the packet.
[in]PacketThe packet to prefix the IP6 header to.
[in]HeadThe caller supplied header.
[in]FragmentOffsetThe fragment offset of the data following the header.
[in]ExtHdrsThe length of the original extension header.
[in]ExtHdrsLenThe length of the extension headers.
[in]LastHeaderThe pointer of next header of last extension header.
[in]HeadLenThe length of the unfragmented part of the IP6 header.
Return values
EFI_BAD_BUFFER_SIZEThere is no enough room in the head space of Packet.
EFI_SUCCESSThe operation performed successfully.

Definition at line 367 of file Ip6Output.c.

◆ Ip6SelectInterface()

IP6_INTERFACE * Ip6SelectInterface ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS Destination,
IN OUT EFI_IPv6_ADDRESS Source 
)

Select an interface to send the packet generated in the IP6 driver itself: that is, not by the requests of the IP6 child's consumer. Such packets include the ICMPv6 echo replies and other ICMPv6 error packets.

Parameters
[in]IpSbThe IP4 service that wants to send the packets.
[in]DestinationThe destination of the packet.
[in,out]SourceThe source of the packet.
Returns
NULL if no proper interface is found, otherwise, the interface that can be used to send the system packet from.

Definition at line 286 of file Ip6Output.c.

◆ Ip6SelectSourceAddress()

EFI_STATUS Ip6SelectSourceAddress ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS Destination,
OUT EFI_IPv6_ADDRESS Source 
)

Output all the available source addresses to a list entry head SourceList. The number of source addresses are also returned.

Parameters
[in]IpSbPoints to a IP6 service binding instance.
[in]DestinationThe IPv6 destination address.
[out]SourceThe selected IPv6 source address according to the Destination.
Return values
EFI_SUCCESSThe source addresses were copied to a list entry head SourceList.
EFI_NO_MAPPINGThe IPv6 stack is not auto configured.

Definition at line 153 of file Ip6Output.c.

◆ Ip6SysPacketSent()

VOID Ip6SysPacketSent ( NET_BUF Packet,
EFI_STATUS  IoStatus,
UINT32  LinkFlag,
VOID *  Context 
)

The default callback function for the system generated packet. It will free the packet.

Parameters
[in]PacketThe packet that transmitted.
[in]IoStatusThe result of the transmission, succeeded or failed.
[in]LinkFlagNot used when transmitted. Check IP6_FRAME_CALLBACK for reference.
[in]ContextThe context provided by us.

Definition at line 337 of file Ip6Output.c.

Variable Documentation

◆ mIp6Id

UINT32 mIp6Id

Definition at line 12 of file Ip6Output.c.