blob: 5a09eddaab25370c6a1036190fec7f16bb7ea246 [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>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define MRT_BASE 200
24#define MRT_INIT (MRT_BASE)
Tao Baod7db5942015-01-28 10:07:51 -080025#define MRT_DONE (MRT_BASE + 1)
26#define MRT_ADD_VIF (MRT_BASE + 2)
Tao Baod7db5942015-01-28 10:07:51 -080027#define MRT_DEL_VIF (MRT_BASE + 3)
28#define MRT_ADD_MFC (MRT_BASE + 4)
29#define MRT_DEL_MFC (MRT_BASE + 5)
30#define MRT_VERSION (MRT_BASE + 6)
Tao Baod7db5942015-01-28 10:07:51 -080031#define MRT_ASSERT (MRT_BASE + 7)
32#define MRT_PIM (MRT_BASE + 8)
33#define MRT_TABLE (MRT_BASE + 9)
34#define MRT_ADD_MFC_PROXY (MRT_BASE + 10)
Tao Baod7db5942015-01-28 10:07:51 -080035#define MRT_DEL_MFC_PROXY (MRT_BASE + 11)
36#define MRT_MAX (MRT_BASE + 11)
Ben Cheng655a7c02013-10-16 16:09:24 -070037#define SIOCGETVIFCNT SIOCPROTOPRIVATE
Tao Baod7db5942015-01-28 10:07:51 -080038#define SIOCGETSGCNT (SIOCPROTOPRIVATE + 1)
Tao Baod7db5942015-01-28 10:07:51 -080039#define SIOCGETRPF (SIOCPROTOPRIVATE + 2)
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define MAXVIFS 32
41typedef unsigned long vifbitmap_t;
42typedef unsigned short vifi_t;
Tao Baod7db5942015-01-28 10:07:51 -080043#define ALL_VIFS ((vifi_t) (- 1))
44#define VIFM_SET(n,m) ((m) |= (1 << (n)))
45#define VIFM_CLR(n,m) ((m) &= ~(1 << (n)))
46#define VIFM_ISSET(n,m) ((m) & (1 << (n)))
Tao Baod7db5942015-01-28 10:07:51 -080047#define VIFM_CLRALL(m) ((m) = 0)
48#define VIFM_COPY(mfrom,mto) ((mto) = (mfrom))
49#define VIFM_SAME(m1,m2) ((m1) == (m2))
Ben Cheng655a7c02013-10-16 16:09:24 -070050struct vifctl {
Tao Baod7db5942015-01-28 10:07:51 -080051 vifi_t vifc_vifi;
52 unsigned char vifc_flags;
53 unsigned char vifc_threshold;
54 unsigned int vifc_rate_limit;
Tao Baod7db5942015-01-28 10:07:51 -080055 union {
56 struct in_addr vifc_lcl_addr;
57 int vifc_lcl_ifindex;
58 };
Tao Baod7db5942015-01-28 10:07:51 -080059 struct in_addr vifc_rmt_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070060};
61#define VIFF_TUNNEL 0x1
62#define VIFF_SRCRT 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define VIFF_REGISTER 0x4
64#define VIFF_USE_IFINDEX 0x8
65struct mfcctl {
Tao Baod7db5942015-01-28 10:07:51 -080066 struct in_addr mfcc_origin;
Tao Baod7db5942015-01-28 10:07:51 -080067 struct in_addr mfcc_mcastgrp;
68 vifi_t mfcc_parent;
69 unsigned char mfcc_ttls[MAXVIFS];
70 unsigned int mfcc_pkt_cnt;
Tao Baod7db5942015-01-28 10:07:51 -080071 unsigned int mfcc_byte_cnt;
72 unsigned int mfcc_wrong_if;
73 int mfcc_expire;
Ben Cheng655a7c02013-10-16 16:09:24 -070074};
Ben Cheng655a7c02013-10-16 16:09:24 -070075struct sioc_sg_req {
Tao Baod7db5942015-01-28 10:07:51 -080076 struct in_addr src;
77 struct in_addr grp;
78 unsigned long pktcnt;
Tao Baod7db5942015-01-28 10:07:51 -080079 unsigned long bytecnt;
80 unsigned long wrong_if;
Ben Cheng655a7c02013-10-16 16:09:24 -070081};
82struct sioc_vif_req {
Tao Baod7db5942015-01-28 10:07:51 -080083 vifi_t vifi;
84 unsigned long icount;
85 unsigned long ocount;
86 unsigned long ibytes;
Tao Baod7db5942015-01-28 10:07:51 -080087 unsigned long obytes;
Ben Cheng655a7c02013-10-16 16:09:24 -070088};
89struct igmpmsg {
Tao Baod7db5942015-01-28 10:07:51 -080090 __u32 unused1, unused2;
Tao Baod7db5942015-01-28 10:07:51 -080091 unsigned char im_msgtype;
92 unsigned char im_mbz;
93 unsigned char im_vif;
94 unsigned char unused3;
Tao Baod7db5942015-01-28 10:07:51 -080095 struct in_addr im_src, im_dst;
Ben Cheng655a7c02013-10-16 16:09:24 -070096};
Tao Baod7db5942015-01-28 10:07:51 -080097#define MFC_ASSERT_THRESH (3 * HZ)
Ben Cheng655a7c02013-10-16 16:09:24 -070098#define IGMPMSG_NOCACHE 1
Ben Cheng655a7c02013-10-16 16:09:24 -070099#define IGMPMSG_WRONGVIF 2
100#define IGMPMSG_WHOLEPKT 3
101#endif