ipv6_multicast.c File Reference

IPv6 multicast filtering. More...

#include "core/net.h"
#include "core/socket_misc.h"
#include "ipv6/ipv6.h"
#include "ipv6/ipv6_multicast.h"
#include "mld/mld_node.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   IPV6_TRACE_LEVEL
 

Functions

error_t ipv6MulticastFilter (NetInterface *interface, const Ipv6Addr *destAddr, const Ipv6Addr *srcAddr)
 Filter out incoming multicast traffic. More...
 
error_t ipv6JoinMulticastGroup (NetInterface *interface, const Ipv6Addr *groupAddr)
 Join an IPv6 multicast group. More...
 
error_t ipv6LeaveMulticastGroup (NetInterface *interface, const Ipv6Addr *groupAddr)
 Leave an IPv6 multicast group. More...
 
void ipv6UpdateMulticastFilter (NetInterface *interface, const Ipv6Addr *groupAddr)
 Update IPv6 multicast filter table. More...
 
void ipv6DeriveInterfaceState (Ipv6FilterEntry *entry, SocketMulticastGroup *group)
 Derive the per-interface state from the per-socket state. More...
 
error_t ipv6AcceptMulticastAddr (NetInterface *interface, const Ipv6Addr *groupAddr)
 Reconfigure the MAC layer to accept multicast traffic. More...
 
void ipv6DropMulticastAddr (NetInterface *interface, const Ipv6Addr *groupAddr)
 Reconfigure the MAC layer to reject multicast traffic. More...
 
error_t ipv6MapMulticastAddrToMac (const Ipv6Addr *ipAddr, MacAddr *macAddr)
 Map an IPv6 multicast address to a MAC-layer multicast address. More...
 
Ipv6FilterEntryipv6CreateMulticastFilterEntry (NetInterface *interface, const Ipv6Addr *multicastAddr)
 Create a new multicast filter entry. More...
 
Ipv6FilterEntryipv6FindMulticastFilterEntry (NetInterface *interface, const Ipv6Addr *multicastAddr)
 Search the multicast filter for a given address. More...
 
void ipv6DeleteMulticastFilterEntry (Ipv6FilterEntry *entry)
 Delete a multicast filter entry. More...
 
error_t ipv6AddSrcAddr (Ipv6SrcAddrList *list, const Ipv6Addr *srcAddr)
 Append a source address to a given list. More...
 
void ipv6RemoveSrcAddr (Ipv6SrcAddrList *list, const Ipv6Addr *srcAddr)
 Remove a source address from a given list. More...
 
int_t ipv6FindSrcAddr (const Ipv6SrcAddrList *list, const Ipv6Addr *srcAddr)
 Search the list of sources for a given IP address. More...
 
bool_t ipv6CompareSrcAddrLists (const Ipv6SrcAddrList *list1, const Ipv6SrcAddrList *list2)
 Compare lists of sources. More...
 

Detailed Description

IPv6 multicast filtering.

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 ipv6_multicast.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   IPV6_TRACE_LEVEL

Definition at line 32 of file ipv6_multicast.c.

Function Documentation

◆ ipv6AcceptMulticastAddr()

error_t ipv6AcceptMulticastAddr ( NetInterface interface,
const Ipv6Addr groupAddr 
)

Reconfigure the MAC layer to accept multicast traffic.

Parameters
[in]interfaceUnderlying network interface
[in]groupAddrIPv6 multicast address to accept
Returns
Error code

Definition at line 484 of file ipv6_multicast.c.

◆ ipv6AddSrcAddr()

error_t ipv6AddSrcAddr ( Ipv6SrcAddrList list,
const Ipv6Addr srcAddr 
)

Append a source address to a given list.

Parameters
[in]listPointer to the list of source addresses
[in]srcAddrSource IP address to be added

Definition at line 699 of file ipv6_multicast.c.

◆ ipv6CompareSrcAddrLists()

bool_t ipv6CompareSrcAddrLists ( const Ipv6SrcAddrList list1,
const Ipv6SrcAddrList list2 
)

Compare lists of sources.

Parameters
[in]list1Pointer to the first list of source addresses
[in]list2Pointer to the first list of source addresses
Returns
TRUE if the lists contain the same set of addresses, else FALSE

Definition at line 812 of file ipv6_multicast.c.

◆ ipv6CreateMulticastFilterEntry()

Ipv6FilterEntry* ipv6CreateMulticastFilterEntry ( NetInterface interface,
const Ipv6Addr multicastAddr 
)

Create a new multicast filter entry.

