NetworkPkg/Ip6Dxe/Ip6Mld.c File Reference


Functions

IP6_MLD_GROUPIp6CreateMldEntry (IN OUT IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *MulticastAddr, IN UINT32 DelayTimer)
IP6_MLD_GROUPIp6FindMldEntry (IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *MulticastAddr)
INTN Ip6FindMac (IN IP6_MLD_SERVICE_DATA *MldCtrl, IN EFI_MAC_ADDRESS *Mac)
EFI_STATUS Ip6SendMldReport (IN IP6_SERVICE *IpSb, IN IP6_INTERFACE *Interface, IN EFI_IPv6_ADDRESS *MulticastAddr)
EFI_STATUS Ip6SendMldDone (IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *MulticastAddr)
EFI_STATUS Ip6InitMld (IN IP6_SERVICE *IpSb)
EFI_STATUS Ip6CombineGroups (IN OUT IP6_PROTOCOL *IpInstance, IN EFI_IPv6_ADDRESS *Group)
EFI_STATUS Ip6RemoveGroup (IN OUT IP6_PROTOCOL *IpInstance, IN EFI_IPv6_ADDRESS *Group)
EFI_STATUS Ip6JoinGroup (IN IP6_SERVICE *IpSb, IN IP6_INTERFACE *Interface, IN EFI_IPv6_ADDRESS *Address)
EFI_STATUS Ip6LeaveGroup (IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Address)
EFI_STATUS Ip6Groups (IN IP6_PROTOCOL *IpInstance, IN BOOLEAN JoinFlag, IN EFI_IPv6_ADDRESS *GroupAddress)
EFI_STATUS Ip6UpdateDelayTimer (IN IP6_SERVICE *IpSb, IN UINT16 MaxRespDelay, IN EFI_IPv6_ADDRESS *MulticastAddr, IN OUT IP6_MLD_GROUP *Group)
EFI_STATUS Ip6ProcessMldQuery (IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
EFI_STATUS Ip6ProcessMldReport (IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
VOID Ip6MldTimerTicking (IN IP6_SERVICE *IpSb)

Detailed Description

Multicast Listener Discovery support routines.

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

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 http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

EFI_STATUS Ip6CombineGroups ( IN OUT IP6_PROTOCOL IpInstance,
IN EFI_IPv6_ADDRESS *  Group 
)

Add a group address to the array of group addresses. The caller should make sure that no duplicated address existed in the array.

Parameters:
[in,out] IpInstance Points to an IP6_PROTOCOL instance.
[in] Group The IP6 multicast address to add.
Return values:
EFI_OUT_OF_RESOURCES There are not sufficient resources to complete the operation.
EFI_SUCESS The address is added to the group address array.

References IP6_PROTOCOL_SIGNATURE.

Referenced by Ip6Groups().

IP6_MLD_GROUP* Ip6CreateMldEntry ( IN OUT IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS *  MulticastAddr,
IN UINT32  DelayTimer 
)

Create a IP6_MLD_GROUP list entry node and record to IP6 service binding data.

Parameters:
[in,out] IpSb Points to IP6 service binding instance.
[in] MulticastAddr The IPv6 multicast address to be recorded.
[in] DelayTimer The maximum allowed delay before sending a responding report, in units of milliseconds.
Returns:
The created IP6_ML_GROUP list entry or NULL.

References IP6_MLD_GROUP::Address, IP6_MLD_GROUP::DelayTimer, IP6_SERVICE_SIGNATURE, IP6_MLD_GROUP::Link, IP6_MLD_GROUP::RefCnt, and IP6_MLD_GROUP::SendByUs.

Referenced by Ip6InitMld(), and Ip6JoinGroup().

INTN Ip6FindMac ( IN IP6_MLD_SERVICE_DATA MldCtrl,
IN EFI_MAC_ADDRESS *  Mac 
)

Count the number of IP6 multicast groups that are mapped to the same MAC address. Several IP6 multicast address may be mapped to the same MAC address.

Parameters:
[in] MldCtrl The MLD control block to search in.
[in] Mac The MAC address to search.
Returns:
The number of the IP6 multicast group that mapped to the same multicast group Mac.

References IP6_MLD_GROUP::Mac.

Referenced by Ip6LeaveGroup().

IP6_MLD_GROUP* Ip6FindMldEntry ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS *  MulticastAddr 
)

Search a IP6_MLD_GROUP list entry node from a list array.

Parameters:
[in] IpSb Points to IP6 service binding instance.
[in] MulticastAddr The IPv6 multicast address to be searched.
Returns:
The found IP6_ML_GROUP list entry or NULL.

References IP6_MLD_GROUP::Address, and IP6_SERVICE_SIGNATURE.

Referenced by Ip6JoinGroup(), Ip6LeaveGroup(), Ip6PreProcessPacket(), Ip6ProcessMldQuery(), and Ip6ProcessMldReport().

EFI_STATUS Ip6Groups ( IN IP6_PROTOCOL IpInstance,
IN BOOLEAN  JoinFlag,
IN EFI_IPv6_ADDRESS *  GroupAddress 
)

Worker function for EfiIp6Groups(). The caller should make sure that the parameters are valid.

Parameters:
[in] IpInstance The IP6 child to change the setting.
[in] JoinFlag TRUE to join the group, otherwise leave it.
[in] GroupAddress The target group address. If NULL, leave all the group addresses.
Return values:
EFI_ALREADY_STARTED Wants to join the group, but is already a member of it
EFI_OUT_OF_RESOURCES Failed to allocate sufficient resources.
EFI_DEVICE_ERROR Failed to set the group configuraton.
EFI_SUCCESS Successfully updated the group setting.
EFI_NOT_FOUND Try to leave the group which it isn't a member.

References Ip6CombineGroups(), Ip6JoinGroup(), Ip6LeaveGroup(), and Ip6RemoveGroup().

Referenced by EfiIp6Groups(), and Ip6CleanProtocol().

EFI_STATUS Ip6InitMld ( IN IP6_SERVICE IpSb  ) 

Init the MLD data of the IP6 service instance. Configure MNP to receive ALL SYSTEM multicast.

Parameters:
[in] IpSb The IP6 service whose MLD is to be initialized.
Return values:
EFI_OUT_OF_RESOURCES There are not sufficient resourcet to complete the operation.
EFI_SUCCESS The MLD module successfully initialized.

References IP6_INFINIT_LIFETIME, IP6_LINK_LOCAL_SCOPE, Ip6CreateMldEntry(), Ip6GetMulticastMac(), Ip6SetToAllNodeMulticast(), IP6_MLD_GROUP::Link, and IP6_MLD_GROUP::Mac.

Referenced by Ip6CreateService().

EFI_STATUS Ip6JoinGroup ( IN IP6_SERVICE IpSb,
IN IP6_INTERFACE Interface,
IN EFI_IPv6_ADDRESS *  Address 
)

Join the multicast group on behalf of this IP6 service binding instance.

Parameters:
[in] IpSb The IP6 service binding instance.
[in] Interface Points to an IP6_INTERFACE structure.
[in] Address The group address to join.
Return values:
EFI_SUCCESS Successfully join the multicast group.
EFI_OUT_OF_RESOURCES Failed to allocate resources.
Others Failed to join the multicast group.

References IP6_UNSOLICITED_REPORT_INTERVAL, Ip6CreateMldEntry(), Ip6FindMldEntry(), Ip6GetMulticastMac(), Ip6SendMldReport(), IP6_MLD_GROUP::Link, IP6_MLD_GROUP::Mac, IP6_MLD_GROUP::RefCnt, and IP6_MLD_GROUP::SendByUs.

Referenced by Ip6Groups(), and Ip6InitDADProcess().

EFI_STATUS Ip6LeaveGroup ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS *  Address 
)

