igmp_snooping_misc.c File Reference

Helper functions for IGMP snooping switch. More...

#include "core/net.h"
#include "ipv4/ipv4.h"
#include "ipv4/ipv4_misc.h"
#include "igmp/igmp_snooping.h"
#include "igmp/igmp_snooping_misc.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   IGMP_TRACE_LEVEL
 

Functions

void igmpSnoopingProcessMessage (IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
 Process incoming IGMP message. More...
 
void igmpSnoopingProcessMembershipQuery (IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
 Process incoming Membership Query message. More...
 
void igmpSnoopingProcessMembershipReport (IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
 Process incoming Membership Report message. More...
 
void igmpSnoopingProcessMembershipReportV3 (IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMembershipReportV3 *message, size_t length, const NetRxAncillary *ancillary)
 Process incoming Version 3 Membership Report message. More...
 
void igmpSnoopingProcessLeaveGroup (IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
 Process incoming Leave Group message. More...
 
void igmpSnoopingProcessUnknownMessage (IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
 Process unrecognized IGMP messages. More...
 
error_t igmpSnoopingForwardMessage (IgmpSnoopingContext *context, uint32_t forwardPorts, const MacAddr *destMacAddr, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length)
 Forward an IGMP message to the desired ports. More...
 
IgmpSnoopingGroupigmpSnoopingCreateGroup (IgmpSnoopingContext *context, Ipv4Addr groupAddr, uint8_t port)
 Create a new multicast group. More...
 
IgmpSnoopingGroupigmpSnoopingFindGroup (IgmpSnoopingContext *context, Ipv4Addr groupAddr, uint8_t port)
 Search the list of multicast groups for a given group address. More...
 
void igmpSnoopingDeleteGroup (IgmpSnoopingContext *context, IgmpSnoopingGroup *group)
 Delete a multicast group. More...
 
void igmpSnoopingEnableMonitoring (IgmpSnoopingContext *context, bool_t enable)
 Enable IGMP monitoring. More...
 
void igmpSnoopingUpdateStaticFdbEntry (IgmpSnoopingContext *context, Ipv4Addr groupAddr)
 Update a entry of the static MAC table. More...
 
void igmpSnoopingSetUnknownMcastFwdPorts (IgmpSnoopingContext *context, bool_t enable, uint32_t forwardPorts)
 Set forward ports for unknown multicast packets. More...
 
uint32_t igmpSnoopingGetRouterPorts (IgmpSnoopingContext *context)
 

Detailed Description

Helper functions for IGMP snooping switch.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file igmp_snooping_misc.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   IGMP_TRACE_LEVEL

Definition at line 32 of file igmp_snooping_misc.c.

Function Documentation

◆ igmpSnoopingCreateGroup()

IgmpSnoopingGroup* igmpSnoopingCreateGroup ( IgmpSnoopingContext context,
Ipv4Addr  groupAddr,
uint8_t  port 
)

Create a new multicast group.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]groupAddrMulticast group address
[in]portPort number associated with the multicast group
Returns
Pointer to the newly created multicast group

Definition at line 614 of file igmp_snooping_misc.c.

◆ igmpSnoopingDeleteGroup()

void igmpSnoopingDeleteGroup ( IgmpSnoopingContext context,
IgmpSnoopingGroup group 
)

Delete a multicast group.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]groupMulticast group

Definition at line 695 of file igmp_snooping_misc.c.

◆ igmpSnoopingEnableMonitoring()

void igmpSnoopingEnableMonitoring ( IgmpSnoopingContext context,
bool_t  enable 
)

Enable IGMP monitoring.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]enableEnable or disable MLD monitoring

Definition at line 712 of file igmp_snooping_misc.c.

◆ igmpSnoopingFindGroup()

IgmpSnoopingGroup* igmpSnoopingFindGroup ( IgmpSnoopingContext context,
Ipv4Addr  groupAddr,
uint8_t  port 
)

Search the list of multicast groups for a given group address.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]groupAddrMulticast group address
[in]portPort number
Returns
Pointer to the matching multicast group, if any

Definition at line 660 of file igmp_snooping_misc.c.

◆ igmpSnoopingForwardMessage()

error_t igmpSnoopingForwardMessage ( IgmpSnoopingContext context,
uint32_t  forwardPorts,
const MacAddr destMacAddr,
const Ipv4PseudoHeader pseudoHeader,
const IgmpMessage message,
size_t  length 
)

Forward an IGMP message to the desired ports.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]forwardPortsPort map
[in]destMacAddrDestination MAC address
[in]pseudoHeaderIPv4 pseudo header
[in]messagePointer to the IGMP message
[in]lengthLength of the IGMP message, in bytes

