~ubuntu-branches/ubuntu/vivid/keepalived/vivid

« back to all changes in this revision

Viewing changes to keepalived/libipvs-2.6/ip_vs.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2011-10-25 16:10:58 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20111025161058-bgqn5elt0xo1tq0a
Tags: 1:1.2.2-1ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - debian/rules: DEB_UPDATE_RCD_PARAMS := explicit init start/stop
    parameters (don't stop at 0 and 6)
  - debian/init.d: init script header adapted to stop rule
  - debian/keepalived.postinst: Remove shutdown and reboot links
* Build with libnl3, thanks to a patch from Marc - A. Dahlhaus.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 <asm/types.h>          /* For __uXX types */
 
10
#include <linux/types.h>        /* For __beXX types in userland */
 
11
 
 
12
#include <netinet/in.h>
 
13
#include <sys/types.h>
 
14
#include <sys/socket.h>
 
15
#include <arpa/inet.h>
 
16
 
 
17
#ifdef LIBIPVS_USE_NL
 
18
#include <netlink/netlink.h>
 
19
#include <netlink/genl/genl.h>
 
20
#include <netlink/genl/ctrl.h>
 
21
#endif
 
22
 
 
23
#define IP_VS_VERSION_CODE      0x010201
 
24
#define NVERSION(version)                       \
 
25
        (version >> 16) & 0xFF,                 \
 
26
        (version >> 8) & 0xFF,                  \
 
27
        version & 0xFF
 
28
 
 
29
/*
 
30
 *      Virtual Service Flags
 
31
 */
 
32
#define IP_VS_SVC_F_PERSISTENT  0x0001          /* persistent port */
 
33
#define IP_VS_SVC_F_HASHED      0x0002          /* hashed entry */
 
34
 
 
35
/*
 
36
 *      Destination Server Flags
 
37
 */
 
38
#define IP_VS_DEST_F_AVAILABLE  0x0001          /* server is available */
 
39
#define IP_VS_DEST_F_OVERLOAD   0x0002          /* server is overloaded */
 
40
 
 
41
/*
 
42
 *      IPVS sync daemon states
 
43
 */
 
44
#define IP_VS_STATE_NONE        0x0000          /* daemon is stopped */
 
45
#define IP_VS_STATE_MASTER      0x0001          /* started as master */
 
46
#define IP_VS_STATE_BACKUP      0x0002          /* started as backup */
 
47
 
 
48
/*
 
49
 *      IPVS socket options
 
50
 */
 
51
#define IP_VS_BASE_CTL          (64+1024+64)            /* base */
 
52
 
 
53
#define IP_VS_SO_SET_NONE       IP_VS_BASE_CTL          /* just peek */
 
54
#define IP_VS_SO_SET_INSERT     (IP_VS_BASE_CTL+1)
 
55
#define IP_VS_SO_SET_ADD        (IP_VS_BASE_CTL+2)
 
56
#define IP_VS_SO_SET_EDIT       (IP_VS_BASE_CTL+3)
 
57
#define IP_VS_SO_SET_DEL        (IP_VS_BASE_CTL+4)
 
58
#define IP_VS_SO_SET_FLUSH      (IP_VS_BASE_CTL+5)
 
59
#define IP_VS_SO_SET_LIST       (IP_VS_BASE_CTL+6)
 
60
#define IP_VS_SO_SET_ADDDEST    (IP_VS_BASE_CTL+7)
 
61
#define IP_VS_SO_SET_DELDEST    (IP_VS_BASE_CTL+8)
 
62
#define IP_VS_SO_SET_EDITDEST   (IP_VS_BASE_CTL+9)
 
63
#define IP_VS_SO_SET_TIMEOUT    (IP_VS_BASE_CTL+10)
 
64
#define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11)
 
65
#define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12)
 
66
#define IP_VS_SO_SET_RESTORE    (IP_VS_BASE_CTL+13)
 
67
#define IP_VS_SO_SET_SAVE       (IP_VS_BASE_CTL+14)
 
68
#define IP_VS_SO_SET_ZERO       (IP_VS_BASE_CTL+15)
 
69
#define IP_VS_SO_SET_MAX        IP_VS_SO_SET_ZERO
 
70
 
 
71
#define IP_VS_SO_GET_VERSION    IP_VS_BASE_CTL
 
72
#define IP_VS_SO_GET_INFO       (IP_VS_BASE_CTL+1)
 
73
#define IP_VS_SO_GET_SERVICES   (IP_VS_BASE_CTL+2)
 
74
#define IP_VS_SO_GET_SERVICE    (IP_VS_BASE_CTL+3)
 
75
#define IP_VS_SO_GET_DESTS      (IP_VS_BASE_CTL+4)
 
76
#define IP_VS_SO_GET_DEST       (IP_VS_BASE_CTL+5)      /* not used now */
 
77
#define IP_VS_SO_GET_TIMEOUT    (IP_VS_BASE_CTL+6)
 
78
#define IP_VS_SO_GET_DAEMON     (IP_VS_BASE_CTL+7)
 
79
#define IP_VS_SO_GET_MAX        IP_VS_SO_GET_DAEMON
 
80
 
 
81
 
 
82
/*
 
83
 *      IPVS Connection Flags
 
84
 */
 
85
#define IP_VS_CONN_F_FWD_MASK   0x0007          /* mask for the fwd methods */
 
86
#define IP_VS_CONN_F_MASQ       0x0000          /* masquerading/NAT */
 
87
#define IP_VS_CONN_F_LOCALNODE  0x0001          /* local node */
 
88
#define IP_VS_CONN_F_TUNNEL     0x0002          /* tunneling */
 
89
#define IP_VS_CONN_F_DROUTE     0x0003          /* direct routing */
 
90
#define IP_VS_CONN_F_BYPASS     0x0004          /* cache bypass */
 
91
#define IP_VS_CONN_F_SYNC       0x0020          /* entry created by sync */
 
92
#define IP_VS_CONN_F_HASHED     0x0040          /* hashed entry */
 
93
#define IP_VS_CONN_F_NOOUTPUT   0x0080          /* no output packets */
 
94
#define IP_VS_CONN_F_INACTIVE   0x0100          /* not established */
 
95
#define IP_VS_CONN_F_OUT_SEQ    0x0200          /* must do output seq adjust */
 
96
#define IP_VS_CONN_F_IN_SEQ     0x0400          /* must do input seq adjust */
 
97
#define IP_VS_CONN_F_SEQ_MASK   0x0600          /* in/out sequence mask */
 
98
#define IP_VS_CONN_F_NO_CPORT   0x0800          /* no client port set yet */
 
99
#define IP_VS_CONN_F_TEMPLATE   0x1000          /* template, not connection */
 
100
 
 
101
/* Move it to better place one day, for now keep it unique */
 
102
#define NFC_IPVS_PROPERTY       0x10000
 
103
 
 
104
#define IP_VS_SCHEDNAME_MAXLEN  16
 
105
#define IP_VS_IFNAME_MAXLEN     16
 
106
 
 
107
union nf_inet_addr {
 
108
        __u32           all[4];
 
109
        __be32          ip;
 
110
        __be32          ip6[4];
 
111
        struct in_addr  in;
 
112
        struct in6_addr in6;
 
113
};
 
114
 
 
115
/*
 
116
 *      The struct ip_vs_service_user and struct ip_vs_dest_user are
 
117
 *      used to set IPVS rules through setsockopt.
 
118
 */
 
119
struct ip_vs_service_kern {
 
120
        /* virtual service addresses */
 
121
        u_int16_t               protocol;
 
122
        __be32                  addr;   /* virtual ip address */
 
123
        __be16                  port;
 
124
        u_int32_t               fwmark;         /* firwall mark of service */
 
125
 
 
126
        /* virtual service options */
 
127
        char                    sched_name[IP_VS_SCHEDNAME_MAXLEN];
 
128
        unsigned                flags;          /* virtual service flags */
 
129
        unsigned                timeout;        /* persistent timeout in sec */
 
130
        __be32                  netmask;        /* persistent netmask */
 
131
};
 
132
 
 
133
struct ip_vs_service_user {
 
134
        /* virtual service addresses */
 
135
        u_int16_t               protocol;
 
136
        __be32                  __addr_v4;      /* virtual ip address - internal use only */
 
137
        __be16                  port;
 
138
        u_int32_t               fwmark;         /* firwall mark of service */
 
139
 
 
140
        /* virtual service options */
 
141
        char                    sched_name[IP_VS_SCHEDNAME_MAXLEN];
 
142
        unsigned                flags;          /* virtual service flags */
 
143
        unsigned                timeout;        /* persistent timeout in sec */
 
144
        __be32                  netmask;        /* persistent netmask */
 
145
        u_int16_t               af;
 
146
        union nf_inet_addr      addr;
 
147
};
 
148
 
 
149
struct ip_vs_dest_kern {
 
150
        /* destination server address */
 
151
        __be32                  addr;
 
152
        __be16                  port;
 
153
 
 
154
        /* real server options */
 
155
        unsigned                conn_flags;     /* connection flags */
 
156
        int                     weight;         /* destination weight */
 
157
 
 
158
        /* thresholds for active connections */
 
159
        u_int32_t               u_threshold;    /* upper threshold */
 
160
        u_int32_t               l_threshold;    /* lower threshold */
 
161
};
 
162
 
 
163
struct ip_vs_dest_user {
 
164
        /* destination server address */
 
165
        __be32                  __addr_v4; /* internal use only */
 
166
        __be16                  port;
 
167
 
 
168
        /* real server options */
 
169
        unsigned                conn_flags;     /* connection flags */
 
170
        int                     weight;         /* destination weight */
 
171
 
 
172
        /* thresholds for active connections */
 
173
        u_int32_t               u_threshold;    /* upper threshold */
 
174
        u_int32_t               l_threshold;    /* lower threshold */
 
175
        u_int16_t               af;
 
176
        union nf_inet_addr      addr;
 
177
};
 
178
 
 
179
/*
 
180
 *      IPVS statistics object (for user space)
 
181
 */
 
182
struct ip_vs_stats_user
 
183
{
 
184
        __u32                   conns;          /* connections scheduled */
 
185
        __u32                   inpkts;         /* incoming packets */
 
186
        __u32                   outpkts;        /* outgoing packets */
 
187
        __u64                   inbytes;        /* incoming bytes */
 
188
        __u64                   outbytes;       /* outgoing bytes */
 
189
 
 
190
        __u32                   cps;            /* current connection rate */
 
191
        __u32                   inpps;          /* current in packet rate */
 
192
        __u32                   outpps;         /* current out packet rate */
 
193
        __u32                   inbps;          /* current in byte rate */
 
194
        __u32                   outbps;         /* current out byte rate */
 
195
};
 
196
 
 
197
 
 
198
/* The argument to IP_VS_SO_GET_INFO */
 
199
struct ip_vs_getinfo {
 
200
        /* version number */
 
201
        unsigned int            version;
 
202
 
 
203
        /* size of connection hash table */
 
204
        unsigned int            size;
 
205
 
 
206
        /* number of virtual services */
 
207
        unsigned int            num_services;
 
208
};
 
209
 
 
210
 
 
211
/* The argument to IP_VS_SO_GET_SERVICE */
 
212
struct ip_vs_service_entry_kern {
 
213
        /* which service: user fills in these */
 
214
        u_int16_t               protocol;
 
215
        __be32                  addr;   /* virtual address */
 
216
        __be16                  port;
 
217
        u_int32_t               fwmark;         /* firwall mark of service */
 
218
 
 
219
        /* service options */
 
220
        char                    sched_name[IP_VS_SCHEDNAME_MAXLEN];
 
221
        unsigned                flags;          /* virtual service flags */
 
222
        unsigned                timeout;        /* persistent timeout */
 
223
        __be32                  netmask;        /* persistent netmask */
 
224
 
 
225
        /* number of real servers */
 
226
        unsigned int            num_dests;
 
227
 
 
228
        /* statistics */
 
229
        struct ip_vs_stats_user stats;
 
230
};
 
231
 
 
232
struct ip_vs_service_entry {
 
233
        /* which service: user fills in these */
 
234
        u_int16_t               protocol;
 
235
        __be32                  __addr_v4;      /* virtual address - internal use only*/
 
236
        __be16                  port;
 
237
        u_int32_t               fwmark;         /* firwall mark of service */
 
238
 
 
239
        /* service options */
 
240
        char                    sched_name[IP_VS_SCHEDNAME_MAXLEN];
 
241
        unsigned                flags;          /* virtual service flags */
 
242
        unsigned                timeout;        /* persistent timeout */
 
243
        __be32                  netmask;        /* persistent netmask */
 
244
 
 
245
        /* number of real servers */
 
246
        unsigned int            num_dests;
 
247
 
 
248
        /* statistics */
 
249
        struct ip_vs_stats_user stats;
 
250
 
 
251
        u_int16_t               af;
 
252
        union nf_inet_addr      addr;
 
253
 
 
254
};
 
255
 
 
256
struct ip_vs_dest_entry_kern {
 
257
        __be32                  addr;   /* destination address */
 
258
        __be16                  port;
 
259
        unsigned                conn_flags;     /* connection flags */
 
260
        int                     weight;         /* destination weight */
 
261
 
 
262
        u_int32_t               u_threshold;    /* upper threshold */
 
263
        u_int32_t               l_threshold;    /* lower threshold */
 
264
 
 
265
        u_int32_t               activeconns;    /* active connections */
 
266
        u_int32_t               inactconns;     /* inactive connections */
 
267
        u_int32_t               persistconns;   /* persistent connections */
 
268
 
 
269
        /* statistics */
 
270
        struct ip_vs_stats_user stats;
 
271
};
 
272
 
 
273
struct ip_vs_dest_entry {
 
274
        __be32                  __addr_v4;      /* destination address - internal use only */
 
275
        __be16                  port;
 
276
        unsigned                conn_flags;     /* connection flags */
 
277
        int                     weight;         /* destination weight */
 
278
 
 
279
        u_int32_t               u_threshold;    /* upper threshold */
 
280
        u_int32_t               l_threshold;    /* lower threshold */
 
281
 
 
282
        u_int32_t               activeconns;    /* active connections */
 
283
        u_int32_t               inactconns;     /* inactive connections */
 
284
        u_int32_t               persistconns;   /* persistent connections */
 
285
 
 
286
        /* statistics */
 
287
        struct ip_vs_stats_user stats;
 
288
        u_int16_t               af;
 
289
        union nf_inet_addr      addr;
 
290
};
 
291
 
 
292
/* The argument to IP_VS_SO_GET_DESTS */
 
293
struct ip_vs_get_dests_kern {
 
294
        /* which service: user fills in these */
 
295
        u_int16_t               protocol;
 
296
        __be32                  addr;   /* virtual address - internal use only */
 
297
        __be16                  port;
 
298
        u_int32_t               fwmark;         /* firwall mark of service */
 
299
 
 
300
        /* number of real servers */
 
301
        unsigned int            num_dests;
 
302
 
 
303
        /* the real servers */
 
304
        struct ip_vs_dest_entry_kern    entrytable[0];
 
305
};
 
306
 
 
307
struct ip_vs_get_dests {
 
308
        /* which service: user fills in these */
 
309
        u_int16_t               protocol;
 
310
        __be32                  __addr_v4;      /* virtual address - internal use only */
 
311
        __be16                  port;
 
312
        u_int32_t               fwmark;         /* firwall mark of service */
 
313
 
 
314
        /* number of real servers */
 
315
        unsigned int            num_dests;
 
316
        u_int16_t               af;
 
317
        union nf_inet_addr      addr;
 
318
 
 
319
        /* the real servers */
 
320
        struct ip_vs_dest_entry entrytable[0];
 
321
};
 
322
 
 
323
/* The argument to IP_VS_SO_GET_SERVICES */
 
324
struct ip_vs_get_services {
 
325
        /* number of virtual services */
 
326
        unsigned int            num_services;
 
327
 
 
328
        /* service table */
 
329
        struct ip_vs_service_entry entrytable[0];
 
330
};
 
331
 
 
332
struct ip_vs_get_services_kern {
 
333
        /* number of virtual services */
 
334
        unsigned int            num_services;
 
335
 
 
336
        /* service table */
 
337
        struct ip_vs_service_entry_kern entrytable[0];
 
338
};
 
339
 
 
340
/* The argument to IP_VS_SO_GET_TIMEOUT */
 
341
struct ip_vs_timeout_user {
 
342
        int                     tcp_timeout;
 
343
        int                     tcp_fin_timeout;
 
344
        int                     udp_timeout;
 
345
};
 
346
 
 
347
 
 
348
/* The argument to IP_VS_SO_GET_DAEMON */
 
349
struct ip_vs_daemon_user {
 
350
        /* sync daemon state (master/backup) */
 
351
        int                     state;
 
352
 
 
353
        /* multicast interface name */
 
354
        char                    mcast_ifn[IP_VS_IFNAME_MAXLEN];
 
355
 
 
356
        /* SyncID we belong to */
 
357
        int                     syncid;
 
358
};
 
359
 
 
360
 
 
361
/*
 
362
 *
 
363
 * IPVS Generic Netlink interface definitions
 
364
 *
 
365
 */
 
366
 
 
367
/* Generic Netlink family info */
 
368
 
 
369
#define IPVS_GENL_NAME          "IPVS"
 
370
#define IPVS_GENL_VERSION       0x1
 
371
 
 
372
struct ip_vs_flags {
 
373
        __be32 flags;
 
374
        __be32 mask;
 
375
};
 
376
 
 
377
/* Generic Netlink command attributes */
 
378
enum {
 
379
        IPVS_CMD_UNSPEC = 0,
 
380
 
 
381
        IPVS_CMD_NEW_SERVICE,           /* add service */
 
382
        IPVS_CMD_SET_SERVICE,           /* modify service */
 
383
        IPVS_CMD_DEL_SERVICE,           /* delete service */
 
384
        IPVS_CMD_GET_SERVICE,           /* get info about specific service */
 
385
 
 
386
        IPVS_CMD_NEW_DEST,              /* add destination */
 
387
        IPVS_CMD_SET_DEST,              /* modify destination */
 
388
        IPVS_CMD_DEL_DEST,              /* delete destination */
 
389
        IPVS_CMD_GET_DEST,              /* get list of all service dests */
 
390
 
 
391
        IPVS_CMD_NEW_DAEMON,            /* start sync daemon */
 
392
        IPVS_CMD_DEL_DAEMON,            /* stop sync daemon */
 
393
        IPVS_CMD_GET_DAEMON,            /* get sync daemon status */
 
394
 
 
395
        IPVS_CMD_SET_TIMEOUT,           /* set TCP and UDP timeouts */
 
396
        IPVS_CMD_GET_TIMEOUT,           /* get TCP and UDP timeouts */
 
397
 
 
398
        IPVS_CMD_SET_INFO,              /* only used in GET_INFO reply */
 
399
        IPVS_CMD_GET_INFO,              /* get general IPVS info */
 
400
 
 
401
        IPVS_CMD_ZERO,                  /* zero all counters and stats */
 
402
        IPVS_CMD_FLUSH,                 /* flush services and dests */
 
403
 
 
404
        __IPVS_CMD_MAX,
 
405
};
 
406
 
 
407
#define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1)
 
408
 
 
409
/* Attributes used in the first level of commands */
 
410
enum {
 
411
        IPVS_CMD_ATTR_UNSPEC = 0,
 
412
        IPVS_CMD_ATTR_SERVICE,          /* nested service attribute */
 
413
        IPVS_CMD_ATTR_DEST,             /* nested destination attribute */
 
414
        IPVS_CMD_ATTR_DAEMON,           /* nested sync daemon attribute */
 
415
        IPVS_CMD_ATTR_TIMEOUT_TCP,      /* TCP connection timeout */
 
416
        IPVS_CMD_ATTR_TIMEOUT_TCP_FIN,  /* TCP FIN wait timeout */
 
417
        IPVS_CMD_ATTR_TIMEOUT_UDP,      /* UDP timeout */
 
418
        __IPVS_CMD_ATTR_MAX,
 
419
};
 
420
 
 
421
#define IPVS_CMD_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
 
422
 
 
423
/*
 
424
 * Attributes used to describe a service
 
425
 *
 
426
 * Used inside nested attribute IPVS_CMD_ATTR_SERVICE
 
427
 */
 
428
enum {
 
429
        IPVS_SVC_ATTR_UNSPEC = 0,
 
430
        IPVS_SVC_ATTR_AF,               /* address family */
 
431
        IPVS_SVC_ATTR_PROTOCOL,         /* virtual service protocol */
 
432
        IPVS_SVC_ATTR_ADDR,             /* virtual service address */
 
433
        IPVS_SVC_ATTR_PORT,             /* virtual service port */
 
434
        IPVS_SVC_ATTR_FWMARK,           /* firewall mark of service */
 
435
 
 
436
        IPVS_SVC_ATTR_SCHED_NAME,       /* name of scheduler */
 
437
        IPVS_SVC_ATTR_FLAGS,            /* virtual service flags */
 
438
        IPVS_SVC_ATTR_TIMEOUT,          /* persistent timeout */
 
439
        IPVS_SVC_ATTR_NETMASK,          /* persistent netmask */
 
440
 
 
441
        IPVS_SVC_ATTR_STATS,            /* nested attribute for service stats */
 
442
        __IPVS_SVC_ATTR_MAX,
 
443
};
 
444
 
 
445
#define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
 
446
 
 
447
/*
 
448
 * Attributes used to describe a destination (real server)
 
449
 *
 
450
 * Used inside nested attribute IPVS_CMD_ATTR_DEST
 
451
 */
 
452
enum {
 
453
        IPVS_DEST_ATTR_UNSPEC = 0,
 
454
        IPVS_DEST_ATTR_ADDR,            /* real server address */
 
455
        IPVS_DEST_ATTR_PORT,            /* real server port */
 
456
 
 
457
        IPVS_DEST_ATTR_FWD_METHOD,      /* forwarding method */
 
458
        IPVS_DEST_ATTR_WEIGHT,          /* destination weight */
 
459
 
 
460
        IPVS_DEST_ATTR_U_THRESH,        /* upper threshold */
 
461
        IPVS_DEST_ATTR_L_THRESH,        /* lower threshold */
 
462
 
 
463
        IPVS_DEST_ATTR_ACTIVE_CONNS,    /* active connections */
 
464
        IPVS_DEST_ATTR_INACT_CONNS,     /* inactive connections */
 
465
        IPVS_DEST_ATTR_PERSIST_CONNS,   /* persistent connections */
 
466
 
 
467
        IPVS_DEST_ATTR_STATS,           /* nested attribute for dest stats */
 
468
        __IPVS_DEST_ATTR_MAX,
 
469
};
 
470
 
 
471
#define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1)
 
472
 
 
473
/*
 
474
 * Attributes describing a sync daemon
 
475
 *
 
476
 * Used inside nested attribute IPVS_CMD_ATTR_DAEMON
 
477
 */
 
478
enum {
 
479
        IPVS_DAEMON_ATTR_UNSPEC = 0,
 
480
        IPVS_DAEMON_ATTR_STATE,         /* sync daemon state (master/backup) */
 
481
        IPVS_DAEMON_ATTR_MCAST_IFN,     /* multicast interface name */
 
482
        IPVS_DAEMON_ATTR_SYNC_ID,       /* SyncID we belong to */
 
483
        __IPVS_DAEMON_ATTR_MAX,
 
484
};
 
485
 
 
486
#define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1)
 
487
 
 
488
/*
 
489
 * Attributes used to describe service or destination entry statistics
 
490
 *
 
491
 * Used inside nested attributes IPVS_SVC_ATTR_STATS and IPVS_DEST_ATTR_STATS
 
492
 */
 
493
enum {
 
494
        IPVS_STATS_ATTR_UNSPEC = 0,
 
495
        IPVS_STATS_ATTR_CONNS,          /* connections scheduled */
 
496
        IPVS_STATS_ATTR_INPKTS,         /* incoming packets */
 
497
        IPVS_STATS_ATTR_OUTPKTS,        /* outgoing packets */
 
498
        IPVS_STATS_ATTR_INBYTES,        /* incoming bytes */
 
499
        IPVS_STATS_ATTR_OUTBYTES,       /* outgoing bytes */
 
500
 
 
501
        IPVS_STATS_ATTR_CPS,            /* current connection rate */
 
502
        IPVS_STATS_ATTR_INPPS,          /* current in packet rate */
 
503
        IPVS_STATS_ATTR_OUTPPS,         /* current out packet rate */
 
504
        IPVS_STATS_ATTR_INBPS,          /* current in byte rate */
 
505
        IPVS_STATS_ATTR_OUTBPS,         /* current out byte rate */
 
506
        __IPVS_STATS_ATTR_MAX,
 
507
};
 
508
 
 
509
#define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1)
 
510
 
 
511
/* Attributes used in response to IPVS_CMD_GET_INFO command */
 
512
enum {
 
513
        IPVS_INFO_ATTR_UNSPEC = 0,
 
514
        IPVS_INFO_ATTR_VERSION,         /* IPVS version number */
 
515
        IPVS_INFO_ATTR_CONN_TAB_SIZE,   /* size of connection hash table */
 
516
        __IPVS_INFO_ATTR_MAX,
 
517
};
 
518
 
 
519
#define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1)
 
520
 
 
521
#ifdef LIBIPVS_USE_NL
 
522
extern struct nla_policy ipvs_cmd_policy[IPVS_CMD_ATTR_MAX + 1];
 
523
extern struct nla_policy ipvs_service_policy[IPVS_SVC_ATTR_MAX + 1];
 
524
extern struct nla_policy ipvs_dest_policy[IPVS_DEST_ATTR_MAX + 1];
 
525
extern struct nla_policy ipvs_stats_policy[IPVS_STATS_ATTR_MAX + 1];
 
526
extern struct nla_policy ipvs_info_policy[IPVS_INFO_ATTR_MAX + 1];
 
527
extern struct nla_policy ipvs_daemon_policy[IPVS_DAEMON_ATTR_MAX + 1];
 
528
#endif
 
529
 
 
530
/* End of Generic Netlink interface definitions */
 
531
 
 
532
#endif  /* _IP_VS_H */