igmp_common.c File Reference

Definitions common to IGMP host, router and snooping switch. More...

#include "core/net.h"
#include "ipv4/ipv4_multicast.h"
#include "ipv4/ipv4_misc.h"
#include "igmp/igmp_host.h"
#include "igmp/igmp_host_misc.h"
#include "igmp/igmp_router.h"
#include "igmp/igmp_router_misc.h"
#include "igmp/igmp_snooping.h"
#include "igmp/igmp_snooping_misc.h"
#include "igmp/igmp_common.h"
#include "igmp/igmp_debug.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   IGMP_TRACE_LEVEL
 

Functions

error_t igmpInit (NetInterface *interface)
 IGMP initialization. More...
 
void igmpTick (NetInterface *interface)
 IGMP timer handler. More...
 
void igmpLinkChangeEvent (NetInterface *interface)
 Callback function for link change event. More...
 
error_t igmpSendMessage (NetInterface *interface, Ipv4Addr destAddr, NetBuffer *buffer, size_t offset)
 Send IGMP message. More...
 
void igmpProcessMessage (NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary)
 Process incoming IGMP message. More...
 
systime_t igmpGetRandomDelay (systime_t maxDelay)
 Generate a random delay. More...
 
uint32_t igmpDecodeFloatingPointValue (uint8_t code)
 Decode a floating-point value. More...
 

Variables

systime_t igmpTickCounter
 

Detailed Description

Definitions common to IGMP host, router and snooping switch.

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.

Description

IGMP is used by IP hosts to report their multicast group memberships to any immediately-neighboring multicast routersRefer to the following RFCs for complete details:

  • RFC 1112: Host Extensions for IP Multicasting
  • RFC 2236: Internet Group Management Protocol, Version 2
  • RFC 3376: Internet Group Management Protocol, Version 3
  • RFC 4541: Considerations for IGMP and MLD Snooping Switches
Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file igmp_common.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   IGMP_TRACE_LEVEL

Definition at line 42 of file igmp_common.c.

Function Documentation

◆ igmpDecodeFloatingPointValue()

uint32_t igmpDecodeFloatingPointValue ( uint8_t  code)

Decode a floating-point value.

Parameters
[in]codeFloating-point representation
Returns
Decoded value

Definition at line 398 of file igmp_common.c.

◆ igmpGetRandomDelay()

systime_t igmpGetRandomDelay ( systime_t  maxDelay)

Generate a random delay.

Parameters
[in]maxDelaymaximum delay
Returns
Random amount of time

Definition at line 373 of file igmp_common.c.

◆ igmpInit()

error_t igmpInit ( NetInterface interface)

IGMP initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 72 of file igmp_common.c.

◆ igmpLinkChangeEvent()

void igmpLinkChangeEvent ( NetInterface interface)

Callback function for link change event.

Parameters
[in]interfaceUnderlying network interface

Definition at line 139 of file igmp_common.c.

◆ igmpProcessMessage()

void igmpProcessMessage ( NetInterface interface,
const Ipv4PseudoHeader pseudoHeader,
const NetBuffer buffer,
size_t  offset,
const NetRxAncillary ancillary 
)

Process incoming IGMP message.

Parameters
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv4 pseudo header
[in]bufferMulti-part buffer containing the incoming IGMP message
[in]offsetOffset to the first byte of the IGMP message
[in]ancillaryAdditional options passed to the stack along with the packet

Definition at line 292 of file igmp_common.c.

◆ igmpSendMessage()

error_t igmpSendMessage ( NetInterface interface,
Ipv4Addr  destAddr,
NetBuffer buffer,
size_t  offset 
)

Send IGMP message.

Parameters
[in]interfaceUnderlying network interface
[in]destAddrDestination IP address
[in]bufferMulti-part buffer containing the payload
[in]offsetOffset to the first byte of the payload
Returns
Error code

Definition at line 157 of file igmp_common.c.

◆ igmpTick()

void igmpTick ( NetInterface interface)

IGMP timer handler.

This routine must be periodically called by the TCP/IP stack to handle IGMP related timers

Parameters
[in]interfaceUnderlying network interface

Definition at line 107 of file igmp_common.c.

Variable Documentation

◆ igmpTickCounter

systime_t igmpTickCounter

Definition at line 63 of file igmp_common.c.