Leave the IP6 multicast group.

Parameters:
[in] IpSb The IP6 service binding instance.
[in] Address The group address to leave.
Return values:
EFI_NOT_FOUND The IP6 service instance isn't in the group.
EFI_SUCCESS Successfully leave the multicast group..
Others Failed to leave the multicast group.

References Ip6FindMac(), Ip6FindMldEntry(), Ip6SendMldDone(), IP6_MLD_GROUP::Link, IP6_MLD_GROUP::Mac, IP6_MLD_GROUP::RefCnt, and IP6_MLD_GROUP::SendByUs.

Referenced by Ip6CleanService(), Ip6Groups(), Ip6OnDADFinished(), and Ip6RemoveAddr().

VOID Ip6MldTimerTicking ( IN IP6_SERVICE IpSb  ) 

The heartbeat timer of MLD module. It sends out a solicited MLD report when DelayTimer expires.

Parameters:
[in] IpSb The IP6 service binding instance.

References IP6_MLD_GROUP::Address, IP6_MLD_GROUP::DelayTimer, and Ip6SendMldReport().

Referenced by Ip6TimerTicking().

EFI_STATUS Ip6ProcessMldQuery ( IN IP6_SERVICE IpSb,
IN EFI_IP6_HEADER *  Head,
IN NET_BUF *  Packet 
)

Process the Multicast Listener Query message.

