mld.c File Reference

MLD (Multicast Listener Discovery for IPv6) More...

#include "core/net.h"
#include "core/ip.h"
#include "ipv6/ipv6.h"
#include "ipv6/icmpv6.h"
#include "ipv6/mld.h"
#include "mibs/ip_mib_module.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   MLD_TRACE_LEVEL
 

Functions

error_t mldInit (NetInterface *interface)
 MLD initialization. More...
 
error_t mldStartListening (NetInterface *interface, Ipv6FilterEntry *entry)
 Start listening to the address on the interface. More...
 
error_t mldStopListening (NetInterface *interface, Ipv6FilterEntry *entry)
 Stop listening to the address on the interface. More...
 
void mldTick (NetInterface *interface)
 MLD timer handler. More...
 
void mldLinkChangeEvent (NetInterface *interface)
 Callback function for link change event. More...
 
void mldProcessListenerQuery (NetInterface *interface, const Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
 Process incoming Multicast Listener Query message. More...
 
void mldProcessListenerReport (NetInterface *interface, const Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
 Process incoming Multicast Listener Report message. More...
 
error_t mldSendListenerReport (NetInterface *interface, Ipv6Addr *ipAddr)
 Send Multicast Listener Report message. More...
 
error_t mldSendListenerDone (NetInterface *interface, Ipv6Addr *ipAddr)
 Send Multicast Listener Done message. More...
 
void mldDumpMessage (const MldMessage *message)
 Dump MLD message for debugging purpose. More...
 

Variables

systime_t mldTickCounter
 

Detailed Description

MLD (Multicast Listener Discovery for IPv6)

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.

Description

MLD is used by an IPv6 router to discover the presence of multicast listeners on its directly attached links, and to discover specifically which multicast addresses are of interest to those neighboring nodes. Refer to the following RFCs for complete details:

  • RFC 2710: Multicast Listener Discovery (MLD) for IPv6
  • RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6
Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file mld.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   MLD_TRACE_LEVEL

Definition at line 41 of file mld.c.

Function Documentation

◆ mldDumpMessage()

void mldDumpMessage ( const MldMessage message)

Dump MLD message for debugging purpose.

Parameters
[in]messagePointer to the MLD message

Definition at line 610 of file mld.c.

◆ mldInit()

error_t mldInit ( NetInterface interface)

MLD initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 65 of file mld.c.

◆ mldLinkChangeEvent()

void mldLinkChangeEvent ( NetInterface interface)

Callback function for link change event.

Parameters
[in]interfaceUnderlying network interface

Definition at line 198 of file mld.c.

◆ mldProcessListenerQuery()

void mldProcessListenerQuery ( NetInterface interface,
const Ipv6PseudoHeader pseudoHeader,
const NetBuffer buffer,
size_t  offset,
uint8_t  hopLimit 
)

Process incoming Multicast Listener Query message.

Parameters
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the incoming MLD message
[in]offsetOffset to the first byte of the MLD message
[in]hopLimitHop Limit field from IPv6 header

Definition at line 268 of file mld.c.

◆ mldProcessListenerReport()

void mldProcessListenerReport ( NetInterface interface,
const Ipv6PseudoHeader pseudoHeader,
const NetBuffer buffer,
size_t  offset,
uint8_t  hopLimit 
)

Process incoming Multicast Listener Report message.

Parameters
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the incoming MLD message
[in]offsetOffset to the first byte of the MLD message
[in]hopLimitHop Limit field from IPv6 header

Definition at line 372 of file mld.c.

◆ mldSendListenerDone()

error_t mldSendListenerDone ( NetInterface interface,
Ipv6Addr ipAddr 
)

Send Multicast Listener Done message.

Parameters
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address specifying the multicast address being left
Returns
Error code

Definition at line 526 of file mld.c.

◆ mldSendListenerReport()

error_t mldSendListenerReport ( NetInterface interface,
Ipv6Addr ipAddr 
)

Send Multicast Listener Report message.

Parameters
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address specifying the multicast address
Returns
Error code

Definition at line 440 of file mld.c.

◆ mldStartListening()

error_t mldStartListening ( NetInterface interface,
Ipv6FilterEntry entry 
)

Start listening to the address on the interface.

Parameters
[in]interfaceUnderlying network interface
[in]entryIPv6 filter entry identifying the address to listen to
Returns
Error code

Definition at line 79 of file mld.c.

◆ mldStopListening()

error_t mldStopListening ( NetInterface interface,
Ipv6FilterEntry entry 
)

Stop listening to the address on the interface.

Parameters
[in]interfaceUnderlying network interface
[in]entryIPv6 filter entry identifying the multicast address to leave
Returns
Error code

Definition at line 128 of file mld.c.

◆ mldTick()

void mldTick ( NetInterface interface)

MLD timer handler.

This routine must be periodically called by the TCP/IP stack to handle MLD related timers

Parameters
[in]interfaceUnderlying network interface

Definition at line 155 of file mld.c.

Variable Documentation

◆ mldTickCounter

systime_t mldTickCounter

Definition at line 56 of file mld.c.