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 _IP_VS_H 8 #define _IP_VS_H 9 #include <linux/types.h> 10 #define IP_VS_VERSION_CODE 0x010201 11 #define NVERSION(version) (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF 12 #define IP_VS_SVC_F_PERSISTENT 0x0001 13 #define IP_VS_SVC_F_HASHED 0x0002 14 #define IP_VS_SVC_F_ONEPACKET 0x0004 15 #define IP_VS_SVC_F_SCHED1 0x0008 16 #define IP_VS_SVC_F_SCHED2 0x0010 17 #define IP_VS_SVC_F_SCHED3 0x0020 18 #define IP_VS_SVC_F_SCHED_SH_FALLBACK IP_VS_SVC_F_SCHED1 19 #define IP_VS_SVC_F_SCHED_SH_PORT IP_VS_SVC_F_SCHED2 20 #define IP_VS_DEST_F_AVAILABLE 0x0001 21 #define IP_VS_DEST_F_OVERLOAD 0x0002 22 #define IP_VS_STATE_NONE 0x0000 23 #define IP_VS_STATE_MASTER 0x0001 24 #define IP_VS_STATE_BACKUP 0x0002 25 #define IP_VS_BASE_CTL (64 + 1024 + 64) 26 #define IP_VS_SO_SET_NONE IP_VS_BASE_CTL 27 #define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL + 1) 28 #define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL + 2) 29 #define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL + 3) 30 #define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL + 4) 31 #define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL + 5) 32 #define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL + 6) 33 #define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL + 7) 34 #define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL + 8) 35 #define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL + 9) 36 #define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL + 10) 37 #define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL + 11) 38 #define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL + 12) 39 #define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL + 13) 40 #define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL + 14) 41 #define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL + 15) 42 #define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO 43 #define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL 44 #define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL + 1) 45 #define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL + 2) 46 #define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL + 3) 47 #define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL + 4) 48 #define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL + 5) 49 #define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL + 6) 50 #define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL + 7) 51 #define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON 52 #define IP_VS_CONN_F_FWD_MASK 0x0007 53 #define IP_VS_CONN_F_MASQ 0x0000 54 #define IP_VS_CONN_F_LOCALNODE 0x0001 55 #define IP_VS_CONN_F_TUNNEL 0x0002 56 #define IP_VS_CONN_F_DROUTE 0x0003 57 #define IP_VS_CONN_F_BYPASS 0x0004 58 #define IP_VS_CONN_F_SYNC 0x0020 59 #define IP_VS_CONN_F_HASHED 0x0040 60 #define IP_VS_CONN_F_NOOUTPUT 0x0080 61 #define IP_VS_CONN_F_INACTIVE 0x0100 62 #define IP_VS_CONN_F_OUT_SEQ 0x0200 63 #define IP_VS_CONN_F_IN_SEQ 0x0400 64 #define IP_VS_CONN_F_SEQ_MASK 0x0600 65 #define IP_VS_CONN_F_NO_CPORT 0x0800 66 #define IP_VS_CONN_F_TEMPLATE 0x1000 67 #define IP_VS_CONN_F_ONE_PACKET 0x2000 68 #define IP_VS_CONN_F_BACKUP_MASK (IP_VS_CONN_F_FWD_MASK | IP_VS_CONN_F_NOOUTPUT | IP_VS_CONN_F_INACTIVE | IP_VS_CONN_F_SEQ_MASK | IP_VS_CONN_F_NO_CPORT | IP_VS_CONN_F_TEMPLATE) 69 #define IP_VS_CONN_F_BACKUP_UPD_MASK (IP_VS_CONN_F_INACTIVE | IP_VS_CONN_F_SEQ_MASK) 70 #define IP_VS_CONN_F_NFCT (1 << 16) 71 #define IP_VS_CONN_F_DEST_MASK (IP_VS_CONN_F_FWD_MASK | IP_VS_CONN_F_ONE_PACKET | IP_VS_CONN_F_NFCT | 0) 72 #define IP_VS_SCHEDNAME_MAXLEN 16 73 #define IP_VS_PENAME_MAXLEN 16 74 #define IP_VS_IFNAME_MAXLEN 16 75 #define IP_VS_PEDATA_MAXLEN 255 76 enum { 77 IP_VS_CONN_F_TUNNEL_TYPE_IPIP = 0, 78 IP_VS_CONN_F_TUNNEL_TYPE_GUE, 79 IP_VS_CONN_F_TUNNEL_TYPE_GRE, 80 IP_VS_CONN_F_TUNNEL_TYPE_MAX, 81 }; 82 #define IP_VS_TUNNEL_ENCAP_FLAG_NOCSUM (0) 83 #define IP_VS_TUNNEL_ENCAP_FLAG_CSUM (1 << 0) 84 #define IP_VS_TUNNEL_ENCAP_FLAG_REMCSUM (1 << 1) 85 struct ip_vs_service_user { 86 __u16 protocol; 87 __be32 addr; 88 __be16 port; 89 __u32 fwmark; 90 char sched_name[IP_VS_SCHEDNAME_MAXLEN]; 91 unsigned int flags; 92 unsigned int timeout; 93 __be32 netmask; 94 }; 95 struct ip_vs_dest_user { 96 __be32 addr; 97 __be16 port; 98 unsigned int conn_flags; 99 int weight; 100 __u32 u_threshold; 101 __u32 l_threshold; 102 }; 103 struct ip_vs_stats_user { 104 __u32 conns; 105 __u32 inpkts; 106 __u32 outpkts; 107 __u64 inbytes; 108 __u64 outbytes; 109 __u32 cps; 110 __u32 inpps; 111 __u32 outpps; 112 __u32 inbps; 113 __u32 outbps; 114 }; 115 struct ip_vs_getinfo { 116 unsigned int version; 117 unsigned int size; 118 unsigned int num_services; 119 }; 120 struct ip_vs_service_entry { 121 __u16 protocol; 122 __be32 addr; 123 __be16 port; 124 __u32 fwmark; 125 char sched_name[IP_VS_SCHEDNAME_MAXLEN]; 126 unsigned int flags; 127 unsigned int timeout; 128 __be32 netmask; 129 unsigned int num_dests; 130 struct ip_vs_stats_user stats; 131 }; 132 struct ip_vs_dest_entry { 133 __be32 addr; 134 __be16 port; 135 unsigned int conn_flags; 136 int weight; 137 __u32 u_threshold; 138 __u32 l_threshold; 139 __u32 activeconns; 140 __u32 inactconns; 141 __u32 persistconns; 142 struct ip_vs_stats_user stats; 143 }; 144 struct ip_vs_get_dests { 145 __u16 protocol; 146 __be32 addr; 147 __be16 port; 148 __u32 fwmark; 149 unsigned int num_dests; 150 struct ip_vs_dest_entry entrytable[]; 151 }; 152 struct ip_vs_get_services { 153 unsigned int num_services; 154 struct ip_vs_service_entry entrytable[]; 155 }; 156 struct ip_vs_timeout_user { 157 int tcp_timeout; 158 int tcp_fin_timeout; 159 int udp_timeout; 160 }; 161 struct ip_vs_daemon_user { 162 int state; 163 char mcast_ifn[IP_VS_IFNAME_MAXLEN]; 164 int syncid; 165 }; 166 #define IPVS_GENL_NAME "IPVS" 167 #define IPVS_GENL_VERSION 0x1 168 struct ip_vs_flags { 169 __u32 flags; 170 __u32 mask; 171 }; 172 enum { 173 IPVS_CMD_UNSPEC = 0, 174 IPVS_CMD_NEW_SERVICE, 175 IPVS_CMD_SET_SERVICE, 176 IPVS_CMD_DEL_SERVICE, 177 IPVS_CMD_GET_SERVICE, 178 IPVS_CMD_NEW_DEST, 179 IPVS_CMD_SET_DEST, 180 IPVS_CMD_DEL_DEST, 181 IPVS_CMD_GET_DEST, 182 IPVS_CMD_NEW_DAEMON, 183 IPVS_CMD_DEL_DAEMON, 184 IPVS_CMD_GET_DAEMON, 185 IPVS_CMD_SET_CONFIG, 186 IPVS_CMD_GET_CONFIG, 187 IPVS_CMD_SET_INFO, 188 IPVS_CMD_GET_INFO, 189 IPVS_CMD_ZERO, 190 IPVS_CMD_FLUSH, 191 __IPVS_CMD_MAX, 192 }; 193 #define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1) 194 enum { 195 IPVS_CMD_ATTR_UNSPEC = 0, 196 IPVS_CMD_ATTR_SERVICE, 197 IPVS_CMD_ATTR_DEST, 198 IPVS_CMD_ATTR_DAEMON, 199 IPVS_CMD_ATTR_TIMEOUT_TCP, 200 IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, 201 IPVS_CMD_ATTR_TIMEOUT_UDP, 202 __IPVS_CMD_ATTR_MAX, 203 }; 204 #define IPVS_CMD_ATTR_MAX (__IPVS_CMD_ATTR_MAX - 1) 205 enum { 206 IPVS_SVC_ATTR_UNSPEC = 0, 207 IPVS_SVC_ATTR_AF, 208 IPVS_SVC_ATTR_PROTOCOL, 209 IPVS_SVC_ATTR_ADDR, 210 IPVS_SVC_ATTR_PORT, 211 IPVS_SVC_ATTR_FWMARK, 212 IPVS_SVC_ATTR_SCHED_NAME, 213 IPVS_SVC_ATTR_FLAGS, 214 IPVS_SVC_ATTR_TIMEOUT, 215 IPVS_SVC_ATTR_NETMASK, 216 IPVS_SVC_ATTR_STATS, 217 IPVS_SVC_ATTR_PE_NAME, 218 IPVS_SVC_ATTR_STATS64, 219 __IPVS_SVC_ATTR_MAX, 220 }; 221 #define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1) 222 enum { 223 IPVS_DEST_ATTR_UNSPEC = 0, 224 IPVS_DEST_ATTR_ADDR, 225 IPVS_DEST_ATTR_PORT, 226 IPVS_DEST_ATTR_FWD_METHOD, 227 IPVS_DEST_ATTR_WEIGHT, 228 IPVS_DEST_ATTR_U_THRESH, 229 IPVS_DEST_ATTR_L_THRESH, 230 IPVS_DEST_ATTR_ACTIVE_CONNS, 231 IPVS_DEST_ATTR_INACT_CONNS, 232 IPVS_DEST_ATTR_PERSIST_CONNS, 233 IPVS_DEST_ATTR_STATS, 234 IPVS_DEST_ATTR_ADDR_FAMILY, 235 IPVS_DEST_ATTR_STATS64, 236 IPVS_DEST_ATTR_TUN_TYPE, 237 IPVS_DEST_ATTR_TUN_PORT, 238 IPVS_DEST_ATTR_TUN_FLAGS, 239 __IPVS_DEST_ATTR_MAX, 240 }; 241 #define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1) 242 enum { 243 IPVS_DAEMON_ATTR_UNSPEC = 0, 244 IPVS_DAEMON_ATTR_STATE, 245 IPVS_DAEMON_ATTR_MCAST_IFN, 246 IPVS_DAEMON_ATTR_SYNC_ID, 247 IPVS_DAEMON_ATTR_SYNC_MAXLEN, 248 IPVS_DAEMON_ATTR_MCAST_GROUP, 249 IPVS_DAEMON_ATTR_MCAST_GROUP6, 250 IPVS_DAEMON_ATTR_MCAST_PORT, 251 IPVS_DAEMON_ATTR_MCAST_TTL, 252 __IPVS_DAEMON_ATTR_MAX, 253 }; 254 #define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1) 255 enum { 256 IPVS_STATS_ATTR_UNSPEC = 0, 257 IPVS_STATS_ATTR_CONNS, 258 IPVS_STATS_ATTR_INPKTS, 259 IPVS_STATS_ATTR_OUTPKTS, 260 IPVS_STATS_ATTR_INBYTES, 261 IPVS_STATS_ATTR_OUTBYTES, 262 IPVS_STATS_ATTR_CPS, 263 IPVS_STATS_ATTR_INPPS, 264 IPVS_STATS_ATTR_OUTPPS, 265 IPVS_STATS_ATTR_INBPS, 266 IPVS_STATS_ATTR_OUTBPS, 267 IPVS_STATS_ATTR_PAD, 268 __IPVS_STATS_ATTR_MAX, 269 }; 270 #define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1) 271 enum { 272 IPVS_INFO_ATTR_UNSPEC = 0, 273 IPVS_INFO_ATTR_VERSION, 274 IPVS_INFO_ATTR_CONN_TAB_SIZE, 275 __IPVS_INFO_ATTR_MAX, 276 }; 277 #define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1) 278 #endif 279