mld_node_misc.c File Reference

Helper functions for MLD node. More...

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

Go to the source code of this file.

Macros

#define TRACE_LEVEL   MLD_TRACE_LEVEL
 

Functions

void mldNodeChangeCompatibilityMode (MldNodeContext *context, MldVersion compatibilityMode)
 Change host compatibility mode. More...
 
void mldNodeSendUnsolicitedReport (MldNodeContext *context, const Ipv6Addr *groupAddr)
 Send an unsolicited Report message. More...
 
void mldNodeSendListenerReport (MldNodeContext *context, const Ipv6Addr *groupAddr)
 Send Multicast Listener Report message. More...
 
void mldNodeSendListenerDone (MldNodeContext *context, const Ipv6Addr *groupAddr)
 Send Multicast Listener Done message. More...
 
void mldNodeSendCurrentStateReport (MldNodeContext *context, const Ipv6Addr *groupAddr)
 Send Current-State Report message. More...
 
void mldNodeSendStateChangeReport (MldNodeContext *context, const Ipv6Addr *groupAddr)
 Send State-Change Report message. More...
 
void mldNodeFlushReportRecords (MldNodeContext *context, NetBuffer *buffer, size_t offset, size_t *length)
 Flush report records. More...
 
void mldNodeProcessMessage (MldNodeContext *context, const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message, size_t length)
 Process incoming MLD message. More...
 
void mldNodeProcessListenerQuery (MldNodeContext *context, const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message, size_t length)
 Process incoming Multicast Listener Query message. More...
 
void mldNodeProcessListenerQueryV2 (MldNodeContext *context, const Ipv6PseudoHeader *pseudoHeader, const MldListenerQueryV2 *message, size_t length)
 Process incoming Version 2 Multicast Listener Query message. More...
 
void mldNodeProcessListenerReport (MldNodeContext *context, const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message, size_t length)
 Process incoming Multicast Listener Report message. More...
 
void mldNodeMergeReports (MldNodeGroup *group, IpFilterMode newFilterMode, const Ipv6SrcAddrList *newFilter)
 Merge difference the report and the pending report. More...
 
bool_t mldNodeGetRetransmitStatus (MldNodeContext *context)
 Get the retransmission status of the State-Change report. More...
 
bool_t mldNodeGetGroupRetransmitStatus (MldNodeGroup *group)
 Get the retransmission status for a given group. More...
 
void mldNodeDecGroupRetransmitCounters (MldNodeGroup *group)
 Decrement retransmission counters for a given group. More...
 
MldNodeGroupmldNodeCreateGroup (MldNodeContext *context, const Ipv6Addr *groupAddr)
 Create a new multicast group. More...
 
MldNodeGroupmldNodeFindGroup (MldNodeContext *context, const Ipv6Addr *groupAddr)
 Search the list of multicast groups for a given group address. More...
 
bool_t mldNodeMatchGroup (MldNodeGroup *group, const Ipv6Addr *multicastAddr)
 Check whether a group matches a given multicast address. More...
 
void mldNodeDeleteGroup (MldNodeGroup *group)
 Delete a multicast group. More...
 
void mldNodeFlushUnusedGroups (MldNodeContext *context)
 Delete groups in "non-existent" state. More...
 
error_t mldNodeAddSrcAddr (MldNodeSrcAddrList *list, const Ipv6Addr *srcAddr)
 Append a source address to a given list. More...
 
void mldNodeRemoveSrcAddr (MldNodeSrcAddrList *list, const Ipv6Addr *srcAddr)
 Remove a source address from a given list. More...
 
int_t mldNodeFindSrcAddr (const MldNodeSrcAddrList *list, const Ipv6Addr *srcAddr)
 Search the list of sources for a given IP address. More...
 

Detailed Description

Helper functions for MLD node.

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

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   MLD_TRACE_LEVEL

Definition at line 32 of file mld_node_misc.c.

Function Documentation

◆ mldNodeAddSrcAddr()

error_t mldNodeAddSrcAddr ( MldNodeSrcAddrList list,
const Ipv6Addr srcAddr 
)

Append a source address to a given list.

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

