mld_node_misc.h
Go to the documentation of this file.
1 /**
2  * @file mld_node_misc.h
3  * @brief Helper functions for MLD node
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _MLD_NODE_MISC_H
32 #define _MLD_NODE_MISC_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "mld/mld_node.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //MLD node related functions
45  MldVersion compatibilityMode);
46 
48  const Ipv6Addr *groupAddr);
49 
51  const Ipv6Addr *groupAddr);
52 
54  const Ipv6Addr *groupAddr);
55 
57  const Ipv6Addr *groupAddr);
58 
60  const Ipv6Addr *groupAddr);
61 
63  size_t offset, size_t *length);
64 
66  const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message,
67  size_t length);
68 
70  const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message,
71  size_t length);
72 
74  const Ipv6PseudoHeader *pseudoHeader, const MldListenerQueryV2 *message,
75  size_t length);
76 
78  const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message,
79  size_t length);
80 
82  IpFilterMode newFilterMode, const Ipv6SrcAddrList *newFilter);
83 
87 
89  const Ipv6Addr *groupAddr);
90 
92  const Ipv6Addr *groupAddr);
93 
95 void mldNodeDeleteGroup(MldNodeGroup *group);
97 
100 
102  const Ipv6Addr *srcAddr);
103 
104 //C++ guard
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif
IpFilterMode
Multicast filter mode.
Definition: ip.h:67
void mldNodeProcessListenerReport(MldNodeContext *context, const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message, size_t length)
Process incoming Multicast Listener Report message.
int bool_t
Definition: compiler_port.h:53
Source address list.
Definition: ipv6.h:469
signed int int_t
Definition: compiler_port.h:49
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
uint8_t message[]
Definition: chap.h:154
MldMessage
Definition: mld_common.h:134
Ipv6Addr
Definition: ipv6.h:260
void mldNodeProcessMessage(MldNodeContext *context, const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message, size_t length)
Process incoming MLD message.
MLD node context.
Definition: mld_node.h:114
void mldNodeSendListenerReport(MldNodeContext *context, const Ipv6Addr *groupAddr)
Send Multicast Listener Report message.
void mldNodeSendStateChangeReport(MldNodeContext *context, const Ipv6Addr *groupAddr)
Send State-Change Report message.
error_t mldNodeAddSrcAddr(MldNodeSrcAddrList *list, const Ipv6Addr *srcAddr)
Append a source address to a given list.
void mldNodeMergeReports(MldNodeGroup *group, IpFilterMode newFilterMode, const Ipv6SrcAddrList *newFilter)
Merge difference the report and the pending report.
void mldNodeSendCurrentStateReport(MldNodeContext *context, const Ipv6Addr *groupAddr)
Send Current-State Report message.
void mldNodeChangeCompatibilityMode(MldNodeContext *context, MldVersion compatibilityMode)
Change host compatibility mode.
Definition: mld_node_misc.c:53
error_t
Error codes.
Definition: error.h:43
#define Ipv6PseudoHeader
Definition: ipv6.h:42
void mldNodeFlushUnusedGroups(MldNodeContext *context)
Delete groups in "non-existent" state.
void mldNodeDeleteGroup(MldNodeGroup *group)
Delete a multicast group.
void mldNodeDecGroupRetransmitCounters(MldNodeGroup *group)
Decrement retransmission counters for a given group.
int_t mldNodeFindSrcAddr(const MldNodeSrcAddrList *list, const Ipv6Addr *srcAddr)
Search the list of sources for a given IP address.
uint8_t length
Definition: tcp.h:368
MldNodeGroup * mldNodeCreateGroup(MldNodeContext *context, const Ipv6Addr *groupAddr)
Create a new multicast group.
void mldNodeRemoveSrcAddr(MldNodeSrcAddrList *list, const Ipv6Addr *srcAddr)
Remove a source address from a given list.
bool_t mldNodeGetRetransmitStatus(MldNodeContext *context)
Get the retransmission status of the State-Change report.
MLD node (Multicast Listener Discovery for IPv6)
MldNodeGroup * mldNodeFindGroup(MldNodeContext *context, const Ipv6Addr *groupAddr)
Search the list of multicast groups for a given group address.
void mldNodeProcessListenerQueryV2(MldNodeContext *context, const Ipv6PseudoHeader *pseudoHeader, const MldListenerQueryV2 *message, size_t length)
Process incoming Version 2 Multicast Listener Query message.
bool_t mldNodeMatchGroup(MldNodeGroup *group, const Ipv6Addr *multicastAddr)
Check whether a group matches a given multicast address.
void mldNodeFlushReportRecords(MldNodeContext *context, NetBuffer *buffer, size_t offset, size_t *length)
Flush report records.
Ipv4Addr groupAddr
Definition: igmp_common.h:214
MldVersion
MLD versions.
Definition: mld_common.h:93
void mldNodeSendListenerDone(MldNodeContext *context, const Ipv6Addr *groupAddr)
Send Multicast Listener Done message.
bool_t mldNodeGetGroupRetransmitStatus(MldNodeGroup *group)
Get the retransmission status for a given group.
MacAddr srcAddr
Definition: ethernet.h:220
void mldNodeSendUnsolicitedReport(MldNodeContext *context, const Ipv6Addr *groupAddr)
Send an unsolicited Report message.
Source address list.
Definition: mld_node.h:80
MldListenerQueryV2
Definition: mld_common.h:161
TCP/IP stack core.
void mldNodeProcessListenerQuery(MldNodeContext *context, const Ipv6PseudoHeader *pseudoHeader, const MldMessage *message, size_t length)
Process incoming Multicast Listener Query message.
Multicast group.
Definition: mld_node.h:93
Ipv4Addr multicastAddr
Definition: igmp_common.h:267