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

Go to the source code of this file.

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 OPTIONAL, 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 OPTIONAL)
 
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.

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

Definition in file Ip6Mld.c.

Function Documentation

◆ Ip6CombineGroups()

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]IpInstancePoints to an IP6_PROTOCOL instance.
[in]GroupThe IP6 multicast address to add.
Return values
EFI_OUT_OF_RESOURCESThere are not sufficient resources to complete the operation.
EFI_SUCCESSThe address is added to the group address array.

Definition at line 390 of file Ip6Mld.c.

◆ Ip6CreateMldEntry()

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]IpSbPoints to IP6 service binding instance.
[in]MulticastAddrThe IPv6 multicast address to be recorded.
[in]DelayTimerThe maximum allowed delay before sending a responding report, in units of milliseconds.
Returns
The created IP6_ML_GROUP list entry or NULL.

Definition at line 23 of file Ip6Mld.c.

◆ Ip6FindMac()

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]MldCtrlThe MLD control block to search in.
[in]MacThe MAC address to search.
Returns
The number of the IP6 multicast group that mapped to the same multicast group Mac.

Definition at line 90 of file Ip6Mld.c.

◆ Ip6FindMldEntry()

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]IpSbPoints to IP6 service binding instance.
[in]MulticastAddrThe IPv6 multicast address to be searched.
Returns
The found IP6_ML_GROUP list entry or NULL.

Definition at line 56 of file Ip6Mld.c.

◆ Ip6Groups()

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

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

Parameters
[in]IpInstanceThe IP6 child to change the setting.
[in]JoinFlagTRUE to join the group, otherwise leave it.
[in]GroupAddressThe target group address. If NULL, leave all the group addresses.
Return values
EFI_ALREADY_STARTEDWants to join the group, but is already a member of it
EFI_OUT_OF_RESOURCESFailed to allocate sufficient resources.
EFI_DEVICE_ERRORFailed to set the group configuration.
EFI_SUCCESSSuccessfully updated the group setting.
EFI_NOT_FOUNDTry to leave the group which it isn't a member.

Definition at line 613 of file Ip6Mld.c.

◆ Ip6InitMld()

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]IpSbThe IP6 service whose MLD is to be initialized.
Return values
EFI_OUT_OF_RESOURCESThere are not sufficient resourcet to complete the operation.
EFI_SUCCESSThe MLD module successfully initialized.

Definition at line 334 of file Ip6Mld.c.

◆ Ip6JoinGroup()

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]IpSbThe IP6 service binding instance.
[in]InterfacePoints to an IP6_INTERFACE structure.
[in]AddressThe group address to join.
Return values
EFI_SUCCESSSuccessfully join the multicast group.
EFI_OUT_OF_RESOURCESFailed to allocate resources.
OthersFailed to join the multicast group.

Definition at line 483 of file Ip6Mld.c.

◆ Ip6LeaveGroup()

EFI_STATUS Ip6LeaveGroup ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS Address 
)

Leave the IP6 multicast group.

Parameters
[in]IpSbThe IP6 service binding instance.
[in]AddressThe group address to leave.
Return values
EFI_NOT_FOUNDThe IP6 service instance isn't in the group.
EFI_SUCCESSSuccessfully leave the multicast group..
OthersFailed to leave the multicast group.

Definition at line 547 of file Ip6Mld.c.

◆ Ip6MldTimerTicking()

VOID Ip6MldTimerTicking ( IN IP6_SERVICE IpSb)

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

Parameters
[in]IpSbThe IP6 service binding instance.

Definition at line 894 of file Ip6Mld.c.

◆ Ip6ProcessMldQuery()

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

Process the Multicast Listener Query message.

Parameters
[in]IpSbThe IP service that received the packet.
[in]HeadThe IP head of the MLD query packet.
[in]PacketThe content of the MLD query packet with IP head removed.
Return values
EFI_SUCCESSThe MLD query packet processed successfully.
EFI_INVALID_PARAMETERThe packet is invalid.
OthersFailed to process the packet.

Definition at line 746 of file Ip6Mld.c.

◆ Ip6ProcessMldReport()

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

Process the Multicast Listener Report message.

Parameters
[in]IpSbThe IP service that received the packet.
[in]HeadThe IP head of the MLD report packet.
[in]PacketThe content of the MLD report packet with IP head removed.
Return values
EFI_SUCCESSThe MLD report packet processed successfully.
EFI_INVALID_PARAMETERThe packet is invalid.

Definition at line 835 of file Ip6Mld.c.

◆ Ip6RemoveGroup()

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]IpInstancePoints to an IP6_PROTOCOL instance.
[in]GroupThe IP6 multicast address to remove.
Return values
EFI_NOT_FOUNDCannot find the to be removed group address.
EFI_SUCCESSThe group address was successfully removed.

Definition at line 439 of file Ip6Mld.c.

◆ Ip6SendMldDone()

EFI_STATUS Ip6SendMldDone ( IN IP6_SERVICE IpSb,
IN EFI_IPv6_ADDRESS MulticastAddr 
)

Generate MLD Done message and send it out to MulticastAddr.

Parameters
[in]IpSbThe IP service to send the packet.
[in]MulticastAddrThe specific IPv6 multicast address to which the message sender is ceasing to listen.
Return values
EFI_OUT_OF_RESOURCESThere are not sufficient resources to complete the operation.
EFI_SUCCESSThe MLD report message was successfully sent out.

Definition at line 231 of file Ip6Mld.c.

◆ Ip6SendMldReport()

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

Generate MLD report message and send it out to MulticastAddr.

Parameters
[in]IpSbThe IP service to send the packet.
[in]InterfaceThe IP interface to send the packet. If NULL, a system interface will be selected.
[in]MulticastAddrThe specific IPv6 multicast address to which the message sender is listening.
Return values
EFI_OUT_OF_RESOURCESThere are not sufficient resources to complete the operation.
EFI_SUCCESSThe MLD report message was successfully sent out.

Definition at line 127 of file Ip6Mld.c.

◆ 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]IpSbThe IP6 service binding instance.
[in]MaxRespDelayThe Maximum Response Delay, in milliseconds.
[in]MulticastAddrThe multicast address.
[in,out]GroupPoints to a IP6_MLD_GROUP list entry node.
Return values
EFI_SUCCESSThe delay timer is successfully updated or timer expiration is performed immediately.
OthersFailed to send out MLD report message.

Definition at line 692 of file Ip6Mld.c.