igmp_router.h File Reference

IGMP router. More...

#include "core/net.h"
#include "igmp/igmp_common.h"

Go to the source code of this file.

Data Structures

struct  IgmpRouterGroup
 Multicast group. More...
 
struct  IgmpRouterSettings
 IGMP router settings. More...
 
struct  _IgmpRouterContext
 IGMP router context. More...
 

Macros

#define IGMP_ROUTER_SUPPORT   DISABLED
 
#define IgmpRouterContext   struct _IgmpRouterContext
 

Typedefs

typedef void(* IgmpRouterAddMcastRouteCallback) (IgmpRouterContext *context, Ipv4Addr groupAddr, NetInterface *interface)
 Add multicast route callback. More...
 
typedef void(* IgmpRouterDeleteMcastRouteCallback) (IgmpRouterContext *context, Ipv4Addr groupAddr, NetInterface *interface)
 Delete multicast route callback. More...
 

Enumerations

enum  IgmpRouterState { IGMP_ROUTER_STATE_INIT = 0, IGMP_ROUTER_STATE_QUERIER = 1, IGMP_ROUTER_STATE_NON_QUERIER = 2 }
 IGMP router states. More...
 
enum  IgmpRouterGroupState { IGMP_ROUTER_GROUP_STATE_NO_MEMBERS_PRESENT = 0, IGMP_ROUTER_GROUP_STATE_MEMBERS_PRESENT = 1, IGMP_ROUTER_GROUP_STATE_V1_MEMBERS_PRESENT = 2, IGMP_ROUTER_GROUP_STATE_CHECKING_MEMBERSHIP = 3 }
 Multicast group states. More...
 

Functions

void igmpRouterGetDefaultSettings (IgmpRouterSettings *settings)
 Initialize settings with default values. More...
 
error_t igmpRouterInit (IgmpRouterContext *context, const IgmpRouterSettings *settings)
 IGMP router initialization. More...
 
error_t igmpRouterStart (IgmpRouterContext *context)
 Start IGMP router. More...
 
error_t igmpRouterStop (IgmpRouterContext *context)
 Stop IGMP router. More...
 
void igmpRouterTick (IgmpRouterContext *context)
 IGMP router timer handler. More...
 
void igmpRouterFsm (IgmpRouterContext *context)
 IGMP router state machine. More...
 
void igmpRouterGroupFsm (IgmpRouterContext *context, IgmpRouterGroup *group)
 IGMP group state machine. More...
 

Detailed Description

IGMP router.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file igmp_router.h.

Macro Definition Documentation

◆ IGMP_ROUTER_SUPPORT

#define IGMP_ROUTER_SUPPORT   DISABLED

Definition at line 40 of file igmp_router.h.

◆ IgmpRouterContext

#define IgmpRouterContext   struct _IgmpRouterContext

Definition at line 47 of file igmp_router.h.

Typedef Documentation

◆ IgmpRouterAddMcastRouteCallback

typedef void(* IgmpRouterAddMcastRouteCallback) (IgmpRouterContext *context, Ipv4Addr groupAddr, NetInterface *interface)

Add multicast route callback.

Definition at line 84 of file igmp_router.h.

◆ IgmpRouterDeleteMcastRouteCallback

typedef void(* IgmpRouterDeleteMcastRouteCallback) (IgmpRouterContext *context, Ipv4Addr groupAddr, NetInterface *interface)

Delete multicast route callback.

Definition at line 92 of file igmp_router.h.

Enumeration Type Documentation

◆ IgmpRouterGroupState

Multicast group states.

Enumerator
IGMP_ROUTER_GROUP_STATE_NO_MEMBERS_PRESENT 
IGMP_ROUTER_GROUP_STATE_MEMBERS_PRESENT 
IGMP_ROUTER_GROUP_STATE_V1_MEMBERS_PRESENT 
IGMP_ROUTER_GROUP_STATE_CHECKING_MEMBERSHIP 

Definition at line 71 of file igmp_router.h.

◆ IgmpRouterState

IGMP router states.

Enumerator
IGMP_ROUTER_STATE_INIT 
IGMP_ROUTER_STATE_QUERIER 
IGMP_ROUTER_STATE_NON_QUERIER 

Definition at line 59 of file igmp_router.h.

Function Documentation

◆ igmpRouterFsm()

void igmpRouterFsm ( IgmpRouterContext context)

IGMP router state machine.

Parameters
[in]contextPointer to the IGMP router context

Definition at line 245 of file igmp_router.c.

◆ igmpRouterGetDefaultSettings()

void igmpRouterGetDefaultSettings ( IgmpRouterSettings settings)

Initialize settings with default values.

Parameters
[out]settingsStructure that contains IGMP router settings

Definition at line 58 of file igmp_router.c.

◆ igmpRouterGroupFsm()

void igmpRouterGroupFsm ( IgmpRouterContext context,
IgmpRouterGroup group 
)

IGMP group state machine.

Parameters
[in]contextPointer to the IGMP router context
[in]groupMulticast group

Definition at line 316 of file igmp_router.c.

◆ igmpRouterInit()

error_t igmpRouterInit ( IgmpRouterContext context,
const IgmpRouterSettings settings 
)

IGMP router initialization.

Parameters
[in]contextPointer to the IGMP router context
[in]settingsIGMP router specific settings
Returns
Error code

Definition at line 87 of file igmp_router.c.

◆ igmpRouterStart()

error_t igmpRouterStart ( IgmpRouterContext context)

Start IGMP router.

Parameters
[in]contextPointer to the IGMP router context
Returns
Error code

Definition at line 149 of file igmp_router.c.

◆ igmpRouterStop()

error_t igmpRouterStop ( IgmpRouterContext context)

Stop IGMP router.

Parameters
[in]contextPointer to the IGMP router context
Returns
Error code

Definition at line 183 of file igmp_router.c.

◆ igmpRouterTick()

void igmpRouterTick ( IgmpRouterContext context)

IGMP router timer handler.

This routine must be periodically called by the TCP/IP stack to update IGMP router state machines

Parameters
[in]contextPointer to the IGMP router context

Definition at line 220 of file igmp_router.c.