igmp_snooping_misc.h
Go to the documentation of this file.
1 /**
2  * @file igmp_snooping_misc.h
3  * @brief Helper functions for IGMP snooping switch
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_SNOOPING_MISC_H
32 #define _IGMP_SNOOPING_MISC_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "igmp/igmp_snooping.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //IGMP snooping related functions
45  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
46  size_t length, const NetRxAncillary *ancillary);
47 
49  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
50  size_t length, const NetRxAncillary *ancillary);
51 
53  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
54  size_t length, const NetRxAncillary *ancillary);
55 
57  const Ipv4PseudoHeader *pseudoHeader, const IgmpMembershipReportV3 *message,
58  size_t length, const NetRxAncillary *ancillary);
59 
61  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
62  size_t length, const NetRxAncillary *ancillary);
63 
65  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
66  size_t length, const NetRxAncillary *ancillary);
67 
69  uint32_t forwardPorts, const MacAddr *destMacAddr,
70  const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message,
71  size_t length);
72 
74  Ipv4Addr groupAddr, uint8_t port);
75 
77  Ipv4Addr groupAddr, uint8_t port);
78 
80  IgmpSnoopingGroup *group);
81 
83 
86 
88  bool_t enable, uint32_t forwardPorts);
89 
91 
92 //C++ guard
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif
IgmpMembershipReportV3
Definition: igmp_common.h:255
uint32_t igmpSnoopingGetRouterPorts(IgmpSnoopingContext *context)
int bool_t
Definition: compiler_port.h:53
void igmpSnoopingProcessMessage(IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
Process incoming IGMP message.
IgmpMessage
Definition: igmp_common.h:215
uint8_t message[]
Definition: chap.h:154
void igmpSnoopingProcessMembershipQuery(IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
Process incoming Membership Query message.
void igmpSnoopingSetUnknownMcastFwdPorts(IgmpSnoopingContext *context, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
IGMP snooping switch.
void igmpSnoopingDeleteGroup(IgmpSnoopingContext *context, IgmpSnoopingGroup *group)
Delete a multicast group.
uint32_t Ipv4Addr
IPv4 network address.
Definition: ipv4.h:297
error_t
Error codes.
Definition: error.h:43
void igmpSnoopingProcessMembershipReportV3(IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMembershipReportV3 *message, size_t length, const NetRxAncillary *ancillary)
Process incoming Version 3 Membership Report message.
void igmpSnoopingEnableMonitoring(IgmpSnoopingContext *context, bool_t enable)
Enable IGMP monitoring.
#define NetRxAncillary
Definition: net_misc.h:40
#define Ipv4PseudoHeader
Definition: ipv4.h:39
uint8_t length
Definition: tcp.h:368
MacAddr
Definition: ethernet.h:195
uint16_t port
Definition: dns_common.h:267
void igmpSnoopingProcessUnknownMessage(IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
Process unrecognized IGMP messages.
void igmpSnoopingUpdateStaticFdbEntry(IgmpSnoopingContext *context, Ipv4Addr groupAddr)
Update a entry of the static MAC table.
Ipv4Addr groupAddr
Definition: igmp_common.h:214
void igmpSnoopingProcessMembershipReport(IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
Process incoming Membership Report message.
IgmpSnoopingGroup * igmpSnoopingFindGroup(IgmpSnoopingContext *context, Ipv4Addr groupAddr, uint8_t port)
Search the list of multicast groups for a given group address.
void igmpSnoopingProcessLeaveGroup(IgmpSnoopingContext *context, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length, const NetRxAncillary *ancillary)
Process incoming Leave Group message.
Multicast group.
Definition: igmp_snooping.h:79
IGMP snooping switch context.
TCP/IP stack core.
IgmpSnoopingGroup * igmpSnoopingCreateGroup(IgmpSnoopingContext *context, Ipv4Addr groupAddr, uint8_t port)
Create a new multicast group.
error_t igmpSnoopingForwardMessage(IgmpSnoopingContext *context, uint32_t forwardPorts, const MacAddr *destMacAddr, const Ipv4PseudoHeader *pseudoHeader, const IgmpMessage *message, size_t length)
Forward an IGMP message to the desired ports.