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