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