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

Go to the source code of this file.

Functions

EFI_STATUS Ip4InitIgmp (IN OUT IP4_SERVICE *IpSb)
 
IGMP_GROUPIp4FindGroup (IN IGMP_SERVICE_DATA *IgmpCtrl, IN IP4_ADDR Address)
 
INTN Ip4FindMac (IN IGMP_SERVICE_DATA *IgmpCtrl, IN EFI_MAC_ADDRESS *Mac)
 
EFI_STATUS Ip4SendIgmpMessage (IN IP4_SERVICE *IpSb, IN IP4_ADDR Dst, IN UINT8 Type, IN IP4_ADDR Group)
 
EFI_STATUS Ip4SendIgmpReport (IN IP4_SERVICE *IpSb, IN IP4_ADDR Group)
 
EFI_STATUS Ip4JoinGroup (IN IP4_PROTOCOL *IpInstance, IN IP4_ADDR Address)
 
EFI_STATUS Ip4LeaveGroup (IN IP4_PROTOCOL *IpInstance, IN IP4_ADDR Address)
 
EFI_STATUS Ip4IgmpHandle (IN IP4_SERVICE *IpSb, IN IP4_HEAD *Head, IN NET_BUF *Packet)
 
VOID Ip4IgmpTicking (IN IP4_SERVICE *IpSb)
 
IP4_ADDR * Ip4CombineGroups (IN IP4_ADDR *Source, IN UINT32 Count, IN IP4_ADDR Addr)
 
INTN Ip4RemoveGroupAddr (IN OUT IP4_ADDR *Groups, IN UINT32 Count, IN IP4_ADDR Addr)
 

Variables

UINT32 mRouteAlertOption = 0x00000494
 

Detailed Description

This file implements the RFC2236: IGMP v2.

Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ip4Igmp.c.

Function Documentation

◆ Ip4CombineGroups()

IP4_ADDR * Ip4CombineGroups ( IN IP4_ADDR *  Source,
IN UINT32  Count,
IN IP4_ADDR  Addr 
)

Add a group address to the array of group addresses. The caller should make sure that no duplicated address existed in the array. Although the function doesn't assume the byte order of the both Source and Addr, the network byte order is used by the caller.

Parameters
[in]SourceThe array of group addresses to add to.
[in]CountThe number of group addresses in the Source.
[in]AddrThe IP4 multicast address to add.
Returns
NULL if failed to allocate memory for the new groups, otherwise the new combined group addresses.

Definition at line 549 of file Ip4Igmp.c.

◆ Ip4FindGroup()

IGMP_GROUP * Ip4FindGroup ( IN IGMP_SERVICE_DATA IgmpCtrl,
IN IP4_ADDR  Address 
)

Find the IGMP_GROUP structure which contains the status of multicast group Address in this IGMP control block

Parameters
[in]IgmpCtrlThe IGMP control block to search from.
[in]AddressThe multicast address to search.
Returns
NULL if the multicast address isn't in the IGMP control block. Otherwise the point to the IGMP_GROUP which contains the status of multicast group for Address.

Definition at line 89 of file Ip4Igmp.c.

◆ Ip4FindMac()

INTN Ip4FindMac ( IN IGMP_SERVICE_DATA IgmpCtrl,
IN EFI_MAC_ADDRESS Mac 
)

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

Parameters
[in]IgmpCtrlThe IGMP control block to search in.
[in]MacThe MAC address to search.
Returns
The number of the IP4 multicast group that mapped to the same multicast group Mac.

Definition at line 121 of file Ip4Igmp.c.

◆ Ip4IgmpHandle()

EFI_STATUS Ip4IgmpHandle ( IN IP4_SERVICE IpSb,
IN IP4_HEAD Head,
IN NET_BUF Packet 
)

Handle the received IGMP message for the IP4 service instance.

Parameters
[in]IpSbThe IP4 service instance that received the message.
[in]HeadThe IP4 header of the received message.
[in]PacketThe IGMP message, without IP4 header.
Return values
EFI_INVALID_PARAMETERThe IGMP message is malformatted.
EFI_SUCCESSThe IGMP message is successfully processed.

