Go to the documentation of this file.
31 #ifndef _IGMP_COMMON_H
32 #define _IGMP_COMMON_H
38 #ifndef IGMP_TICK_INTERVAL
39 #define IGMP_TICK_INTERVAL 200
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_OLDER_VERSION_QUERIER_PRESENT_TIMEOUT
114 #define IGMP_OLDER_VERSION_QUERIER_PRESENT_TIMEOUT 400000
115 #elif (IGMP_OLDER_VERSION_QUERIER_PRESENT_TIMEOUT < 1000)
116 #error IGMP_OLDER_VERSION_QUERIER_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
127 #ifndef IGMP_V3_UNSOLICITED_REPORT_INTERVAL
128 #define IGMP_V3_UNSOLICITED_REPORT_INTERVAL 1000
129 #elif (IGMP_V3_UNSOLICITED_REPORT_INTERVAL < 1000)
130 #error IGMP_V3_UNSOLICITED_REPORT_INTERVAL parameter is not valid
134 #ifndef IGMP_MAX_MSG_SIZE
135 #define IGMP_MAX_MSG_SIZE 1024
136 #elif (IGMP_MAX_MSG_SIZE < 1)
137 #error IGMP_MAX_MSG_SIZE parameter is not valid
144 #define IGMP_ALL_SYSTEMS_ADDR IPV4_ADDR(224, 0, 0, 1)
146 #define IGMP_ALL_ROUTERS_ADDR IPV4_ADDR(224, 0, 0, 2)
148 #define IGMP_V3_ALL_ROUTERS_ADDR IPV4_ADDR(224, 0, 0, 22)
198 #if defined(__CCRX__)
200 #elif defined(__CWCC__) || defined(_WIN32)
201 #pragma pack(push, 1)
228 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
273 #if defined(__CCRX__)
275 #elif defined(__CWCC__) || defined(_WIN32)
void igmpLinkChangeEvent(NetInterface *interface)
Callback function for link change event.
IgmpVersion
IGMP versions.
Structure describing a buffer that spans multiple chunks.
IgmpGroupRecordType
IGMPv3 group record types.
error_t igmpInit(NetInterface *interface)
IGMP initialization.
@ IGMP_TYPE_MEMBERSHIP_REPORT_V2
error_t igmpSendMessage(NetInterface *interface, Ipv4Addr destAddr, NetBuffer *buffer, size_t offset)
Send IGMP message.
uint32_t Ipv4Addr
IPv4 network address.
@ IGMP_TYPE_MEMBERSHIP_REPORT_V1
@ IGMP_TYPE_MEMBERSHIP_QUERY
void igmpProcessMessage(NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary)
Process incoming IGMP message.
systime_t igmpGetRandomDelay(systime_t maxDelay)
Generate a random delay.
uint16_t numOfGroupRecords
@ IGMP_GROUP_RECORD_TYPE_BLOCK
void igmpTick(NetInterface *interface)
IGMP timer handler.
@ IGMP_GROUP_RECORD_TYPE_ALLOW
@ IGMP_TYPE_MEMBERSHIP_REPORT_V3
typedef __packed_struct
IGMP message.
@ IGMP_GROUP_RECORD_TYPE_IS_EX
uint32_t systime_t
System time.
@ IGMP_GROUP_RECORD_TYPE_TO_EX
IgmpType
IGMP message types.
uint32_t igmpDecodeFloatingPointValue(uint8_t code)
Decode a floating-point value.
@ IGMP_GROUP_RECORD_TYPE_IS_IN
@ IGMP_GROUP_RECORD_TYPE_TO_IN
systime_t igmpTickCounter