summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-12-20 11:42:03 -0500
committerRich Felker <dalias@aerifal.cx>2013-12-20 11:42:03 -0500
commitc91ad4f7167bad8314b06c487ddd1c638981fc24 (patch)
treea9bee62cb41e45aef2b7280d35123861b1735123
parente2b4525e3bb50acdfe095e6829b040636d37a295 (diff)
downloadmusl-c91ad4f7167bad8314b06c487ddd1c638981fc24.tar.gz
musl-c91ad4f7167bad8314b06c487ddd1c638981fc24.tar.bz2
musl-c91ad4f7167bad8314b06c487ddd1c638981fc24.tar.xz
musl-c91ad4f7167bad8314b06c487ddd1c638981fc24.zip
add netinet/igmp.h and multicast groups to netinet/in.h
based on patch by Timo Teräs.
-rw-r--r--include/netinet/igmp.h45
-rw-r--r--include/netinet/in.h5
2 files changed, 50 insertions, 0 deletions
diff --git a/include/netinet/igmp.h b/include/netinet/igmp.h
new file mode 100644
index 00000000..bbe8206a
--- /dev/null
+++ b/include/netinet/igmp.h
@@ -0,0 +1,45 @@
+#ifndef _NETINET_IGMP_H
+#define _NETINET_IGMP_H
+
+#include <stdint.h>
+#include <netinet/in.h>
+
+struct igmp {
+ uint8_t igmp_type;
+ uint8_t igmp_code;
+ uint16_t igmp_cksum;
+ struct in_addr igmp_group;
+};
+
+#define IGMP_MINLEN 8
+
+#define IGMP_MEMBERSHIP_QUERY 0x11
+#define IGMP_V1_MEMBERSHIP_REPORT 0x12
+#define IGMP_V2_MEMBERSHIP_REPORT 0x16
+#define IGMP_V2_LEAVE_GROUP 0x17
+
+#define IGMP_DVMRP 0x13
+#define IGMP_PIM 0x14
+#define IGMP_TRACE 0x15
+
+#define IGMP_MTRACE_RESP 0x1e
+#define IGMP_MTRACE 0x1f
+
+#define IGMP_MAX_HOST_REPORT_DELAY 10
+#define IGMP_TIMER_SCALE 10
+
+#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
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 8be51e83..db961442 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 } } }