10000 add netinet/igmp.h and multicast groups to netinet/in.h · micropython/micropython@c91ad4f · GitHub
[go: up one dir, main page]

Skip to content

Commit c91ad4f

Browse files
committed
add netinet/igmp.h and multicast groups to netinet/in.h
based on patch by Timo Teräs.
1 parent e2b4525 commit c91ad4f

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

include/netinet/igmp.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#ifndef _NETINET_IGMP_H
2+
#define _NETINET_IGMP_H
3+
4+
#include <stdint.h>
5+
#include <netinet/in.h>
6+
7+
struct igmp {
8+
uint8_t igmp_type;
9+
uint8_t igmp_code;
10+
uint16_t igmp_cksum;
11+
struct in_addr igmp_group;
12+
};
13+
14+
#define IGMP_MINLEN 8
15+
16+
#define IGMP_MEMBERSHIP_QUERY 0x11
17+
#define IGMP_V1_MEMBERSHIP_REPORT 0x12
18+
#define IGMP_V2_MEMBERSHIP_REPORT 0x16
19+
#define IGMP_V2_LEAVE_GROUP 0x17
20+
21+
#define IGMP_DVMRP 0x13
22+
#define IGMP_PIM 0x14
23+
#define IGMP_TRACE 0x15
24+
25+
#define IGMP_MTRACE_RESP 0x1e
26+
#define IGMP_MTRACE 0x1f
27+
28+
#define IGMP_MAX_HOST_REPORT_DELAY 10
29+
#define IGMP_TIMER_SCALE 10
30+
31+
#define IGMP_DELAYING_MEMBER 1
32+
#define IGMP_IDLE_MEMBER 2
33+
#define IGMP_LAZY_MEMBER 3
34+
#define IGMP_SLEEPING_MEMBER 4
35+
#define IGMP_AWAKENING_MEMBER 5
36+
37+
#define IGMP_v1_ROUTER 1
38+
#define IGMP_v2_ROUTER 2
39+
40+
#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
41+
#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
42+
#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
43+
#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
44+
45+
#endif

include/netinet/in.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ struct ipv6_mreq
5353
#define INADDR_NONE ((in_addr_t) 0xffffffff)
5454
#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001)
5555

56+
#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
57+
#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
58+
#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002)
59+
#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff)
60+
5661
#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
5762
#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
5863

0 commit comments

Comments
 (0)
0