mld.h File Reference

MLD (Multicast Listener Discovery for IPv6) More...

#include "core/net.h"

Go to the source code of this file.

Macros

#define MLD_SUPPORT   DISABLED
 
#define MLD_TICK_INTERVAL   1000
 
#define MLD_UNSOLICITED_REPORT_INTERVAL   10000
 
#define MLD_HOP_LIMIT   1
 

Typedefs

struct {
   uint8_t   type
 
   uint8_t   code
 
   uint16_t   checksum
 
   uint16_t   maxRespDelay
 
   uint16_t   reserved
 
   Ipv6Addr   multicastAddr
 
MldMessage
 MLD message. More...
 

Enumerations

enum  MldState { MLD_STATE_NON_LISTENER = 0, MLD_STATE_DELAYING_LISTENER = 1, MLD_STATE_IDLE_LISTENER = 2 }
 MLD node states. More...
 

Functions

error_t mldInit (NetInterface *interface)
 MLD initialization. More...
 
error_t mldStartListening (NetInterface *interface, Ipv6FilterEntry *entry)
 Start listening to the address on the interface. More...
 
error_t mldStopListening (NetInterface *interface, Ipv6FilterEntry *entry)
 Stop listening to the address on the interface. More...
 
void mldTick (NetInterface *interface)
 MLD timer handler. More...
 
void mldLinkChangeEvent (NetInterface *interface)
 Callback function for link change event. More...
 
void mldProcessListenerQuery (NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
 Process incoming Multicast Listener Query message. More...
 
void mldProcessListenerReport (NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
 Process incoming Multicast Listener Report message. More...
 
error_t mldSendListenerReport (NetInterface *interface, Ipv6Addr *ipAddr)
 Send Multicast Listener Report message. More...
 
error_t mldSendListenerDone (NetInterface *interface, Ipv6Addr *ipAddr)
 Send Multicast Listener Done message. More...
 
uint32_t mldRand (uint32_t max)
 Get a random value in the specified range. More...
 
void mldDumpMessage (const MldMessage *message)
 Dump MLD message for debugging purpose. More...
 

Variables

systime_t mldTickCounter
 

Detailed Description

MLD (Multicast Listener Discovery for IPv6)

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 mld.h.

Macro Definition Documentation

◆ MLD_HOP_LIMIT

#define MLD_HOP_LIMIT   1

Definition at line 57 of file mld.h.

◆ MLD_SUPPORT

#define MLD_SUPPORT   DISABLED

Definition at line 37 of file mld.h.

◆ MLD_TICK_INTERVAL

#define MLD_TICK_INTERVAL   1000

Definition at line 44 of file mld.h.

◆ MLD_UNSOLICITED_REPORT_INTERVAL

#define MLD_UNSOLICITED_REPORT_INTERVAL   10000

Definition at line 51 of file mld.h.

Typedef Documentation

◆ MldMessage

typedef { ... } MldMessage

MLD message.

Enumeration Type Documentation

◆ MldState

enum MldState

MLD node states.

Enumerator
MLD_STATE_NON_LISTENER 
MLD_STATE_DELAYING_LISTENER 
MLD_STATE_IDLE_LISTENER 

Definition at line 69 of file mld.h.

Function Documentation

◆ mldDumpMessage()

void mldDumpMessage ( const MldMessage message)

Dump MLD message for debugging purpose.

Parameters
[in]messagePointer to the MLD message

Definition at line 595 of file mld.c.

◆ mldInit()

error_t mldInit ( NetInterface interface)

MLD initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 63 of file mld.c.

◆ mldLinkChangeEvent()

void mldLinkChangeEvent ( NetInterface interface)

Callback function for link change event.

Parameters
[in]interfaceUnderlying network interface

Definition at line 196 of file mld.c.

◆ mldProcessListenerQuery()

void mldProcessListenerQuery ( NetInterface interface,
Ipv6PseudoHeader pseudoHeader,
const NetBuffer buffer,
size_t  offset,
uint8_t  hopLimit 
)

Process incoming Multicast Listener Query message.

Parameters
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the incoming MLD message
[in]offsetOffset to the first byte of the MLD message
[in]hopLimitHop Limit field from IPv6 header

Definition at line 266 of file mld.c.

◆ mldProcessListenerReport()

void mldProcessListenerReport ( NetInterface interface,
Ipv6PseudoHeader pseudoHeader,
const NetBuffer buffer,
size_t  offset,
uint8_t  hopLimit 
)

Process incoming Multicast Listener Report message.

Parameters
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the incoming MLD message
[in]offsetOffset to the first byte of the MLD message
[in]hopLimitHop Limit field from IPv6 header

Definition at line 369 of file mld.c.

◆ mldRand()

uint32_t mldRand ( 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 583 of file mld.c.

◆ mldSendListenerDone()

error_t mldSendListenerDone ( NetInterface interface,
Ipv6Addr ipAddr 
)

Send Multicast Listener Done message.

Parameters
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address specifying the multicast address being left
Returns
Error code

Definition at line 510 of file mld.c.

◆ mldSendListenerReport()

error_t mldSendListenerReport ( NetInterface interface,
Ipv6Addr ipAddr 
)

Send Multicast Listener Report message.

Parameters
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address specifying the multicast address
Returns
Error code

Definition at line 436 of file mld.c.

◆ mldStartListening()

error_t mldStartListening ( NetInterface interface,
Ipv6FilterEntry entry 
)

Start listening to the address on the interface.

Parameters
[in]interfaceUnderlying network interface
[in]entryIPv6 filter entry identifying the address to listen to
Returns
Error code

Definition at line 77 of file mld.c.

◆ mldStopListening()

error_t mldStopListening ( NetInterface interface,
Ipv6FilterEntry entry 
)

Stop listening to the address on the interface.

Parameters
[in]interfaceUnderlying network interface
[in]entryIPv6 filter entry identifying the multicast address to leave
Returns
Error code

Definition at line 126 of file mld.c.

◆ mldTick()

void mldTick ( NetInterface interface)

MLD timer handler.

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

Parameters
[in]interfaceUnderlying network interface

Definition at line 153 of file mld.c.

Variable Documentation

◆ checksum

uint16_t checksum

Definition at line 91 of file mld.h.

◆ code

uint8_t code

Definition at line 90 of file mld.h.

◆ maxRespDelay

uint16_t maxRespDelay

Definition at line 92 of file mld.h.

◆ mldTickCounter

systime_t mldTickCounter

Definition at line 54 of file mld.c.

◆ multicastAddr

Ipv6Addr multicastAddr

Definition at line 94 of file mld.h.

◆ reserved

uint16_t reserved

Definition at line 93 of file mld.h.

◆ type

uint8_t type

Definition at line 89 of file mld.h.