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_MROUTE6_H |
| 20 | #define _UAPI__LINUX_MROUTE6_H |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 21 | #include <linux/kernel.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 22 | #include <linux/types.h> |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 23 | #include <linux/sockios.h> |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 24 | #include <linux/in6.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 25 | #define MRT6_BASE 200 |
| 26 | #define MRT6_INIT (MRT6_BASE) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | #define MRT6_DONE (MRT6_BASE + 1) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 28 | #define MRT6_ADD_MIF (MRT6_BASE + 2) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 29 | #define MRT6_DEL_MIF (MRT6_BASE + 3) |
| 30 | #define MRT6_ADD_MFC (MRT6_BASE + 4) |
| 31 | #define MRT6_DEL_MFC (MRT6_BASE + 5) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 32 | #define MRT6_VERSION (MRT6_BASE + 6) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 33 | #define MRT6_ASSERT (MRT6_BASE + 7) |
| 34 | #define MRT6_PIM (MRT6_BASE + 8) |
| 35 | #define MRT6_TABLE (MRT6_BASE + 9) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 36 | #define MRT6_ADD_MFC_PROXY (MRT6_BASE + 10) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 37 | #define MRT6_DEL_MFC_PROXY (MRT6_BASE + 11) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame^] | 38 | #define MRT6_FLUSH (MRT6_BASE + 12) |
| 39 | #define MRT6_MAX (MRT6_BASE + 12) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 41 | #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE + 1) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 42 | #define SIOCGETRPF (SIOCPROTOPRIVATE + 2) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame^] | 43 | #define MRT6_FLUSH_MFC 1 |
| 44 | #define MRT6_FLUSH_MFC_STATIC 2 |
| 45 | #define MRT6_FLUSH_MIFS 4 |
| 46 | #define MRT6_FLUSH_MIFS_STATIC 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define MAXMIFS 32 |
| 48 | typedef unsigned long mifbitmap_t; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 49 | typedef unsigned short mifi_t; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 50 | #define ALL_MIFS ((mifi_t) (- 1)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #ifndef IF_SETSIZE |
| 52 | #define IF_SETSIZE 256 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 53 | #endif |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 54 | typedef __u32 if_mask; |
| 55 | #define NIFBITS (sizeof(if_mask) * 8) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | typedef struct if_set { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 57 | if_mask ifs_bits[__KERNEL_DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; |
| 58 | } if_set; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | #define IF_SET(n,p) ((p)->ifs_bits[(n) / NIFBITS] |= (1 << ((n) % NIFBITS))) |
| 60 | #define IF_CLR(n,p) ((p)->ifs_bits[(n) / NIFBITS] &= ~(1 << ((n) % NIFBITS))) |
| 61 | #define IF_ISSET(n,p) ((p)->ifs_bits[(n) / NIFBITS] & (1 << ((n) % NIFBITS))) |
| 62 | #define IF_COPY(f,t) bcopy(f, t, sizeof(* (f))) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | #define IF_ZERO(p) bzero(p, sizeof(* (p))) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 64 | struct mif6ctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 65 | mifi_t mif6c_mifi; |
| 66 | unsigned char mif6c_flags; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | unsigned char vifc_threshold; |
| 68 | __u16 mif6c_pifi; |
| 69 | unsigned int vifc_rate_limit; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 70 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 71 | #define MIFF_REGISTER 0x1 |
| 72 | struct mf6cctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 73 | struct sockaddr_in6 mf6cc_origin; |
| 74 | struct sockaddr_in6 mf6cc_mcastgrp; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | mifi_t mf6cc_parent; |
| 76 | struct if_set mf6cc_ifset; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 77 | }; |
| 78 | struct sioc_sg_req6 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | struct sockaddr_in6 src; |
| 80 | struct sockaddr_in6 grp; |
| 81 | unsigned long pktcnt; |
| 82 | unsigned long bytecnt; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | unsigned long wrong_if; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 84 | }; |
| 85 | struct sioc_mif_req6 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 86 | mifi_t mifi; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | unsigned long icount; |
| 88 | unsigned long ocount; |
| 89 | unsigned long ibytes; |
| 90 | unsigned long obytes; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 91 | }; |
| 92 | struct mrt6msg { |
| 93 | #define MRT6MSG_NOCACHE 1 |
| 94 | #define MRT6MSG_WRONGMIF 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 95 | #define MRT6MSG_WHOLEPKT 3 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 96 | __u8 im6_mbz; |
| 97 | __u8 im6_msgtype; |
| 98 | __u16 im6_mif; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | __u32 im6_pad; |
| 100 | struct in6_addr im6_src, im6_dst; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 101 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 102 | enum { |
| 103 | IP6MRA_CREPORT_UNSPEC, |
| 104 | IP6MRA_CREPORT_MSGTYPE, |
| 105 | IP6MRA_CREPORT_MIF_ID, |
| 106 | IP6MRA_CREPORT_SRC_ADDR, |
| 107 | IP6MRA_CREPORT_DST_ADDR, |
| 108 | IP6MRA_CREPORT_PKT, |
| 109 | __IP6MRA_CREPORT_MAX |
| 110 | }; |
| 111 | #define IP6MRA_CREPORT_MAX (__IP6MRA_CREPORT_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 112 | #endif |