/** @file
Udp6 driver's whole implementation.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Udp6Impl.h"
/**
This function checks and timeouts the I/O datagrams holding by the corresponding
service context.
@param[in] Event The event this function is registered to.
@param[in] Context The context data registered during the creation of
the Event.
**/
);
/**
This function finds the udp instance by the specified <Address, Port> pair.
@param[in] InstanceList Pointer to the head of the list linking the udp
instances.
@param[in] Address Pointer to the specified IPv6 address.
@param[in] Port The udp port number.
@retval TRUE The specified <Address, Port> pair is found.
@retval FALSE Otherwise.
**/
);
/**
This function is the packet transmitting notify function registered to the IpIo
interface. It's called to signal the udp TxToken when the IpIo layer completes
transmitting of the udp datagram.
@param[in] Status The completion status of the output udp datagram.
@param[in] Context Pointer to the context data.
@param[in] Sender Specify a EFI_IP6_PROTOCOL for sending.
@param[in] NotifyData Pointer to the notify data.
**/
);
/**
This function processes the received datagram passed up by the IpIo layer.
@param[in] Status The status of this udp datagram.
@param[in] IcmpError The IcmpError code, only available when Status is
EFI_ICMP_ERROR.
@param[in] NetSession Pointer to the EFI_NET_SESSION_DATA.
@param[in] Packet Pointer to the NET_BUF containing the received udp
datagram.
@param[in] Context Pointer to the context data.
**/
);
/**
This function cancle the token specified by Arg in the Map.
@param[in] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM.
@param[in] Arg Pointer to the token to be cancelled, if NULL, all
the tokens in this Map will be cancelled.
This parameter is optional and may be NULL.
@retval EFI_SUCCESS The token is cancelled if Arg is NULL or the token
is not the same as that in the Item if Arg is not
NULL.
@retval EFI_ABORTED Arg is not NULL, and the token specified by Arg is
cancelled.
**/
);
/**
This function check if the received udp datagram matches with the Instance.
@param[in] Instance Pointer to the udp instance context data.
@param[in] Udp6Session Pointer to the EFI_UDP6_SESSION_DATA abstracted
from the received udp datagram.
@retval TRUE The udp datagram matches the receiving requirements of the Instance.
@retval FALSE The udp datagram doe not match the receiving requirements of the Instance.
**/
);
/**
This function removes the Wrap specified by Context and releases relevant resources.
@param[in] Event The Event this notify function is registered to.
@param[in] Context Pointer to the context data.
**/
);
/**
This function wraps the Packet into RxData.
@param[in] Instance Pointer to the instance context data.
@param[in] Packet Pointer to the buffer containing the received
datagram.
@param[in] RxData Pointer to the EFI_UDP6_RECEIVE_DATA of this
datagram.
@return Pointer to the structure wrapping the RxData and the Packet.
**/
);
/**
This function enqueues the received datagram into the instances' receiving queues.
@param[in] Udp6Service Pointer to the udp service context data.
@param[in] Packet Pointer to the buffer containing the received
datagram.
@param[in] RxData Pointer to the EFI_UDP6_RECEIVE_DATA of this
datagram.
@return The times this datagram is enqueued.
**/
);
/**
This function delivers the datagrams enqueued in the instances.
@param[in] Udp6Service Pointer to the udp service context data.
**/
);
/**
This function demultiplexes the received udp datagram to the apropriate instances.
@param[in] Udp6Service Pointer to the udp service context data.
@param[in] NetSession Pointer to the EFI_NET_SESSION_DATA abstrated from
the received datagram.
@param[in] Packet Pointer to the buffer containing the received udp
datagram.
**/
);
/**
This function handles the received Icmp Error message and demultiplexes it to the
instance.
@param[in] Udp6Service Pointer to the udp service context data.
@param[in] IcmpError The icmp error code.
@param[in] NetSession Pointer to the EFI_NET_SESSION_DATA abstracted
from the received Icmp Error packet.
@param[in, out] Packet Pointer to the Icmp Error packet.
**/
);
/**
This function builds and sends out a icmp port unreachable message.
@param[in] IpIo Pointer to the IP_IO instance.
@param[in] NetSession Pointer to the EFI_NET_SESSION_DATA of the packet
causes this icmp error message.
@param[in] Udp6Header Pointer to the udp header of the datagram causes
this icmp error message.
**/
);
/**
Find the key in the netmap
@param[in] Map The netmap to search within.
@param[in] Key The key to search.
@return The point to the item contains the Key, or NULL if Key isn't in the map.
**/
);
/**
Create the Udp service context data.
@param[in] Udp6Service Pointer to the UDP6_SERVICE_DATA.
@param[in] ImageHandle The image handle of this udp6 driver.
@param[in] ControllerHandle The controller handle this udp6 driver binds on.
@retval EFI_SUCCESS The udp6 service context data was created and
initialized.
@retval EFI_OUT_OF_RESOURCES Cannot allocate memory.
@retval Others An error condition occurred.
**/
)
{
Udp6Service->ChildrenNumber = 0;
//
// Create the IpIo for this service context.
//
return EFI_OUT_OF_RESOURCES;
}
//
// Set the OpenData used to open the IpIo.
//
CopyMem (
sizeof (EFI_IP6_CONFIG_DATA)
);
//
// Configure and start the IpIo.
//
goto ON_ERROR;
}
//
// Create the event for Udp timeout checking.
//
);
goto ON_ERROR;
}
//
// Start the timeout timer event.
//
);
goto ON_ERROR;
}
return EFI_SUCCESS;
}
return Status;
}
/**
Clean the Udp service context data.
@param[in, out] Udp6Service Pointer to the UDP6_SERVICE_DATA.
**/
)
{
//
// Close the TimeoutEvent timer.
//
//
// Destroy the IpIo.
//
}
/**
This function checks and times out the I/O datagrams listed in the
UDP6_SERVICE_DATA which is specified by the input parameter Context.
@param[in] Event The event this function registered to.
@param[in] Context The context data registered during the creation of
the Event.
**/
)
{
//
// Iterate all the instances belonging to this service context.
//
//
// Skip this instance if it's not configured or no receive timeout.
//
continue;
}
//
// Iterate all the rxdatas belonging to this udp instance.
//
//
// Remove this RxData if it timeouts.
//
} else {
}
}
}
}
/**
This function intializes the new created udp instance.
@param[in] Udp6Service Pointer to the UDP6_SERVICE_DATA.
@param[in, out] Instance Pointer to the un-initialized UDP6_INSTANCE_DATA.
**/
)
{
//
// Set the signature.
//
//
// Init the lists.
//
//
// Init the NET_MAPs.
//
//
// Save the pointer to the UDP6_SERVICE_DATA, and initialize other members.
//
}
/**
This function cleans the udp instance.
@param[in, out] Instance Pointer to the UDP6_INSTANCE_DATA to clean.
**/
)
{
}
/**
This function finds the udp instance by the specified <Address, Port> pair.
@param[in] InstanceList Pointer to the head of the list linking the udp
instances.
@param[in] Address Pointer to the specified IPv6 address.
@param[in] Port The udp port number.
@retval TRUE The specified <Address, Port> pair is found.
@retval FALSE Otherwise.
**/
)
{
//
// Iterate all the udp instances.
//
//
// If the instance is not configured, or the configdata of the instance indicates
// this instance accepts any port, skip it.
//
continue;
}
) {
//
// If both the address and the port are the same, return TRUE.
//
return TRUE;
}
}
//
// Return FALSE when matching fails.
//
return FALSE;
}
/**
This function tries to bind the udp instance according to the configured port
allocation stragety.
@param[in] InstanceList Pointer to the head of the list linking the udp
instances.
@param[in] ConfigData Pointer to the ConfigData of the instance to be
bound.
@retval EFI_SUCCESS The bound operation completed successfully.
@retval EFI_ACCESS_DENIED The <Address, Port> specified by the ConfigData is
already used by other instance.
@retval EFI_OUT_OF_RESOURCES No available port resources.
**/
Udp6Bind (
)
{
if (ConfigData->AcceptAnyPort) {
return EFI_SUCCESS;
}
if (ConfigData->StationPort != 0) {
if (!ConfigData->AllowDuplicatePort &&
) {
//
// Do not allow duplicate ports and the port is already used by other instance.
//
return EFI_ACCESS_DENIED;
}
} else {
//
// Select a random port for this instance.
//
if (ConfigData->AllowDuplicatePort) {
//
// Just pick up the random port if the instance allows duplicate port.
//
} else {
if (mUdp6RandomPort == 0) {
}
if (mUdp6RandomPort == StartPort) {
//
// No available port.
//
return EFI_OUT_OF_RESOURCES;
}
}
}
if (mUdp6RandomPort == 0) {
}
}
return EFI_SUCCESS;
}
/**
This function is used to check whether the NewConfigData has any un-reconfigurable
parameters changed compared to the OldConfigData.
@param[in] OldConfigData Pointer to the current ConfigData the udp instance
uses.
@param[in] NewConfigData Pointer to the new ConfigData.
@retval TRUE The instance is reconfigurable according to the NewConfigData.
@retval FALSE Otherwise.
**/
)
{
) {
//
// The receiving filter parameters cannot be changed.
//
return FALSE;
}
if ((!NewConfigData->AcceptAnyPort) &&
) {
//
// The port is not changeable.
//
return FALSE;
}
//
// The StationAddress is not the same.
//
return FALSE;
}
//
// The remoteaddress is not the same.
//
return FALSE;
}
) {
//
// The RemotePort differs if it's designated in the configdata.
//
return FALSE;
}
//
// All checks pass, return TRUE.
//
return TRUE;
}
/**
This function builds the Ip6 configdata from the Udp6ConfigData.
@param[in] Udp6ConfigData Pointer to the EFI_UDP6_CONFIG_DATA.
@param[in, out] Ip6ConfigData Pointer to the EFI_IP6_CONFIG_DATA.
**/
)
{
CopyMem (
sizeof (EFI_IP6_CONFIG_DATA)
);
//
// Use the -1 magic number to disable the receiving process of the ip instance.
//
}
/**
This function validates the TxToken. It returns the error code according to the spec.
@param[in] Instance Pointer to the udp instance context data.
@param[in] TxToken Pointer to the token to be checked.
@retval EFI_SUCCESS The TxToken is valid.
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
Token.Event is NULL;
Token.Packet.TxData is NULL;
Token.Packet.TxData.FragmentCount is zero;
Token.Packet.TxData.DataLength is not equal to the
sum of fragment lengths;
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;
UdpSessionData.DestinationAddress are not valid
unicast IPv6 addresses if the UdpSessionData is
not NULL;
UdpSessionData.DestinationPort and
ConfigData.RemotePort are all zero if the
UdpSessionData is not NULL.
@retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP
packet size.
**/
)
{
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
TotalLen = 0;
) {
//
// If the FragmentBuffer is NULL, or the FragmentLeng is zero.
//
return EFI_INVALID_PARAMETER;
}
}
//
// The TotalLen calculated by adding all the FragmentLeng doesn't equal to the
// DataLength.
//
return EFI_INVALID_PARAMETER;
}
if (UdpSessionData != NULL) {
//
// Ambiguous; no avalaible DestinationPort for this token.
//
return EFI_INVALID_PARAMETER;
}
) {
//
// The DestinationAddress is not specificed.
//
return EFI_INVALID_PARAMETER;
}
) {
//
// The ConfigData.RemoteAddress is not zero and the UdpSessionData.DestinationAddress
// is not zero too.
//
return EFI_INVALID_PARAMETER;
}
//
// The configured RemoteAddress is all zero, and the user doesn't override the
// destination address.
//
return EFI_INVALID_PARAMETER;
}
return EFI_BAD_BUFFER_SIZE;
}
return EFI_SUCCESS;
}
/**
This function checks whether the specified Token duplicates the one in the Map.
@param[in] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM contain the pointer to
the Token.
@param[in] Context Pointer to the Token to be checked.
@retval EFI_SUCCESS The Token specified by Context differs from the
one in the Item.
@retval EFI_ACCESS_DENIED The Token duplicates with the one in the Item.
**/
)
{
//
// The Token duplicates with the TokenInItem in case either the two pointers are the
// same, or the Events of these two tokens are the same.
//
return EFI_ACCESS_DENIED;
}
return EFI_SUCCESS;
}
/**
This function calculates the checksum for the Packet, utilizing the pre-calculated
pseudo HeadSum to reduce some overhead.
@param[in] Packet Pointer to the NET_BUF contains the udp datagram.
@param[in] HeadSum Checksum of the pseudo header, execpt the length
field.
@return The 16-bit checksum of this udp datagram.
**/
)
{
return Checksum;
}
/**
This function removes the specified Token from the TokenMap.
@param[in] TokenMap Pointer to the NET_MAP containing the tokens.
@param[in] Token Pointer to the Token to be removed.
@retval EFI_SUCCESS The specified Token is removed from the TokenMap.
@retval EFI_NOT_FOUND The specified Token is not found in the TokenMap.
**/
)
{
//
// Find the Token first.
//
//
// Remove the token if it's found in the map.
//
return EFI_SUCCESS;
}
return EFI_NOT_FOUND;
}
/**
This function is the packet transmitting notify function registered to the IpIo
interface. It's called to signal the udp TxToken when IpIo layer completes the
transmitting of the udp datagram.
@param[in] Status The completion status of the output udp datagram.
@param[in] Context Pointer to the context data.
@param[in] Sender Specify a EFI_IP6_PROTOCOL for sending.
@param[in] NotifyData Pointer to the notify data.
**/
)
{
//
// The token may be cancelled. Only signal it if the remove operation succeeds.
//
DispatchDpc ();
}
}
/**
This function processes the received datagram passed up by the IpIo layer.
@param[in] Status The status of this udp datagram.
@param[in] IcmpError The IcmpError code, only available when Status is
EFI_ICMP_ERROR.
@param[in] NetSession Pointer to the EFI_NET_SESSION_DATA.
@param[in] Packet Pointer to the NET_BUF containing the received udp
datagram.
@param[in] Context Pointer to the context data.
**/
)
{
//
// IpIo only passes received packets with Status EFI_SUCCESS or EFI_ICMP_ERROR.
//
if (Status == EFI_SUCCESS) {
//
// Demultiplex the received datagram.
//
} else {
//
// Handle the ICMP6 Error packet.
//
}
//
// Dispatch the DPC queued by the NotifyFunction of the rx token's events
// that are signaled with received data.
//
DispatchDpc ();
}
/**
This function removes the multicast group specified by Arg from the Map.
@param[in] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM.
@param[in] Arg Pointer to the Arg, it's the pointer to a
multicast IPv6 Address. This parameter is
optional and may be NULL.
@retval EFI_SUCCESS The multicast address is removed.
@retval EFI_ABORTED The specified multicast address is removed, and the
Arg is not NULL.
**/
)
{
) {
//
// McastIp is not NULL and the multicast address contained in the Item
// is not the same as McastIp.
//
return EFI_SUCCESS;
}
//
// Remove this Item.
//
//
// Return EFI_ABORTED in case McastIp is not NULL to terminate the iteration.
//
return EFI_ABORTED;
}
return EFI_SUCCESS;
}
/**
This function cancle the token specified by Arg in the Map.
@param[in] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM.
@param[in] Arg Pointer to the token to be cancelled. If NULL, all
the tokens in this Map will be cancelled.
This parameter is optional and may be NULL.
@retval EFI_SUCCESS The token is cancelled if Arg is NULL, or the token
is not the same as that in the Item, if Arg is not
NULL.
@retval EFI_ABORTED Arg is not NULL, and the token specified by Arg is
cancelled.
**/
)
{
return EFI_SUCCESS;
}
//
// If the token is a transmit token, the corresponding Packet is recorded in
// Item->Value, invoke IpIo to cancel this packet first. The IpIoCancelTxToken
// will invoke Udp6DgramSent, the token will be signaled and this Item will
// be removed from the Map there.
//
} else {
//
// The token is a receive token. Abort it and remove it from the Map.
//
}
return EFI_ABORTED;
}
return EFI_SUCCESS;
}
/**
This function removes all the Wrap datas in the RcvdDgramQue.
@param[in] Instance Pointer to the Udp6 Instance.
**/
)
{
//
// Iterate all the Wraps in the RcvdDgramQue.
//
//
// The Wrap will be removed from the RcvdDgramQue by this function call.
//
}
}
/**
Cancel Udp6 tokens from the Udp6 instance.
@param[in] Instance Pointer to the udp instance context data.
@param[in] Token Pointer to the token to be canceled. If NULL, all
tokens in this instance will be cancelled.
This parameter is optional and may be NULL.
@retval EFI_SUCCESS The Token is cancelled.
@retval EFI_NOT_FOUND The Token is not found.
**/
)
{
//
// Cancel this token from the TxTokens map.
//
//
// If Token isn't NULL and Status is EFI_ABORTED, the token is cancelled from
// the TxTokens and returns success.
//
return EFI_SUCCESS;
}
//
// Try to cancel this token from the RxTokens map in condition either the Token
// is NULL or the specified Token is not in TxTokens.
//
//
// If Token isn't NULL and Status is EFI_SUCCESS, the token is neither in the
// TxTokens nor the RxTokens, or say, it's not found.
//
return EFI_NOT_FOUND;
}
);
return EFI_SUCCESS;
}
/**
This function checks if the received udp datagram matches with the Instance.
@param[in] Instance Pointer to the udp instance context data.
@param[in] Udp6Session Pointer to the EFI_UDP6_SESSION_DATA abstracted
from the received udp datagram.
@retval TRUE The udp datagram matches the receiving requirements of the Instance.
@retval FALSE The udp datagram does not matche the receiving requirements of the Instance.
**/
)
{
if (ConfigData->AcceptPromiscuous) {
//
// Always matches if this instance is in the promiscuous state.
//
return TRUE;
}
) {
//
// The local port or the remote port doesn't match.
//
return FALSE;
}
) {
//
// This datagram doesn't come from the instance's specified sender.
//
return FALSE;
}
) {
//
// The instance is configured to receive datagrams destinated to any station IP or
// the destination address of this datagram matches the configured station IP.
//
return TRUE;
}
if (IP6_IS_MULTICAST (&Destination) &&
) {
//
// It's a multicast packet and the multicast address is accepted by this instance.
//
return TRUE;
}
return FALSE;
}
/**
This function removes the Wrap specified by Context and release relevant resources.
@param[in] Event The Event this notify function registered to.
@param[in] Context Pointer to the context data.
**/
)
{
//
// Remove the Wrap from the list it belongs to.
//
//
// Free the Packet associated with this Wrap.
//
//
// Close the event.
//
}
/**
This function wraps the Packet into RxData.
@param[in] Instance Pointer to the instance context data.
@param[in] Packet Pointer to the buffer containing the received
datagram.
@param[in] RxData Pointer to the EFI_UDP6_RECEIVE_DATA of this
datagram.
@return Pointer to the structure wrapping the RxData and the Packet.
**/
)
{
//
// Allocate buffer for the Wrap.
//
return NULL;
}
//
// Create the Recycle event.
//
Wrap,
);
return NULL;
}
return Wrap;
}
/**
This function enqueues the received datagram into the instances' receiving queues.
@param[in] Udp6Service Pointer to the udp service context data.
@param[in] Packet Pointer to the buffer containing the received
datagram.
@param[in] RxData Pointer to the EFI_UDP6_RECEIVE_DATA of this
datagram.
@return The times this datagram is enqueued.
**/
)
{
Enqueued = 0;
//
// Iterate the instances.
//
if (!Instance->Configured) {
continue;
}
//
// Wrap the RxData and put this Wrap into the instances RcvdDgramQue.
//
continue;
}
Enqueued++;
}
}
return Enqueued;
}
/**
This function delivers the received datagrams to the specified instance.
@param[in] Instance Pointer to the instance context data.
**/
)
{
) {
//
// Duplicate the Packet if it is shared between instances.
//
return;
}
}
//
// Build the FragmentTable and set the FragmentCount in RxData.
//
);
}
}
/**
This function delivers the datagrams enqueued in the instances.
@param[in] Udp6Service Pointer to the udp service context data.
**/
)
{
//
// Iterate the instances.
//
if (!Instance->Configured) {
continue;
}
//
// Deliver the datagrams of this instance.
//
}
}
/**
This function demultiplexes the received udp datagram to the appropriate instances.
@param[in] Udp6Service Pointer to the udp service context data.
@param[in] NetSession Pointer to the EFI_NET_SESSION_DATA abstrated from
the received datagram.
@param[in] Packet Pointer to the buffer containing the received udp
datagram.
**/
)
{
//
// Get the datagram header from the packet buffer.
//
if (Udp6Header->Checksum != 0) {
//
// check the checksum.
//
0
);
//
// Wrong checksum.
//
return;
}
}
//
// Trim the UDP header.
//
//
// Try to enqueue this datagram into the instances.
//
if (Enqueued == 0) {
//
// Send the port unreachable ICMP packet before we free this NET_BUF
//
}
//
// Try to free the packet before deliver it.
//
NetbufFree (Packet);
if (Enqueued > 0) {
//
// Deliver the datagram.
//
}
}
/**
This function builds and sends out a icmp port unreachable message.
@param[in] IpIo Pointer to the IP_IO instance.
@param[in] NetSession Pointer to the EFI_NET_SESSION_DATA of the packet
causes this icmp error message.
@param[in] Udp6Header Pointer to the udp header of the datagram causes
this icmp error message.
**/
)
{
Ip6ModeData = NULL;
//
// An ICMPv6 error message MUST NOT be originated as A packet destined to
// 1) an IPv6 multicast address 2) The IPv6 Unspecified Address
//
) {
goto EXIT;
}
}
//
// Get the Ipv6 Mode Data.
//
//
// If not finding the related IpSender use the default IpIo to send out
// the port unreachable ICMP message.
//
} else {
}
NULL,
);
goto EXIT;
}
//
// The ICMP6 packet length, includes whole invoking packet and ICMP6 error header.
//
sizeof (IP6_ICMP_ERROR_HEAD);
//
// If the ICMP6 packet length larger than IP MTU, adjust its length to MTU.
//
}
//
// Allocate buffer for the icmp error message.
//
goto EXIT;
}
//
// Allocate space for the IP6_ICMP_ERROR_HEAD.
//
//
// Set the required fields for the icmp port unreachable message.
//
IcmpErrHdr->Fourth = 0;
//
// Copy as much of invoking Packet as possible without the ICMPv6 packet
// exceeding the minimum Ipv6 MTU. The length of IP6_ICMP_ERROR_HEAD contains
// the length of EFI_IP6_HEADER, so when using the length of IP6_ICMP_ERROR_HEAD
// for pointer movement that fact should be considered.
//
CopyMem (
);
//
// Set the checksum as zero, and IP6 driver will calcuate it with pseudo header.
//
//
// Fill the override data.
//
//
// Send out this icmp packet.
//
NetbufFree (Packet);
EXIT:
if (Ip6ModeData != NULL) {
}
}
/**
This function handles the received Icmp Error message and de-multiplexes it to the
instance.
@param[in] Udp6Service Pointer to the udp service context data.
@param[in] IcmpError The icmp error code.
@param[in] NetSession Pointer to the EFI_NET_SESSION_DATA abstracted
from the received Icmp Error packet.
@param[in, out] Packet Pointer to the Icmp Error packet.
**/
)
{
//
// Iterate all the instances.
//
if (!Instance->Configured) {
continue;
}
//
// Translate the Icmp Error code according to the udp spec.
//
if (IcmpError > ICMP_ERR_UNREACH_PORT) {
}
//
// Notify the instance with the received Icmp Error.
//
break;
}
}
NetbufFree (Packet);
}
/**
This function reports the received ICMP error.
@param[in] Instance Pointer to the udp instance context data.
**/
)
{
//
// There are no receive tokens to deliver the ICMP error.
//
return;
}
//
// Try to get a RxToken from the RxTokens map.
//
//
// Report the error through the Token.
//
//
// Clear the IcmpError.
//
}
}
}
/**
This function is a dummy ext-free function for the NET_BUF created for the output
udp datagram.
@param[in] Context Pointer to the context data.
**/
)
{
}
/**
Set the Udp6 variable data.
@param[in] Udp6Service Udp6 service data.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to set the
variable.
@retval other Set variable failed.
**/
)
{
//
// Go through the children list to count the configured children.
//
Link,
);
if (Udp6Instance->Configured) {
}
}
//
// Calculate the size of the Udp6VariableData. As there may be no Udp6 child,
// we should add extra buffer for the service points only if the number of configured
// children is more than 1.
//
VariableDataSize = sizeof (EFI_UDP6_VARIABLE_DATA);
if (NumConfiguredInstance > 1) {
}
if (Udp6VariableData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
// Go through the children list to fill the configured children's address pairs.
//
Link,
);
if (Udp6Instance->Configured) {
);
);
}
}
//
// Get the MAC string.
//
);
goto EXIT;
}
//
// The variable is set already, we're going to update it.
//
//
// The MAC address is changed, delete the previous variable first.
//
gRT->SetVariable (
0,
);
}
}
(VOID *) Udp6VariableData
);
EXIT:
return Status;
}
/**
Clear the variable and free the resource.
@param[in, out] Udp6Service Udp6 service data.
**/
)
{
gRT->SetVariable (
0,
);
}
/**
Find the key in the netmap.
@param[in] Map The netmap to search within.
@param[in] Key The key to search.
@return The point to the item contains the Key, or NULL, if Key isn't in the map.
**/
)
{
return Item;
}
}
return NULL;
}