Warning, cross-references for /kernel/include/lwip/igmp.h need to be fixed.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef __LWIP_IGMP_H__
0036 #define __LWIP_IGMP_H__
0037
0038 #include "lwip/opt.h"
0039 #include "lwip/ip_addr.h"
0040 #include "lwip/netif.h"
0041 #include "lwip/pbuf.h"
0042
0043 #if LWIP_IGMP
0044
0045 #ifdef __cplusplus
0046 extern "C" {
0047 #endif
0048
0049
0050
0051
0052 #define IP_PROTO_IGMP 2
0053 #define IGMP_TTL 1
0054 #define IGMP_MINLEN 8
0055 #define ROUTER_ALERT 0x9404
0056 #define ROUTER_ALERTLEN 4
0057
0058
0059
0060
0061 #define IGMP_MEMB_QUERY 0x11
0062 #define IGMP_V1_MEMB_REPORT 0x12
0063 #define IGMP_V2_MEMB_REPORT 0x16
0064 #define IGMP_LEAVE_GROUP 0x17
0065
0066
0067 #define IGMP_TMR_INTERVAL 100
0068 #define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL)
0069 #define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL)
0070
0071
0072 #define IGMP_DEL_MAC_FILTER 0
0073 #define IGMP_ADD_MAC_FILTER 1
0074
0075
0076 #define IGMP_GROUP_NON_MEMBER 0
0077 #define IGMP_GROUP_DELAYING_MEMBER 1
0078 #define IGMP_GROUP_IDLE_MEMBER 2
0079
0080
0081
0082
0083 #ifdef PACK_STRUCT_USE_INCLUDES
0084 # include "arch/bpstruct.h"
0085 #endif
0086 PACK_STRUCT_BEGIN
0087 struct igmp_msg {
0088 PACK_STRUCT_FIELD(u8_t igmp_msgtype);
0089 PACK_STRUCT_FIELD(u8_t igmp_maxresp);
0090 PACK_STRUCT_FIELD(u16_t igmp_checksum);
0091 PACK_STRUCT_FIELD(struct ip_addr igmp_group_address);
0092 } PACK_STRUCT_STRUCT;
0093 PACK_STRUCT_END
0094 #ifdef PACK_STRUCT_USE_INCLUDES
0095 # include "arch/epstruct.h"
0096 #endif
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110 struct igmp_group {
0111 struct igmp_group *next;
0112 struct netif *interface;
0113 struct ip_addr group_address;
0114 u8_t last_reporter_flag;
0115 u8_t group_state;
0116 u16_t timer;
0117 u8_t use;
0118 };
0119
0120
0121
0122 void igmp_init(void);
0123
0124 err_t igmp_start( struct netif *netif);
0125
0126 err_t igmp_stop( struct netif *netif);
0127
0128 void igmp_report_groups( struct netif *netif);
0129
0130 struct igmp_group *igmp_lookfor_group( struct netif *ifp, struct ip_addr *addr);
0131
0132 struct igmp_group *igmp_lookup_group( struct netif *ifp, struct ip_addr *addr);
0133
0134 err_t igmp_remove_group( struct igmp_group *group);
0135
0136 void igmp_input( struct pbuf *p, struct netif *inp, struct ip_addr *dest);
0137
0138 err_t igmp_joingroup( struct ip_addr *ifaddr, struct ip_addr *groupaddr);
0139
0140 err_t igmp_leavegroup( struct ip_addr *ifaddr, struct ip_addr *groupaddr);
0141
0142 void igmp_tmr(void);
0143
0144 void igmp_timeout( struct igmp_group *group);
0145
0146 void igmp_start_timer( struct igmp_group *group, u8_t max_time);
0147
0148 void igmp_stop_timer( struct igmp_group *group);
0149
0150 void igmp_delaying_member( struct igmp_group *group, u8_t maxresp);
0151
0152 err_t igmp_ip_output_if( struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t ttl, u8_t proto, struct netif *netif);
0153
0154 void igmp_send( struct igmp_group *group, u8_t type);
0155
0156 #ifdef __cplusplus
0157 }
0158 #endif
0159
0160 #endif
0161
0162 #endif