Definition at line 401 of file Ip4Igmp.c.

◆ Ip4IgmpTicking()

VOID Ip4IgmpTicking ( IN IP4_SERVICE IpSb)

The periodical timer function for IGMP. It does the following things:

  1. Decrease the Igmpv1QuerySeen to make it possible to refresh the IGMP server type.
  2. Decrease the report timer for each IGMP group in "delaying member" state.
Parameters
[in]IpSbThe IP4 service instance that is ticking.

Definition at line 501 of file Ip4Igmp.c.

◆ Ip4InitIgmp()

EFI_STATUS Ip4InitIgmp ( IN OUT IP4_SERVICE IpSb)

Init the IGMP control data of the IP4 service instance, configure MNP to receive ALL SYSTEM multicast.

Parameters
[in,out]IpSbThe IP4 service whose IGMP is to be initialized.
Return values
EFI_SUCCESSIGMP of the IpSb is successfully initialized.
EFI_OUT_OF_RESOURCESFailed to allocate resource to initialize IGMP.
OthersFailed to initialize the IGMP of IpSb.

Definition at line 29 of file Ip4Igmp.c.

◆ Ip4JoinGroup()

EFI_STATUS Ip4JoinGroup ( IN IP4_PROTOCOL IpInstance,
IN IP4_ADDR  Address 
)

Join the multicast group on behalf of this IP4 child

Parameters
[in]IpInstanceThe IP4 child that wants to join the group.
[in]AddressThe group 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 253 of file Ip4Igmp.c.

◆ Ip4LeaveGroup()

EFI_STATUS Ip4LeaveGroup ( IN IP4_PROTOCOL IpInstance,
IN IP4_ADDR  Address 
)

Leave the IP4 multicast group on behalf of IpInstance.

Parameters
[in]IpInstanceThe IP4 child that wants to leave the group address.
[in]AddressThe group address to leave.
Return values
EFI_NOT_FOUNDThe IP4 service instance isn't in the group.
EFI_SUCCESSSuccessfully leave the multicast group.
OthersFailed to leave the multicast group.

Definition at line 333 of file Ip4Igmp.c.

◆ Ip4RemoveGroupAddr()

INTN Ip4RemoveGroupAddr ( IN OUT IP4_ADDR *  Groups,
IN UINT32  Count,
IN IP4_ADDR  Addr 
)

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

Parameters
GroupsThe array of group addresses to remove from.
CountThe number of group addresses in the Groups.
AddrThe IP4 multicast address to remove.
Returns
The number of group addresses in the Groups after remove. It is Count if the Addr isn't in the Groups.

Definition at line 584 of file Ip4Igmp.c.

◆ Ip4SendIgmpMessage()

EFI_STATUS Ip4SendIgmpMessage ( IN IP4_SERVICE IpSb,
IN IP4_ADDR  Dst,
IN UINT8  Type,
IN IP4_ADDR  Group 
)

Send an IGMP protocol message to the Dst, such as IGMP v1 membership report.

Parameters
[in]IpSbThe IP4 service instance that requests the transmission.
[in]DstThe destination to send to.
[in]TypeThe IGMP message type, such as IGMP v1 membership report.
[in]GroupThe group address in the IGMP message head.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate memory to build the message.
EFI_SUCCESSThe IGMP message is successfully send.
OthersFailed to send the IGMP message.

Definition at line 159 of file Ip4Igmp.c.

◆ Ip4SendIgmpReport()

EFI_STATUS Ip4SendIgmpReport ( IN IP4_SERVICE IpSb,
IN IP4_ADDR  Group 
)

Send an IGMP membership report. Depends on whether the server is v1 or v2, it will send either a V1 or V2 membership report.

Parameters
[in]IpSbThe IP4 service instance that requests the transmission.
[in]GroupThe group address to report.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate memory to build the message.
EFI_SUCCESSThe IGMP report message is successfully send.
OthersFailed to send the report.

Definition at line 229 of file Ip4Igmp.c.

Variable Documentation

◆ mRouteAlertOption

UINT32 mRouteAlertOption = 0x00000494

Definition at line 15 of file Ip4Igmp.c.