38#ifndef IGMP_TICK_INTERVAL
39 #define IGMP_TICK_INTERVAL 1000
40#elif (IGMP_TICK_INTERVAL < 10)
41 #error IGMP_TICK_INTERVAL parameter is not valid
45#ifndef IGMP_ROBUSTNESS_VARIABLE
46 #define IGMP_ROBUSTNESS_VARIABLE 2
47#elif (IGMP_ROBUSTNESS_VARIABLE < 1)
48 #error IGMP_ROBUSTNESS_VARIABLE parameter is not valid
52#ifndef IGMP_QUERY_INTERVAL
53 #define IGMP_QUERY_INTERVAL 125000
54#elif (IGMP_QUERY_INTERVAL < 1000)
55 #error IGMP_QUERY_INTERVAL parameter is not valid
59#ifndef IGMP_QUERY_RESPONSE_INTERVAL
60 #define IGMP_QUERY_RESPONSE_INTERVAL 10000
61#elif (IGMP_QUERY_RESPONSE_INTERVAL < 1000 || IGMP_QUERY_RESPONSE_INTERVAL > IGMP_QUERY_INTERVAL)
62 #error IGMP_QUERY_RESPONSE_INTERVAL parameter is not valid
66#define IGMP_GROUP_MEMBERSHIP_INTERVAL ((IGMP_ROBUSTNESS_VARIABLE * \
67 IGMP_QUERY_INTERVAL) + IGMP_QUERY_RESPONSE_INTERVAL)
70#define IGMP_OTHER_QUERIER_PRESENT_INTERVAL ((IGMP_ROBUSTNESS_VARIABLE * \
71 IGMP_QUERY_INTERVAL) + (IGMP_QUERY_RESPONSE_INTERVAL / 2))
74#ifndef IGMP_STARTUP_QUERY_INTERVAL
75 #define IGMP_STARTUP_QUERY_INTERVAL (IGMP_QUERY_INTERVAL / 4)
76#elif (IGMP_STARTUP_QUERY_INTERVAL < 1000)
77 #error IGMP_STARTUP_QUERY_INTERVAL parameter is not valid
81#ifndef IGMP_STARTUP_QUERY_COUNT
82 #define IGMP_STARTUP_QUERY_COUNT IGMP_ROBUSTNESS_VARIABLE
83#elif (IGMP_STARTUP_QUERY_COUNT < 1)
84 #error IGMP_STARTUP_QUERY_COUNT parameter is not valid
88#ifndef IGMP_LAST_MEMBER_QUERY_INTERVAL
89 #define IGMP_LAST_MEMBER_QUERY_INTERVAL 1000
90#elif (IGMP_LAST_MEMBER_QUERY_INTERVAL < 100)
91 #error IGMP_LAST_MEMBER_QUERY_INTERVAL parameter is not valid
95#ifndef IGMP_LAST_MEMBER_QUERY_COUNT
96 #define IGMP_LAST_MEMBER_QUERY_COUNT IGMP_ROBUSTNESS_VARIABLE
97#elif (IGMP_LAST_MEMBER_QUERY_COUNT < 1)
98 #error IGMP_LAST_MEMBER_QUERY_COUNT parameter is not valid
102#define IGMP_LAST_MEMBER_QUERY_TIME (IGMP_LAST_MEMBER_QUERY_COUNT * \
103 IGMP_LAST_MEMBER_QUERY_INTERVAL)
106#ifndef IGMP_UNSOLICITED_REPORT_INTERVAL
107 #define IGMP_UNSOLICITED_REPORT_INTERVAL 10000
108#elif (IGMP_UNSOLICITED_REPORT_INTERVAL < 1000)
109 #error IGMP_UNSOLICITED_REPORT_INTERVAL parameter is not valid
113#ifndef IGMP_V1_ROUTER_PRESENT_TIMEOUT
114 #define IGMP_V1_ROUTER_PRESENT_TIMEOUT 400000
115#elif (IGMP_V1_ROUTER_PRESENT_TIMEOUT < 1000)
116 #error IGMP_V1_ROUTER_PRESENT_TIMEOUT parameter is not valid
120#ifndef IGMP_V1_MAX_RESPONSE_TIME
121 #define IGMP_V1_MAX_RESPONSE_TIME 10000
122#elif (IGMP_V1_MAX_RESPONSE_TIME < 1000)
123 #error IGMP_V1_MAX_RESPONSE_TIME parameter is not valid
130#define IGMP_ALL_SYSTEMS_ADDR IPV4_ADDR(224, 0, 0, 1)
132#define IGMP_ALL_ROUTERS_ADDR IPV4_ADDR(224, 0, 0, 2)
146 IGMP_TYPE_MEMBERSHIP_QUERY = 0x11,
147 IGMP_TYPE_MEMBERSHIP_REPORT_V1 = 0x12,
148 IGMP_TYPE_MEMBERSHIP_REPORT_V2 = 0x16,
149 IGMP_TYPE_LEAVE_GROUP = 0x17,
150 IGMP_TYPE_MEMBERSHIP_REPORT_V3 = 0x22
155#if defined(__CWCC__) || defined(_WIN32)
156 #pragma pack(push, 1)
174#if defined(__CWCC__) || defined(_WIN32)
182error_t igmpInit(NetInterface *interface);
183void igmpTick(NetInterface *interface);
184void igmpLinkChangeEvent(NetInterface *interface);
187 const IgmpMessage *message,
size_t length);
189void igmpProcessMessage(NetInterface *interface,
190 const Ipv4PseudoHeader *pseudoHeader,
const NetBuffer *buffer,
191 size_t offset,
const NetRxAncillary *ancillary);
193void igmpDumpMessage(
const IgmpMessage *message);
error_t
Error codes.
Definition error.h:43
IgmpType
IGMP message type.
Definition igmp_common.h:145
typedef __packed_struct
General IGMP message format.
Definition igmp_common.h:165
uint32_t Ipv4Addr
IPv4 network address.
Definition ipv4.h:267
uint32_t systime_t
System time.
Definition os_port_none.h:90
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89