Definition at line 1479 of file mld_node_misc.c.

◆ mldNodeChangeCompatibilityMode()

void mldNodeChangeCompatibilityMode ( MldNodeContext context,
MldVersion  compatibilityMode 
)

Change host compatibility mode.

Parameters
[in]contextPointer to the MLD node context
[in]compatibilityModeNew host compatibility mode

Definition at line 53 of file mld_node_misc.c.

◆ mldNodeCreateGroup()

MldNodeGroup* mldNodeCreateGroup ( MldNodeContext context,
const Ipv6Addr groupAddr 
)

Create a new multicast group.

Parameters
[in]contextPointer to the MLD node context
[in]groupAddrMulticast group address
Returns
Pointer to the newly created multicast group

Definition at line 1302 of file mld_node_misc.c.

◆ mldNodeDecGroupRetransmitCounters()

void mldNodeDecGroupRetransmitCounters ( MldNodeGroup group)

Decrement retransmission counters for a given group.

Parameters
[in]groupPointer to the multicast group

Definition at line 1241 of file mld_node_misc.c.

◆ mldNodeDeleteGroup()

void mldNodeDeleteGroup ( MldNodeGroup group)

Delete a multicast group.

Parameters
[in]groupPointer to the multicast group

Definition at line 1425 of file mld_node_misc.c.

◆ mldNodeFindGroup()

MldNodeGroup* mldNodeFindGroup ( MldNodeContext context,
const Ipv6Addr groupAddr 
)

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

Parameters
[in]contextPointer to the MLD node context
[in]groupAddrMulticast group address
Returns
Pointer to the matching multicast group, if any

Definition at line 1363 of file mld_node_misc.c.

◆ mldNodeFindSrcAddr()

