Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 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 Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 23 | #include <linux/in.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #define MRT_BASE 200 |
| 25 | #define MRT_INIT (MRT_BASE) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 26 | #define MRT_DONE (MRT_BASE + 1) |
| 27 | #define MRT_ADD_VIF (MRT_BASE + 2) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 28 | #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 Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 32 | #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 Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 36 | #define MRT_DEL_MFC_PROXY (MRT_BASE + 11) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 37 | #define MRT_FLUSH (MRT_BASE + 12) |
| 38 | #define MRT_MAX (MRT_BASE + 12) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define SIOCGETVIFCNT SIOCPROTOPRIVATE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 40 | #define SIOCGETSGCNT (SIOCPROTOPRIVATE + 1) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 41 | #define SIOCGETRPF (SIOCPROTOPRIVATE + 2) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 42 | #define MRT_FLUSH_MFC 1 |
| 43 | #define MRT_FLUSH_MFC_STATIC 2 |
| 44 | #define MRT_FLUSH_VIFS 4 |
| 45 | #define MRT_FLUSH_VIFS_STATIC 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 46 | #define MAXVIFS 32 |
| 47 | typedef unsigned long vifbitmap_t; |
| 48 | typedef unsigned short vifi_t; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 49 | #define ALL_VIFS ((vifi_t) (- 1)) |
| 50 | #define VIFM_SET(n,m) ((m) |= (1 << (n))) |
| 51 | #define VIFM_CLR(n,m) ((m) &= ~(1 << (n))) |
| 52 | #define VIFM_ISSET(n,m) ((m) & (1 << (n))) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 53 | #define VIFM_CLRALL(m) ((m) = 0) |
| 54 | #define VIFM_COPY(mfrom,mto) ((mto) = (mfrom)) |
| 55 | #define VIFM_SAME(m1,m2) ((m1) == (m2)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | struct vifctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 57 | vifi_t vifc_vifi; |
| 58 | unsigned char vifc_flags; |
| 59 | unsigned char vifc_threshold; |
| 60 | unsigned int vifc_rate_limit; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 61 | union { |
| 62 | struct in_addr vifc_lcl_addr; |
| 63 | int vifc_lcl_ifindex; |
| 64 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 65 | struct in_addr vifc_rmt_addr; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 66 | }; |
| 67 | #define VIFF_TUNNEL 0x1 |
| 68 | #define VIFF_SRCRT 0x2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 69 | #define VIFF_REGISTER 0x4 |
| 70 | #define VIFF_USE_IFINDEX 0x8 |
| 71 | struct mfcctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | struct in_addr mfcc_origin; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 73 | struct in_addr mfcc_mcastgrp; |
| 74 | vifi_t mfcc_parent; |
| 75 | unsigned char mfcc_ttls[MAXVIFS]; |
| 76 | unsigned int mfcc_pkt_cnt; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 77 | unsigned int mfcc_byte_cnt; |
| 78 | unsigned int mfcc_wrong_if; |
| 79 | int mfcc_expire; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 80 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 81 | struct sioc_sg_req { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 82 | struct in_addr src; |
| 83 | struct in_addr grp; |
| 84 | unsigned long pktcnt; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 85 | unsigned long bytecnt; |
| 86 | unsigned long wrong_if; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 87 | }; |
| 88 | struct sioc_vif_req { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 89 | vifi_t vifi; |
| 90 | unsigned long icount; |
| 91 | unsigned long ocount; |
| 92 | unsigned long ibytes; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 93 | unsigned long obytes; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | }; |
| 95 | struct igmpmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 96 | __u32 unused1, unused2; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 97 | unsigned char im_msgtype; |
| 98 | unsigned char im_mbz; |
| 99 | unsigned char im_vif; |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 100 | unsigned char im_vif_hi; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 101 | struct in_addr im_src, im_dst; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 102 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 103 | enum { |
| 104 | IPMRA_TABLE_UNSPEC, |
| 105 | IPMRA_TABLE_ID, |
| 106 | IPMRA_TABLE_CACHE_RES_QUEUE_LEN, |
| 107 | IPMRA_TABLE_MROUTE_REG_VIF_NUM, |
| 108 | IPMRA_TABLE_MROUTE_DO_ASSERT, |
| 109 | IPMRA_TABLE_MROUTE_DO_PIM, |
| 110 | IPMRA_TABLE_VIFS, |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 111 | IPMRA_TABLE_MROUTE_DO_WRVIFWHOLE, |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 112 | __IPMRA_TABLE_MAX |
| 113 | }; |
| 114 | #define IPMRA_TABLE_MAX (__IPMRA_TABLE_MAX - 1) |
| 115 | enum { |
| 116 | IPMRA_VIF_UNSPEC, |
| 117 | IPMRA_VIF, |
| 118 | __IPMRA_VIF_MAX |
| 119 | }; |
| 120 | #define IPMRA_VIF_MAX (__IPMRA_VIF_MAX - 1) |
| 121 | enum { |
| 122 | IPMRA_VIFA_UNSPEC, |
| 123 | IPMRA_VIFA_IFINDEX, |
| 124 | IPMRA_VIFA_VIF_ID, |
| 125 | IPMRA_VIFA_FLAGS, |
| 126 | IPMRA_VIFA_BYTES_IN, |
| 127 | IPMRA_VIFA_BYTES_OUT, |
| 128 | IPMRA_VIFA_PACKETS_IN, |
| 129 | IPMRA_VIFA_PACKETS_OUT, |
| 130 | IPMRA_VIFA_LOCAL_ADDR, |
| 131 | IPMRA_VIFA_REMOTE_ADDR, |
| 132 | IPMRA_VIFA_PAD, |
| 133 | __IPMRA_VIFA_MAX |
| 134 | }; |
| 135 | #define IPMRA_VIFA_MAX (__IPMRA_VIFA_MAX - 1) |
| 136 | enum { |
| 137 | IPMRA_CREPORT_UNSPEC, |
| 138 | IPMRA_CREPORT_MSGTYPE, |
| 139 | IPMRA_CREPORT_VIF_ID, |
| 140 | IPMRA_CREPORT_SRC_ADDR, |
| 141 | IPMRA_CREPORT_DST_ADDR, |
| 142 | IPMRA_CREPORT_PKT, |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 143 | IPMRA_CREPORT_TABLE, |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 144 | __IPMRA_CREPORT_MAX |
| 145 | }; |
| 146 | #define IPMRA_CREPORT_MAX (__IPMRA_CREPORT_MAX - 1) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 147 | #define MFC_ASSERT_THRESH (3 * HZ) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 148 | #define IGMPMSG_NOCACHE 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 149 | #define IGMPMSG_WRONGVIF 2 |
| 150 | #define IGMPMSG_WHOLEPKT 3 |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 151 | #define IGMPMSG_WRVIFWHOLE 4 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 152 | #endif |