igmp.c File Reference

IGMP (Internet Group Management Protocol) More...

#include "core/net.h"
#include "core/ip.h"
#include "ipv4/ipv4.h"
#include "ipv4/igmp.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...
 
error_t igmpJoinGroup (NetInterface *interface, Ipv4FilterEntry *entry)
 Join the specified host group. More...
 
error_t igmpLeaveGroup (NetInterface *interface, Ipv4FilterEntry *entry)
 Leave the specified host group. More...
 
void igmpTick (NetInterface *interface)
 IGMP timer handler. More...
 
void igmpLinkChangeEvent (NetInterface *interface)
 Callback function for link change event. More...
 
void igmpProcessMessage (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Process incoming IGMP message. More...
 
void igmpProcessQueryMessage (NetInterface *interface, const IgmpMessage *message, size_t length)
 Process incoming Membership Query message. More...
 
void igmpProcessReportMessage (NetInterface *interface, const IgmpMessage *message, size_t length)
 Process incoming Membership Report message. More...
 
error_t igmpSendReportMessage (NetInterface *interface, Ipv4Addr ipAddr)
 Send Membership Report message. More...
 
error_t igmpSendLeaveGroupMessage (NetInterface *interface, Ipv4Addr ipAddr)
 Send Leave Group message. More...
 
uint32_t igmpRand (uint32_t max)
 Get a random value in the specified range. More...
 
void igmpDumpMessage (const IgmpMessage *message)
 Dump IGMP message for debugging purpose. More...
 

Variables

systime_t igmpTickCounter
 

Detailed Description

IGMP (Internet Group Management Protocol)

License

Copyright (C) 2010-2018 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 routers. Refer 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
Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file igmp.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   IGMP_TRACE_LEVEL

Definition at line 38 of file igmp.c.

Function Documentation

◆ igmpDumpMessage()

void igmpDumpMessage ( const IgmpMessage message)

Dump IGMP message for debugging purpose.

Parameters
[in]messagePointer to the IGMP message

Definition at line 623 of file igmp.c.

◆ igmpInit()

error_t igmpInit ( NetInterface interface)

IGMP initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 60 of file igmp.c.

◆ igmpJoinGroup()

error_t igmpJoinGroup ( NetInterface interface,
Ipv4FilterEntry entry 
)

Join the specified host group.

Parameters
[in]interfaceUnderlying network interface
[in]entryIPv4 filter entry identifying the host group to join
Returns
Error code

Definition at line 81 of file igmp.c.

◆ igmpLeaveGroup()

error_t igmpLeaveGroup ( NetInterface interface,
Ipv4FilterEntry entry 
)

Leave the specified host group.

Parameters
[in]interfaceUnderlying network interface
[in]entryIPv4 filter entry identifying the host group to leave
Returns
Error code

Definition at line 131 of file igmp.c.

◆ igmpLinkChangeEvent()

void igmpLinkChangeEvent ( NetInterface interface)

Callback function for link change event.

Parameters
[in]interfaceUnderlying network interface

Definition at line 205 of file igmp.c.

◆ igmpProcessMessage()

void igmpProcessMessage ( NetInterface interface,
const NetBuffer buffer,
size_t  offset 
)

Process incoming IGMP message.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the incoming IGMP message
[in]offsetOffset to the first byte of the IGMP message

Definition at line 278 of file igmp.c.

◆ igmpProcessQueryMessage()

void igmpProcessQueryMessage ( NetInterface interface,
const IgmpMessage message,
size_t  length 
)

Process incoming Membership Query message.

Parameters
[in]interfaceUnderlying network interface
[in]messageIncoming Membership Query message
[in]lengthMessage length

Definition at line 347 of file igmp.c.

◆ igmpProcessReportMessage()

void igmpProcessReportMessage ( NetInterface interface,
const IgmpMessage message,
size_t  length 
)

Process incoming Membership Report message.

Parameters
[in]interfaceUnderlying network interface
[in]messageIncoming Membership Report message
[in]lengthMessage length

Definition at line 434 of file igmp.c.

◆ igmpRand()

uint32_t igmpRand ( uint32_t  max)

Get a random value in the specified range.

Parameters
[in]maxUpper bound
Returns
Random value in the specified range

Definition at line 611 of file igmp.c.

◆ igmpSendLeaveGroupMessage()

error_t igmpSendLeaveGroupMessage ( NetInterface interface,
Ipv4Addr  ipAddr 
)

Send Leave Group message.

Parameters
[in]interfaceUnderlying network interface
[in]ipAddrIPv4 address specifying the group address being left
Returns
Error code

Definition at line 543 of file igmp.c.

◆ igmpSendReportMessage()

error_t igmpSendReportMessage ( NetInterface interface,
Ipv4Addr  ipAddr 
)

Send Membership Report message.

Parameters
[in]interfaceUnderlying network interface
[in]ipAddrIPv4 address specifying the group address
Returns
Error code

Definition at line 474 of file igmp.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 158 of file igmp.c.

Variable Documentation

◆ igmpTickCounter

systime_t igmpTickCounter

Definition at line 51 of file igmp.c.