blob: 0ecce4209d6b6015d9786745158450f0ab897d17 [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_MROUTE_H
8#define _UAPI__LINUX_MROUTE_H
9#include <linux/sockios.h>
10#include <linux/types.h>
Christopher Ferris525ce912017-07-26 13:12:53 -070011#include <linux/in.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070012#define MRT_BASE 200
13#define MRT_INIT (MRT_BASE)
Tao Baod7db5942015-01-28 10:07:51 -080014#define MRT_DONE (MRT_BASE + 1)
15#define MRT_ADD_VIF (MRT_BASE + 2)
Tao Baod7db5942015-01-28 10:07:51 -080016#define MRT_DEL_VIF (MRT_BASE + 3)
17#define MRT_ADD_MFC (MRT_BASE + 4)
18#define MRT_DEL_MFC (MRT_BASE + 5)
19#define MRT_VERSION (MRT_BASE + 6)
Tao Baod7db5942015-01-28 10:07:51 -080020#define MRT_ASSERT (MRT_BASE + 7)
21#define MRT_PIM (MRT_BASE + 8)
22#define MRT_TABLE (MRT_BASE + 9)
23#define MRT_ADD_MFC_PROXY (MRT_BASE + 10)
Tao Baod7db5942015-01-28 10:07:51 -080024#define MRT_DEL_MFC_PROXY (MRT_BASE + 11)
Christopher Ferris24f97eb2019-05-20 12:58:13 -070025#define MRT_FLUSH (MRT_BASE + 12)
26#define MRT_MAX (MRT_BASE + 12)
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define SIOCGETVIFCNT SIOCPROTOPRIVATE
Tao Baod7db5942015-01-28 10:07:51 -080028#define SIOCGETSGCNT (SIOCPROTOPRIVATE + 1)
Tao Baod7db5942015-01-28 10:07:51 -080029#define SIOCGETRPF (SIOCPROTOPRIVATE + 2)
Christopher Ferris24f97eb2019-05-20 12:58:13 -070030#define MRT_FLUSH_MFC 1
31#define MRT_FLUSH_MFC_STATIC 2
32#define MRT_FLUSH_VIFS 4
33#define MRT_FLUSH_VIFS_STATIC 8
Ben Cheng655a7c02013-10-16 16:09:24 -070034#define MAXVIFS 32
35typedef unsigned long vifbitmap_t;
36typedef unsigned short vifi_t;
Tao Baod7db5942015-01-28 10:07:51 -080037#define ALL_VIFS ((vifi_t) (- 1))
38#define VIFM_SET(n,m) ((m) |= (1 << (n)))
39#define VIFM_CLR(n,m) ((m) &= ~(1 << (n)))
40#define VIFM_ISSET(n,m) ((m) & (1 << (n)))
Tao Baod7db5942015-01-28 10:07:51 -080041#define VIFM_CLRALL(m) ((m) = 0)
42#define VIFM_COPY(mfrom,mto) ((mto) = (mfrom))
43#define VIFM_SAME(m1,m2) ((m1) == (m2))
Ben Cheng655a7c02013-10-16 16:09:24 -070044struct vifctl {
Tao Baod7db5942015-01-28 10:07:51 -080045 vifi_t vifc_vifi;
46 unsigned char vifc_flags;
47 unsigned char vifc_threshold;
48 unsigned int vifc_rate_limit;
Tao Baod7db5942015-01-28 10:07:51 -080049 union {
50 struct in_addr vifc_lcl_addr;
51 int vifc_lcl_ifindex;
52 };
Tao Baod7db5942015-01-28 10:07:51 -080053 struct in_addr vifc_rmt_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070054};
55#define VIFF_TUNNEL 0x1
56#define VIFF_SRCRT 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define VIFF_REGISTER 0x4
58#define VIFF_USE_IFINDEX 0x8
59struct mfcctl {
Tao Baod7db5942015-01-28 10:07:51 -080060 struct in_addr mfcc_origin;
Tao Baod7db5942015-01-28 10:07:51 -080061 struct in_addr mfcc_mcastgrp;
62 vifi_t mfcc_parent;
63 unsigned char mfcc_ttls[MAXVIFS];
64 unsigned int mfcc_pkt_cnt;
Tao Baod7db5942015-01-28 10:07:51 -080065 unsigned int mfcc_byte_cnt;
66 unsigned int mfcc_wrong_if;
67 int mfcc_expire;
Ben Cheng655a7c02013-10-16 16:09:24 -070068};
Ben Cheng655a7c02013-10-16 16:09:24 -070069struct sioc_sg_req {
Tao Baod7db5942015-01-28 10:07:51 -080070 struct in_addr src;
71 struct in_addr grp;
72 unsigned long pktcnt;
Tao Baod7db5942015-01-28 10:07:51 -080073 unsigned long bytecnt;
74 unsigned long wrong_if;
Ben Cheng655a7c02013-10-16 16:09:24 -070075};
76struct sioc_vif_req {
Tao Baod7db5942015-01-28 10:07:51 -080077 vifi_t vifi;
78 unsigned long icount;
79 unsigned long ocount;
80 unsigned long ibytes;
Tao Baod7db5942015-01-28 10:07:51 -080081 unsigned long obytes;
Ben Cheng655a7c02013-10-16 16:09:24 -070082};
83struct igmpmsg {
Tao Baod7db5942015-01-28 10:07:51 -080084 __u32 unused1, unused2;
Tao Baod7db5942015-01-28 10:07:51 -080085 unsigned char im_msgtype;
86 unsigned char im_mbz;
87 unsigned char im_vif;
Christopher Ferris32ff3f82020-12-14 13:10:04 -080088 unsigned char im_vif_hi;
Tao Baod7db5942015-01-28 10:07:51 -080089 struct in_addr im_src, im_dst;
Ben Cheng655a7c02013-10-16 16:09:24 -070090};
Christopher Ferris1308ad32017-11-14 17:32:13 -080091enum {
92 IPMRA_TABLE_UNSPEC,
93 IPMRA_TABLE_ID,
94 IPMRA_TABLE_CACHE_RES_QUEUE_LEN,
95 IPMRA_TABLE_MROUTE_REG_VIF_NUM,
96 IPMRA_TABLE_MROUTE_DO_ASSERT,
97 IPMRA_TABLE_MROUTE_DO_PIM,
98 IPMRA_TABLE_VIFS,
Christopher Ferris9ce28842018-10-25 12:11:39 -070099 IPMRA_TABLE_MROUTE_DO_WRVIFWHOLE,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800100 __IPMRA_TABLE_MAX
101};
102#define IPMRA_TABLE_MAX (__IPMRA_TABLE_MAX - 1)
103enum {
104 IPMRA_VIF_UNSPEC,
105 IPMRA_VIF,
106 __IPMRA_VIF_MAX
107};
108#define IPMRA_VIF_MAX (__IPMRA_VIF_MAX - 1)
109enum {
110 IPMRA_VIFA_UNSPEC,
111 IPMRA_VIFA_IFINDEX,
112 IPMRA_VIFA_VIF_ID,
113 IPMRA_VIFA_FLAGS,
114 IPMRA_VIFA_BYTES_IN,
115 IPMRA_VIFA_BYTES_OUT,
116 IPMRA_VIFA_PACKETS_IN,
117 IPMRA_VIFA_PACKETS_OUT,
118 IPMRA_VIFA_LOCAL_ADDR,
119 IPMRA_VIFA_REMOTE_ADDR,
120 IPMRA_VIFA_PAD,
121 __IPMRA_VIFA_MAX
122};
123#define IPMRA_VIFA_MAX (__IPMRA_VIFA_MAX - 1)
124enum {
125 IPMRA_CREPORT_UNSPEC,
126 IPMRA_CREPORT_MSGTYPE,
127 IPMRA_CREPORT_VIF_ID,
128 IPMRA_CREPORT_SRC_ADDR,
129 IPMRA_CREPORT_DST_ADDR,
130 IPMRA_CREPORT_PKT,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800131 IPMRA_CREPORT_TABLE,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800132 __IPMRA_CREPORT_MAX
133};
134#define IPMRA_CREPORT_MAX (__IPMRA_CREPORT_MAX - 1)
Tao Baod7db5942015-01-28 10:07:51 -0800135#define MFC_ASSERT_THRESH (3 * HZ)
Ben Cheng655a7c02013-10-16 16:09:24 -0700136#define IGMPMSG_NOCACHE 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define IGMPMSG_WRONGVIF 2
138#define IGMPMSG_WHOLEPKT 3
Christopher Ferris9ce28842018-10-25 12:11:39 -0700139#define IGMPMSG_WRVIFWHOLE 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#endif