1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
From e136625c8e0dc757dd1bd335bfca6e753e06d185 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 18 Dec 2013 08:47:01 +0200
Subject: [PATCH] add netinet/igmp.h and multicast groups to netinet/in.h
---
include/netinet/igmp.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
include/netinet/in.h | 5 +++++
2 files changed, 57 insertions(+)
create mode 100644 include/netinet/igmp.h
diff --git a/include/netinet/igmp.h b/include/netinet/igmp.h
new file mode 100644
index 0000000..822a6c7
--- /dev/null
+++ b/include/netinet/igmp.h
@@ -0,0 +1,52 @@
+#ifndef _NETINET_IGMP_H
+#define _NETINET_IGMP_H 1
+
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+
+#include <sys/types.h>
+#include <netinet/in.h>
+
+struct igmp {
+ u_int8_t igmp_type; /* IGMP type */
+ u_int8_t igmp_code; /* routing code */
+ u_int16_t igmp_cksum; /* checksum */
+ struct in_addr igmp_group; /* group address */
+};
+
+#define IGMP_MINLEN 8
+
+#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
+#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
+#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
+#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
+
+#define IGMP_DVMRP 0x13 /* DVMRP routing message */
+#define IGMP_PIM 0x14 /* PIM routing message */
+#define IGMP_TRACE 0x15
+
+#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
+#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
+
+#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
+ /* query (in seconds) according */
+ /* to RFC1112 */
+#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
+ /* specifies time in 10th of seconds*/
+
+#define IGMP_DELAYING_MEMBER 1
+#define IGMP_IDLE_MEMBER 2
+#define IGMP_LAZY_MEMBER 3
+#define IGMP_SLEEPING_MEMBER 4
+#define IGMP_AWAKENING_MEMBER 5
+
+#define IGMP_v1_ROUTER 1
+#define IGMP_v2_ROUTER 2
+
+#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
+#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
+#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
+#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
+
+#endif
+
+#endif
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 8be51e8..db96144 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -53,6 +53,11 @@ struct ipv6_mreq
#define INADDR_NONE ((in_addr_t) 0xffffffff)
#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001)
+#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
+#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
+#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002)
+#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff)
+
#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
--
1.8.5.1
|