igmp_host_misc.h
Go to the documentation of this file.
1 /**
2  * @file igmp_host_misc.h
3  * @brief Helper functions for IGMP host
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 _IGMP_HOST_MISC_H
32 #define _IGMP_HOST_MISC_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "igmp/igmp_host.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //IGMP host related functions
45  IgmpVersion compatibilityMode);
46 
49 
52 
54 
56  size_t offset, size_t *length);
57 
59  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
60  size_t length);
61 
63  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
64  size_t length);
65 
67  const Ipv4PseudoHeader *pseudoHeader, const IgmpMembershipQueryV3 *message,
68  size_t length);
69 
71  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
72  size_t length);
73 
75  IpFilterMode newFilterMode, const Ipv4SrcAddrList *newFilter);
76 
80 
83 
88 
92 
93 //C++ guard
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif
Multicast group.
Definition: igmp_host.h:93
IgmpHostGroup * igmpHostCreateGroup(IgmpHostContext *context, Ipv4Addr groupAddr)
Create a new multicast group.
IpFilterMode
Multicast filter mode.
Definition: ip.h:67
int_t igmpHostFindSrcAddr(const IgmpHostSrcAddrList *list, Ipv4Addr srcAddr)
Search the list of sources for a given IP address.
int bool_t
Definition: compiler_port.h:53
Source address list.
Definition: ipv4.h:399
IgmpMessage
Definition: igmp_common.h:215
signed int int_t
Definition: compiler_port.h:49
IgmpVersion
IGMP versions.
Definition: igmp_common.h:161
void igmpHostProcessMessage(IgmpHostContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length)
Process incoming IGMP message.
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
uint8_t message[]
Definition: chap.h:154
void igmpHostDecGroupRetransmitCounters(IgmpHostGroup *group)
Decrement retransmission counters for a given group.
bool_t igmpHostGetGroupRetransmitStatus(IgmpHostGroup *group)
Get the retransmission status for a given group.
void igmpHostRemoveSrcAddr(IgmpHostSrcAddrList *list, Ipv4Addr srcAddr)
Remove a source address from a given list.
uint32_t Ipv4Addr
IPv4 network address.
Definition: ipv4.h:297
Source address list.
Definition: igmp_host.h:80
void igmpHostProcessMembershipQuery(IgmpHostContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length)
Process incoming Membership Query message.
bool_t igmpHostMatchGroup(IgmpHostGroup *group, Ipv4Addr multicastAddr)
Check whether a group matches a given multicast address.
IGMP host context.
Definition: igmp_host.h:114
void igmpHostSendLeaveGroup(IgmpHostContext *context, Ipv4Addr groupAddr)
Send Leave Group message.
void igmpHostDeleteGroup(IgmpHostGroup *group)
Delete a multicast group.
void igmpHostSendCurrentStateReport(IgmpHostContext *context, Ipv4Addr groupAddr)
Send Current-State Report message.
void igmpHostSendStateChangeReport(IgmpHostContext *context)
Send State-Change Report message.
error_t
Error codes.
Definition: error.h:43
void igmpHostFlushReportRecords(IgmpHostContext *context, NetBuffer *buffer, size_t offset, size_t *length)
Flush report records.
void igmpHostProcessMembershipReport(IgmpHostContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length)
Process incoming Membership Report message.
bool_t igmpHostGetRetransmitStatus(IgmpHostContext *context)
Get the retransmission status of the State-Change report.
IgmpHostGroup * igmpHostFindGroup(IgmpHostContext *context, Ipv4Addr groupAddr)
Search the list of multicast groups for a given group address.
void igmpHostMergeReports(IgmpHostGroup *group, IpFilterMode newFilterMode, const Ipv4SrcAddrList *newFilter)
Merge difference the report and the pending report.
#define Ipv4PseudoHeader
Definition: ipv4.h:39
IGMP host.
uint8_t length
Definition: tcp.h:368
error_t igmpHostAddSrcAddr(IgmpHostSrcAddrList *list, Ipv4Addr srcAddr)
Append a source address to a given list.
Ipv4Addr groupAddr
Definition: igmp_common.h:214
void igmpHostProcessMembershipQueryV3(IgmpHostContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMembershipQueryV3 *message, size_t length)
Process incoming Version 3 Membership Query message.
IgmpMembershipQueryV3
Definition: igmp_common.h:240
void igmpHostSendMembershipReport(IgmpHostContext *context, Ipv4Addr groupAddr)
Send Membership Report message.
MacAddr srcAddr
Definition: ethernet.h:220
void igmpHostChangeCompatibilityMode(IgmpHostContext *context, IgmpVersion compatibilityMode)
Change host compatibility mode.
void igmpHostFlushUnusedGroups(IgmpHostContext *context)
Delete groups in "non-existent" state.
TCP/IP stack core.
Ipv4Addr multicastAddr
Definition: igmp_common.h:267