Parameters:
[in] IpSb The IP service that received the packet.
[in] Head The IP head of the MLD query packet.
[in] Packet The content of the MLD query packet with IP head removed.
Return values:
EFI_SUCCESS The MLD query packet processed successfully.
EFI_INVALID_PARAMETER The packet is invalid.
Others Failed to process the packet.

References IP6_MLD_GROUP::Address, IP6_LINK_LOCAL_SCOPE, Ip6FindMldEntry(), Ip6SetToAllNodeMulticast(), and Ip6UpdateDelayTimer().

Referenced by Ip6ProcessIcmpInformation().

EFI_STATUS Ip6ProcessMldReport ( IN IP6_SERVICE IpSb,
IN EFI_IP6_HEADER *  Head,
IN NET_BUF *  Packet 
)

Process the Multicast Listener Report message.

Parameters:
[in] IpSb The IP service that received the packet.
[in] Head The IP head of the MLD report packet.
[in] Packet The content of the MLD report packet with IP head removed.
Return values:
EFI_SUCCESS The MLD report packet processed successfully.
EFI_INVALID_PARAMETER The packet is invalid.

References IP6_MLD_GROUP::DelayTimer, Ip6FindMldEntry(), and IP6_MLD_GROUP::SendByUs.

Referenced by Ip6ProcessIcmpInformation().

EFI_STATUS Ip6RemoveGroup ( IN OUT IP6_PROTOCOL IpInstance,
IN EFI_IPv6_ADDRESS *  Group 
)

Remove a group address from the array of group addresses. Although the function doesn't assume the byte order of Group, the network byte order is used by the caller.

Parameters:
[in,out] IpInstance Points to an IP6_PROTOCOL instance.
[in] Group The IP6 multicast address to remove.
Return values:
EFI_NOT_FOUND Cannot find the to be removed group address.
EFI_SUCCESS The group address was successfully removed.

Referenced by Ip6Groups().

EFI_STATUS Ip6SendMldDone ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS *  MulticastAddr 
)

Generate MLD Done message and send it out to MulticastAddr.

Parameters:
[in] IpSb The IP service to send the packet.
[in] MulticastAddr The specific IPv6 multicast address to which the message sender is ceasing to listen.
Return values:
EFI_OUT_OF_RESOURCES There are not sufficient resources to complete the operation.
EFI_SUCCESS The MLD report message was successfully sent out.

References IP6_MLD_HEAD::Group, IP6_MLD_HEAD::Head, IP6_LINK_LOCAL_SCOPE, IP6_SERVICE_SIGNATURE, Ip6FillHopByHop(), Ip6Output(), Ip6SetToAllNodeMulticast(), and Ip6SysPacketSent().

Referenced by Ip6LeaveGroup().

EFI_STATUS Ip6SendMldReport ( IN IP6_SERVICE IpSb,
IN IP6_INTERFACE Interface,
IN EFI_IPv6_ADDRESS *  MulticastAddr 
)

Generate MLD report message and send it out to MulticastAddr.

Parameters:
[in] IpSb The IP service to send the packet.
[in] Interface The IP interface to send the packet. If NULL, a system interface will be selected.
[in] MulticastAddr The specific IPv6 multicast address to which the message sender is listening.
Return values:
EFI_OUT_OF_RESOURCES There are not sufficient resources to complete the operation.
EFI_SUCCESS The MLD report message was successfully sent out.

References IP6_MLD_HEAD::Group, IP6_MLD_HEAD::Head, IP6_SERVICE_SIGNATURE, Ip6FillHopByHop(), Ip6Output(), and Ip6SysPacketSent().

Referenced by Ip6JoinGroup(), Ip6MldTimerTicking(), and Ip6UpdateDelayTimer().

EFI_STATUS Ip6UpdateDelayTimer ( IN IP6_SERVICE IpSb,
IN UINT16  MaxRespDelay,
IN EFI_IPv6_ADDRESS *  MulticastAddr,
IN OUT IP6_MLD_GROUP Group 
)

Set a random value of the delay timer for the multicast address from the range [0, Maximum Response Delay]. If a timer for any address is already running, it is reset to the new random value only if the requested Maximum Response Delay is less than the remaining value of the running timer. If the Query packet specifies a Maximum Response Delay of zero, each timer is effectively set to zero, and the action specified below for timer expiration is performed immediately.

Parameters:
[in] IpSb The IP6 service binding instance.
[in] MaxRespDelay The Maximum Response Delay, in milliseconds.
[in] MulticastAddr The multicast address.
[in,out] Group Points to a IP6_MLD_GROUP list entry node.
Return values:
EFI_SUCCESS The delay timer is successfully updated or timer expiration is performed immediately.
Others Failed to send out MLD report message.

References Ip6SendMldReport().

Referenced by Ip6ProcessMldQuery().


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1