blob: ccb38d99128047b6e5dfda42b6f45525de972267 [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_MROUTE6_H
20#define _UAPI__LINUX_MROUTE6_H
Christopher Ferris106b3a82016-08-24 12:15:38 -070021#include <linux/kernel.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#include <linux/types.h>
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#include <linux/sockios.h>
Christopher Ferris525ce912017-07-26 13:12:53 -070024#include <linux/in6.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define MRT6_BASE 200
26#define MRT6_INIT (MRT6_BASE)
Tao Baod7db5942015-01-28 10:07:51 -080027#define MRT6_DONE (MRT6_BASE + 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -070028#define MRT6_ADD_MIF (MRT6_BASE + 2)
Tao Baod7db5942015-01-28 10:07:51 -080029#define MRT6_DEL_MIF (MRT6_BASE + 3)
30#define MRT6_ADD_MFC (MRT6_BASE + 4)
31#define MRT6_DEL_MFC (MRT6_BASE + 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -070032#define MRT6_VERSION (MRT6_BASE + 6)
Tao Baod7db5942015-01-28 10:07:51 -080033#define MRT6_ASSERT (MRT6_BASE + 7)
34#define MRT6_PIM (MRT6_BASE + 8)
35#define MRT6_TABLE (MRT6_BASE + 9)
Christopher Ferris106b3a82016-08-24 12:15:38 -070036#define MRT6_ADD_MFC_PROXY (MRT6_BASE + 10)
Tao Baod7db5942015-01-28 10:07:51 -080037#define MRT6_DEL_MFC_PROXY (MRT6_BASE + 11)
38#define MRT6_MAX (MRT6_BASE + 11)
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE
Christopher Ferris106b3a82016-08-24 12:15:38 -070040#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE + 1)
Tao Baod7db5942015-01-28 10:07:51 -080041#define SIOCGETRPF (SIOCPROTOPRIVATE + 2)
Ben Cheng655a7c02013-10-16 16:09:24 -070042#define MAXMIFS 32
43typedef unsigned long mifbitmap_t;
Christopher Ferris106b3a82016-08-24 12:15:38 -070044typedef unsigned short mifi_t;
Tao Baod7db5942015-01-28 10:07:51 -080045#define ALL_MIFS ((mifi_t) (- 1))
Ben Cheng655a7c02013-10-16 16:09:24 -070046#ifndef IF_SETSIZE
47#define IF_SETSIZE 256
Christopher Ferris106b3a82016-08-24 12:15:38 -070048#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070049typedef __u32 if_mask;
50#define NIFBITS (sizeof(if_mask) * 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070051typedef struct if_set {
Christopher Ferris106b3a82016-08-24 12:15:38 -070052 if_mask ifs_bits[__KERNEL_DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
53} if_set;
Tao Baod7db5942015-01-28 10:07:51 -080054#define IF_SET(n,p) ((p)->ifs_bits[(n) / NIFBITS] |= (1 << ((n) % NIFBITS)))
55#define IF_CLR(n,p) ((p)->ifs_bits[(n) / NIFBITS] &= ~(1 << ((n) % NIFBITS)))
56#define IF_ISSET(n,p) ((p)->ifs_bits[(n) / NIFBITS] & (1 << ((n) % NIFBITS)))
57#define IF_COPY(f,t) bcopy(f, t, sizeof(* (f)))
Tao Baod7db5942015-01-28 10:07:51 -080058#define IF_ZERO(p) bzero(p, sizeof(* (p)))
Ben Cheng655a7c02013-10-16 16:09:24 -070059struct mif6ctl {
Tao Baod7db5942015-01-28 10:07:51 -080060 mifi_t mif6c_mifi;
61 unsigned char mif6c_flags;
Tao Baod7db5942015-01-28 10:07:51 -080062 unsigned char vifc_threshold;
63 __u16 mif6c_pifi;
64 unsigned int vifc_rate_limit;
Ben Cheng655a7c02013-10-16 16:09:24 -070065};
Ben Cheng655a7c02013-10-16 16:09:24 -070066#define MIFF_REGISTER 0x1
67struct mf6cctl {
Tao Baod7db5942015-01-28 10:07:51 -080068 struct sockaddr_in6 mf6cc_origin;
69 struct sockaddr_in6 mf6cc_mcastgrp;
Tao Baod7db5942015-01-28 10:07:51 -080070 mifi_t mf6cc_parent;
71 struct if_set mf6cc_ifset;
Ben Cheng655a7c02013-10-16 16:09:24 -070072};
73struct sioc_sg_req6 {
Tao Baod7db5942015-01-28 10:07:51 -080074 struct sockaddr_in6 src;
75 struct sockaddr_in6 grp;
76 unsigned long pktcnt;
77 unsigned long bytecnt;
Tao Baod7db5942015-01-28 10:07:51 -080078 unsigned long wrong_if;
Ben Cheng655a7c02013-10-16 16:09:24 -070079};
80struct sioc_mif_req6 {
Tao Baod7db5942015-01-28 10:07:51 -080081 mifi_t mifi;
Tao Baod7db5942015-01-28 10:07:51 -080082 unsigned long icount;
83 unsigned long ocount;
84 unsigned long ibytes;
85 unsigned long obytes;
Ben Cheng655a7c02013-10-16 16:09:24 -070086};
87struct mrt6msg {
88#define MRT6MSG_NOCACHE 1
89#define MRT6MSG_WRONGMIF 2
Ben Cheng655a7c02013-10-16 16:09:24 -070090#define MRT6MSG_WHOLEPKT 3
Tao Baod7db5942015-01-28 10:07:51 -080091 __u8 im6_mbz;
92 __u8 im6_msgtype;
93 __u16 im6_mif;
Tao Baod7db5942015-01-28 10:07:51 -080094 __u32 im6_pad;
95 struct in6_addr im6_src, im6_dst;
Ben Cheng655a7c02013-10-16 16:09:24 -070096};
Christopher Ferris1308ad32017-11-14 17:32:13 -080097enum {
98 IP6MRA_CREPORT_UNSPEC,
99 IP6MRA_CREPORT_MSGTYPE,
100 IP6MRA_CREPORT_MIF_ID,
101 IP6MRA_CREPORT_SRC_ADDR,
102 IP6MRA_CREPORT_DST_ADDR,
103 IP6MRA_CREPORT_PKT,
104 __IP6MRA_CREPORT_MAX
105};
106#define IP6MRA_CREPORT_MAX (__IP6MRA_CREPORT_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700107#endif