int_t mldNodeFindSrcAddr ( const MldNodeSrcAddrList 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 1564 of file mld_node_misc.c.

◆ mldNodeFlushReportRecords()

void mldNodeFlushReportRecords ( MldNodeContext context,
NetBuffer buffer,
size_t  offset,
size_t *  length 
)

Flush report records.

Parameters
[in]contextPointer to the MLD node context
[in]bufferMulti-part buffer containing the report message
[in]offsetOffset to the first byte of the report message
[in,out]lengthLength of the report message, in bytes

Definition at line 658 of file mld_node_misc.c.

◆ mldNodeFlushUnusedGroups()

void mldNodeFlushUnusedGroups ( MldNodeContext context)

Delete groups in "non-existent" state.

Parameters
[in]contextPointer to the MLD node context

Definition at line 1441 of file mld_node_misc.c.

◆ mldNodeGetGroupRetransmitStatus()

bool_t mldNodeGetGroupRetransmitStatus ( MldNodeGroup group)

Get the retransmission status for a given group.

Parameters
[in]groupPointer to the multicast group
Returns
TRUE if additional retransmissions are needed, else FALSE

Definition at line 1209 of file mld_node_misc.c.

◆ mldNodeGetRetransmitStatus()

bool_t mldNodeGetRetransmitStatus ( MldNodeContext context)

Get the retransmission status of the State-Change report.

Parameters
[in]contextPointer to the MLD node context
Returns
TRUE if additional retransmissions are needed, else FALSE

Definition at line 1171 of file mld_node_misc.c.

◆ mldNodeMatchGroup()

bool_t mldNodeMatchGroup ( MldNodeGroup group,
const Ipv6Addr multicastAddr 
)

Check whether a group matches a given multicast address.

Parameters
[in]groupPointer to the multicast group
[in]multicastAddrIPv6 multicast address
Returns
TRUE if the group matches the specified multicast address, else FALSE

Definition at line 1397 of file mld_node_misc.c.

◆ mldNodeMergeReports()

void mldNodeMergeReports ( MldNodeGroup group,
IpFilterMode  newFilterMode,
const Ipv6SrcAddrList newFilter 
)

Merge difference the report and the pending report.

Parameters
[in]groupPointer to the multicast group
[in]newFilterModeNew filter mode for the affected group
[in]newFilterNew interface state for the affected group

Definition at line 1076 of file mld_node_misc.c.

◆ mldNodeProcessListenerQuery()

void mldNodeProcessListenerQuery ( MldNodeContext context,
const Ipv6PseudoHeader pseudoHeader,
const MldMessage message,
size_t  length 
)

Process incoming Multicast Listener Query message.

Parameters
[in]contextPointer to the MLD node context
[in]pseudoHeaderIPv6 pseudo header
[in]messagePointer to the incoming MLD message
[in]lengthLength of the MLD message, in bytes

Definition at line 747 of file mld_node_misc.c.

◆ mldNodeProcessListenerQueryV2()

void mldNodeProcessListenerQueryV2 ( MldNodeContext context,
const Ipv6PseudoHeader pseudoHeader,
const MldListenerQueryV2 message,
size_t  length 
)

Process incoming Version 2 Multicast Listener Query message.

Parameters
[in]contextPointer to the MLD node context
[in]pseudoHeaderIPv6 pseudo header
[in]messagePointer to the incoming MLD message
[in]lengthLength of the MLD message, in bytes

Definition at line 839 of file mld_node_misc.c.

◆ mldNodeProcessListenerReport()

void mldNodeProcessListenerReport ( MldNodeContext context,
const Ipv6PseudoHeader pseudoHeader,
const MldMessage message,
size_t  length 
)

Process incoming Multicast Listener Report message.

Parameters
[in]contextPointer to the MLD node context
[in]pseudoHeaderIPv6 pseudo header
[in]messagePointer to the incoming MLD message
[in]lengthLength of the MLD message, in bytes

Definition at line 1034 of file mld_node_misc.c.

◆ mldNodeProcessMessage()

void mldNodeProcessMessage ( MldNodeContext context,
const Ipv6PseudoHeader pseudoHeader,
const MldMessage message,
size_t  length 
)

Process incoming MLD message.

Parameters
[in]contextPointer to the MLD node context
[in]pseudoHeaderIPv6 pseudo header
[in]messagePointer to the incoming MLD message
[in]lengthLength of the MLD message, in bytes

Definition at line 701 of file mld_node_misc.c.

◆ mldNodeRemoveSrcAddr()

void mldNodeRemoveSrcAddr ( MldNodeSrcAddrList list,
const Ipv6Addr srcAddr 
)

Remove a source address from a given list.

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

Definition at line 1527 of file mld_node_misc.c.

◆ mldNodeSendCurrentStateReport()

void mldNodeSendCurrentStateReport ( MldNodeContext context,
const Ipv6Addr groupAddr 
)

Send Current-State Report message.

Parameters
[in]contextPointer to the MLD node context
[in]groupAddrIPv6 address specifying the group address

Definition at line 223 of file mld_node_misc.c.

◆ mldNodeSendListenerDone()

void mldNodeSendListenerDone ( MldNodeContext context,
const Ipv6Addr groupAddr 
)

Send Multicast Listener Done message.

Parameters
[in]contextPointer to the MLD node context
[in]groupAddrIPv6 address specifying the multicast address being left

Definition at line 183 of file mld_node_misc.c.

◆ mldNodeSendListenerReport()

void mldNodeSendListenerReport ( MldNodeContext context,
const Ipv6Addr groupAddr 
)

Send Multicast Listener Report message.

Parameters
[in]contextPointer to the MLD node context
[in]groupAddrIPv6 address specifying the multicast address

Definition at line 144 of file mld_node_misc.c.

◆ mldNodeSendStateChangeReport()

void mldNodeSendStateChangeReport ( MldNodeContext context,
const Ipv6Addr groupAddr 
)

Send State-Change Report message.

Parameters
[in]contextPointer to the MLD node context
[in]groupAddrIPv6 address specifying the group address

Definition at line 453 of file mld_node_misc.c.

◆ mldNodeSendUnsolicitedReport()

void mldNodeSendUnsolicitedReport ( MldNodeContext context,
const Ipv6Addr groupAddr 
)

Send an unsolicited Report message.

Parameters
[in]contextPointer to the MLD node context
[in]groupAddrIPv6 address specifying the multicast address

Definition at line 108 of file mld_node_misc.c.