mikroSDK Reference Manual
mld.h
Go to the documentation of this file.
1
31#ifndef _MLD_H
32#define _MLD_H
33
34//Dependencies
35#include "core/net.h"
36
37//MLD support
38#ifndef MLD_SUPPORT
39 #define MLD_SUPPORT DISABLED
40#elif (MLD_SUPPORT != ENABLED && MLD_SUPPORT != DISABLED)
41 #error MLD_SUPPORT parameter is not valid
42#endif
43
44//MLD tick interval
45#ifndef MLD_TICK_INTERVAL
46 #define MLD_TICK_INTERVAL 1000
47#elif (MLD_TICK_INTERVAL < 10)
48 #error MLD_TICK_INTERVAL parameter is not valid
49#endif
50
51//Unsolicited report interval
52#ifndef MLD_UNSOLICITED_REPORT_INTERVAL
53 #define MLD_UNSOLICITED_REPORT_INTERVAL 10000
54#elif (MLD_UNSOLICITED_REPORT_INTERVAL < 1000)
55 #error MLD_UNSOLICITED_REPORT_INTERVAL parameter is not valid
56#endif
57
58//Hop Limit used by MLD messages
59#define MLD_HOP_LIMIT 1
60
61//C++ guard
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66
71typedef enum
72{
73 MLD_STATE_NON_LISTENER = 0,
74 MLD_STATE_DELAYING_LISTENER = 1,
75 MLD_STATE_IDLE_LISTENER = 2
76} MldState;
77
78
79//CodeWarrior or Win32 compiler?
80#if defined(__CWCC__) || defined(_WIN32)
81 #pragma pack(push, 1)
82#endif
83
84
90{
91 uint8_t type; //0
92 uint8_t code; //1
93 uint16_t checksum; //2-3
94 uint16_t maxRespDelay; //4-5
95 uint16_t reserved; //6-7
96 Ipv6Addr multicastAddr; //8-23
97} MldMessage;
98
99
100//CodeWarrior or Win32 compiler?
101#if defined(__CWCC__) || defined(_WIN32)
102 #pragma pack(pop)
103#endif
104
105//Tick counter to handle periodic operations
106extern systime_t mldTickCounter;
107
108//MLD related functions
109error_t mldInit(NetInterface *interface);
110error_t mldStartListening(NetInterface *interface, Ipv6FilterEntry *entry);
111error_t mldStopListening(NetInterface *interface, Ipv6FilterEntry *entry);
112
113void mldTick(NetInterface *interface);
114void mldLinkChangeEvent(NetInterface *interface);
115
116void mldProcessListenerQuery(NetInterface *interface,
117 const Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer,
118 size_t offset, uint8_t hopLimit);
119
120void mldProcessListenerReport(NetInterface *interface,
121 const Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer,
122 size_t offset, uint8_t hopLimit);
123
124error_t mldSendListenerReport(NetInterface *interface, Ipv6Addr *ipAddr);
125error_t mldSendListenerDone(NetInterface *interface, Ipv6Addr *ipAddr);
126
127void mldDumpMessage(const MldMessage *message);
128
129//C++ guard
130#ifdef __cplusplus
131}
132#endif
133
134#endif
error_t
Error codes.
Definition error.h:43
typedef __packed_struct
MLD message.
Definition mld.h:90
MldState
MLD node states.
Definition mld.h:72
TCP/IP stack core.
uint32_t systime_t
System time.
Definition os_port_none.h:90
IPv6 multicast filter entry.
Definition ipv6.h:444
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89