[-]
[+]
|
Changed |
ipvsadm.changes
|
|
[-]
[+]
|
Changed |
ipvsadm.spec
^
|
|
[-]
[+]
|
Added |
ipvsadm-001-activeconn.patch
^
|
@@ -0,0 +1,25 @@
+commit 737f3b4e995b2d1fa3e0224712a6b3f5d8ccd464
+Author: Jan Friesse <jfriesse@redhat.com>
+Date: Mon May 3 09:55:07 2010 +0200
+
+ Don't report persistentconns as activeconns
+
+ This fixes what appears to be a typo in the netlink client code
+ whereby the activeconns is read as activeconns and then
+ overwritten by persistentconns. The result is that the active
+ connection count reported by ipvsadm -L is wrong if the
+ code is compiled to use the netlink interface.
+
+diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c
+index c1455f3..6c87da5 100644
+--- a/libipvs/libipvs.c
++++ b/libipvs/libipvs.c
+@@ -747,7 +747,7 @@ static int ipvs_dests_parse_cb(struct nl_msg *msg, void *arg)
+ d->entrytable[i].l_threshold = nla_get_u32(dest_attrs[IPVS_DEST_ATTR_L_THRESH]);
+ d->entrytable[i].activeconns = nla_get_u32(dest_attrs[IPVS_DEST_ATTR_ACTIVE_CONNS]);
+ d->entrytable[i].inactconns = nla_get_u32(dest_attrs[IPVS_DEST_ATTR_INACT_CONNS]);
+- d->entrytable[i].activeconns = nla_get_u32(dest_attrs[IPVS_DEST_ATTR_PERSIST_CONNS]);
++ d->entrytable[i].persistconns = nla_get_u32(dest_attrs[IPVS_DEST_ATTR_PERSIST_CONNS]);
+ d->entrytable[i].af = d->af;
+
+ if (ipvs_parse_stats(&(d->entrytable[i].stats),
|
[-]
[+]
|
Added |
ipvsadm-002-ops.patch
^
|
@@ -0,0 +1,151 @@
+commit b7f48555acd4068225af6c3190de9998ade329c9
+Author: Jan Friesse <jfriesse@redhat.com>
+Date: Fri Jul 2 17:37:18 2010 +0200
+
+ One Packet Scheduler support
+
+ Add the One-Packet Scheduler support. Feature is available only for
+ UDP connections. Uses --ops, -O option.
+
+ Resolves BZ#573112
+
+diff --git a/ipvsadm.c b/ipvsadm.c
+index 6b10d57..a95ec9d 100644
+--- a/ipvsadm.c
++++ b/ipvsadm.c
+@@ -181,7 +181,8 @@ static const char* cmdnames[] = {
+ #define OPT_NOSORT 0x040000
+ #define OPT_SYNCID 0x080000
+ #define OPT_EXACT 0x100000
+-#define NUMBER_OF_OPT 21
++#define OPT_ONEPACKET 0x200000
++#define NUMBER_OF_OPT 22
+
+ static const char* optnames[] = {
+ "numeric",
+@@ -205,6 +206,7 @@ static const char* optnames[] = {
+ "nosort",
+ "syncid",
+ "exact",
++ "ops",
+ };
+
+ /*
+@@ -217,21 +219,21 @@ static const char* optnames[] = {
+ */
+ static const char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
+ {
+- /* -n -c svc -s -p -M -r fwd -w -x -y -mc tot dmn -st -rt thr -pc srt sid -ex */
+-/*ADD*/ {'x', 'x', '+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*EDIT*/ {'x', 'x', '+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*DEL*/ {'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*FLUSH*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*LIST*/ {' ', '1', '1', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '1', '1', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
+-/*ADDSRV*/ {'x', 'x', '+', 'x', 'x', 'x', '+', ' ', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*DELSRV*/ {'x', 'x', '+', 'x', 'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*EDITSRV*/ {'x', 'x', '+', 'x', 'x', 'x', '+', ' ', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*TIMEOUT*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*STARTD*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x'},
+-/*STOPD*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x'},
+-/*RESTORE*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*SAVE*/ {' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+-/*ZERO*/ {'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++ /* -n -c svc -s -p -M -r fwd -w -x -y -mc tot dmn -st -rt thr -pc srt sid -ex ops*/
++/*ADD*/ {'x', 'x', '+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' '},
++/*EDIT*/ {'x', 'x', '+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' '},
++/*DEL*/ {'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++/*FLUSH*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++/*LIST*/ {' ', '1', '1', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '1', '1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'x'},
++/*ADDSRV*/ {'x', 'x', '+', 'x', 'x', 'x', '+', ' ', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++/*DELSRV*/ {'x', 'x', '+', 'x', 'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++/*EDITSRV*/ {'x', 'x', '+', 'x', 'x', 'x', '+', ' ', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++/*TIMEOUT*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++/*STARTD*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x'},
++/*STOPD*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x'},
++/*RESTORE*/ {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++/*SAVE*/ {' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
++/*ZERO*/ {'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
+ };
+
+ /* printing format flags */
+@@ -389,6 +391,7 @@ parse_options(int argc, char **argv, struct ipvs_command_entry *ce,
+ {"sort", '\0', POPT_ARG_NONE, NULL, 'o'},
+ {"exact", 'X', POPT_ARG_NONE, NULL, 'X'},
+ {"ipv6", '6', POPT_ARG_NONE, NULL, '%'},
++ {"ops", 'O', POPT_ARG_NONE, NULL, 'O'},
+ {NULL, 0, 0, NULL, 0}
+ };
+
+@@ -491,10 +494,14 @@ parse_options(int argc, char **argv, struct ipvs_command_entry *ce,
+ break;
+ case 'p':
+ set_option(options, OPT_PERSISTENT);
+- ce->svc.flags = IP_VS_SVC_F_PERSISTENT;
++ ce->svc.flags |= IP_VS_SVC_F_PERSISTENT;
+ ce->svc.timeout =
+ parse_timeout(optarg, 1, MAX_TIMEOUT);
+ break;
++ case 'O':
++ set_option(options, OPT_ONEPACKET);
++ ce->svc.flags |= IP_VS_SVC_F_ONEPACKET;
++ break;
+ case 'M':
+ set_option(options, OPT_NETMASK);
+ if (ce->svc.af != AF_INET6) {
+@@ -696,10 +703,15 @@ static int process_options(int argc, char **argv, int reading_stdin)
+ if (ce.cmd == CMD_ADD || ce.cmd == CMD_EDIT) {
+ /* Make sure that port zero service is persistent */
+ if (!ce.svc.fwmark && !ce.svc.port &&
+- (ce.svc.flags != IP_VS_SVC_F_PERSISTENT))
++ (!(ce.svc.flags & IP_VS_SVC_F_PERSISTENT)))
+ fail(2, "Zero port specified "
+ "for non-persistent service");
+
++ if (ce.svc.flags & IP_VS_SVC_F_ONEPACKET &&
++ !ce.svc.fwmark && ce.svc.protocol != IPPROTO_UDP)
++ fail(2, "One-Packet Scheduling is only "
++ "for UDP virtual services");
++
+ /* Set the default scheduling algorithm if not specified */
+ if (strlen(ce.svc.sched_name) == 0)
+ strcpy(ce.svc.sched_name, DEF_SCHED);
+@@ -1087,6 +1099,7 @@ static void usage_exit(const char *program, const int exit_status)
+ " --persistent-conn output of persistent connection info\n"
+ " --nosort disable sorting output of service/server entries\n"
+ " --sort does nothing, for backwards compatibility\n"
++ " --ops -O one-packet scheduling\n"
+ " --numeric -n numeric output of addresses and ports\n",
+ DEF_SCHED);
+
+@@ -1419,6 +1432,9 @@ print_service_entry(ipvs_service_entry_t *se, unsigned int format)
+ printf(" -M %i", se->netmask);
+ }
+ }
++ if (se->flags & IP_VS_SVC_F_ONEPACKET) {
++ printf(" -O");
++ }
+ } else if (format & FMT_STATS) {
+ printf("%-33s", svc_name);
+ print_largenum(se->stats.conns, format);
+@@ -1447,6 +1463,9 @@ print_service_entry(ipvs_service_entry_t *se, unsigned int format)
+ if (se->netmask != 128)
+ printf(" mask %i", se->netmask);
+ }
++ if (se->flags & IP_VS_SVC_F_ONEPACKET) {
++ printf(" ops");
++ }
+ }
+ printf("\n");
+
+diff --git a/libipvs/ip_vs.h b/libipvs/ip_vs.h
+index 2a6ffce..9cdad51 100644
+--- a/libipvs/ip_vs.h
++++ b/libipvs/ip_vs.h
+@@ -28,6 +28,7 @@
+ */
+ #define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */
+ #define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */
++#define IP_VS_SVC_F_ONEPACKET 0x0004 /* one-packet scheduling */
+
+ /*
+ * IPVS sync daemon states
|
[-]
[+]
|
Added |
ipvsadm-003-ops-man.patch
^
|
@@ -0,0 +1,33 @@
+ One-packet Scheduler man page
+
+ Man page documentation of One-packet scheduling options -O, --ops.
+
+ Related: rhbz#573112
+
+diff --git a/ipvsadm.8 b/ipvsadm.8
+index 58f4d62..08a357f 100644
+--- a/ipvsadm.8
++++ b/ipvsadm.8
+@@ -37,7 +37,7 @@ ipvsadm \- Linux Virtual Server administration
+ .SH SYNOPSIS
+ .B ipvsadm -A|E -t|u|f \fIservice-address\fP [-s \fIscheduler\fP]
+ .ti 15
+-.B [-p [\fItimeout\fP]] [-M \fInetmask\fP]
++.B [-p [\fItimeout\fP]] [-O] [-M \fInetmask\fP]
+ .br
+ .B ipvsadm -D -t|u|f \fIservice-address\fP
+ .br
+@@ -401,6 +401,13 @@ port>. The real server entries are sorted in ascending order by
+ .B --nosort
+ Do not sort the list of virtual services and real servers.
+ .TP
++.B -O, --ops
++Specify that a virtual service uses one-packet scheduling. This
++option can be used only for UDP services. If this option is specified,
++all connections are created only to schedule one packet.
++Option is useful to schedule UDP packets from same client port to different
++real servers.
++.TP
+ .B -n, --numeric
+ Numeric output. IP addresses and port numbers will be printed in
+ numeric format rather than as as host names and services respectively,
|
[-]
[+]
|
Added |
ipvsadm-1.25-popt.patch
^
|
@@ -0,0 +1,19 @@
+diff -Naupr ipvsadm-1.25.orig/Makefile ipvsadm-1.25/Makefile
+--- ipvsadm-1.25.orig/Makefile 2008-09-23 18:14:46.000000000 +0200
++++ ipvsadm-1.25/Makefile 2008-12-22 20:03:53.793372130 +0100
+@@ -62,14 +62,7 @@ RPMBUILD = $(shell \
+ fi )
+
+ ifeq (,$(FORCE_GETOPT))
+-LIB_SEARCH = /lib /usr/lib /usr/local/lib
+-POPT_LIB = $(shell for i in $(LIB_SEARCH); do \
+- if [ -f $$i/libpopt.a ]; then \
+- if nm $$i/libpopt.a | fgrep -q poptGetContext; then \
+- echo "-lpopt"; \
+- fi; \
+- fi; \
+-done)
++POPT_LIB = "-lpopt"
+ endif
+
+ ifneq (,$(POPT_LIB))
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/Makefile
^
|
@@ -2,7 +2,7 @@
# ipvsadm - IP Virtual Server ADMinistration program
# for IPVS NetFilter Module in kernel 2.4
#
-# Version: $Id: Makefile,v 1.33 2005/12/10 16:00:07 wensong Exp $
+# Version: $Id: Makefile 59 2008-09-23 16:14:43Z wensong $
#
# Authors: Wensong Zhang <wensong@linux-vs.org>
# Peter Kese <peter.kese@ijs.si>
@@ -35,7 +35,7 @@
RPMSPECDIR = $(shell rpm --eval '%_specdir')
CC = gcc
-INCLUDE = -I.. -I.
+INCLUDE =
SBIN = $(BUILD_ROOT)/sbin
MANDIR = usr/man
MAN = $(BUILD_ROOT)/$(MANDIR)/man8
|
[-]
[+]
|
Added |
ipvsadm-1.25.tar.bz2/TAGS
^
|
@@ -0,0 +1,532 @@
+
+libipvs/ip_vs.h,16620
+#define _IP_VS_H_IP_VS_H7,104
+#define IP_VS_VERSION_CODE IP_VS_VERSION_CODE20,375
+#define NVERSION(NVERSION21,411
+#define IP_VS_SVC_F_PERSISTENT IP_VS_SVC_F_PERSISTENT29,552
+#define IP_VS_SVC_F_HASHED IP_VS_SVC_F_HASHED30,613
+#define IP_VS_STATE_NONE IP_VS_STATE_NONE35,707
+#define IP_VS_STATE_MASTER IP_VS_STATE_MASTER36,764
+#define IP_VS_STATE_BACKUP IP_VS_STATE_BACKUP37,823
+#define IP_VS_BASE_CTL IP_VS_BASE_CTL42,918
+#define IP_VS_SO_SET_NONE IP_VS_SO_SET_NONE44,968
+#define IP_VS_SO_SET_INSERT IP_VS_SO_SET_INSERT45,1026
+#define IP_VS_SO_SET_ADD IP_VS_SO_SET_ADD46,1073
+#define IP_VS_SO_SET_EDIT IP_VS_SO_SET_EDIT47,1117
+#define IP_VS_SO_SET_DEL IP_VS_SO_SET_DEL48,1162
+#define IP_VS_SO_SET_FLUSH IP_VS_SO_SET_FLUSH49,1206
+#define IP_VS_SO_SET_LIST IP_VS_SO_SET_LIST50,1252
+#define IP_VS_SO_SET_ADDDEST IP_VS_SO_SET_ADDDEST51,1297
+#define IP_VS_SO_SET_DELDEST IP_VS_SO_SET_DELDEST52,1345
+#define IP_VS_SO_SET_EDITDEST IP_VS_SO_SET_EDITDEST53,1393
+#define IP_VS_SO_SET_TIMEOUT IP_VS_SO_SET_TIMEOUT54,1442
+#define IP_VS_SO_SET_STARTDAEMON IP_VS_SO_SET_STARTDAEMON55,1491
+#define IP_VS_SO_SET_STOPDAEMON IP_VS_SO_SET_STOPDAEMON56,1544
+#define IP_VS_SO_SET_RESTORE IP_VS_SO_SET_RESTORE57,1596
+#define IP_VS_SO_SET_SAVE IP_VS_SO_SET_SAVE58,1648
+#define IP_VS_SO_SET_ZERO IP_VS_SO_SET_ZERO59,1700
+#define IP_VS_SO_SET_MAX IP_VS_SO_SET_MAX60,1746
+#define IP_VS_SO_GET_VERSION IP_VS_SO_GET_VERSION62,1790
+#define IP_VS_SO_GET_INFO IP_VS_SO_GET_INFO63,1834
+#define IP_VS_SO_GET_SERVICES IP_VS_SO_GET_SERVICES64,1879
+#define IP_VS_SO_GET_SERVICE IP_VS_SO_GET_SERVICE65,1928
+#define IP_VS_SO_GET_DESTS IP_VS_SO_GET_DESTS66,1976
+#define IP_VS_SO_GET_DEST IP_VS_SO_GET_DEST67,2022
+#define IP_VS_SO_GET_TIMEOUT IP_VS_SO_GET_TIMEOUT68,2086
+#define IP_VS_SO_GET_DAEMON IP_VS_SO_GET_DAEMON69,2134
+#define IP_VS_SO_GET_MAX IP_VS_SO_GET_MAX70,2181
+#define IP_VS_CONN_F_FWD_MASK IP_VS_CONN_F_FWD_MASK76,2265
+#define IP_VS_CONN_F_MASQ IP_VS_CONN_F_MASQ77,2334
+#define IP_VS_CONN_F_LOCALNODE IP_VS_CONN_F_LOCALNODE78,2391
+#define IP_VS_CONN_F_TUNNEL IP_VS_CONN_F_TUNNEL79,2447
+#define IP_VS_CONN_F_DROUTE IP_VS_CONN_F_DROUTE80,2499
+#define IP_VS_CONN_F_BYPASS IP_VS_CONN_F_BYPASS81,2556
+#define IP_VS_CONN_F_SYNC IP_VS_CONN_F_SYNC82,2611
+#define IP_VS_CONN_F_HASHED IP_VS_CONN_F_HASHED83,2673
+#define IP_VS_CONN_F_NOOUTPUT IP_VS_CONN_F_NOOUTPUT84,2728
+#define IP_VS_CONN_F_INACTIVE IP_VS_CONN_F_INACTIVE85,2790
+#define IP_VS_CONN_F_OUT_SEQ IP_VS_CONN_F_OUT_SEQ86,2850
+#define IP_VS_CONN_F_IN_SEQ IP_VS_CONN_F_IN_SEQ87,2919
+#define IP_VS_CONN_F_SEQ_MASK IP_VS_CONN_F_SEQ_MASK88,2986
+#define IP_VS_CONN_F_NO_CPORT IP_VS_CONN_F_NO_CPORT89,3051
+#define IP_VS_CONN_F_TEMPLATE IP_VS_CONN_F_TEMPLATE90,3118
+#define NFC_IPVS_PROPERTY NFC_IPVS_PROPERTY93,3250
+#define IP_VS_SCHEDNAME_MAXLEN IP_VS_SCHEDNAME_MAXLEN95,3285
+#define IP_VS_IFNAME_MAXLEN IP_VS_IFNAME_MAXLEN96,3319
+union nf_inet_addr {nf_inet_addr98,3351
+ __u32 all[4];all99,3372
+ __be32 ip;ip100,3404
+ __be32 ip6[4];ip6101,3432
+ struct in_addr in;in102,3464
+ struct in6_addr in6;in6103,3492
+struct ip_vs_service_kern {ip_vs_service_kern110,3642
+ u_int16_t protocol;protocol112,3703
+ __be32 addr; /* virtual ip address */addr113,3725
+ __be16 port;port114,3766
+ u_int32_t fwmark; /* firwall mark of service */fwmark115,3782
+ char sched_name[IP_VS_SCHEDNAME_MAXLEN];sched_name118,3865
+ unsigned flags; /* virtual service flags */flags119,3909
+ unsigned timeout; /* persistent timeout in sec */timeout120,3956
+ __be32 netmask; /* persistent netmask */netmask121,4008
+struct ip_vs_service_user {ip_vs_service_user124,4056
+ u_int16_t protocol;protocol126,4117
+ __be32 __addr_v4; /* virtual ip address - internal use only */__addr_v4127,4139
+ __be16 port;port128,4205
+ u_int32_t fwmark; /* firwall mark of service */fwmark129,4221
+ char sched_name[IP_VS_SCHEDNAME_MAXLEN];sched_name132,4304
+ unsigned flags; /* virtual service flags */flags133,4348
+ unsigned timeout; /* persistent timeout in sec */timeout134,4395
+ __be32 netmask; /* persistent netmask */netmask135,4447
+ u_int16_t af;af136,4491
+ union nf_inet_addr addr;addr137,4507
+struct ip_vs_dest_kern {ip_vs_dest_kern140,4537
+ __be32 addr;addr142,4596
+ __be16 port;port143,4612
+ unsigned conn_flags; /* connection flags */conn_flags146,4656
+ int weight; /* destination weight */weight147,4702
+ u_int32_t u_threshold; /* upper threshold */u_threshold150,4785
+ u_int32_t l_threshold; /* lower threshold */l_threshold151,4832
+struct ip_vs_dest_user {ip_vs_dest_user154,4883
+ __be32 __addr_v4; /* internal use only */__addr_v4156,4942
+ __be16 port;port157,4987
+ unsigned conn_flags; /* connection flags */conn_flags160,5031
+ int weight; /* destination weight */weight161,5077
+ u_int32_t u_threshold; /* upper threshold */u_threshold164,5160
+ u_int32_t l_threshold; /* lower threshold */l_threshold165,5207
+ u_int16_t af;af166,5254
+ union nf_inet_addr addr;addr167,5270
+struct ip_vs_stats_userip_vs_stats_user173,5350
+ __u32 conns; /* connections scheduled */conns175,5376
+ __u32 inpkts; /* incoming packets */inpkts176,5445
+ __u32 outpkts; /* outgoing packets */outpkts177,5509
+ __u64 inbytes; /* incoming bytes */inbytes178,5573
+ __u64 outbytes; /* outgoing bytes */outbytes179,5635
+ __u32 cps; /* current connection rate */cps181,5698
+ __u32 inpps; /* current in packet rate */inpps182,5743
+ __u32 outpps; /* current out packet rate */outpps183,5789
+ __u32 inbps; /* current in byte rate */inbps184,5837
+ __u32 outbps; /* current out byte rate */outbps185,5881
+struct ip_vs_getinfo {ip_vs_getinfo190,5972
+ unsigned int version;version192,6017
+ unsigned int size;size195,6079
+ unsigned int num_services;num_services198,6135
+struct ip_vs_service_entry_kern {ip_vs_service_entry_kern203,6212
+ u_int16_t protocol;protocol205,6288
+ __be32 addr; /* virtual address */addr206,6310
+ __be16 port;port207,6348
+ u_int32_t fwmark; /* firwall mark of service */fwmark208,6364
+ char sched_name[IP_VS_SCHEDNAME_MAXLEN];sched_name211,6439
+ unsigned flags; /* virtual service flags */flags212,6483
+ unsigned timeout; /* persistent timeout */timeout213,6538
+ __be32 netmask; /* persistent netmask */netmask214,6583
+ unsigned int num_dests;num_dests217,6658
+ struct ip_vs_stats_user stats;stats220,6703
+struct ip_vs_service_entry {ip_vs_service_entry223,6739
+ u_int16_t protocol;protocol225,6810
+ __be32 __addr_v4; /* virtual address - internal use only*/__addr_v4226,6832
+ __be16 port;port227,6894
+ u_int32_t fwmark; /* firwall mark of service */fwmark228,6910
+ char sched_name[IP_VS_SCHEDNAME_MAXLEN];sched_name231,6985
+ unsigned flags; /* virtual service flags */flags232,7029
+ unsigned timeout; /* persistent timeout */timeout233,7084
+ __be32 netmask; /* persistent netmask */netmask234,7129
+ unsigned int num_dests;num_dests237,7204
+ struct ip_vs_stats_user stats;stats240,7249
+ u_int16_t af;af242,7282
+ union nf_inet_addr addr;addr243,7298
+struct ip_vs_dest_entry_kern {ip_vs_dest_entry_kern247,7329
+ __be32 addr; /* destination address */addr248,7360
+ __be16 port;port249,7402
+ unsigned conn_flags; /* connection flags */conn_flags250,7418
+ int weight; /* destination weight */weight251,7464
+ u_int32_t u_threshold; /* upper threshold */u_threshold253,7506
+ u_int32_t l_threshold; /* lower threshold */l_threshold254,7553
+ u_int32_t activeconns; /* active connections */activeconns256,7601
+ u_int32_t inactconns; /* inactive connections */inactconns257,7651
+ u_int32_t persistconns; /* persistent connections */persistconns258,7702
+ struct ip_vs_stats_user stats;stats261,7776
+struct ip_vs_dest_entry {ip_vs_dest_entry264,7812
+ __be32 __addr_v4; /* destination address - internal use only */__addr_v4265,7838
+ __be16 port;port266,7905
+ unsigned conn_flags; /* connection flags */conn_flags267,7921
+ int weight; /* destination weight */weight268,7967
+ u_int32_t u_threshold; /* upper threshold */u_threshold270,8009
+ u_int32_t l_threshold; /* lower threshold */l_threshold271,8056
+ u_int32_t activeconns; /* active connections */activeconns273,8104
+ u_int32_t inactconns; /* inactive connections */inactconns274,8154
+ u_int32_t persistconns; /* persistent connections */persistconns275,8205
+ struct ip_vs_stats_user stats;stats278,8279
+ u_int16_t af;af279,8311
+ union nf_inet_addr addr;addr280,8327
+struct ip_vs_get_dests_kern {ip_vs_get_dests_kern284,8398
+ u_int16_t protocol;protocol286,8470
+ __be32 addr; /* virtual address - internal use only */addr287,8492
+ __be16 port;port288,8550
+ u_int32_t fwmark; /* firwall mark of service */fwmark289,8566
+ unsigned int num_dests;num_dests292,8648
+ struct ip_vs_dest_entry_kern entrytable[0];entrytable295,8699
+struct ip_vs_get_dests {ip_vs_get_dests298,8748
+ u_int16_t protocol;protocol300,8815
+ __be32 __addr_v4; /* virtual address - internal use only */__addr_v4301,8837
+ __be16 port;port302,8900
+ u_int32_t fwmark; /* firwall mark of service */fwmark303,8916
+ unsigned int num_dests;num_dests306,8998
+ u_int16_t af;af307,9024
+ union nf_inet_addr addr;addr308,9040
+ struct ip_vs_dest_entry entrytable[0];entrytable311,9091
+struct ip_vs_get_services {ip_vs_get_services315,9179
+ unsigned int num_services;num_services317,9241
+ struct ip_vs_service_entry entrytable[0];entrytable320,9292
+struct ip_vs_get_services_kern {ip_vs_get_services_kern323,9339
+ unsigned int num_services;num_services325,9406
+ struct ip_vs_service_entry_kern entrytable[0];entrytable328,9457
+struct ip_vs_timeout_user {ip_vs_timeout_user332,9552
+ int tcp_timeout;tcp_timeout333,9580
+ int tcp_fin_timeout;tcp_fin_timeout334,9600
+ int udp_timeout;udp_timeout335,9624
+struct ip_vs_daemon_user {ip_vs_daemon_user340,9691
+ int state;state342,9759
+ char mcast_ifn[IP_VS_IFNAME_MAXLEN];mcast_ifn345,9806
+ int syncid;syncid348,9874
+#define IPVS_GENL_NAME IPVS_GENL_NAME360,9989
+#define IPVS_GENL_VERSION IPVS_GENL_VERSION361,10020
+struct ip_vs_flags {ip_vs_flags363,10051
+ __be32 flags;flags364,10072
+ __be32 mask;mask365,10087
+ IPVS_CMD_UNSPEC = 0,IPVS_CMD_UNSPEC370,10153
+ IPVS_CMD_NEW_SERVICE, /* add service */IPVS_CMD_NEW_SERVICE372,10176
+ IPVS_CMD_SET_SERVICE, /* modify service */IPVS_CMD_SET_SERVICE373,10218
+ IPVS_CMD_DEL_SERVICE, /* delete service */IPVS_CMD_DEL_SERVICE374,10263
+ IPVS_CMD_GET_SERVICE, /* get info about specific service */IPVS_CMD_GET_SERVICE375,10308
+ IPVS_CMD_NEW_DEST, /* add destination */IPVS_CMD_NEW_DEST377,10371
+ IPVS_CMD_SET_DEST, /* modify destination */IPVS_CMD_SET_DEST378,10414
+ IPVS_CMD_DEL_DEST, /* delete destination */IPVS_CMD_DEL_DEST379,10460
+ IPVS_CMD_GET_DEST, /* get list of all service dests */IPVS_CMD_GET_DEST380,10506
+ IPVS_CMD_NEW_DAEMON, /* start sync daemon */IPVS_CMD_NEW_DAEMON382,10564
+ IPVS_CMD_DEL_DAEMON, /* stop sync daemon */IPVS_CMD_DEL_DAEMON383,10611
+ IPVS_CMD_GET_DAEMON, /* get sync daemon status */IPVS_CMD_GET_DAEMON384,10657
+ IPVS_CMD_SET_TIMEOUT, /* set TCP and UDP timeouts */IPVS_CMD_SET_TIMEOUT386,10710
+ IPVS_CMD_GET_TIMEOUT, /* get TCP and UDP timeouts */IPVS_CMD_GET_TIMEOUT387,10765
+ IPVS_CMD_SET_INFO, /* only used in GET_INFO reply */IPVS_CMD_SET_INFO389,10821
+ IPVS_CMD_GET_INFO, /* get general IPVS info */IPVS_CMD_GET_INFO390,10876
+ IPVS_CMD_ZERO, /* zero all counters and stats */IPVS_CMD_ZERO392,10926
+ IPVS_CMD_FLUSH, /* flush services and dests */IPVS_CMD_FLUSH393,10978
+ __IPVS_CMD_MAX,__IPVS_CMD_MAX395,11029
+#define IPVS_CMD_MAX IPVS_CMD_MAX398,11050
+ IPVS_CMD_ATTR_UNSPEC = 0,IPVS_CMD_ATTR_UNSPEC402,11153
+ IPVS_CMD_ATTR_SERVICE, /* nested service attribute */IPVS_CMD_ATTR_SERVICE403,11180
+ IPVS_CMD_ATTR_DEST, /* nested destination attribute */IPVS_CMD_ATTR_DEST404,11236
+ IPVS_CMD_ATTR_DAEMON, /* nested sync daemon attribute */IPVS_CMD_ATTR_DAEMON405,11293
+ IPVS_CMD_ATTR_TIMEOUT_TCP, /* TCP connection timeout */IPVS_CMD_ATTR_TIMEOUT_TCP406,11352
+ IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, /* TCP FIN wait timeout */IPVS_CMD_ATTR_TIMEOUT_TCP_FIN407,11409
+ IPVS_CMD_ATTR_TIMEOUT_UDP, /* UDP timeout */IPVS_CMD_ATTR_TIMEOUT_UDP408,11468
+ __IPVS_CMD_ATTR_MAX,__IPVS_CMD_ATTR_MAX409,11514
+#define IPVS_CMD_ATTR_MAX IPVS_CMD_ATTR_MAX412,11540
+ IPVS_SVC_ATTR_UNSPEC = 0,IPVS_SVC_ATTR_UNSPEC420,11705
+ IPVS_SVC_ATTR_AF, /* address family */IPVS_SVC_ATTR_AF421,11732
+ IPVS_SVC_ATTR_PROTOCOL, /* virtual service protocol */IPVS_SVC_ATTR_PROTOCOL422,11773
+ IPVS_SVC_ATTR_ADDR, /* virtual service address */IPVS_SVC_ATTR_ADDR423,11830
+ IPVS_SVC_ATTR_PORT, /* virtual service port */IPVS_SVC_ATTR_PORT424,11882
+ IPVS_SVC_ATTR_FWMARK, /* firewall mark of service */IPVS_SVC_ATTR_FWMARK425,11931
+ IPVS_SVC_ATTR_SCHED_NAME, /* name of scheduler */IPVS_SVC_ATTR_SCHED_NAME427,11987
+ IPVS_SVC_ATTR_FLAGS, /* virtual service flags */IPVS_SVC_ATTR_FLAGS428,12038
+ IPVS_SVC_ATTR_TIMEOUT, /* persistent timeout */IPVS_SVC_ATTR_TIMEOUT429,12089
+ IPVS_SVC_ATTR_NETMASK, /* persistent netmask */IPVS_SVC_ATTR_NETMASK430,12139
+ IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */IPVS_SVC_ATTR_STATS432,12190
+ __IPVS_SVC_ATTR_MAX,__IPVS_SVC_ATTR_MAX433,12254
+#define IPVS_SVC_ATTR_MAX IPVS_SVC_ATTR_MAX436,12280
+ IPVS_DEST_ATTR_UNSPEC = 0,IPVS_DEST_ATTR_UNSPEC444,12460
+ IPVS_DEST_ATTR_ADDR, /* real server address */IPVS_DEST_ATTR_ADDR445,12488
+ IPVS_DEST_ATTR_PORT, /* real server port */IPVS_DEST_ATTR_PORT446,12537
+ IPVS_DEST_ATTR_FWD_METHOD, /* forwarding method */IPVS_DEST_ATTR_FWD_METHOD448,12584
+ IPVS_DEST_ATTR_WEIGHT, /* destination weight */IPVS_DEST_ATTR_WEIGHT449,12636
+ IPVS_DEST_ATTR_U_THRESH, /* upper threshold */IPVS_DEST_ATTR_U_THRESH451,12687
+ IPVS_DEST_ATTR_L_THRESH, /* lower threshold */IPVS_DEST_ATTR_L_THRESH452,12735
+ IPVS_DEST_ATTR_ACTIVE_CONNS, /* active connections */IPVS_DEST_ATTR_ACTIVE_CONNS454,12784
+ IPVS_DEST_ATTR_INACT_CONNS, /* inactive connections */IPVS_DEST_ATTR_INACT_CONNS455,12839
+ IPVS_DEST_ATTR_PERSIST_CONNS, /* persistent connections */IPVS_DEST_ATTR_PERSIST_CONNS456,12895
+ IPVS_DEST_ATTR_STATS, /* nested attribute for dest stats */IPVS_DEST_ATTR_STATS458,12956
+ __IPVS_DEST_ATTR_MAX,__IPVS_DEST_ATTR_MAX459,13018
+#define IPVS_DEST_ATTR_MAX IPVS_DEST_ATTR_MAX462,13045
+ IPVS_DAEMON_ATTR_UNSPEC = 0,IPVS_DAEMON_ATTR_UNSPEC470,13209
+ IPVS_DAEMON_ATTR_STATE, /* sync daemon state (master/backup) */IPVS_DAEMON_ATTR_STATE471,13239
+ IPVS_DAEMON_ATTR_MCAST_IFN, /* multicast interface name */IPVS_DAEMON_ATTR_MCAST_IFN472,13305
+ IPVS_DAEMON_ATTR_SYNC_ID, /* SyncID we belong to */IPVS_DAEMON_ATTR_SYNC_ID473,13365
+ __IPVS_DAEMON_ATTR_MAX,__IPVS_DAEMON_ATTR_MAX474,13418
+#define IPVS_DAEMON_ATTR_MAX IPVS_DAEMON_ATTR_MAX477,13447
+ IPVS_STATS_ATTR_UNSPEC = 0,IPVS_STATS_ATTR_UNSPEC485,13672
+ IPVS_STATS_ATTR_CONNS, /* connections scheduled */IPVS_STATS_ATTR_CONNS486,13701
+ IPVS_STATS_ATTR_INPKTS, /* incoming packets */IPVS_STATS_ATTR_INPKTS487,13754
+ IPVS_STATS_ATTR_OUTPKTS, /* outgoing packets */IPVS_STATS_ATTR_OUTPKTS488,13803
+ IPVS_STATS_ATTR_INBYTES, /* incoming bytes */IPVS_STATS_ATTR_INBYTES489,13852
+ IPVS_STATS_ATTR_OUTBYTES, /* outgoing bytes */IPVS_STATS_ATTR_OUTBYTES490,13899
+ IPVS_STATS_ATTR_CPS, /* current connection rate */IPVS_STATS_ATTR_CPS492,13948
+ IPVS_STATS_ATTR_INPPS, /* current in packet rate */IPVS_STATS_ATTR_INPPS493,14001
+ IPVS_STATS_ATTR_OUTPPS, /* current out packet rate */IPVS_STATS_ATTR_OUTPPS494,14055
+ IPVS_STATS_ATTR_INBPS, /* current in byte rate */IPVS_STATS_ATTR_INBPS495,14111
+ IPVS_STATS_ATTR_OUTBPS, /* current out byte rate */IPVS_STATS_ATTR_OUTBPS496,14163
+ __IPVS_STATS_ATTR_MAX,__IPVS_STATS_ATTR_MAX497,14217
+#define IPVS_STATS_ATTR_MAX IPVS_STATS_ATTR_MAX500,14245
+ IPVS_INFO_ATTR_UNSPEC = 0,IPVS_INFO_ATTR_UNSPEC504,14372
+ IPVS_INFO_ATTR_VERSION, /* IPVS version number */IPVS_INFO_ATTR_VERSION505,14400
+ IPVS_INFO_ATTR_CONN_TAB_SIZE, /* size of connection hash table */IPVS_INFO_ATTR_CONN_TAB_SIZE506,14452
+ __IPVS_INFO_ATTR_MAX,__IPVS_INFO_ATTR_MAX507,14519
+#define IPVS_INFO_ATTR_MAX IPVS_INFO_ATTR_MAX510,14546
+
+libipvs/ip_vs_nl_policy.c,535
+struct nla_policy ipvs_cmd_policy[IPVS_CMD_ATTR_MAX + 1] = {ipvs_cmd_policy5,69
+struct nla_policy ipvs_service_policy[IPVS_SVC_ATTR_MAX + 1] = {ipvs_service_policy14,446
+struct nla_policy ipvs_dest_policy[IPVS_DEST_ATTR_MAX + 1] = {ipvs_dest_policy31,1184
+struct nla_policy ipvs_stats_policy[IPVS_STATS_ATTR_MAX + 1] = {ipvs_stats_policy45,1806
+struct nla_policy ipvs_info_policy[IPVS_INFO_ATTR_MAX + 1] = {ipvs_info_policy58,2367
+struct nla_policy ipvs_daemon_policy[IPVS_DAEMON_ATTR_MAX + 1] = {ipvs_daemon_policy63,2538
+
+libipvs/libipvs.c,3463
+typedef struct ipvs_servicedest_s {ipvs_servicedest_s25,711
+ struct ip_vs_service_kern svc;svc26,747
+ struct ip_vs_dest_kern dest;dest27,779
+} ipvs_servicedest_t;ipvs_servicedest_t28,810
+static int sockfd = -1;sockfd30,833
+static void* ipvs_func = NULL;ipvs_func31,857
+struct ip_vs_getinfo ipvs_info;ipvs_info32,888
+struct nl_handle *sock = NULL;sock35,943
+int family, try_nl = 1;family36,974
+int family, try_nl = 1;try_nl36,974
+#define CHECK_IPV4(CHECK_IPV439,1006
+struct nl_msg *ipvs_nl_message(int cmd, int flags) {ipvs_nl_message44,1165
+static int ipvs_nl_noop_cb(struct nl_msg *msg, void *arg) {ipvs_nl_noop_cb57,1399
+int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg) {ipvs_nl_send_message61,1477
+int ipvs_init(void)ipvs_init108,2302
+static int ipvs_getinfo_parse_cb(struct nl_msg *msg, void *arg)ipvs_getinfo_parse_cb134,2733
+int ipvs_getinfo(void)ipvs_getinfo153,3239
+unsigned int ipvs_version(void)ipvs_version175,3645
+int ipvs_flush(void)ipvs_flush181,3710
+static int ipvs_nl_fill_service_attr(struct nl_msg *msg, ipvs_service_t *svc) {ipvs_nl_fill_service_attr196,4030
+int ipvs_add_service(ipvs_service_t *svc)ipvs_add_service228,4941
+int ipvs_update_service(ipvs_service_t *svc)ipvs_update_service249,5431
+int ipvs_del_service(ipvs_service_t *svc)ipvs_del_service269,5927
+int ipvs_zero_service(ipvs_service_t *svc)ipvs_zero_service289,6416
+static int ipvs_nl_fill_dest_attr(struct nl_msg *msg, ipvs_dest_t *dst) {ipvs_nl_fill_dest_attr314,7042
+int ipvs_add_dest(ipvs_service_t *svc, ipvs_dest_t *dest)ipvs_add_dest336,7693
+int ipvs_update_dest(ipvs_service_t *svc, ipvs_dest_t *dest)ipvs_update_dest366,8439
+int ipvs_del_dest(ipvs_service_t *svc, ipvs_dest_t *dest)ipvs_del_dest395,9191
+int ipvs_set_timeout(ipvs_timeout_t *to)ipvs_set_timeout425,9937
+int ipvs_start_daemon(ipvs_daemon_t *dm)ipvs_start_daemon447,10551
+int ipvs_stop_daemon(ipvs_daemon_t *dm)ipvs_stop_daemon478,11312
+static int ipvs_parse_stats(struct ip_vs_stats_user *stats, struct nlattr *nla) {ipvs_parse_stats509,12091
+static int ipvs_services_parse_cb(struct nl_msg *msg, void *arg)ipvs_services_parse_cb542,13345
+struct ip_vs_get_services *ipvs_get_services(void)ipvs_get_services610,15633
+typedef int (*qsort_cmp_t)(const void *, const void *);qsort_cmp_t664,16956
+ipvs_cmp_services(ipvs_service_entry_t *s1, ipvs_service_entry_t *s2)ipvs_cmp_services667,17017
+ipvs_sort_services(struct ip_vs_get_services *s, ipvs_service_cmp_t f)ipvs_sort_services696,17531
+static int ipvs_dests_parse_cb(struct nl_msg *msg, void *arg)ipvs_dests_parse_cb703,17722
+struct ip_vs_get_dests *ipvs_get_dests(ipvs_service_entry_t *svc)ipvs_get_dests760,19866
+int ipvs_cmp_dests(ipvs_dest_entry_t *d1, ipvs_dest_entry_t *d2)ipvs_cmp_dests855,22063
+void ipvs_sort_dests(struct ip_vs_get_dests *d, ipvs_dest_cmp_t f)ipvs_sort_dests872,22414
+ipvs_get_service(__u32 fwmark, __u16 af, __u16 protocol, union nf_inet_addr addr, __u16 port)ipvs_get_service880,22597
+static int ipvs_timeout_parse_cb(struct nl_msg *msg, void *arg)ipvs_timeout_parse_cb945,23987
+ipvs_timeout_t *ipvs_get_timeout(void)ipvs_get_timeout965,24629
+static int ipvs_daemon_parse_cb(struct nl_msg *msg, void *arg)ipvs_daemon_parse_cb996,25210
+ipvs_daemon_t *ipvs_get_daemon(void)ipvs_get_daemon1030,26227
+void ipvs_close(void)ipvs_close1062,26869
+const char *ipvs_strerror(int err)ipvs_strerror1073,26970
+
+libipvs/Makefile,301
+CC = gccCC3,24
+CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -fPICCFLAGS4,34
+DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \DEFINES11,226
+.PHONY = all clean install dist distclean rpm rpms.PHONY14,318
+STATIC_LIB = libipvs.aSTATIC_LIB15,370
+SHARED_LIB = libipvs.soSHARED_LIB16,393
+
+libipvs/libipvs.h,968
+#define _LIBIPVS_H_LIBIPVS_H11,209
+#define MINIMUM_IPVS_VERSION_MAJOR MINIMUM_IPVS_VERSION_MAJOR16,250
+#define MINIMUM_IPVS_VERSION_MINOR MINIMUM_IPVS_VERSION_MINOR17,292
+#define MINIMUM_IPVS_VERSION_PATCH MINIMUM_IPVS_VERSION_PATCH18,334
+#define IPVS_VERSION(IPVS_VERSION21,398
+#define IPVS_SVC_PERSISTENT_TIMEOUT IPVS_SVC_PERSISTENT_TIMEOUT34,984
+typedef struct ip_vs_service_user ipvs_service_t;ipvs_service_t37,1029
+typedef struct ip_vs_dest_user ipvs_dest_t;ipvs_dest_t38,1079
+typedef struct ip_vs_timeout_user ipvs_timeout_t;ipvs_timeout_t39,1124
+typedef struct ip_vs_daemon_user ipvs_daemon_t;ipvs_daemon_t40,1174
+typedef struct ip_vs_service_entry ipvs_service_entry_t;ipvs_service_entry_t41,1222
+typedef struct ip_vs_dest_entry ipvs_dest_entry_t;ipvs_dest_entry_t42,1279
+typedef int (*ipvs_service_cmp_t)(ipvs_service_entry_t *,ipvs_service_cmp_t95,2779
+typedef int (*ipvs_dest_cmp_t)(ipvs_dest_entry_t *,ipvs_dest_cmp_t106,3220
+
+ipvsadm.c,5960
+#undef __KERNEL__ __KERNEL__93,4783
+#define IPVS_OPTION_PROCESSING IPVS_OPTION_PROCESSING116,5290
+#define IPVSADM_VERSION_NO IPVSADM_VERSION_NO121,5386
+#define IPVSADM_VERSION_DATE IPVSADM_VERSION_DATE122,5425
+#define IPVSADM_VERSION IPVSADM_VERSION123,5466
+#define MAX_TIMEOUT MAX_TIMEOUT125,5536
+#define CMD_NONE CMD_NONE127,5583
+#define CMD_ADD CMD_ADD128,5603
+#define CMD_EDIT CMD_EDIT129,5634
+#define CMD_DEL CMD_DEL130,5665
+#define CMD_FLUSH CMD_FLUSH131,5696
+#define CMD_LIST CMD_LIST132,5728
+#define CMD_ADDDEST CMD_ADDDEST133,5759
+#define CMD_DELDEST CMD_DELDEST134,5793
+#define CMD_EDITDEST CMD_EDITDEST135,5827
+#define CMD_TIMEOUT CMD_TIMEOUT136,5862
+#define CMD_STARTDAEMON CMD_STARTDAEMON137,5896
+#define CMD_STOPDAEMON CMD_STOPDAEMON138,5935
+#define CMD_RESTORE CMD_RESTORE139,5973
+#define CMD_SAVE CMD_SAVE140,6008
+#define CMD_ZERO CMD_ZERO141,6040
+#define CMD_MAX CMD_MAX142,6072
+#define NUMBER_OF_CMD NUMBER_OF_CMD143,6099
+static const char* cmdnames[] = {cmdnames145,6144
+#define OPT_NONE OPT_NONE162,6373
+#define OPT_NUMERIC OPT_NUMERIC163,6400
+#define OPT_CONNECTION OPT_CONNECTION164,6430
+#define OPT_SERVICE OPT_SERVICE165,6463
+#define OPT_SCHEDULER OPT_SCHEDULER166,6493
+#define OPT_PERSISTENT OPT_PERSISTENT167,6525
+#define OPT_NETMASK OPT_NETMASK168,6558
+#define OPT_SERVER OPT_SERVER169,6588
+#define OPT_FORWARD OPT_FORWARD170,6617
+#define OPT_WEIGHT OPT_WEIGHT171,6647
+#define OPT_UTHRESHOLD OPT_UTHRESHOLD172,6676
+#define OPT_LTHRESHOLD OPT_LTHRESHOLD173,6709
+#define OPT_MCAST OPT_MCAST174,6742
+#define OPT_TIMEOUT OPT_TIMEOUT175,6770
+#define OPT_DAEMON OPT_DAEMON176,6800
+#define OPT_STATS OPT_STATS177,6829
+#define OPT_RATE OPT_RATE178,6857
+#define OPT_THRESHOLDS OPT_THRESHOLDS179,6884
+#define OPT_PERSISTENTCONN OPT_PERSISTENTCONN180,6917
+#define OPT_NOSORT OPT_NOSORT181,6953
+#define OPT_SYNCID OPT_SYNCID182,6982
+#define OPT_EXACT OPT_EXACT183,7011
+#define NUMBER_OF_OPT NUMBER_OF_OPT184,7039
+static const char* optnames[] = {optnames186,7066
+static const char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =commands_v_options218,7585
+#define FMT_NONE FMT_NONE238,9467
+#define FMT_NUMERIC FMT_NUMERIC239,9492
+#define FMT_RULE FMT_RULE240,9520
+#define FMT_STATS FMT_STATS241,9545
+#define FMT_RATE FMT_RATE242,9571
+#define FMT_THRESHOLDS FMT_THRESHOLDS243,9596
+#define FMT_PERSISTENTCONN FMT_PERSISTENTCONN244,9627
+#define FMT_NOSORT FMT_NOSORT245,9661
+#define FMT_EXACT FMT_EXACT246,9688
+#define SERVICE_NONE SERVICE_NONE248,9715
+#define SERVICE_ADDR SERVICE_ADDR249,9744
+#define SERVICE_PORT SERVICE_PORT250,9773
+#define DEF_SCHED DEF_SCHED253,9827
+#define DEF_MCAST_IFN DEF_MCAST_IFN256,9892
+#define CONN_PROC_FILE CONN_PROC_FILE258,9923
+struct ipvs_command_entry {ipvs_command_entry260,9971
+ int cmd;cmd261,9999
+ ipvs_service_t svc;svc262,10011
+ ipvs_dest_t dest;dest263,10033
+ ipvs_timeout_t timeout;timeout264,10053
+ ipvs_daemon_t daemon;daemon265,10079
+int main(int argc, char **argv)main308,11892
+parse_options(int argc, char **argv, struct ipvs_command_entry *ce,parse_options340,12551
+static int restore_table(int argc, char **argv, int reading_stdin)restore_table655,21385
+static int process_options(int argc, char **argv, int reading_stdin)process_options675,21849
+static int string_to_number(const char *s, int min, int max)string_to_number803,24941
+static int parse_timeout(char *buf, int min, int max)parse_timeout822,25291
+static unsigned int parse_fwmark(char *buf)parse_fwmark840,25638
+static int parse_netmask(char *buf, u_int32_t *addr)parse_netmask860,25975
+parse_service(char *buf, ipvs_service_t *svc)parse_service886,26446
+generic_opt_check(int command, int options)generic_opt_check945,27630
+opt2name(int option)opt2name979,28478
+set_command(int *cmd, const int newcmd)set_command988,28606
+set_option(unsigned int *options, unsigned int option)set_option996,28744
+static void tryhelp_exit(const char *program, const int exit_status)tryhelp_exit1004,28914
+static void usage_exit(const char *program, const int exit_status)usage_exit1012,29101
+static void version_exit(const int exit_status)version_exit1097,33185
+static void version(FILE *stream)version1112,33362
+static void fail(int err, char *msg, ...)fail1121,33551
+static int modprobe_ipvs(void)modprobe_ipvs1133,33718
+static void check_ipvs_version(void)check_ipvs_version1155,34026
+static void print_conn(char *buf, unsigned int format)print_conn1175,34563
+void list_conn(unsigned int format)list_conn1240,36350
+static inline char *fwd_name(unsigned flags)fwd_name1273,37048
+static inline char *fwd_switch(unsigned flags)fwd_switch1294,37389
+static void print_largenum(unsigned long long i, unsigned int format)print_largenum1311,37692
+static void print_title(unsigned int format)print_title1335,38325
+print_service_entry(ipvs_service_entry_t *se, unsigned int format)print_service_entry1364,39385
+static void list_service(ipvs_service_t *svc, unsigned int format)list_service1506,43564
+static void list_all(unsigned int format)list_all1522,43911
+void list_timeout(void)list_timeout1546,44447
+static void list_daemon(void)list_daemon1558,44660
+int host_to_addr(const char *name, struct in_addr *addr)host_to_addr1575,45033
+static char * addr_to_host(int af, const void *addr)addr_to_host1591,45405
+static char * addr_to_anyname(int af, const void *addr)addr_to_anyname1603,45636
+int service_to_port(const char *name, unsigned short proto)service_to_port1615,45862
+static char * port_to_service(unsigned short port, unsigned short proto)port_to_service1630,46241
+static char * port_to_anyname(unsigned short port, unsigned short proto)port_to_anyname1645,46610
+addrport_to_anyname(int af, const void *addr, unsigned short port,addrport_to_anyname1660,46859
+static int str_is_digit(const char *str)str_is_digit1686,47428
+
+config_stream.c,88
+config_stream_read(FILE * stream, const char *first_element)config_stream_read31,1091
+
+dynamic_array.c,648
+dynamic_array_create(size_t block_size)dynamic_array_create29,1009
+dynamic_array_destroy(dynamic_array_t * a,dynamic_array_destroy61,1964
+dynamic_array_add_element(dynamic_array_t * a,dynamic_array_add_element96,3301
+dynamic_array_display(dynamic_array_t * a,dynamic_array_display141,4814
+dynamic_array_get_element(dynamic_array_t * a, size_t elementno)dynamic_array_get_element194,6249
+dynamic_array_get_count(dynamic_array_t * a)dynamic_array_get_count211,6747
+dynamic_array_get_vector(dynamic_array_t * a)dynamic_array_get_vector228,7165
+dynamic_array_split_str(char *string, const char delimiter)dynamic_array_split_str249,7777
+
+config_stream.h,101
+#define CONFIG_STREAM_FLIMCONFIG_STREAM_FLIM11,238
+#define MAX_LINE_LENGTH MAX_LINE_LENGTH15,294
+
+dynamic_array.h,471
+#define DYNAMIC_ARRAY_FLIMDYNAMIC_ARRAY_FLIM15,487
+#define DEFAULT_DYNAMIC_ARRAY_BLOCK_SIZE DEFAULT_DYNAMIC_ARRAY_BLOCK_SIZE27,687
+#define DESTROY_STR DESTROY_STR31,788
+#define DUP_STR DUP_STR32,832
+#define DISPLAY_STR DISPLAY_STR33,881
+#define LEN_STR LEN_STR34,936
+ void **vector;vector38,999
+ size_t count;count39,1016
+ size_t allocated_size;allocated_size40,1032
+ size_t block_size;block_size41,1057
+} dynamic_array_t;dynamic_array_t42,1078
+
+ipvsadm.sh,106
+ function action {action35,817
+ function success {success40,872
+ function failure {failure43,919
+
+Makefile,1432
+NAME = ipvsadmNAME28,1081
+VERSION = $(shell cat VERSION)VERSION29,1097
+RELEASE = 1RELEASE30,1129
+SCHEDULERS = "$(shell cat SCHEDULERS)"SCHEDULERS31,1142
+PROGROOT = $(shell basename `pwd`)PROGROOT32,1181
+ARCH = $(shell uname -m)ARCH33,1216
+RPMSOURCEDIR = $(shell rpm --eval '%_sourcedir')RPMSOURCEDIR34,1242
+RPMSPECDIR = $(shell rpm --eval '%_specdir')RPMSPECDIR35,1291
+KERNELDIR = /lib/modules/$(shell uname -r)/buildKERNELDIR36,1336
+CC = gccCC38,1386
+INCLUDE = -I.INCLUDE39,1396
+SBIN = $(BUILD_ROOT)/sbinSBIN40,1411
+MANDIR = usr/manMANDIR41,1438
+MAN = $(BUILD_ROOT)/$(MANDIR)/man8MAN42,1456
+INIT = $(BUILD_ROOT)/etc/rc.d/init.dINIT43,1492
+MKDIR = mkdirMKDIR44,1530
+INSTALL = installINSTALL45,1545
+STATIC_LIBS = libipvs/libipvs.aSTATIC_LIBS46,1564
+ CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlowCFLAGS49,1622
+ CFLAGS = -Wall -Wunused -Wstrict-prototypes -gCFLAGS51,1722
+RPMBUILD = $(shell \RPMBUILD58,1858
+LIB_SEARCH = /lib /usr/lib /usr/local/libLIB_SEARCH66,2014
+POPT_LIB = $(shell for i in $(LIB_SEARCH); do \POPT_LIB67,2056
+POPT_DEFINE = -DHAVE_POPTPOPT_DEFINE77,2266
+OBJS = ipvsadm.o config_stream.o dynamic_array.oOBJS80,2299
+LIBS = $(POPT_LIB)LIBS81,2349
+DEFINES = -DVERSION=\"$(VERSION)\" -DSCHEDULERS=\"$(SCHEDULERS)\" \DEFINES85,2410
+.PHONY = all clean install dist distclean rpm rpms.PHONY91,2590
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/VERSION
^
|
@@ -1 +1 @@
-1.25_nl_5
+1.25
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/ipvsadm-restore
^
|
@@ -4,7 +4,7 @@
# A very simple wrapper to restore IPVS rules
# Inspired by ipchains-save.
#
-# Version: $Id: ipvsadm-restore,v 1.3 2002/08/10 04:32:38 wensong Exp $
+# Version: $Id: ipvsadm-restore 54 2008-09-15 20:09:17Z vince $
#
# Script Author: Horms <horms@vergenet.net>
#
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/ipvsadm-restore.8
^
|
@@ -2,7 +2,7 @@
.\" ipvsadm-restore(8) manual page
.\" Inspired by ipchains-restore
.\"
-.\" $Id: ipvsadm-restore.8,v 1.1 2001/03/22 12:57:46 wensong Exp $
+.\" $Id: ipvsadm-restore.8 49 2001-03-27 09:27:54Z wensong $
.\"
.\" Authors: Wensong Zhang <wensong@linuxvirtualserver.org>
.\"
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/ipvsadm-save
^
|
@@ -4,7 +4,7 @@
# A very simple wrapper to save IPVS rules
# Inspired by ipchains-save.
#
-# Version: $Id: ipvsadm-save,v 1.3 2001/03/22 12:57:46 wensong Exp $
+# Version: $Id: ipvsadm-save 49 2001-03-27 09:27:54Z wensong $
#
# Script Author: Horms <horms@vergenet.net>
#
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/ipvsadm-save.8
^
|
@@ -2,7 +2,7 @@
.\" ipvsadm-save(8) manual page
.\" Inspired by ipchains-save
.\"
-.\" $Id: ipvsadm-save.8,v 1.1 2001/03/22 12:57:46 wensong Exp $
+.\" $Id: ipvsadm-save.8 49 2001-03-27 09:27:54Z wensong $
.\"
.\" Authors: Wensong Zhang <wensong@linuxvirtualserver.org>
.\"
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/ipvsadm.8
^
|
@@ -1,7 +1,7 @@
.\"
.\" ipvsadm(8) manual page
.\"
-.\" $Id: ipvsadm.8,v 1.23 2005/12/10 16:00:07 wensong Exp $
+.\" $Id: ipvsadm.8 56 2008-09-15 20:57:07Z vince $
.\"
.\" Authors: Mike Wangsmo <wanger@redhat.com>
.\" Wensong Zhang <wensong@linux-vs.org>
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/ipvsadm.c
^
|
@@ -2,7 +2,7 @@
* ipvsadm - IP Virtual Server ADMinistration program
* for IPVS NetFilter Module in kernel 2.4
*
- * Version: $Id: ipvsadm.c,v 1.27 2005/12/10 16:00:07 wensong Exp $
+ * Version: $Id: ipvsadm.c 56 2008-09-15 20:57:07Z vince $
*
* Authors: Wensong Zhang <wensong@linuxvirtualserver.org>
* Peter Kese <peter.kese@ijs.si>
|
[-]
[+]
|
Added |
ipvsadm-1.25.tar.bz2/ipvsadm.spec
^
|
@@ -0,0 +1,100 @@
+%define prefix /usr
+
+Summary: Utility to administer the Linux Virtual Server
+Name: ipvsadm
+Version: 1.25
+Release: 1
+License: GPL
+URL: http://www.LinuxVirtualServer.org/
+Group: Applications/System
+Source0: http://www.LinuxVirtualServer.org/software/ipvsadm-%{version}.tar.gz
+BuildRoot: /var/tmp/%name-%{PACKAGE_VERSION}-root
+Provides: %{name}-%{version}
+Conflicts: piranha <= 0.4.14
+
+%description
+ipvsadm is a utility to administer the IP Virtual Server services
+offered by the latest Linux kernel 2.6.x.
+
+
+%prep
+%setup -n %{name}-%{version}
+
+
+%build
+CFLAGS="${RPM_OPT_FLAGS}" make
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p ${RPM_BUILD_ROOT}/{sbin,%{_mandir}/man8,etc/rc.d/init.d}
+make install BUILD_ROOT=${RPM_BUILD_ROOT} MANDIR=%{_mandir}
+
+
+%files
+%defattr(-,root,root)
+%doc README
+%config /etc/rc.d/init.d/ipvsadm
+/sbin/ipvsadm*
+%{_mandir}/man8/ipvsadm*
+
+%post
+/sbin/chkconfig --add ipvsadm
+
+%preun
+/sbin/chkconfig --del ipvsadm
+
+
+%clean
+rm -rf $RPM_BUILD_DIR/%{name}
+rm -rf $RPM_BUILD_ROOT
+
+
+%changelog
+* Thu Jun 23 2005 Steve Nielsen <snielsen@comscore.com>
+- Respect rpmmacros that might be set (by using rpm --eval)
+
+* Sat Dec 20 2003 Wensong Zhang <wensong@linux-vs.org>
+- tidy up the description
+
+* Sat Apr 5 2003 Wensong Zhang <wensong@linux-vs.org>
+- Removed the unnecessary Docdir setting.
+
+* Thu Dec 16 2001 Wensong Zhang <wensong@linuxvirtualserver.org>
+- Changed to install ipvsadm man pages according to the %{_mandir}
+
+* Thu Dec 30 2000 Wensong Zhang <wensong@linuxvirtualserver.org>
+- update the %file section
+
+* Thu Dec 17 2000 Wensong Zhang <wensong@linuxvirtualserver.org>
+- Added a if-condition to keep both new or old rpm utility building
+ the package happily.
+
+* Tue Dec 12 2000 P.Copeland <bryce@redhat.com>
+- Small modifications to make the compiler happy in RH7 and the Alpha
+- Fixed the documentation file that got missed off in building
+ the rpm
+- Made a number of -pedantic mods though popt will not compile with
+ -pedantic
+
+* Wed Aug 9 2000 Horms <horms@vergenet.net>
+- Removed Obseletes tag as ipvsadm is back in /sbin where it belongs
+ as it is more or less analogous to both route and ipchains both of
+ which reside in /sbin.
+- Create directory to install init script into. Init scripts won't install
+ into build directory unless this is done
+
+* Thu Jul 6 2000 Wensong Zhang <wensong@linuxvirtualserver.org>
+- Changed to build rpms on the ipvsadm tar ball directly
+
+* Wed Jun 21 2000 P.Copeland <copeland@redhat.com>
+- fixed silly install permission settings
+
+* Mon Jun 19 2000 P.Copeland <copeland@redhat.com>
+- Added 'dist' and 'rpms' to the Makefile
+- Added Obsoletes tag since there were early versions
+ of ipvsadm-*.rpm that installed in /sbin
+- Obsolete tag was a bit vicious re: piranha
+
+* Mon Apr 10 2000 Horms <horms@vergenet.net>
+- created for version 1.9
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/libipvs/Makefile
^
|
@@ -19,7 +19,7 @@
$(STATIC_LIB): libipvs.o ip_vs_nl_policy.o
ar rv $@ $^
-
+
$(SHARED_LIB): libipvs.o ip_vs_nl_policy.o
$(CC) -shared -Wl,-soname,$@ -o $@ $^
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/libipvs/ip_vs.h
^
|
@@ -6,13 +6,10 @@
#ifndef _IP_VS_H
#define _IP_VS_H
-#include <asm/types.h> /* For __uXX types */
-#include <linux/types.h> /* For __beXX types in userland */
-
#include <netinet/in.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
+#include <linux/types.h> /* For __beXX types in userland */
#ifdef LIBIPVS_USE_NL
#include <netlink/netlink.h>
@@ -33,12 +30,6 @@
#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */
/*
- * Destination Server Flags
- */
-#define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */
-#define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */
-
-/*
* IPVS sync daemon states
*/
#define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */
@@ -98,9 +89,6 @@
#define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */
#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
-/* Move it to better place one day, for now keep it unique */
-#define NFC_IPVS_PROPERTY 0x10000
-
#define IP_VS_SCHEDNAME_MAXLEN 16
#define IP_VS_IFNAME_MAXLEN 16
|
[-]
[+]
|
Changed |
ipvsadm-1.25.tar.bz2/libipvs/libipvs.c
^
|
@@ -17,7 +17,6 @@
#include <string.h>
#include <errno.h>
#include <netinet/in.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
@@ -42,7 +41,8 @@
s->__addr_v4 = s->addr.ip; \
#ifdef LIBIPVS_USE_NL
-struct nl_msg *ipvs_nl_message(int cmd, int flags) {
+struct nl_msg *ipvs_nl_message(int cmd, int flags)
+{
struct nl_msg *msg;
msg = nlmsg_alloc();
@@ -55,11 +55,13 @@
return msg;
}
-static int ipvs_nl_noop_cb(struct nl_msg *msg, void *arg) {
+static int ipvs_nl_noop_cb(struct nl_msg *msg, void *arg)
+{
return NL_OK;
}
-int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg) {
+int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg)
+{
int err = EINVAL;
sock = nl_handle_alloc();
@@ -67,10 +69,10 @@
nlmsg_free(msg);
return -1;
}
-
+
if (genl_connect(sock) < 0)
goto fail_genl;
-
+
family = genl_ctrl_resolve(sock, IPVS_GENL_NAME);
if (family < 0)
goto fail_genl;
@@ -139,14 +141,14 @@
if (genlmsg_parse(nlh, 0, attrs, IPVS_INFO_ATTR_MAX, ipvs_info_policy) != 0)
return -1;
-
+
if (!(attrs[IPVS_INFO_ATTR_VERSION] &&
attrs[IPVS_INFO_ATTR_CONN_TAB_SIZE]))
return -1;
ipvs_info.version = nla_get_u32(attrs[IPVS_INFO_ATTR_VERSION]);
ipvs_info.size = nla_get_u32(attrs[IPVS_INFO_ATTR_CONN_TAB_SIZE]);
-
+
return NL_OK;
}
#endif
@@ -194,15 +196,16 @@
}
#ifdef LIBIPVS_USE_NL
-static int ipvs_nl_fill_service_attr(struct nl_msg *msg, ipvs_service_t *svc) {
+static int ipvs_nl_fill_service_attr(struct nl_msg *msg, ipvs_service_t *svc)
+{
struct nlattr *nl_service;
struct ip_vs_flags flags = { .flags = svc->flags,
.mask = ~0 };
-
+
nl_service = nla_nest_start(msg, IPVS_CMD_ATTR_SERVICE);
if (!nl_service)
return -1;
-
+
NLA_PUT_U16(msg, IPVS_SVC_ATTR_AF, svc->af);
if (svc->fwmark) {
@@ -217,7 +220,7 @@
NLA_PUT(msg, IPVS_SVC_ATTR_FLAGS, sizeof(flags), &flags);
NLA_PUT_U32(msg, IPVS_SVC_ATTR_TIMEOUT, svc->timeout);
NLA_PUT_U32(msg, IPVS_SVC_ATTR_NETMASK, svc->netmask);
-
+
nla_nest_end(msg, nl_service);
return 0;
@@ -312,20 +315,21 @@
}
#ifdef LIBIPVS_USE_NL
-static int ipvs_nl_fill_dest_attr(struct nl_msg *msg, ipvs_dest_t *dst) {
+static int ipvs_nl_fill_dest_attr(struct nl_msg *msg, ipvs_dest_t *dst)
+{
struct nlattr *nl_dest;
-
+
nl_dest = nla_nest_start(msg, IPVS_CMD_ATTR_DEST);
if (!nl_dest)
return -1;
-
+
NLA_PUT(msg, IPVS_DEST_ATTR_ADDR, sizeof(dst->addr), &(dst->addr));
NLA_PUT_U16(msg, IPVS_DEST_ATTR_PORT, dst->port);
NLA_PUT_U32(msg, IPVS_DEST_ATTR_FWD_METHOD, dst->conn_flags & IP_VS_CONN_F_FWD_MASK);
NLA_PUT_U32(msg, IPVS_DEST_ATTR_WEIGHT, dst->weight);
NLA_PUT_U32(msg, IPVS_DEST_ATTR_U_THRESH, dst->u_threshold);
NLA_PUT_U32(msg, IPVS_DEST_ATTR_L_THRESH, dst->l_threshold);
-
+
nla_nest_end(msg, nl_dest);
return 0;
@@ -507,12 +511,13 @@
}
#ifdef LIBIPVS_USE_NL
-static int ipvs_parse_stats(struct ip_vs_stats_user *stats, struct nlattr *nla) {
+static int ipvs_parse_stats(struct ip_vs_stats_user *stats, struct nlattr *nla)
+{
struct nlattr *attrs[IPVS_STATS_ATTR_MAX + 1];
if (nla_parse_nested(attrs, IPVS_STATS_ATTR_MAX, nla, ipvs_stats_policy))
return -1;
-
+
if (!(attrs[IPVS_STATS_ATTR_CONNS] &&
attrs[IPVS_STATS_ATTR_INPKTS] &&
attrs[IPVS_STATS_ATTR_OUTPKTS] &&
@@ -552,7 +557,7 @@
if (genlmsg_parse(nlh, 0, attrs, IPVS_CMD_ATTR_MAX, ipvs_cmd_policy) != 0)
return -1;
-
+
if (!attrs[IPVS_CMD_ATTR_SERVICE])
return -1;
@@ -597,7 +602,7 @@
return -1;
get->entrytable[i].num_dests = 0;
-
+
i++;
get->num_services = i;
@@ -712,7 +717,7 @@
if (genlmsg_parse(nlh, 0, attrs, IPVS_CMD_ATTR_MAX, ipvs_cmd_policy) != 0)
return -1;
-
+
if (!attrs[IPVS_CMD_ATTR_DEST])
return -1;
@@ -951,14 +956,14 @@
if (genlmsg_parse(nlh, 0, attrs, IPVS_CMD_ATTR_MAX, ipvs_cmd_policy) != 0)
return -1;
-
+
if (attrs[IPVS_CMD_ATTR_TIMEOUT_TCP])
u->tcp_timeout = nla_get_u32(attrs[IPVS_CMD_ATTR_TIMEOUT_TCP]);
if (attrs[IPVS_CMD_ATTR_TIMEOUT_TCP_FIN])
u->tcp_fin_timeout = nla_get_u32(attrs[IPVS_CMD_ATTR_TIMEOUT_TCP_FIN]);
if (attrs[IPVS_CMD_ATTR_TIMEOUT_UDP])
u->udp_timeout = nla_get_u32(attrs[IPVS_CMD_ATTR_TIMEOUT_UDP]);
-
+
return NL_OK;
}
#endif
@@ -1008,11 +1013,11 @@
if (genlmsg_parse(nlh, 0, attrs, IPVS_CMD_ATTR_MAX, ipvs_cmd_policy) != 0)
return -1;
-
+
if (nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX,
attrs[IPVS_CMD_ATTR_DAEMON], ipvs_daemon_policy))
return -1;
-
+
if (!(daemon_attrs[IPVS_DAEMON_ATTR_STATE] &&
daemon_attrs[IPVS_DAEMON_ATTR_MCAST_IFN] &&
daemon_attrs[IPVS_DAEMON_ATTR_SYNC_ID]))
@@ -1023,7 +1028,7 @@
nla_get_string(daemon_attrs[IPVS_DAEMON_ATTR_MCAST_IFN]),
IP_VS_IFNAME_MAXLEN);
u[i].syncid = nla_get_u32(daemon_attrs[IPVS_DAEMON_ATTR_SYNC_ID]);
-
+
return NL_OK;
}
#endif
|