blob: c429668e3ed3e2f1a649c58c9b37a5bb06a71385 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_LINUX_IGMP_H
8#define _UAPI_LINUX_IGMP_H
9#include <linux/types.h>
10#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011struct igmphdr {
Tao Baod7db5942015-01-28 10:07:51 -080012 __u8 type;
13 __u8 code;
14 __sum16 csum;
Tao Baod7db5942015-01-28 10:07:51 -080015 __be32 group;
Ben Cheng655a7c02013-10-16 16:09:24 -070016};
17#define IGMPV3_MODE_IS_INCLUDE 1
18#define IGMPV3_MODE_IS_EXCLUDE 2
Ben Cheng655a7c02013-10-16 16:09:24 -070019#define IGMPV3_CHANGE_TO_INCLUDE 3
20#define IGMPV3_CHANGE_TO_EXCLUDE 4
21#define IGMPV3_ALLOW_NEW_SOURCES 5
22#define IGMPV3_BLOCK_OLD_SOURCES 6
Ben Cheng655a7c02013-10-16 16:09:24 -070023struct igmpv3_grec {
Tao Baod7db5942015-01-28 10:07:51 -080024 __u8 grec_type;
25 __u8 grec_auxwords;
26 __be16 grec_nsrcs;
Tao Baod7db5942015-01-28 10:07:51 -080027 __be32 grec_mca;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070028 __be32 grec_src[];
Ben Cheng655a7c02013-10-16 16:09:24 -070029};
30struct igmpv3_report {
Tao Baod7db5942015-01-28 10:07:51 -080031 __u8 type;
32 __u8 resv1;
Christopher Ferris525ce912017-07-26 13:12:53 -070033 __sum16 csum;
Tao Baod7db5942015-01-28 10:07:51 -080034 __be16 resv2;
Tao Baod7db5942015-01-28 10:07:51 -080035 __be16 ngrec;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070036 struct igmpv3_grec grec[];
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
38struct igmpv3_query {
Tao Baod7db5942015-01-28 10:07:51 -080039 __u8 type;
40 __u8 code;
Christopher Ferris525ce912017-07-26 13:12:53 -070041 __sum16 csum;
Tao Baod7db5942015-01-28 10:07:51 -080042 __be32 group;
Ben Cheng655a7c02013-10-16 16:09:24 -070043#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080044 __u8 qrv : 3, suppress : 1, resv : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -070045#elif defined(__BIG_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080046 __u8 resv : 4, suppress : 1, qrv : 3;
Ben Cheng655a7c02013-10-16 16:09:24 -070047#else
48#error "Please fix <asm/byteorder.h>"
49#endif
Tao Baod7db5942015-01-28 10:07:51 -080050 __u8 qqic;
Tao Baod7db5942015-01-28 10:07:51 -080051 __be16 nsrcs;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070052 __be32 srcs[];
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
54#define IGMP_HOST_MEMBERSHIP_QUERY 0x11
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define IGMP_HOST_MEMBERSHIP_REPORT 0x12
56#define IGMP_DVMRP 0x13
57#define IGMP_PIM 0x14
58#define IGMP_TRACE 0x15
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16
60#define IGMP_HOST_LEAVE_MESSAGE 0x17
61#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22
62#define IGMP_MTRACE_RESP 0x1e
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define IGMP_MTRACE 0x1f
Christopher Ferris24f97eb2019-05-20 12:58:13 -070064#define IGMP_MRDISC_ADV 0x30
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define IGMP_DELAYING_MEMBER 0x01
66#define IGMP_IDLE_MEMBER 0x02
67#define IGMP_LAZY_MEMBER 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -070068#define IGMP_SLEEPING_MEMBER 0x04
69#define IGMP_AWAKENING_MEMBER 0x05
70#define IGMP_MINLEN 8
71#define IGMP_MAX_HOST_REPORT_DELAY 10
Ben Cheng655a7c02013-10-16 16:09:24 -070072#define IGMP_TIMER_SCALE 10
73#define IGMP_AGE_THRESHOLD 400
74#define IGMP_ALL_HOSTS htonl(0xE0000001L)
75#define IGMP_ALL_ROUTER htonl(0xE0000002L)
Ben Cheng655a7c02013-10-16 16:09:24 -070076#define IGMPV3_ALL_MCR htonl(0xE0000016L)
77#define IGMP_LOCAL_GROUP htonl(0xE0000000L)
78#define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L)
79#endif