igmp.h File Reference

IGMP (Internet Group Management Protocol) More...

#include "core/net.h"

Go to the source code of this file.

Macros

#define IGMP_SUPPORT   DISABLED
 
#define IGMP_TICK_INTERVAL   1000
 
#define IGMP_UNSOLICITED_REPORT_INTERVAL   10000
 
#define IGMP_V1_MAX_RESPONSE_TIME   10000
 
#define IGMP_V1_ROUTER_PRESENT_TIMEOUT   400000
 
#define IGMP_TTL   1
 
#define IGMP_ALL_SYSTEMS_ADDR   IPV4_ADDR(224, 0, 0, 1)
 
#define IGMP_ALL_ROUTERS_ADDR   IPV4_ADDR(224, 0, 0, 2)
 

Typedefs

struct {
   uint8_t   type
 
   uint8_t   maxRespTime
 
   uint16_t   checksum
 
   Ipv4Addr   groupAddr
 
IgmpMessage
 General IGMP message format. More...
 

Enumerations

enum  IgmpState { IGMP_STATE_NON_MEMBER = 0, IGMP_STATE_DELAYING_MEMBER = 1, IGMP_STATE_IDLE_MEMBER = 2 }
 IGMP host states. More...
 
enum  IgmpType {
  IGMP_TYPE_MEMBERSHIP_QUERY = 0x11, IGMP_TYPE_MEMBERSHIP_REPORT_V1 = 0x12, IGMP_TYPE_MEMBERSHIP_REPORT_V2 = 0x16, IGMP_TYPE_LEAVE_GROUP = 0x17,
  IGMP_TYPE_MEMBERSHIP_REPORT_V3 = 0x22
}
 IGMP message type. More...
 

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.

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

Definition in file igmp.h.

Macro Definition Documentation

◆ IGMP_ALL_ROUTERS_ADDR

#define IGMP_ALL_ROUTERS_ADDR   IPV4_ADDR(224, 0, 0, 2)

Definition at line 76 of file igmp.h.

◆ IGMP_ALL_SYSTEMS_ADDR

#define IGMP_ALL_SYSTEMS_ADDR   IPV4_ADDR(224, 0, 0, 1)

Definition at line 74 of file igmp.h.

◆ IGMP_SUPPORT

#define IGMP_SUPPORT   DISABLED

Definition at line 37 of file igmp.h.

◆ IGMP_TICK_INTERVAL

#define IGMP_TICK_INTERVAL   1000

Definition at line 44 of file igmp.h.

◆ IGMP_TTL

#define IGMP_TTL   1

Definition at line 71 of file igmp.h.

◆ IGMP_UNSOLICITED_REPORT_INTERVAL

#define IGMP_UNSOLICITED_REPORT_INTERVAL   10000

Definition at line 51 of file igmp.h.

◆ IGMP_V1_MAX_RESPONSE_TIME

#define IGMP_V1_MAX_RESPONSE_TIME   10000

Definition at line 58 of file igmp.h.

◆ IGMP_V1_ROUTER_PRESENT_TIMEOUT

#define IGMP_V1_ROUTER_PRESENT_TIMEOUT   400000

Definition at line 65 of file igmp.h.

Typedef Documentation

◆ IgmpMessage

typedef { ... } IgmpMessage

General IGMP message format.

Enumeration Type Documentation

◆ IgmpState

enum IgmpState

IGMP host states.

Enumerator
IGMP_STATE_NON_MEMBER 
IGMP_STATE_DELAYING_MEMBER 
IGMP_STATE_IDLE_MEMBER 

Definition at line 88 of file igmp.h.

◆ IgmpType

enum IgmpType

IGMP message type.

Enumerator
IGMP_TYPE_MEMBERSHIP_QUERY 
IGMP_TYPE_MEMBERSHIP_REPORT_V1 
IGMP_TYPE_MEMBERSHIP_REPORT_V2 
IGMP_TYPE_LEAVE_GROUP 
IGMP_TYPE_MEMBERSHIP_REPORT_V3 

Definition at line 100 of file igmp.h.

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

◆ checksum

uint16_t checksum

Definition at line 124 of file igmp.h.

◆ groupAddr

Ipv4Addr groupAddr

Definition at line 125 of file igmp.h.

◆ igmpTickCounter

systime_t igmpTickCounter

Definition at line 51 of file igmp.c.

◆ maxRespTime

uint8_t maxRespTime

Definition at line 123 of file igmp.h.

◆ type

uint8_t type

Definition at line 122 of file igmp.h.