Definition at line 543 of file igmp_snooping_misc.c.

◆ igmpSnoopingGetRouterPorts()

uint32_t igmpSnoopingGetRouterPorts ( IgmpSnoopingContext context)

Definition at line 854 of file igmp_snooping_misc.c.

◆ igmpSnoopingProcessLeaveGroup()

void igmpSnoopingProcessLeaveGroup ( IgmpSnoopingContext context,
const Ipv4PseudoHeader pseudoHeader,
const IgmpMessage message,
size_t  length,
const NetRxAncillary ancillary 
)

Process incoming Leave Group message.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]pseudoHeaderIPv4 pseudo header
[in]messagePointer to the incoming IGMP message
[in]lengthLength of the IGMP message, in bytes
[in]ancillaryAdditional options passed to the stack along with the packet

Definition at line 459 of file igmp_snooping_misc.c.

◆ igmpSnoopingProcessMembershipQuery()

void igmpSnoopingProcessMembershipQuery ( IgmpSnoopingContext context,
const Ipv4PseudoHeader pseudoHeader,
const IgmpMessage message,
size_t  length,
const NetRxAncillary ancillary 
)

Process incoming Membership Query message.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]pseudoHeaderIPv4 pseudo header
[in]messagePointer to the incoming IGMP message
[in]lengthLength of the IGMP message, in bytes
[in]ancillaryAdditional options passed to the stack along with the packet

Definition at line 118 of file igmp_snooping_misc.c.

◆ igmpSnoopingProcessMembershipReport()

void igmpSnoopingProcessMembershipReport ( IgmpSnoopingContext context,
const Ipv4PseudoHeader pseudoHeader,
const IgmpMessage message,
size_t  length,
const NetRxAncillary ancillary 
)

Process incoming Membership Report message.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]pseudoHeaderIPv4 pseudo header
[in]messagePointer to the incoming IGMP message
[in]lengthLength of the IGMP message, in bytes
[in]ancillaryAdditional options passed to the stack along with the packet

Definition at line 264 of file igmp_snooping_misc.c.

◆ igmpSnoopingProcessMembershipReportV3()

void igmpSnoopingProcessMembershipReportV3 ( IgmpSnoopingContext context,
const Ipv4PseudoHeader pseudoHeader,
const IgmpMembershipReportV3 message,
size_t  length,
const NetRxAncillary ancillary 
)

Process incoming Version 3 Membership Report message.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]pseudoHeaderIPv4 pseudo header
[in]messagePointer to the incoming IGMP message
[in]lengthLength of the IGMP message, in bytes
[in]ancillaryAdditional options passed to the stack along with the packet

Definition at line 331 of file igmp_snooping_misc.c.

◆ igmpSnoopingProcessMessage()

void igmpSnoopingProcessMessage ( IgmpSnoopingContext context,
const Ipv4PseudoHeader pseudoHeader,
const IgmpMessage message,
size_t  length,
const NetRxAncillary ancillary 
)

Process incoming IGMP message.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]pseudoHeaderIPv4 pseudo header
[in]messagePointer to the incoming IGMP message
[in]lengthLength of the IGMP message, in bytes
[in]ancillaryAdditional options passed to the stack along with the packet

Definition at line 56 of file igmp_snooping_misc.c.

◆ igmpSnoopingProcessUnknownMessage()

void igmpSnoopingProcessUnknownMessage ( IgmpSnoopingContext context,
const Ipv4PseudoHeader pseudoHeader,
const IgmpMessage message,
size_t  length,
const NetRxAncillary ancillary 
)

Process unrecognized IGMP messages.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]pseudoHeaderIPv4 pseudo header
[in]messagePointer to the incoming IGMP message
[in]lengthLength of the IGMP message, in bytes
[in]ancillaryAdditional options passed to the stack along with the packet

Definition at line 513 of file igmp_snooping_misc.c.

◆ igmpSnoopingSetUnknownMcastFwdPorts()

void igmpSnoopingSetUnknownMcastFwdPorts ( IgmpSnoopingContext context,
bool_t  enable,
uint32_t  forwardPorts 
)

Set forward ports for unknown multicast packets.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]enableEnable or disable forwarding of unknown multicast packets
[in]forwardPortsPort map

Definition at line 830 of file igmp_snooping_misc.c.

◆ igmpSnoopingUpdateStaticFdbEntry()

void igmpSnoopingUpdateStaticFdbEntry ( IgmpSnoopingContext context,
Ipv4Addr  groupAddr 
)

Update a entry of the static MAC table.

Parameters
[in]contextPointer to the IGMP snooping switch context
[in]groupAddrMulticast group address to be updated

Definition at line 735 of file igmp_snooping_misc.c.