blob: f0cb21b5a467fa22ce0513e0606658592a2279d2 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI__LINUX_MROUTE_H
20#define _UAPI__LINUX_MROUTE_H
21#include <linux/sockios.h>
22#include <linux/types.h>
Christopher Ferris525ce912017-07-26 13:12:53 -070023#include <linux/in.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define MRT_BASE 200
25#define MRT_INIT (MRT_BASE)
Tao Baod7db5942015-01-28 10:07:51 -080026#define MRT_DONE (MRT_BASE + 1)
27#define MRT_ADD_VIF (MRT_BASE + 2)
Tao Baod7db5942015-01-28 10:07:51 -080028#define MRT_DEL_VIF (MRT_BASE + 3)
29#define MRT_ADD_MFC (MRT_BASE + 4)
30#define MRT_DEL_MFC (MRT_BASE + 5)
31#define MRT_VERSION (MRT_BASE + 6)
Tao Baod7db5942015-01-28 10:07:51 -080032#define MRT_ASSERT (MRT_BASE + 7)
33#define MRT_PIM (MRT_BASE + 8)
34#define MRT_TABLE (MRT_BASE + 9)
35#define MRT_ADD_MFC_PROXY (MRT_BASE + 10)
Tao Baod7db5942015-01-28 10:07:51 -080036#define MRT_DEL_MFC_PROXY (MRT_BASE + 11)
37#define MRT_MAX (MRT_BASE + 11)
Ben Cheng655a7c02013-10-16 16:09:24 -070038#define SIOCGETVIFCNT SIOCPROTOPRIVATE
Tao Baod7db5942015-01-28 10:07:51 -080039#define SIOCGETSGCNT (SIOCPROTOPRIVATE + 1)
Tao Baod7db5942015-01-28 10:07:51 -080040#define SIOCGETRPF (SIOCPROTOPRIVATE + 2)
Ben Cheng655a7c02013-10-16 16:09:24 -070041#define MAXVIFS 32
42typedef unsigned long vifbitmap_t;
43typedef unsigned short vifi_t;
Tao Baod7db5942015-01-28 10:07:51 -080044#define ALL_VIFS ((vifi_t) (- 1))
45#define VIFM_SET(n,m) ((m) |= (1 << (n)))
46#define VIFM_CLR(n,m) ((m) &= ~(1 << (n)))
47#define VIFM_ISSET(n,m) ((m) & (1 << (n)))
Tao Baod7db5942015-01-28 10:07:51 -080048#define VIFM_CLRALL(m) ((m) = 0)
49#define VIFM_COPY(mfrom,mto) ((mto) = (mfrom))
50#define VIFM_SAME(m1,m2) ((m1) == (m2))
Ben Cheng655a7c02013-10-16 16:09:24 -070051struct vifctl {
Tao Baod7db5942015-01-28 10:07:51 -080052 vifi_t vifc_vifi;
53 unsigned char vifc_flags;
54 unsigned char vifc_threshold;
55 unsigned int vifc_rate_limit;
Tao Baod7db5942015-01-28 10:07:51 -080056 union {
57 struct in_addr vifc_lcl_addr;
58 int vifc_lcl_ifindex;
59 };
Tao Baod7db5942015-01-28 10:07:51 -080060 struct in_addr vifc_rmt_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070061};
62#define VIFF_TUNNEL 0x1
63#define VIFF_SRCRT 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define VIFF_REGISTER 0x4
65#define VIFF_USE_IFINDEX 0x8
66struct mfcctl {
Tao Baod7db5942015-01-28 10:07:51 -080067 struct in_addr mfcc_origin;
Tao Baod7db5942015-01-28 10:07:51 -080068 struct in_addr mfcc_mcastgrp;
69 vifi_t mfcc_parent;
70 unsigned char mfcc_ttls[MAXVIFS];
71 unsigned int mfcc_pkt_cnt;
Tao Baod7db5942015-01-28 10:07:51 -080072 unsigned int mfcc_byte_cnt;
73 unsigned int mfcc_wrong_if;
74 int mfcc_expire;
Ben Cheng655a7c02013-10-16 16:09:24 -070075};
Ben Cheng655a7c02013-10-16 16:09:24 -070076struct sioc_sg_req {
Tao Baod7db5942015-01-28 10:07:51 -080077 struct in_addr src;
78 struct in_addr grp;
79 unsigned long pktcnt;
Tao Baod7db5942015-01-28 10:07:51 -080080 unsigned long bytecnt;
81 unsigned long wrong_if;
Ben Cheng655a7c02013-10-16 16:09:24 -070082};
83struct sioc_vif_req {
Tao Baod7db5942015-01-28 10:07:51 -080084 vifi_t vifi;
85 unsigned long icount;
86 unsigned long ocount;
87 unsigned long ibytes;
Tao Baod7db5942015-01-28 10:07:51 -080088 unsigned long obytes;
Ben Cheng655a7c02013-10-16 16:09:24 -070089};
90struct igmpmsg {
Tao Baod7db5942015-01-28 10:07:51 -080091 __u32 unused1, unused2;
Tao Baod7db5942015-01-28 10:07:51 -080092 unsigned char im_msgtype;
93 unsigned char im_mbz;
94 unsigned char im_vif;
95 unsigned char unused3;
Tao Baod7db5942015-01-28 10:07:51 -080096 struct in_addr im_src, im_dst;
Ben Cheng655a7c02013-10-16 16:09:24 -070097};
Christopher Ferris1308ad32017-11-14 17:32:13 -080098enum {
99 IPMRA_TABLE_UNSPEC,
100 IPMRA_TABLE_ID,
101 IPMRA_TABLE_CACHE_RES_QUEUE_LEN,
102 IPMRA_TABLE_MROUTE_REG_VIF_NUM,
103 IPMRA_TABLE_MROUTE_DO_ASSERT,
104 IPMRA_TABLE_MROUTE_DO_PIM,
105 IPMRA_TABLE_VIFS,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700106 IPMRA_TABLE_MROUTE_DO_WRVIFWHOLE,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800107 __IPMRA_TABLE_MAX
108};
109#define IPMRA_TABLE_MAX (__IPMRA_TABLE_MAX - 1)
110enum {
111 IPMRA_VIF_UNSPEC,
112 IPMRA_VIF,
113 __IPMRA_VIF_MAX
114};
115#define IPMRA_VIF_MAX (__IPMRA_VIF_MAX - 1)
116enum {
117 IPMRA_VIFA_UNSPEC,
118 IPMRA_VIFA_IFINDEX,
119 IPMRA_VIFA_VIF_ID,
120 IPMRA_VIFA_FLAGS,
121 IPMRA_VIFA_BYTES_IN,
122 IPMRA_VIFA_BYTES_OUT,
123 IPMRA_VIFA_PACKETS_IN,
124 IPMRA_VIFA_PACKETS_OUT,
125 IPMRA_VIFA_LOCAL_ADDR,
126 IPMRA_VIFA_REMOTE_ADDR,
127 IPMRA_VIFA_PAD,
128 __IPMRA_VIFA_MAX
129};
130#define IPMRA_VIFA_MAX (__IPMRA_VIFA_MAX - 1)
131enum {
132 IPMRA_CREPORT_UNSPEC,
133 IPMRA_CREPORT_MSGTYPE,
134 IPMRA_CREPORT_VIF_ID,
135 IPMRA_CREPORT_SRC_ADDR,
136 IPMRA_CREPORT_DST_ADDR,
137 IPMRA_CREPORT_PKT,
138 __IPMRA_CREPORT_MAX
139};
140#define IPMRA_CREPORT_MAX (__IPMRA_CREPORT_MAX - 1)
Tao Baod7db5942015-01-28 10:07:51 -0800141#define MFC_ASSERT_THRESH (3 * HZ)
Ben Cheng655a7c02013-10-16 16:09:24 -0700142#define IGMPMSG_NOCACHE 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700143#define IGMPMSG_WRONGVIF 2
144#define IGMPMSG_WHOLEPKT 3
Christopher Ferris9ce28842018-10-25 12:11:39 -0700145#define IGMPMSG_WRVIFWHOLE 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700146#endif