mikroSDK Reference Manual
igmp_router.h
Go to the documentation of this file.
1
31#ifndef _IGMP_ROUTER_H
32#define _IGMP_ROUTER_H
33
34//Dependencies
35#include "core/net.h"
36#include "igmp/igmp_common.h"
37
38//IGMP router support
39#ifndef IGMP_ROUTER_SUPPORT
40 #define IGMP_ROUTER_SUPPORT DISABLED
41#elif (IGMP_ROUTER_SUPPORT != ENABLED && IGMP_ROUTER_SUPPORT != DISABLED)
42 #error IGMP_ROUTER_SUPPORT parameter is not valid
43#endif
44
45//Forward declaration of DhcpClientContext structure
47#define IgmpRouterContext struct _IgmpRouterContext
48
49//C++ guard
50#ifdef __cplusplus
51extern "C" {
52#endif
53
54
59typedef enum
60{
61 IGMP_VERSION_1 = 1,
62 IGMP_VERSION_2 = 2,
63 IGMP_VERSION_3 = 3
65
66
71typedef enum
72{
73 IGMP_ROUTER_STATE_INIT = 0,
74 IGMP_ROUTER_STATE_QUERIER = 1,
75 IGMP_ROUTER_STATE_NON_QUERIER = 2
77
78
83typedef enum
84{
85 IGMP_ROUTER_GROUP_STATE_NO_MEMBERS_PRESENT = 0,
86 IGMP_ROUTER_GROUP_STATE_MEMBERS_PRESENT = 1,
87 IGMP_ROUTER_GROUP_STATE_V1_MEMBERS_PRESENT = 2,
88 IGMP_ROUTER_GROUP_STATE_CHECKING_MEMBERSHIP = 3
90
91
96typedef void (*IgmpRouterAddMcastRouteCallback)(IgmpRouterContext *context,
97 Ipv4Addr groupAddr, NetInterface *interface);
98
99
104typedef void (*IgmpRouterDeleteMcastRouteCallback)(IgmpRouterContext *context,
105 Ipv4Addr groupAddr, NetInterface *interface);
106
107
121
122
136
137
156
157
158//IGMP router related functions
159void igmpRouterGetDefaultSettings(IgmpRouterSettings *settings);
160
161error_t igmpRouterInit(IgmpRouterContext *context,
162 const IgmpRouterSettings *settings);
163
164error_t igmpRouterStart(IgmpRouterContext *context);
165error_t igmpRouterStop(IgmpRouterContext *context);
166
167void igmpRouterTick(IgmpRouterContext *context);
168void igmpRouterFsm(IgmpRouterContext *context);
169void igmpRouterGroupFsm(IgmpRouterContext *context, IgmpRouterGroup *group);
170
171//C++ guard
172#ifdef __cplusplus
173}
174#endif
175
176#endif
error_t
Error codes.
Definition error.h:43
Definitions common to IGMP host, router and snooping switch.
IgmpRouterGroupState
Multicast group states.
Definition igmp_router.h:84
IgmpRouterState
IGMP router states.
Definition igmp_router.h:72
void(* IgmpRouterAddMcastRouteCallback)(IgmpRouterContext *context, Ipv4Addr groupAddr, NetInterface *interface)
Add multicast route callback.
Definition igmp_router.h:96
void(* IgmpRouterDeleteMcastRouteCallback)(IgmpRouterContext *context, Ipv4Addr groupAddr, NetInterface *interface)
Delete multicast route callback.
Definition igmp_router.h:104
IgmpVersion
IGMP versions.
Definition igmp_router.h:60
uint32_t Ipv4Addr
IPv4 network address.
Definition ipv4.h:267
TCP/IP stack core.
Multicast group.
Definition igmp_router.h:113
NetTimer retransmitTimer
Retransmit timer for the group membership.
Definition igmp_router.h:119
uint_t lastMemberQueryCount
Number of Group-Specific Queries to be sent.
Definition igmp_router.h:116
NetTimer v1HostTimer
IGMPv1 Host timer.
Definition igmp_router.h:118
NetTimer timer
Timer for the group membership.
Definition igmp_router.h:117
IgmpRouterGroupState state
Multicast group state.
Definition igmp_router.h:114
Ipv4Addr addr
Multicast group address.
Definition igmp_router.h:115
IGMP router settings.
Definition igmp_router.h:128
NetInterface * interface
Underlying network interface.
Definition igmp_router.h:129
IgmpVersion version
IGMP version.
Definition igmp_router.h:130
IgmpRouterGroup * groups
Multicast groups.
Definition igmp_router.h:132
IgmpRouterDeleteMcastRouteCallback deleteMcastRouteCallback
Delete multicast route callback.
Definition igmp_router.h:134
IgmpRouterAddMcastRouteCallback addMcastRouteCallback
Add multicast route callback.
Definition igmp_router.h:133
uint_t numGroups
Maximum number of multicast groups.
Definition igmp_router.h:131
Timer.
Definition net_misc.h:171
IGMP router context.
Definition igmp_router.h:143
NetTimer otherQuerierPresentTimer
Other Querier Present timer.
Definition igmp_router.h:154
IgmpRouterAddMcastRouteCallback addMcastRouteCallback
Add multicast route callback.
Definition igmp_router.h:148
IgmpRouterState state
IGMP router state.
Definition igmp_router.h:151
IgmpVersion version
IGMP version.
Definition igmp_router.h:145
bool_t running
IGMP router operation state.
Definition igmp_router.h:150
IgmpRouterGroup * groups
Multicast groups.
Definition igmp_router.h:147
NetInterface * interface
The primary interface on an attached network.
Definition igmp_router.h:144
IgmpRouterDeleteMcastRouteCallback deleteMcastRouteCallback
Delete multicast route callback.
Definition igmp_router.h:149
uint_t startupQueryCount
Number of General Queries to be sent on startup.
Definition igmp_router.h:152
NetTimer generalQueryTimer
General Query timer.
Definition igmp_router.h:153
uint_t numGroups
Maximum number of multicast groups.
Definition igmp_router.h:146