mld.c
Go to the documentation of this file.
1 /**
2  * @file mld.c
3  * @brief MLD (Multicast Listener Discovery for IPv6)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2023 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @section Description
28  *
29  * MLD is used by an IPv6 router to discover the presence of multicast
30  * listeners on its directly attached links, and to discover specifically
31  * which multicast addresses are of interest to those neighboring nodes.
32  * Refer to the following RFCs for complete details:
33  * - RFC 2710: Multicast Listener Discovery (MLD) for IPv6
34  * - RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6
35  *
36  * @author Oryx Embedded SARL (www.oryx-embedded.com)
37  * @version 2.2.4
38  **/
39 
40 //Switch to the appropriate trace level
41 #define TRACE_LEVEL MLD_TRACE_LEVEL
42 
43 //Dependencies
44 #include "core/net.h"
45 #include "core/ip.h"
46 #include "ipv6/ipv6.h"
47 #include "ipv6/icmpv6.h"
48 #include "ipv6/mld.h"
49 #include "mibs/ip_mib_module.h"
50 #include "debug.h"
51 
52 //Check TCP/IP stack configuration
53 #if (IPV6_SUPPORT == ENABLED && MLD_SUPPORT == ENABLED)
54 
55 //Tick counter to handle periodic operations
57 
58 
59 /**
60  * @brief MLD initialization
61  * @param[in] interface Underlying network interface
62  * @return Error code
63  **/
64 
66 {
67  //Successful initialization
68  return NO_ERROR;
69 }
70 
71 
72 /**
73  * @brief Start listening to the address on the interface
74  * @param[in] interface Underlying network interface
75  * @param[in] entry IPv6 filter entry identifying the address to listen to
76  * @return Error code
77  **/
78 
80 {
81  //The link-scope all-nodes address (FF02::1) is handled as a special
82  //case. The host starts in Idle Listener state for that address on
83  //every interface and never transitions to another state
85  {
86  //Clear flag
87  entry->flag = FALSE;
88  //Enter the Idle Listener state
90  }
91  else
92  {
93  //Link is up?
94  if(interface->linkState)
95  {
96  //Send a Multicast Listener Report message for the group on the interface
97  mldSendListenerReport(interface, &entry->addr);
98 
99  //Set flag
100  entry->flag = TRUE;
101  //Start timer
103  //Enter the Delaying Listener state
105  }
106  //Link is down?
107  else
108  {
109  //Clear flag
110  entry->flag = FALSE;
111  //Enter the Idle Listener state
113  }
114  }
115 
116  //Successful processing
117  return NO_ERROR;
118 }
119 
120 
121 /**
122  * @brief Stop listening to the address on the interface
123  * @param[in] interface Underlying network interface
124  * @param[in] entry IPv6 filter entry identifying the multicast address to leave
125  * @return Error code
126  **/
127 
129 {
130  //Check link state
131  if(interface->linkState)
132  {
133  //Send a Multicast Listener Done message if the flag is set
134  if(entry->flag)
135  mldSendListenerDone(interface, &entry->addr);
136  }
137 
138  //Switch to the Non-Listener state
139  entry->state = MLD_STATE_NON_LISTENER;
140 
141  //Successful processing
142  return NO_ERROR;
143 }
144 
145 
146 /**
147  * @brief MLD timer handler
148  *
149  * This routine must be periodically called by the TCP/IP stack to
150  * handle MLD related timers
151  *
152  * @param[in] interface Underlying network interface
153  **/
154 
155 void mldTick(NetInterface *interface)
156 {
157  uint_t i;
158  systime_t time;
159  Ipv6FilterEntry *entry;
160 
161  //Get current time
162  time = osGetSystemTime();
163 
164  //Go through the multicast filter table
165  for(i = 0; i < IPV6_MULTICAST_FILTER_SIZE; i++)
166  {
167  //Point to the current entry
168  entry = &interface->ipv6Context.multicastFilter[i];
169 
170  //Valid entry?
171  if(entry->refCount > 0)
172  {
173  //Delaying Listener state?
174  if(entry->state == MLD_STATE_DELAYING_LISTENER)
175  {
176  //Timer expired?
177  if(timeCompare(time, entry->timer) >= 0)
178  {
179  //Send a Multicast Listener Report message
180  mldSendListenerReport(interface, &entry->addr);
181 
182  //Set flag
183  entry->flag = TRUE;
184  //Switch to the Idle Listener state
186  }
187  }
188  }
189  }
190 }
191 
192 
193 /**
194  * @brief Callback function for link change event
195  * @param[in] interface Underlying network interface
196  **/
197 
199 {
200  uint_t i;
201  systime_t time;
202  Ipv6FilterEntry *entry;
203 
204  //Get current time
205  time = osGetSystemTime();
206 
207  //Link up event?
208  if(interface->linkState)
209  {
210  //Go through the multicast filter table
211  for(i = 0; i < IPV6_MULTICAST_FILTER_SIZE; i++)
212  {
213  //Point to the current entry
214  entry = &interface->ipv6Context.multicastFilter[i];
215 
216  //Valid entry?
217  if(entry->refCount > 0)
218  {
219  //The link-scope all-nodes address (FF02::1) is handled as a special
220  //case. The host starts in Idle Listener state for that address on
221  //every interface and never transitions to another state
223  {
224  //Send an unsolicited Multicast Listener Report message for that group
225  mldSendListenerReport(interface, &entry->addr);
226 
227  //Set flag
228  entry->flag = TRUE;
229  //Start timer
231  //Enter the Delaying Listener state
233  }
234  }
235  }
236  }
237  //Link down event?
238  else
239  {
240  //Go through the multicast filter table
241  for(i = 0; i < IPV6_MULTICAST_FILTER_SIZE; i++)
242  {
243  //Point to the current entry
244  entry = &interface->ipv6Context.multicastFilter[i];
245 
246  //Valid entry?
247  if(entry->refCount > 0)
248  {
249  //Clear flag
250  entry->flag = FALSE;
251  //Enter the Idle Listener state
253  }
254  }
255  }
256 }
257 
258 
259 /**
260  * @brief Process incoming Multicast Listener Query message
261  * @param[in] interface Underlying network interface
262  * @param[in] pseudoHeader IPv6 pseudo header
263  * @param[in] buffer Multi-part buffer containing the incoming MLD message
264  * @param[in] offset Offset to the first byte of the MLD message
265  * @param[in] hopLimit Hop Limit field from IPv6 header
266  **/
267 
269  const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
270 {
271  uint_t i;
272  size_t length;
273  systime_t time;
276  Ipv6FilterEntry *entry;
277 
278  //Retrieve the length of the MLD message
279  length = netBufferGetLength(buffer) - offset;
280 
281  //The message must be at least 24 octets long
282  if(length < sizeof(MldMessage))
283  return;
284 
285  //Point to the beginning of the MLD message
286  message = netBufferAt(buffer, offset);
287  //Sanity check
288  if(message == NULL)
289  return;
290 
291  //Debug message
292  TRACE_INFO("MLD message received (%" PRIuSIZE " bytes)...\r\n", length);
293  //Dump message contents for debugging purpose
295 
296  //Make sure the source address of the message is a valid link-local address
297  if(!ipv6IsLinkLocalUnicastAddr(&pseudoHeader->srcAddr))
298  return;
299 
300  //Check the Hop Limit field
301  if(hopLimit != MLD_HOP_LIMIT)
302  return;
303 
304  //Get current time
305  time = osGetSystemTime();
306 
307  //The Max Resp Delay field specifies the maximum time allowed
308  //before sending a responding report
309  maxRespDelay = message->maxRespDelay * 10;
310 
311  //Go through the multicast filter table
312  for(i = 0; i < IPV6_MULTICAST_FILTER_SIZE; i++)
313  {
314  //Point to the current entry
315  entry = &interface->ipv6Context.multicastFilter[i];
316 
317  //Valid entry?
318  if(entry->refCount > 0)
319  {
320  //The link-scope all-nodes address (FF02::1) is handled as a special
321  //case. The host starts in Idle Listener state for that address on
322  //every interface and never transitions to another state
324  {
325  //A General Query is used to learn which multicast addresses have listeners
326  //on an attached link. A Multicast-Address-Specific Query is used to learn
327  //if a particular multicast address has any listeners on an attached link
328  if(ipv6CompAddr(&message->multicastAddr, &IPV6_UNSPECIFIED_ADDR) ||
329  ipv6CompAddr(&message->multicastAddr, &entry->addr))
330  {
331  //Delaying Listener state?
332  if(entry->state == MLD_STATE_DELAYING_LISTENER)
333  {
334  //The timer has not yet expired?
335  if(timeCompare(time, entry->timer) < 0)
336  {
337  //If a timer for the address is already running, it is reset to
338  //the new random value only if the requested Max Response Delay
339  //is less than the remaining value of the running timer
340  if(maxRespDelay < (entry->timer - time))
341  {
342  //Restart delay timer
344  }
345  }
346  }
347  //Idle Listener state?
348  else if(entry->state == MLD_STATE_IDLE_LISTENER)
349  {
350  //Switch to the Delaying Listener state
352  //Delay the response by a random amount of time
354  }
355  }
356  }
357  }
358  }
359 }
360 
361 
362 /**
363  * @brief Process incoming Multicast Listener Report message
364  * @param[in] interface Underlying network interface
365  * @param[in] pseudoHeader IPv6 pseudo header
366  * @param[in] buffer Multi-part buffer containing the incoming MLD message
367  * @param[in] offset Offset to the first byte of the MLD message
368  * @param[in] hopLimit Hop Limit field from IPv6 header
369  **/
370 
372  const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
373 {
374  uint_t i;
375  size_t length;
377  Ipv6FilterEntry *entry;
378 
379  //Retrieve the length of the MLD message
380  length = netBufferGetLength(buffer) - offset;
381 
382  //The message must be at least 24 octets long
383  if(length < sizeof(MldMessage))
384  return;
385 
386  //Point to the beginning of the MLD message
387  message = netBufferAt(buffer, offset);
388  //Sanity check
389  if(message == NULL)
390  return;
391 
392  //Debug message
393  TRACE_INFO("MLD message received (%" PRIuSIZE " bytes)...\r\n", length);
394  //Dump message contents for debugging purpose
396 
397  //Make sure the source address of the message is a valid link-local address
398  if(!ipv6IsLinkLocalUnicastAddr(&pseudoHeader->srcAddr))
399  return;
400  //Check the Hop Limit field
401  if(hopLimit != MLD_HOP_LIMIT)
402  return;
403 
404  //Go through the multicast filter table
405  for(i = 0; i < IPV6_MULTICAST_FILTER_SIZE; i++)
406  {
407  //Point to the current entry
408  entry = &interface->ipv6Context.multicastFilter[i];
409 
410  //Valid entry?
411  if(entry->refCount > 0)
412  {
413  //Report messages are ignored for multicast addresses
414  //in the Non-Listener or Idle Listener state
415  if(entry->state == MLD_STATE_DELAYING_LISTENER)
416  {
417  //The Multicast Listener Report message matches the current entry?
418  if(ipv6CompAddr(&message->multicastAddr, &entry->addr))
419  {
420  //Clear flag
421  entry->flag = FALSE;
422  //Switch to the Idle Listener state
424  }
425  }
426  }
427  }
428 }
429 
430 
431 /**
432  * @brief Send Multicast Listener Report message
433  * @param[in] interface Underlying network interface
434  * @param[in] ipAddr IPv6 address specifying the multicast address
435  * @return Error code
436  **/
437 
439 {
440  error_t error;
441  size_t offset;
443  NetBuffer *buffer;
444  Ipv6PseudoHeader pseudoHeader;
445  NetTxAncillary ancillary;
446 
447  //Make sure the specified address is a valid multicast address
449  return ERROR_INVALID_ADDRESS;
450 
451  //The link-scope all-nodes address (FF02::1) is handled as a special
452  //case. The host never sends a report for that address
454  return ERROR_INVALID_ADDRESS;
455 
456  //Allocate a memory buffer to hold a MLD message
457  buffer = ipAllocBuffer(sizeof(MldMessage), &offset);
458  //Failed to allocate memory?
459  if(buffer == NULL)
460  return ERROR_OUT_OF_MEMORY;
461 
462  //Point to the beginning of the MLD message
463  message = netBufferAt(buffer, offset);
464 
465  //Format the Multicast Listener Report message
467  message->code = 0;
468  message->checksum = 0;
469  message->maxRespDelay = 0;
470  message->reserved = 0;
471  message->multicastAddr = *ipAddr;
472 
473  //Format IPv6 pseudo header
474  pseudoHeader.srcAddr = interface->ipv6Context.addrList[0].addr;
475  pseudoHeader.destAddr = *ipAddr;
476  pseudoHeader.length = HTONS(sizeof(MldMessage));
477  pseudoHeader.reserved[0] = 0;
478  pseudoHeader.reserved[1] = 0;
479  pseudoHeader.reserved[2] = 0;
480  pseudoHeader.nextHeader = IPV6_ICMPV6_HEADER;
481 
482  //Message checksum calculation
483  message->checksum = ipCalcUpperLayerChecksumEx(&pseudoHeader,
484  sizeof(Ipv6PseudoHeader), buffer, offset, sizeof(MldMessage));
485 
486  //Total number of ICMP messages which this entity attempted to send
487  IP_MIB_INC_COUNTER32(icmpv6Stats.icmpStatsOutMsgs, 1);
488 
489  //Increment per-message type ICMP counter
490  IP_MIB_INC_COUNTER32(icmpv6MsgStatsTable.icmpMsgStatsOutPkts[
492 
493  //Debug message
494  TRACE_INFO("Sending MLD message (%" PRIuSIZE " bytes)...\r\n", sizeof(MldMessage));
495  //Dump message contents for debugging purpose
497 
498  //Additional options can be passed to the stack along with the packet
499  ancillary = NET_DEFAULT_TX_ANCILLARY;
500 
501  //All MLD messages must be sent with an IPv6 Hop Limit of 1 (refer to
502  //RFC 3810, section 5)
503  ancillary.ttl = MLD_HOP_LIMIT;
504 
505  //The Multicast Listener Report message is sent to the multicast address
506  //being reported
507  error = ipv6SendDatagram(interface, &pseudoHeader, buffer, offset,
508  &ancillary);
509 
510  //Free previously allocated memory
511  netBufferFree(buffer);
512  //Return status code
513  return error;
514 }
515 
516 
517 /**
518  * @brief Send Multicast Listener Done message
519  * @param[in] interface Underlying network interface
520  * @param[in] ipAddr IPv6 address specifying the multicast address being left
521  * @return Error code
522  **/
523 
525 {
526  error_t error;
527  size_t offset;
529  NetBuffer *buffer;
530  Ipv6PseudoHeader pseudoHeader;
531  NetTxAncillary ancillary;
532 
533  //Make sure the specified address is a valid multicast address
535  return ERROR_INVALID_ADDRESS;
536 
537  //The link-scope all-nodes address (FF02::1) is handled as a special
538  //case. The host never sends a report for that address
540  return ERROR_INVALID_ADDRESS;
541 
542  //Allocate a memory buffer to hold a MLD message
543  buffer = ipAllocBuffer(sizeof(MldMessage), &offset);
544  //Failed to allocate memory?
545  if(buffer == NULL)
546  return ERROR_OUT_OF_MEMORY;
547 
548  //Point to the beginning of the MLD message
549  message = netBufferAt(buffer, offset);
550 
551  //Format the Multicast Listener Done message
553  message->code = 0;
554  message->checksum = 0;
555  message->maxRespDelay = 0;
556  message->reserved = 0;
557  message->multicastAddr = *ipAddr;
558 
559  //Format IPv6 pseudo header
560  pseudoHeader.srcAddr = interface->ipv6Context.addrList[0].addr;
561  pseudoHeader.destAddr = IPV6_LINK_LOCAL_ALL_ROUTERS_ADDR;
562  pseudoHeader.length = HTONS(sizeof(MldMessage));
563  pseudoHeader.reserved[0] = 0;
564  pseudoHeader.reserved[1] = 0;
565  pseudoHeader.reserved[2] = 0;
566  pseudoHeader.nextHeader = IPV6_ICMPV6_HEADER;
567 
568  //Message checksum calculation
569  message->checksum = ipCalcUpperLayerChecksumEx(&pseudoHeader,
570  sizeof(Ipv6PseudoHeader), buffer, offset, sizeof(MldMessage));
571 
572  //Total number of ICMP messages which this entity attempted to send
573  IP_MIB_INC_COUNTER32(icmpv6Stats.icmpStatsOutMsgs, 1);
574 
575  //Increment per-message type ICMP counter
576  IP_MIB_INC_COUNTER32(icmpv6MsgStatsTable.icmpMsgStatsOutPkts[
578 
579  //Debug message
580  TRACE_INFO("Sending MLD message (%" PRIuSIZE " bytes)...\r\n", sizeof(MldMessage));
581  //Dump message contents for debugging purpose
583 
584  //Additional options can be passed to the stack along with the packet
585  ancillary = NET_DEFAULT_TX_ANCILLARY;
586 
587  //All MLD messages must be sent with an IPv6 Hop Limit of 1 (refer to
588  //RFC 3810, section 5)
589  ancillary.ttl = MLD_HOP_LIMIT;
590 
591  //The Multicast Listener Done message is sent to the all-routers multicast
592  //address
593  error = ipv6SendDatagram(interface, &pseudoHeader, buffer, offset,
594  &ancillary);
595 
596  //Free previously allocated memory
597  netBufferFree(buffer);
598  //Return status code
599  return error;
600 }
601 
602 
603 /**
604  * @brief Dump MLD message for debugging purpose
605  * @param[in] message Pointer to the MLD message
606  **/
607 
609 {
610  //Dump MLD message
611  TRACE_DEBUG(" Type = %" PRIu8 "\r\n", message->type);
612  TRACE_DEBUG(" Code = %" PRIu8 "\r\n", message->code);
613  TRACE_DEBUG(" Checksum = 0x%04" PRIX16 "\r\n", ntohs(message->checksum));
614  TRACE_DEBUG(" Max Resp Delay = %" PRIu16 "\r\n", message->maxRespDelay);
615  TRACE_DEBUG(" Multicast Address = %s\r\n", ipv6AddrToString(&message->multicastAddr, NULL));
616 }
617 
618 #endif
#define MLD_UNSOLICITED_REPORT_INTERVAL
Definition: mld.h:53
uint8_t length
Definition: coap_common.h:193
char_t * ipv6AddrToString(const Ipv6Addr *ipAddr, char_t *str)
Convert a binary IPv6 address to a string representation.
Definition: ipv6.c:2334
IPv6 (Internet Protocol Version 6)
@ MLD_STATE_IDLE_LISTENER
Definition: mld.h:75
NetBuffer * ipAllocBuffer(size_t length, size_t *offset)
Allocate a buffer to hold an IP packet.
Definition: ip.c:724
const NetTxAncillary NET_DEFAULT_TX_ANCILLARY
Definition: net_misc.c:71
uint16_t maxRespDelay
Definition: mld.h:94
#define IP_MIB_INC_COUNTER32(name, value)
Definition: ip_mib_module.h:46
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
#define TRUE
Definition: os_port.h:52
@ ERROR_OUT_OF_MEMORY
Definition: error.h:63
#define ipv6CompAddr(ipAddr1, ipAddr2)
Definition: ipv6.h:121
@ IPV6_ICMPV6_HEADER
Definition: ipv6.h:187
uint_t state
MLD node state.
Definition: ipv6.h:448
@ ICMPV6_TYPE_MULTICAST_LISTENER_REPORT_V1
Definition: icmpv6.h:60
#define timeCompare(t1, t2)
Definition: os_port.h:42
systime_t timer
Delay timer.
Definition: ipv6.h:450
void mldTick(NetInterface *interface)
MLD timer handler.
Definition: mld.c:155
#define ipv6IsMulticastAddr(ipAddr)
Definition: ipv6.h:133
#define FALSE
Definition: os_port.h:48
ICMPv6 (Internet Control Message Protocol Version 6)
error_t mldStartListening(NetInterface *interface, Ipv6FilterEntry *entry)
Start listening to the address on the interface.
Definition: mld.c:79
@ MLD_STATE_DELAYING_LISTENER
Definition: mld.h:74
uint32_t netGenerateRandRange(uint32_t min, uint32_t max)
Generate a random value in the specified range.
Definition: net_misc.c:900
error_t
Error codes.
Definition: error.h:43
error_t mldInit(NetInterface *interface)
MLD initialization.
Definition: mld.c:65
#define Ipv6PseudoHeader
Definition: ipv6.h:42
void * netBufferAt(const NetBuffer *buffer, size_t offset)
Returns a pointer to the data at the specified position.
Definition: net_mem.c:413
@ ERROR_INVALID_ADDRESS
Definition: error.h:103
const Ipv6Addr IPV6_LINK_LOCAL_ALL_NODES_ADDR
Definition: ipv6.c:74
#define NetInterface
Definition: net.h:36
void mldProcessListenerReport(NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
Process incoming Multicast Listener Report message.
Definition: mld.c:371
void netBufferFree(NetBuffer *buffer)
Dispose a multi-part buffer.
Definition: net_mem.c:282
#define NetTxAncillary
Definition: net_misc.h:36
#define IPV6_MULTICAST_FILTER_SIZE
Definition: ipv6.h:101
bool_t flag
MLD flag.
Definition: ipv6.h:449
const Ipv6Addr IPV6_UNSPECIFIED_ADDR
Definition: ipv6.c:66
void mldLinkChangeEvent(NetInterface *interface)
Callback function for link change event.
Definition: mld.c:198
uint_t refCount
Reference count for the current entry.
Definition: ipv6.h:447
#define TRACE_INFO(...)
Definition: debug.h:95
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
__start_packed struct @0 MldMessage
MLD message.
Ipv6Addr addr
Multicast address.
Definition: ipv6.h:446
#define ipv6IsLinkLocalUnicastAddr(ipAddr)
Definition: ipv6.h:125
error_t mldSendListenerReport(NetInterface *interface, Ipv6Addr *ipAddr)
Send Multicast Listener Report message.
Definition: mld.c:438
#define MLD_HOP_LIMIT
Definition: mld.h:59
uint32_t systime_t
System time.
#define ntohs(value)
Definition: cpu_endian.h:421
#define TRACE_DEBUG(...)
Definition: debug.h:107
systime_t mldTickCounter
Definition: mld.c:56
uint32_t time
error_t mldStopListening(NetInterface *interface, Ipv6FilterEntry *entry)
Stop listening to the address on the interface.
Definition: mld.c:128
uint16_t ipCalcUpperLayerChecksumEx(const void *pseudoHeader, size_t pseudoHeaderLen, const NetBuffer *buffer, size_t offset, size_t length)
Calculate IP upper-layer checksum over a multi-part buffer.
Definition: ip.c:699
IPv4 and IPv6 common routines.
#define HTONS(value)
Definition: cpu_endian.h:410
void mldProcessListenerQuery(NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
Process incoming Multicast Listener Query message.
Definition: mld.c:268
const Ipv6Addr IPV6_LINK_LOCAL_ALL_ROUTERS_ADDR
Definition: ipv6.c:78
IP MIB module.
uint8_t message[]
Definition: chap.h:152
void mldDumpMessage(const MldMessage *message)
Dump MLD message for debugging purpose.
Definition: mld.c:608
error_t ipv6SendDatagram(NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send an IPv6 datagram.
Definition: ipv6.c:1637
@ MLD_STATE_NON_LISTENER
Definition: mld.h:73
#define PRIuSIZE
unsigned int uint_t
Definition: compiler_port.h:50
TCP/IP stack core.
error_t mldSendListenerDone(NetInterface *interface, Ipv6Addr *ipAddr)
Send Multicast Listener Done message.
Definition: mld.c:524
__start_packed struct @0 Ipv6Addr
IPv6 network address.
uint8_t ipAddr[4]
Definition: mib_common.h:187
@ NO_ERROR
Success.
Definition: error.h:44
Debugging facilities.
IPv6 multicast filter entry.
Definition: ipv6.h:445
MLD (Multicast Listener Discovery for IPv6)
systime_t osGetSystemTime(void)
Retrieve system time.
@ ICMPV6_TYPE_MULTICAST_LISTENER_DONE_V1
Definition: icmpv6.h:61