Parameters
[in]interfaceUnderlying network interface
[in]multicastAddrIPv6 multicast address
Returns
Pointer to the newly created multicast filter entry

Definition at line 610 of file ipv6_multicast.c.

◆ ipv6DeleteMulticastFilterEntry()

void ipv6DeleteMulticastFilterEntry ( Ipv6FilterEntry entry)

Delete a multicast filter entry.

Parameters
[in]entryPointer to the multicast filter entry

Definition at line 686 of file ipv6_multicast.c.

◆ ipv6DeriveInterfaceState()

void ipv6DeriveInterfaceState ( Ipv6FilterEntry entry,
SocketMulticastGroup group 
)

Derive the per-interface state from the per-socket state.

Parameters
[in]entryPointer to the per-interface state
[in]groupPointer to the per-socket state

Definition at line 383 of file ipv6_multicast.c.

◆ ipv6DropMulticastAddr()

void ipv6DropMulticastAddr ( NetInterface interface,
const Ipv6Addr groupAddr 
)

Reconfigure the MAC layer to reject multicast traffic.

Parameters
[in]interfaceUnderlying network interface
[in]groupAddrIPv6 multicast address to reject

Definition at line 536 of file ipv6_multicast.c.

◆ ipv6FindMulticastFilterEntry()

Ipv6FilterEntry* ipv6FindMulticastFilterEntry ( NetInterface interface,
const Ipv6Addr multicastAddr 
)

Search the multicast filter for a given address.

Parameters
[in]interfaceUnderlying network interface
[in]multicastAddrIPv6 multicast address
Returns
A pointer to the matching multicast filter entry is returned. NULL is returned if the specified group address cannot be found

Definition at line 654 of file ipv6_multicast.c.

◆ ipv6FindSrcAddr()

int_t ipv6FindSrcAddr ( const Ipv6SrcAddrList list,
const Ipv6Addr srcAddr 
)

Search the list of sources for a given IP address.

Parameters
[in]listPointer to the list of source addresses
[in]srcAddrSource IP address
Returns
Index of the matching IP address is returned. -1 is returned if the specified IP address cannot be found

Definition at line 776 of file ipv6_multicast.c.

◆ ipv6JoinMulticastGroup()

error_t ipv6JoinMulticastGroup ( NetInterface interface,
const Ipv6Addr groupAddr 
)

Join an IPv6 multicast group.

Parameters
[in]interfaceUnderlying network interface
[in]groupAddrIPv6 Multicast address to join
Returns
Error code

Definition at line 127 of file ipv6_multicast.c.

◆ ipv6LeaveMulticastGroup()

error_t ipv6LeaveMulticastGroup ( NetInterface interface,
const Ipv6Addr groupAddr 
)

Leave an IPv6 multicast group.

Parameters
[in]interfaceUnderlying network interface
[in]groupAddrIPv6 multicast address to drop
Returns
Error code

Definition at line 186 of file ipv6_multicast.c.

◆ ipv6MapMulticastAddrToMac()

error_t ipv6MapMulticastAddrToMac ( const Ipv6Addr ipAddr,
MacAddr macAddr 
)

Map an IPv6 multicast address to a MAC-layer multicast address.

Parameters
[in]ipAddrIPv6 multicast address
[out]macAddrCorresponding MAC-layer multicast address
Returns
Error code

Definition at line 569 of file ipv6_multicast.c.

◆ ipv6MulticastFilter()

error_t ipv6MulticastFilter ( NetInterface interface,
const Ipv6Addr destAddr,
const Ipv6Addr srcAddr 
)

Filter out incoming multicast traffic.

Parameters
[in]interfaceThe interface on which the packet was received
[in]destAddrDestination IP address of the received packet
[in]srcAddrSource IP address of the received packet
Returns
Error code

Definition at line 54 of file ipv6_multicast.c.

◆ ipv6RemoveSrcAddr()

void ipv6RemoveSrcAddr ( Ipv6SrcAddrList list,
const Ipv6Addr srcAddr 
)

Remove a source address from a given list.

Parameters
[in]listPointer to the list of source addresses
[in]srcAddrSource IP address to be removed

Definition at line 739 of file ipv6_multicast.c.

◆ ipv6UpdateMulticastFilter()

void ipv6UpdateMulticastFilter ( NetInterface interface,
const Ipv6Addr groupAddr 
)

Update IPv6 multicast filter table.

Parameters
[in]interfaceUnderlying network interface
[in]groupAddrIPv6 multicast address

Definition at line 231 of file ipv6_multicast.c.