igmp_host.h
Go to the documentation of this file.
1 /**
2  * @file igmp_host.h
3  * @brief 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.0
29  **/
30 
31 #ifndef _IGMP_HOST_H
32 #define _IGMP_HOST_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "igmp/igmp_common.h"
37 
38 //IGMP host support
39 #ifndef IGMP_HOST_SUPPORT
40  #define IGMP_HOST_SUPPORT ENABLED
41 #elif (IGMP_HOST_SUPPORT != ENABLED && IGMP_HOST_SUPPORT != DISABLED)
42  #error IGMP_HOST_SUPPORT parameter is not valid
43 #endif
44 
45 //C++ guard
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 
51 /**
52  * @brief Multicast group states
53  **/
54 
55 typedef enum
56 {
61 
62 
63 /**
64  * @brief IGMP host context
65  **/
66 
67 typedef struct
68 {
69  bool_t igmpv1RouterPresent; ///<An IGMPv1 query has been recently heard
70  NetTimer timer; ///<IGMPv1 router present timer
72 
73 
74 //IGMP host related functions
78 
79 void igmpHostTick(NetInterface *interface);
80 void igmpHostLinkChangeEvent(NetInterface *interface);
81 
82 //C++ guard
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif
int bool_t
Definition: compiler_port.h:53
error_t
Error codes.
Definition: error.h:43
Definitions common to IGMP host, router and snooping switch.
IgmpHostGroupState
Multicast group states.
Definition: igmp_host.h:56
@ IGMP_HOST_GROUP_STATE_NON_MEMBER
Definition: igmp_host.h:57
@ IGMP_HOST_GROUP_STATE_IDLE_MEMBER
Definition: igmp_host.h:59
@ IGMP_HOST_GROUP_STATE_DELAYING_MEMBER
Definition: igmp_host.h:58
error_t igmpHostJoinGroup(NetInterface *interface, Ipv4FilterEntry *entry)
Join the specified host group.
Definition: igmp_host.c:87
error_t igmpHostInit(NetInterface *interface)
IGMP host initialization.
Definition: igmp_host.c:59
void igmpHostLinkChangeEvent(NetInterface *interface)
Callback function for link change event.
Definition: igmp_host.c:223
void igmpHostTick(NetInterface *interface)
IGMP timer handler.
Definition: igmp_host.c:166
error_t igmpHostLeaveGroup(NetInterface *interface, Ipv4FilterEntry *entry)
Leave the specified host group.
Definition: igmp_host.c:137
TCP/IP stack core.
#define NetInterface
Definition: net.h:36
IGMP host context.
Definition: igmp_host.h:68
bool_t igmpv1RouterPresent
An IGMPv1 query has been recently heard.
Definition: igmp_host.h:69
NetTimer timer
IGMPv1 router present timer.
Definition: igmp_host.h:70
IPv4 multicast filter entry.
Definition: ipv4.h:357
Timer.
Definition: net_misc.h:172