Update to latest upstream sources (same version) and update included

ip_vs.h.
This commit is contained in:
Matthias Saou 2007-10-22 11:51:23 +00:00
parent 1c30e8dee9
commit 8ca75de5ec
2 changed files with 86 additions and 71 deletions

View File

@ -1,19 +1,7 @@
diff -Naur ipvsadm-1.24/Makefile ipvsadm-1.24.khead/Makefile
--- ipvsadm-1.24/Makefile Sat Jan 10 04:39:03 2004
+++ ipvsadm-1.24.khead/Makefile Tue Mar 2 15:10:45 2004
@@ -32,7 +32,7 @@
CC = gcc
CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -O2
-INCLUDE = -I/usr/src/linux/include -I.. -I.
+INCLUDE = -Ikernheaders -I.. -I.
SBIN = $(BUILD_ROOT)/sbin
MANDIR = usr/man
MAN = $(BUILD_ROOT)/$(MANDIR)/man8
diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/net/ip_vs.h
--- ipvsadm-1.24/kernheaders/net/ip_vs.h Wed Dec 31 19:00:00 1969
+++ ipvsadm-1.24.khead/kernheaders/net/ip_vs.h Tue Mar 2 15:10:17 2004
@@ -0,0 +1,999 @@
diff -Naupr ipvsadm-1.24.orig/kernheaders/net/ip_vs.h ipvsadm-1.24/kernheaders/ip_vs.h
--- ipvsadm-1.24.orig/kernheaders/net/ip_vs.h 1970-01-01 01:00:00.000000000 +0100
+++ ipvsadm-1.24/kernheaders/net/ip_vs.h 2007-10-09 22:31:38.000000000 +0200
@@ -0,0 +1,1009 @@
+/*
+ * IP Virtual Server
+ * data structure and functionality definitions
@ -23,8 +11,9 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+#define _IP_VS_H
+
+#include <asm/types.h> /* For __uXX types */
+#include <linux/types.h> /* For __beXX types in userland */
+
+#define IP_VS_VERSION_CODE 0x010200
+#define IP_VS_VERSION_CODE 0x010201
+#define NVERSION(version) \
+ (version >> 16) & 0xFF, \
+ (version >> 8) & 0xFF, \
@ -100,6 +89,7 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+#define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */
+#define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */
+#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
@ -115,22 +105,22 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+struct ip_vs_service_user {
+ /* virtual service addresses */
+ u_int16_t protocol;
+ u_int32_t addr; /* virtual ip address */
+ u_int16_t port;
+ __be32 addr; /* virtual ip address */
+ __be16 port;
+ u_int32_t fwmark; /* firwall mark of service */
+
+ /* virtual service options */
+ char sched_name[IP_VS_SCHEDNAME_MAXLEN];
+ unsigned flags; /* virtual service flags */
+ unsigned timeout; /* persistent timeout in sec */
+ u_int32_t netmask; /* persistent netmask */
+ __be32 netmask; /* persistent netmask */
+};
+
+
+struct ip_vs_dest_user {
+ /* destination server address */
+ u_int32_t addr;
+ u_int16_t port;
+ __be32 addr;
+ __be16 port;
+
+ /* real server options */
+ unsigned conn_flags; /* connection flags */
@ -178,15 +168,15 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+struct ip_vs_service_entry {
+ /* which service: user fills in these */
+ u_int16_t protocol;
+ u_int32_t addr; /* virtual address */
+ u_int16_t port;
+ __be32 addr; /* virtual address */
+ __be16 port;
+ u_int32_t fwmark; /* firwall mark of service */
+
+ /* service options */
+ char sched_name[IP_VS_SCHEDNAME_MAXLEN];
+ unsigned flags; /* virtual service flags */
+ unsigned timeout; /* persistent timeout */
+ u_int32_t netmask; /* persistent netmask */
+ __be32 netmask; /* persistent netmask */
+
+ /* number of real servers */
+ unsigned int num_dests;
@ -197,8 +187,8 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+
+
+struct ip_vs_dest_entry {
+ u_int32_t addr; /* destination address */
+ u_int16_t port;
+ __be32 addr; /* destination address */
+ __be16 port;
+ unsigned conn_flags; /* connection flags */
+ int weight; /* destination weight */
+
@ -218,8 +208,8 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+struct ip_vs_get_dests {
+ /* which service: user fills in these */
+ u_int16_t protocol;
+ u_int32_t addr; /* virtual address */
+ u_int16_t port;
+ __be32 addr; /* virtual address */
+ __be16 port;
+ u_int32_t fwmark; /* firwall mark of service */
+
+ /* number of real servers */
@ -263,20 +253,17 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+
+#ifdef __KERNEL__
+
+#include <linux/config.h>
+#include <linux/list.h> /* for struct list_head */
+#include <linux/spinlock.h> /* for struct rwlock_t */
+#include <linux/skbuff.h> /* for struct sk_buff */
+#include <linux/ip.h> /* for struct iphdr */
+#include <asm/atomic.h> /* for struct atomic_t */
+#include <linux/netdevice.h> /* for struct neighbour */
+#include <net/dst.h> /* for struct dst_entry */
+#include <net/tcp.h>
+#include <net/udp.h>
+#include <linux/compiler.h>
+#include <linux/timer.h>
+
+#include <net/checksum.h>
+
+#ifdef CONFIG_IP_VS_DEBUG
+#include <linux/net.h>
+
+extern int ip_vs_get_debug_level(void);
+#define IP_VS_DBG(level, msg...) \
+ do { \
@ -374,6 +361,7 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ NET_IPV4_VS_EXPIRE_NODEST_CONN=23,
+ NET_IPV4_VS_SYNC_THRESHOLD=24,
+ NET_IPV4_VS_NAT_ICMP_SEND=25,
+ NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE=26,
+ NET_IPV4_VS_LAST
+};
+
@ -444,8 +432,11 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ spinlock_t lock; /* spin lock */
+};
+
+struct dst_entry;
+struct iphdr;
+struct ip_vs_conn;
+struct ip_vs_app;
+struct sk_buff;
+
+struct ip_vs_protocol {
+ struct ip_vs_protocol *next;
@ -516,12 +507,12 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ struct list_head c_list; /* hashed list heads */
+
+ /* Protocol, addresses and port numbers */
+ __u32 caddr; /* client address */
+ __u32 vaddr; /* virtual address */
+ __u32 daddr; /* destination address */
+ __u16 cport;
+ __u16 vport;
+ __u16 dport;
+ __be32 caddr; /* client address */
+ __be32 vaddr; /* virtual address */
+ __be32 daddr; /* destination address */
+ __be16 cport;
+ __be16 vport;
+ __be16 dport;
+ __u16 protocol; /* Which protocol (TCP/UDP) */
+
+ /* counter and timer */
@ -568,12 +559,12 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ atomic_t usecnt; /* use counter */
+
+ __u16 protocol; /* which protocol (TCP/UDP) */
+ __u32 addr; /* IP address for virtual service */
+ __u16 port; /* port number for the service */
+ __be32 addr; /* IP address for virtual service */
+ __be16 port; /* port number for the service */
+ __u32 fwmark; /* firewall mark of the service */
+ unsigned flags; /* service status flags */
+ unsigned timeout; /* persistent timeout in ticks */
+ __u32 netmask; /* grouping granularity */
+ __be32 netmask; /* grouping granularity */
+
+ struct list_head destinations; /* real server d-linked list */
+ __u32 num_dests; /* number of servers */
@ -595,8 +586,8 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ struct list_head n_list; /* for the dests in the service */
+ struct list_head d_list; /* for table with all the dests */
+
+ __u32 addr; /* IP address of the server */
+ __u16 port; /* port number of the server */
+ __be32 addr; /* IP address of the server */
+ __be16 port; /* port number of the server */
+ volatile unsigned flags; /* dest status flags */
+ atomic_t conn_flags; /* flags to copy to conn */
+ atomic_t weight; /* server weight */
@ -619,8 +610,8 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ /* for virtual service */
+ struct ip_vs_service *svc; /* service it belongs to */
+ __u16 protocol; /* which protocol (TCP/UDP) */
+ __u32 vaddr; /* virtual IP address */
+ __u16 vport; /* virtual port number */
+ __be32 vaddr; /* virtual IP address */
+ __be16 vport; /* virtual port number */
+ __u32 vfwmark; /* firewall mark of service */
+};
+
@ -662,7 +653,7 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ /* members for application incarnations */
+ struct list_head p_list; /* member in proto app list */
+ struct ip_vs_app *app; /* its real application */
+ __u16 port; /* port number in net order */
+ __be16 port; /* port number in net order */
+ atomic_t usecnt; /* usage counter */
+
+ /* output hook: return false if can't linearize. diff set for TCP. */
@ -716,8 +707,6 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ * (from ip_vs_core.c)
+ */
+extern const char *ip_vs_proto_name(unsigned proto);
+extern unsigned int check_for_ip_vs_out(struct sk_buff **skb_p,
+ int (*okfn)(struct sk_buff *));
+extern void ip_vs_init_hash_table(struct list_head *table, int rows);
+#define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table(t, sizeof(t)/sizeof(t[0]))
+
@ -756,9 +745,11 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+};
+
+extern struct ip_vs_conn *ip_vs_conn_in_get
+(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port);
+(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
+extern struct ip_vs_conn *ip_vs_ct_in_get
+(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
+extern struct ip_vs_conn *ip_vs_conn_out_get
+(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port);
+(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
+
+/* put back the conn without restarting its timer */
+static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
@ -766,11 +757,11 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ atomic_dec(&cp->refcnt);
+}
+extern void ip_vs_conn_put(struct ip_vs_conn *cp);
+extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __u16 cport);
+extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport);
+
+extern struct ip_vs_conn *
+ip_vs_conn_new(int proto, __u32 caddr, __u16 cport, __u32 vaddr, __u16 vport,
+ __u32 daddr, __u16 dport, unsigned flags,
+ip_vs_conn_new(int proto, __be32 caddr, __be16 cport, __be32 vaddr, __be16 vport,
+ __be32 daddr, __be16 dport, unsigned flags,
+ struct ip_vs_dest *dest);
+extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
+
@ -847,7 +838,7 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+
+extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff **pskb);
+extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff **pskb);
+extern int ip_vs_skb_replace(struct sk_buff *skb, int pri,
+extern int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri,
+ char *o_buf, int o_len, char *n_buf, int n_len);
+extern int ip_vs_app_init(void);
+extern void ip_vs_app_cleanup(void);
@ -895,12 +886,13 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ */
+extern int sysctl_ip_vs_cache_bypass;
+extern int sysctl_ip_vs_expire_nodest_conn;
+extern int sysctl_ip_vs_expire_quiescent_template;
+extern int sysctl_ip_vs_sync_threshold[2];
+extern int sysctl_ip_vs_nat_icmp_send;
+extern struct ip_vs_stats ip_vs_stats;
+
+extern struct ip_vs_service *
+ip_vs_service_get(__u32 fwmark, __u16 protocol, __u32 vaddr, __u16 vport);
+ip_vs_service_get(__u32 fwmark, __u16 protocol, __be32 vaddr, __be16 vport);
+
+static inline void ip_vs_service_put(struct ip_vs_service *svc)
+{
@ -908,7 +900,7 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+}
+
+extern struct ip_vs_dest *
+ip_vs_lookup_real_service(__u16 protocol, __u32 daddr, __u16 dport);
+ip_vs_lookup_real_service(__u16 protocol, __be32 daddr, __be16 dport);
+extern int ip_vs_use_count_inc(void);
+extern void ip_vs_use_count_dec(void);
+extern int ip_vs_control_init(void);
@ -975,7 +967,7 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+ */
+#define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK)
+
+extern __inline__ char ip_vs_fwd_tag(struct ip_vs_conn *cp)
+static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
+{
+ char fwd;
+
@ -1000,22 +992,28 @@ diff -Naur ipvsadm-1.24/kernheaders/net/ip_vs.h ipvsadm-1.24.khead/kernheaders/n
+extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
+ struct ip_vs_conn *cp, int dir);
+
+extern u16 ip_vs_checksum_complete(struct sk_buff *skb, int offset);
+extern __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset);
+
+static inline u16 ip_vs_check_diff(u32 old, u32 new, u16 oldsum)
+static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum)
+{
+ u32 diff[2] = { old, new };
+ __be32 diff[2] = { ~old, new };
+
+ return csum_fold(csum_partial((char *) diff, sizeof(diff),
+ oldsum ^ 0xFFFF));
+ return csum_partial((char *) diff, sizeof(diff), oldsum);
+}
+
+static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
+{
+ __be16 diff[2] = { ~old, new };
+
+ return csum_partial((char *) diff, sizeof(diff), oldsum);
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* _IP_VS_H */
diff -Naur ipvsadm-1.24/libipvs/Makefile ipvsadm-1.24.khead/libipvs/Makefile
--- ipvsadm-1.24/libipvs/Makefile Thu Dec 19 08:53:07 2002
+++ ipvsadm-1.24.khead/libipvs/Makefile Tue Mar 2 15:16:11 2004
diff -Naupr ipvsadm-1.24.orig/libipvs/Makefile ipvsadm-1.24/libipvs/Makefile
--- ipvsadm-1.24.orig/libipvs/Makefile 2005-06-26 17:59:51.000000000 +0200
+++ ipvsadm-1.24/libipvs/Makefile 2007-10-22 13:32:52.000000000 +0200
@@ -1,7 +1,7 @@
# Makefile for libipvs
@ -1025,3 +1023,15 @@ diff -Naur ipvsadm-1.24/libipvs/Makefile ipvsadm-1.24.khead/libipvs/Makefile
CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -O2
INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \
diff -Naupr ipvsadm-1.24.orig/Makefile ipvsadm-1.24/Makefile
--- ipvsadm-1.24.orig/Makefile 2005-12-10 17:00:07.000000000 +0100
+++ ipvsadm-1.24/Makefile 2007-10-22 13:32:29.000000000 +0200
@@ -35,7 +35,7 @@ RPMSOURCEDIR = $(shell rpm --eval '%_sou
RPMSPECDIR = $(shell rpm --eval '%_specdir')
CC = gcc
-INCLUDE = -I/usr/src/linux/include -I.. -I.
+INCLUDE = -Ikernheaders -I.. -I.
SBIN = $(BUILD_ROOT)/sbin
MANDIR = usr/man
MAN = $(BUILD_ROOT)/$(MANDIR)/man8

View File

@ -1,12 +1,12 @@
Summary: Utility to administer the Linux Virtual Server
Name: ipvsadm
Version: 1.24
Release: 9
Release: 10
License: GPLv2+
Group: Applications/System
URL: http://www.linuxvirtualserver.org/software/ipvs.html
Source: http://www.linuxvirtualserver.org/software/kernel-2.6/ipvsadm-%{version}.tar.gz
Patch0: ipvsadm-1.24-kernhdr-1.2.0.patch
Patch0: ipvsadm-1.24-kernhdr-1.2.1.patch
Patch1: ipvsadm-1.24-Makefile.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Buildrequires: kernel-headers
@ -61,6 +61,11 @@ fi
%changelog
* Mon Oct 22 2007 Matthias Saou <http://freshrpms.net/> 1.24-10
- Update to latest upstream sources. Same filename, but updated content!
- Update kernhdr patch for it to still apply, update ip_vs.h from 1.2.0 to
1.2.1 from kernel 2.6.23.1.
* Fri Aug 24 2007 Matthias Saou <http://freshrpms.net/> 1.24-9
- Spec file cleanup.
- Update License field.