Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 1 | /* |
| 2 | * IP Virtual Server |
| 3 | * data structure and functionality definitions |
| 4 | */ |
| 5 | |
| 6 | #ifndef _IP_VS_H |
| 7 | #define _IP_VS_H |
| 8 | |
| 9 | #include <linux/types.h> /* For __beXX types in userland */ |
| 10 | |
| 11 | #define IP_VS_VERSION_CODE 0x010201 |
| 12 | #define NVERSION(version) \ |
| 13 | (version >> 16) & 0xFF, \ |
| 14 | (version >> 8) & 0xFF, \ |
| 15 | version & 0xFF |
| 16 | |
| 17 | /* |
| 18 | * Virtual Service Flags |
| 19 | */ |
| 20 | #define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ |
| 21 | #define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ |
Nick Chalk | 26ec037 | 2010-06-22 08:07:01 +0200 | [diff] [blame] | 22 | #define IP_VS_SVC_F_ONEPACKET 0x0004 /* one-packet scheduling */ |
Alexander Frolkin | eba3b5a | 2013-06-19 10:54:25 +0100 | [diff] [blame] | 23 | #define IP_VS_SVC_F_SCHED1 0x0008 /* scheduler flag 1 */ |
| 24 | #define IP_VS_SVC_F_SCHED2 0x0010 /* scheduler flag 2 */ |
| 25 | #define IP_VS_SVC_F_SCHED3 0x0020 /* scheduler flag 3 */ |
| 26 | |
| 27 | #define IP_VS_SVC_F_SCHED_SH_FALLBACK IP_VS_SVC_F_SCHED1 /* SH fallback */ |
| 28 | #define IP_VS_SVC_F_SCHED_SH_PORT IP_VS_SVC_F_SCHED2 /* SH use port */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 29 | |
| 30 | /* |
| 31 | * Destination Server Flags |
| 32 | */ |
| 33 | #define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */ |
| 34 | #define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */ |
| 35 | |
| 36 | /* |
| 37 | * IPVS sync daemon states |
| 38 | */ |
| 39 | #define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */ |
| 40 | #define IP_VS_STATE_MASTER 0x0001 /* started as master */ |
| 41 | #define IP_VS_STATE_BACKUP 0x0002 /* started as backup */ |
| 42 | |
| 43 | /* |
| 44 | * IPVS socket options |
| 45 | */ |
| 46 | #define IP_VS_BASE_CTL (64+1024+64) /* base */ |
| 47 | |
| 48 | #define IP_VS_SO_SET_NONE IP_VS_BASE_CTL /* just peek */ |
| 49 | #define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL+1) |
| 50 | #define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL+2) |
| 51 | #define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL+3) |
| 52 | #define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL+4) |
| 53 | #define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL+5) |
| 54 | #define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL+6) |
| 55 | #define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL+7) |
| 56 | #define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL+8) |
| 57 | #define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL+9) |
| 58 | #define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL+10) |
| 59 | #define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11) |
| 60 | #define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12) |
| 61 | #define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL+13) |
| 62 | #define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL+14) |
| 63 | #define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL+15) |
| 64 | #define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO |
| 65 | |
| 66 | #define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL |
| 67 | #define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL+1) |
| 68 | #define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL+2) |
| 69 | #define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL+3) |
| 70 | #define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL+4) |
| 71 | #define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL+5) /* not used now */ |
| 72 | #define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL+6) |
| 73 | #define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL+7) |
| 74 | #define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON |
| 75 | |
| 76 | |
| 77 | /* |
| 78 | * IPVS Connection Flags |
Julian Anastasov | 3575792 | 2010-09-17 14:18:16 +0200 | [diff] [blame] | 79 | * Only flags 0..15 are sent to backup server |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 80 | */ |
| 81 | #define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ |
| 82 | #define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ |
| 83 | #define IP_VS_CONN_F_LOCALNODE 0x0001 /* local node */ |
| 84 | #define IP_VS_CONN_F_TUNNEL 0x0002 /* tunneling */ |
| 85 | #define IP_VS_CONN_F_DROUTE 0x0003 /* direct routing */ |
| 86 | #define IP_VS_CONN_F_BYPASS 0x0004 /* cache bypass */ |
| 87 | #define IP_VS_CONN_F_SYNC 0x0020 /* entry created by sync */ |
| 88 | #define IP_VS_CONN_F_HASHED 0x0040 /* hashed entry */ |
| 89 | #define IP_VS_CONN_F_NOOUTPUT 0x0080 /* no output packets */ |
| 90 | #define IP_VS_CONN_F_INACTIVE 0x0100 /* not established */ |
| 91 | #define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */ |
| 92 | #define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */ |
| 93 | #define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ |
| 94 | #define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ |
| 95 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ |
Nick Chalk | 26ec037 | 2010-06-22 08:07:01 +0200 | [diff] [blame] | 96 | #define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 97 | |
Julian Anastasov | cdcc5e9 | 2012-04-24 23:46:38 +0300 | [diff] [blame] | 98 | /* Initial bits allowed in backup server */ |
Hans Schillstrom | fe5e7a1 | 2010-11-19 14:25:12 +0100 | [diff] [blame] | 99 | #define IP_VS_CONN_F_BACKUP_MASK (IP_VS_CONN_F_FWD_MASK | \ |
| 100 | IP_VS_CONN_F_NOOUTPUT | \ |
| 101 | IP_VS_CONN_F_INACTIVE | \ |
| 102 | IP_VS_CONN_F_SEQ_MASK | \ |
| 103 | IP_VS_CONN_F_NO_CPORT | \ |
| 104 | IP_VS_CONN_F_TEMPLATE \ |
| 105 | ) |
| 106 | |
Julian Anastasov | cdcc5e9 | 2012-04-24 23:46:38 +0300 | [diff] [blame] | 107 | /* Bits allowed to update in backup server */ |
| 108 | #define IP_VS_CONN_F_BACKUP_UPD_MASK (IP_VS_CONN_F_INACTIVE | \ |
| 109 | IP_VS_CONN_F_SEQ_MASK) |
| 110 | |
Julian Anastasov | 3575792 | 2010-09-17 14:18:16 +0200 | [diff] [blame] | 111 | /* Flags that are not sent to backup server start from bit 16 */ |
Julian Anastasov | f4bc17c | 2010-09-21 17:35:41 +0200 | [diff] [blame] | 112 | #define IP_VS_CONN_F_NFCT (1 << 16) /* use netfilter conntrack */ |
Julian Anastasov | 3575792 | 2010-09-17 14:18:16 +0200 | [diff] [blame] | 113 | |
| 114 | /* Connection flags from destination that can be changed by user space */ |
| 115 | #define IP_VS_CONN_F_DEST_MASK (IP_VS_CONN_F_FWD_MASK | \ |
| 116 | IP_VS_CONN_F_ONE_PACKET | \ |
Julian Anastasov | f4bc17c | 2010-09-21 17:35:41 +0200 | [diff] [blame] | 117 | IP_VS_CONN_F_NFCT | \ |
Julian Anastasov | 3575792 | 2010-09-17 14:18:16 +0200 | [diff] [blame] | 118 | 0) |
| 119 | |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 120 | #define IP_VS_SCHEDNAME_MAXLEN 16 |
Simon Horman | 8599928 | 2010-08-22 21:37:53 +0900 | [diff] [blame] | 121 | #define IP_VS_PENAME_MAXLEN 16 |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 122 | #define IP_VS_IFNAME_MAXLEN 16 |
| 123 | |
Simon Horman | 8599928 | 2010-08-22 21:37:53 +0900 | [diff] [blame] | 124 | #define IP_VS_PEDATA_MAXLEN 255 |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 125 | |
| 126 | /* |
| 127 | * The struct ip_vs_service_user and struct ip_vs_dest_user are |
| 128 | * used to set IPVS rules through setsockopt. |
| 129 | */ |
| 130 | struct ip_vs_service_user { |
| 131 | /* virtual service addresses */ |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 132 | __u16 protocol; |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 133 | __be32 addr; /* virtual ip address */ |
| 134 | __be16 port; |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 135 | __u32 fwmark; /* firwall mark of service */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 136 | |
| 137 | /* virtual service options */ |
| 138 | char sched_name[IP_VS_SCHEDNAME_MAXLEN]; |
Eric Dumazet | 95c9617 | 2012-04-15 05:58:06 +0000 | [diff] [blame] | 139 | unsigned int flags; /* virtual service flags */ |
| 140 | unsigned int timeout; /* persistent timeout in sec */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 141 | __be32 netmask; /* persistent netmask */ |
| 142 | }; |
| 143 | |
| 144 | |
| 145 | struct ip_vs_dest_user { |
| 146 | /* destination server address */ |
| 147 | __be32 addr; |
| 148 | __be16 port; |
| 149 | |
| 150 | /* real server options */ |
Eric Dumazet | 95c9617 | 2012-04-15 05:58:06 +0000 | [diff] [blame] | 151 | unsigned int conn_flags; /* connection flags */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 152 | int weight; /* destination weight */ |
| 153 | |
| 154 | /* thresholds for active connections */ |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 155 | __u32 u_threshold; /* upper threshold */ |
| 156 | __u32 l_threshold; /* lower threshold */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 157 | }; |
| 158 | |
| 159 | |
| 160 | /* |
| 161 | * IPVS statistics object (for user space) |
| 162 | */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 163 | struct ip_vs_stats_user { |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 164 | __u32 conns; /* connections scheduled */ |
| 165 | __u32 inpkts; /* incoming packets */ |
| 166 | __u32 outpkts; /* outgoing packets */ |
| 167 | __u64 inbytes; /* incoming bytes */ |
| 168 | __u64 outbytes; /* outgoing bytes */ |
| 169 | |
| 170 | __u32 cps; /* current connection rate */ |
| 171 | __u32 inpps; /* current in packet rate */ |
| 172 | __u32 outpps; /* current out packet rate */ |
| 173 | __u32 inbps; /* current in byte rate */ |
| 174 | __u32 outbps; /* current out byte rate */ |
| 175 | }; |
| 176 | |
| 177 | |
| 178 | /* The argument to IP_VS_SO_GET_INFO */ |
| 179 | struct ip_vs_getinfo { |
| 180 | /* version number */ |
| 181 | unsigned int version; |
| 182 | |
| 183 | /* size of connection hash table */ |
| 184 | unsigned int size; |
| 185 | |
| 186 | /* number of virtual services */ |
| 187 | unsigned int num_services; |
| 188 | }; |
| 189 | |
| 190 | |
| 191 | /* The argument to IP_VS_SO_GET_SERVICE */ |
| 192 | struct ip_vs_service_entry { |
| 193 | /* which service: user fills in these */ |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 194 | __u16 protocol; |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 195 | __be32 addr; /* virtual address */ |
| 196 | __be16 port; |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 197 | __u32 fwmark; /* firwall mark of service */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 198 | |
| 199 | /* service options */ |
| 200 | char sched_name[IP_VS_SCHEDNAME_MAXLEN]; |
Eric Dumazet | 95c9617 | 2012-04-15 05:58:06 +0000 | [diff] [blame] | 201 | unsigned int flags; /* virtual service flags */ |
| 202 | unsigned int timeout; /* persistent timeout */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 203 | __be32 netmask; /* persistent netmask */ |
| 204 | |
| 205 | /* number of real servers */ |
| 206 | unsigned int num_dests; |
| 207 | |
| 208 | /* statistics */ |
| 209 | struct ip_vs_stats_user stats; |
| 210 | }; |
| 211 | |
| 212 | |
| 213 | struct ip_vs_dest_entry { |
| 214 | __be32 addr; /* destination address */ |
| 215 | __be16 port; |
Eric Dumazet | 95c9617 | 2012-04-15 05:58:06 +0000 | [diff] [blame] | 216 | unsigned int conn_flags; /* connection flags */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 217 | int weight; /* destination weight */ |
| 218 | |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 219 | __u32 u_threshold; /* upper threshold */ |
| 220 | __u32 l_threshold; /* lower threshold */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 221 | |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 222 | __u32 activeconns; /* active connections */ |
| 223 | __u32 inactconns; /* inactive connections */ |
| 224 | __u32 persistconns; /* persistent connections */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 225 | |
| 226 | /* statistics */ |
| 227 | struct ip_vs_stats_user stats; |
| 228 | }; |
| 229 | |
| 230 | |
| 231 | /* The argument to IP_VS_SO_GET_DESTS */ |
| 232 | struct ip_vs_get_dests { |
| 233 | /* which service: user fills in these */ |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 234 | __u16 protocol; |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 235 | __be32 addr; /* virtual address */ |
| 236 | __be16 port; |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame] | 237 | __u32 fwmark; /* firwall mark of service */ |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 238 | |
| 239 | /* number of real servers */ |
| 240 | unsigned int num_dests; |
| 241 | |
| 242 | /* the real servers */ |
| 243 | struct ip_vs_dest_entry entrytable[0]; |
| 244 | }; |
| 245 | |
| 246 | |
| 247 | /* The argument to IP_VS_SO_GET_SERVICES */ |
| 248 | struct ip_vs_get_services { |
| 249 | /* number of virtual services */ |
| 250 | unsigned int num_services; |
| 251 | |
| 252 | /* service table */ |
| 253 | struct ip_vs_service_entry entrytable[0]; |
| 254 | }; |
| 255 | |
| 256 | |
| 257 | /* The argument to IP_VS_SO_GET_TIMEOUT */ |
| 258 | struct ip_vs_timeout_user { |
| 259 | int tcp_timeout; |
| 260 | int tcp_fin_timeout; |
| 261 | int udp_timeout; |
| 262 | }; |
| 263 | |
| 264 | |
| 265 | /* The argument to IP_VS_SO_GET_DAEMON */ |
| 266 | struct ip_vs_daemon_user { |
| 267 | /* sync daemon state (master/backup) */ |
| 268 | int state; |
| 269 | |
| 270 | /* multicast interface name */ |
| 271 | char mcast_ifn[IP_VS_IFNAME_MAXLEN]; |
| 272 | |
| 273 | /* SyncID we belong to */ |
| 274 | int syncid; |
| 275 | }; |
| 276 | |
Julius Volz | c1bc667 | 2008-08-07 16:43:38 +0200 | [diff] [blame] | 277 | /* |
| 278 | * |
| 279 | * IPVS Generic Netlink interface definitions |
| 280 | * |
| 281 | */ |
| 282 | |
| 283 | /* Generic Netlink family info */ |
| 284 | |
| 285 | #define IPVS_GENL_NAME "IPVS" |
| 286 | #define IPVS_GENL_VERSION 0x1 |
| 287 | |
| 288 | struct ip_vs_flags { |
Julian Anastasov | 0a92586 | 2013-04-17 23:50:49 +0300 | [diff] [blame] | 289 | __u32 flags; |
| 290 | __u32 mask; |
Julius Volz | c1bc667 | 2008-08-07 16:43:38 +0200 | [diff] [blame] | 291 | }; |
| 292 | |
| 293 | /* Generic Netlink command attributes */ |
| 294 | enum { |
| 295 | IPVS_CMD_UNSPEC = 0, |
| 296 | |
| 297 | IPVS_CMD_NEW_SERVICE, /* add service */ |
| 298 | IPVS_CMD_SET_SERVICE, /* modify service */ |
| 299 | IPVS_CMD_DEL_SERVICE, /* delete service */ |
| 300 | IPVS_CMD_GET_SERVICE, /* get service info */ |
| 301 | |
| 302 | IPVS_CMD_NEW_DEST, /* add destination */ |
| 303 | IPVS_CMD_SET_DEST, /* modify destination */ |
| 304 | IPVS_CMD_DEL_DEST, /* delete destination */ |
| 305 | IPVS_CMD_GET_DEST, /* get destination info */ |
| 306 | |
| 307 | IPVS_CMD_NEW_DAEMON, /* start sync daemon */ |
| 308 | IPVS_CMD_DEL_DAEMON, /* stop sync daemon */ |
| 309 | IPVS_CMD_GET_DAEMON, /* get sync daemon status */ |
| 310 | |
| 311 | IPVS_CMD_SET_CONFIG, /* set config settings */ |
| 312 | IPVS_CMD_GET_CONFIG, /* get config settings */ |
| 313 | |
| 314 | IPVS_CMD_SET_INFO, /* only used in GET_INFO reply */ |
| 315 | IPVS_CMD_GET_INFO, /* get general IPVS info */ |
| 316 | |
| 317 | IPVS_CMD_ZERO, /* zero all counters and stats */ |
| 318 | IPVS_CMD_FLUSH, /* flush services and dests */ |
| 319 | |
| 320 | __IPVS_CMD_MAX, |
| 321 | }; |
| 322 | |
| 323 | #define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1) |
| 324 | |
| 325 | /* Attributes used in the first level of commands */ |
| 326 | enum { |
| 327 | IPVS_CMD_ATTR_UNSPEC = 0, |
| 328 | IPVS_CMD_ATTR_SERVICE, /* nested service attribute */ |
| 329 | IPVS_CMD_ATTR_DEST, /* nested destination attribute */ |
| 330 | IPVS_CMD_ATTR_DAEMON, /* nested sync daemon attribute */ |
| 331 | IPVS_CMD_ATTR_TIMEOUT_TCP, /* TCP connection timeout */ |
| 332 | IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, /* TCP FIN wait timeout */ |
| 333 | IPVS_CMD_ATTR_TIMEOUT_UDP, /* UDP timeout */ |
| 334 | __IPVS_CMD_ATTR_MAX, |
| 335 | }; |
| 336 | |
Julian Anastasov | 120c979 | 2013-08-28 19:31:22 +0300 | [diff] [blame] | 337 | #define IPVS_CMD_ATTR_MAX (__IPVS_CMD_ATTR_MAX - 1) |
Julius Volz | c1bc667 | 2008-08-07 16:43:38 +0200 | [diff] [blame] | 338 | |
| 339 | /* |
| 340 | * Attributes used to describe a service |
| 341 | * |
| 342 | * Used inside nested attribute IPVS_CMD_ATTR_SERVICE |
| 343 | */ |
| 344 | enum { |
| 345 | IPVS_SVC_ATTR_UNSPEC = 0, |
| 346 | IPVS_SVC_ATTR_AF, /* address family */ |
| 347 | IPVS_SVC_ATTR_PROTOCOL, /* virtual service protocol */ |
| 348 | IPVS_SVC_ATTR_ADDR, /* virtual service address */ |
| 349 | IPVS_SVC_ATTR_PORT, /* virtual service port */ |
| 350 | IPVS_SVC_ATTR_FWMARK, /* firewall mark of service */ |
| 351 | |
| 352 | IPVS_SVC_ATTR_SCHED_NAME, /* name of scheduler */ |
| 353 | IPVS_SVC_ATTR_FLAGS, /* virtual service flags */ |
| 354 | IPVS_SVC_ATTR_TIMEOUT, /* persistent timeout */ |
| 355 | IPVS_SVC_ATTR_NETMASK, /* persistent netmask */ |
| 356 | |
| 357 | IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */ |
Simon Horman | 0d1e71b | 2010-08-22 21:37:54 +0900 | [diff] [blame] | 358 | |
| 359 | IPVS_SVC_ATTR_PE_NAME, /* name of ct retriever */ |
| 360 | |
Julius Volz | c1bc667 | 2008-08-07 16:43:38 +0200 | [diff] [blame] | 361 | __IPVS_SVC_ATTR_MAX, |
| 362 | }; |
| 363 | |
| 364 | #define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1) |
| 365 | |
| 366 | /* |
| 367 | * Attributes used to describe a destination (real server) |
| 368 | * |
| 369 | * Used inside nested attribute IPVS_CMD_ATTR_DEST |
| 370 | */ |
| 371 | enum { |
| 372 | IPVS_DEST_ATTR_UNSPEC = 0, |
| 373 | IPVS_DEST_ATTR_ADDR, /* real server address */ |
| 374 | IPVS_DEST_ATTR_PORT, /* real server port */ |
| 375 | |
| 376 | IPVS_DEST_ATTR_FWD_METHOD, /* forwarding method */ |
| 377 | IPVS_DEST_ATTR_WEIGHT, /* destination weight */ |
| 378 | |
| 379 | IPVS_DEST_ATTR_U_THRESH, /* upper threshold */ |
| 380 | IPVS_DEST_ATTR_L_THRESH, /* lower threshold */ |
| 381 | |
| 382 | IPVS_DEST_ATTR_ACTIVE_CONNS, /* active connections */ |
| 383 | IPVS_DEST_ATTR_INACT_CONNS, /* inactive connections */ |
| 384 | IPVS_DEST_ATTR_PERSIST_CONNS, /* persistent connections */ |
| 385 | |
| 386 | IPVS_DEST_ATTR_STATS, /* nested attribute for dest stats */ |
Alex Gartrell | 6cff339 | 2014-09-09 16:40:20 -0700 | [diff] [blame] | 387 | |
| 388 | IPVS_DEST_ATTR_ADDR_FAMILY, /* Address family of address */ |
| 389 | |
Julius Volz | c1bc667 | 2008-08-07 16:43:38 +0200 | [diff] [blame] | 390 | __IPVS_DEST_ATTR_MAX, |
| 391 | }; |
| 392 | |
| 393 | #define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1) |
| 394 | |
| 395 | /* |
| 396 | * Attributes describing a sync daemon |
| 397 | * |
| 398 | * Used inside nested attribute IPVS_CMD_ATTR_DAEMON |
| 399 | */ |
| 400 | enum { |
| 401 | IPVS_DAEMON_ATTR_UNSPEC = 0, |
| 402 | IPVS_DAEMON_ATTR_STATE, /* sync daemon state (master/backup) */ |
| 403 | IPVS_DAEMON_ATTR_MCAST_IFN, /* multicast interface name */ |
| 404 | IPVS_DAEMON_ATTR_SYNC_ID, /* SyncID we belong to */ |
| 405 | __IPVS_DAEMON_ATTR_MAX, |
| 406 | }; |
| 407 | |
| 408 | #define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1) |
| 409 | |
| 410 | /* |
| 411 | * Attributes used to describe service or destination entry statistics |
| 412 | * |
| 413 | * Used inside nested attributes IPVS_SVC_ATTR_STATS and IPVS_DEST_ATTR_STATS |
| 414 | */ |
| 415 | enum { |
| 416 | IPVS_STATS_ATTR_UNSPEC = 0, |
| 417 | IPVS_STATS_ATTR_CONNS, /* connections scheduled */ |
| 418 | IPVS_STATS_ATTR_INPKTS, /* incoming packets */ |
| 419 | IPVS_STATS_ATTR_OUTPKTS, /* outgoing packets */ |
| 420 | IPVS_STATS_ATTR_INBYTES, /* incoming bytes */ |
| 421 | IPVS_STATS_ATTR_OUTBYTES, /* outgoing bytes */ |
| 422 | |
| 423 | IPVS_STATS_ATTR_CPS, /* current connection rate */ |
| 424 | IPVS_STATS_ATTR_INPPS, /* current in packet rate */ |
| 425 | IPVS_STATS_ATTR_OUTPPS, /* current out packet rate */ |
| 426 | IPVS_STATS_ATTR_INBPS, /* current in byte rate */ |
| 427 | IPVS_STATS_ATTR_OUTBPS, /* current out byte rate */ |
| 428 | __IPVS_STATS_ATTR_MAX, |
| 429 | }; |
| 430 | |
| 431 | #define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1) |
| 432 | |
| 433 | /* Attributes used in response to IPVS_CMD_GET_INFO command */ |
| 434 | enum { |
| 435 | IPVS_INFO_ATTR_UNSPEC = 0, |
| 436 | IPVS_INFO_ATTR_VERSION, /* IPVS version number */ |
| 437 | IPVS_INFO_ATTR_CONN_TAB_SIZE, /* size of connection hash table */ |
| 438 | __IPVS_INFO_ATTR_MAX, |
| 439 | }; |
| 440 | |
| 441 | #define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1) |
| 442 | |
Julius Volz | bc4768e | 2008-07-31 20:45:24 -0700 | [diff] [blame] | 443 | #endif /* _IP_VS_H */ |