git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
include
/
net
/
ip_vs.h
diff --git
a/include/net/ip_vs.h
b/include/net/ip_vs.h
index
7d2674f
..
672564e
100644
(file)
--- a/
include/net/ip_vs.h
+++ b/
include/net/ip_vs.h
@@
-7,6
+7,7
@@
#define _IP_VS_H
#include <asm/types.h> /* For __uXX types */
#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 0x010201
#define NVERSION(version) \
#define IP_VS_VERSION_CODE 0x010201
#define NVERSION(version) \
@@
-100,22
+101,22
@@
struct ip_vs_service_user {
/* virtual service addresses */
u_int16_t protocol;
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 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 */
};
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 */
/* real server options */
unsigned conn_flags; /* connection flags */
@@
-163,15
+164,15
@@
struct ip_vs_getinfo {
struct ip_vs_service_entry {
/* which service: user fills in these */
u_int16_t protocol;
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 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;
/* number of real servers */
unsigned int num_dests;
@@
-182,8
+183,8
@@
struct ip_vs_service_entry {
struct ip_vs_dest_entry {
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 */
unsigned conn_flags; /* connection flags */
int weight; /* destination weight */
@@
-203,8
+204,8
@@
struct ip_vs_dest_entry {
struct ip_vs_get_dests {
/* which service: user fills in these */
u_int16_t protocol;
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 */
u_int32_t fwmark; /* firwall mark of service */
/* number of real servers */
@@
-248,7
+249,6
@@
struct ip_vs_daemon_user {
#ifdef __KERNEL__
#ifdef __KERNEL__
-#include <linux/config.h>
#include <linux/list.h> /* for struct list_head */
#include <linux/spinlock.h> /* for struct rwlock_t */
#include <asm/atomic.h> /* for struct atomic_t */
#include <linux/list.h> /* for struct list_head */
#include <linux/spinlock.h> /* for struct rwlock_t */
#include <asm/atomic.h> /* for struct atomic_t */
@@
-503,12
+503,12
@@
struct ip_vs_conn {
struct list_head c_list; /* hashed list heads */
/* Protocol, addresses and port numbers */
struct list_head c_list; /* hashed list heads */
/* Protocol, addresses and port numbers */
- __
u
32 caddr; /* client address */
- __
u
32 vaddr; /* virtual address */
- __
u
32 daddr; /* destination address */
- __
u
16 cport;
- __
u
16 vport;
- __
u
16 dport;
+ __
be
32 caddr; /* client address */
+ __
be
32 vaddr; /* virtual address */
+ __
be
32 daddr; /* destination address */
+ __
be
16 cport;
+ __
be
16 vport;
+ __
be
16 dport;
__u16 protocol; /* Which protocol (TCP/UDP) */
/* counter and timer */
__u16 protocol; /* Which protocol (TCP/UDP) */
/* counter and timer */
@@
-555,12
+555,12
@@
struct ip_vs_service {
atomic_t usecnt; /* use counter */
__u16 protocol; /* which protocol (TCP/UDP) */
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 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 */
struct list_head destinations; /* real server d-linked list */
__u32 num_dests; /* number of servers */
@@
-582,8
+582,8
@@
struct ip_vs_dest {
struct list_head n_list; /* for the dests in the service */
struct list_head d_list; /* for table with all the dests */
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 */
volatile unsigned flags; /* dest status flags */
atomic_t conn_flags; /* flags to copy to conn */
atomic_t weight; /* server weight */
@@
-606,8
+606,8
@@
struct ip_vs_dest {
/* for virtual service */
struct ip_vs_service *svc; /* service it belongs to */
__u16 protocol; /* which protocol (TCP/UDP) */
/* 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 */
};
__u32 vfwmark; /* firewall mark of service */
};
@@
-649,7
+649,7
@@
struct ip_vs_app
/* members for application incarnations */
struct list_head p_list; /* member in proto app list */
struct ip_vs_app *app; /* its real application */
/* 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. */
atomic_t usecnt; /* usage counter */
/* output hook: return false if can't linearize. diff set for TCP. */
@@
-741,11
+741,11
@@
enum {
};
extern struct ip_vs_conn *ip_vs_conn_in_get
};
extern struct ip_vs_conn *ip_vs_conn_in_get
-(int protocol, __
u32 s_addr, __u16 s_port, __u32 d_addr, __u
16 d_port);
+(int protocol, __
be32 s_addr, __be16 s_port, __be32 d_addr, __be
16 d_port);
extern struct ip_vs_conn *ip_vs_ct_in_get
extern struct ip_vs_conn *ip_vs_ct_in_get
-(int protocol, __
u32 s_addr, __u16 s_port, __u32 d_addr, __u
16 d_port);
+(int protocol, __
be32 s_addr, __be16 s_port, __be32 d_addr, __be
16 d_port);
extern struct ip_vs_conn *ip_vs_conn_out_get
extern struct ip_vs_conn *ip_vs_conn_out_get
-(int protocol, __
u32 s_addr, __u16 s_port, __u32 d_addr, __u
16 d_port);
+(int protocol, __
be32 s_addr, __be16 s_port, __be32 d_addr, __be
16 d_port);
/* put back the conn without restarting its timer */
static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
/* put back the conn without restarting its timer */
static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
@@
-753,11
+753,11
@@
static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
atomic_dec(&cp->refcnt);
}
extern void ip_vs_conn_put(struct ip_vs_conn *cp);
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, __
u
16 cport);
+extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __
be
16 cport);
extern struct ip_vs_conn *
extern struct ip_vs_conn *
-ip_vs_conn_new(int proto, __
u32 caddr, __u16 cport, __u32 vaddr, __u
16 vport,
- __
u32 daddr, __u
16 dport, unsigned flags,
+ip_vs_conn_new(int proto, __
be32 caddr, __be16 cport, __be32 vaddr, __be
16 vport,
+ __
be32 daddr, __be
16 dport, unsigned flags,
struct ip_vs_dest *dest);
extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
struct ip_vs_dest *dest);
extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
@@
-888,7
+888,7
@@
extern int sysctl_ip_vs_nat_icmp_send;
extern struct ip_vs_stats ip_vs_stats;
extern struct ip_vs_service *
extern struct ip_vs_stats ip_vs_stats;
extern struct ip_vs_service *
-ip_vs_service_get(__u32 fwmark, __u16 protocol, __
u32 vaddr, __u
16 vport);
+ip_vs_service_get(__u32 fwmark, __u16 protocol, __
be32 vaddr, __be
16 vport);
static inline void ip_vs_service_put(struct ip_vs_service *svc)
{
static inline void ip_vs_service_put(struct ip_vs_service *svc)
{
@@
-896,7
+896,7
@@
static inline void ip_vs_service_put(struct ip_vs_service *svc)
}
extern struct ip_vs_dest *
}
extern struct ip_vs_dest *
-ip_vs_lookup_real_service(__u16 protocol, __
u32 daddr, __u
16 dport);
+ip_vs_lookup_real_service(__u16 protocol, __
be32 daddr, __be
16 dport);
extern int ip_vs_use_count_inc(void);
extern void ip_vs_use_count_dec(void);
extern int ip_vs_control_init(void);
extern int ip_vs_use_count_inc(void);
extern void ip_vs_use_count_dec(void);
extern int ip_vs_control_init(void);
@@
-988,14
+988,20
@@
extern int ip_vs_make_skb_writable(struct sk_buff **pskb, int len);
extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
struct ip_vs_conn *cp, int dir);
extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
struct ip_vs_conn *cp, int dir);
-extern
u
16 ip_vs_checksum_complete(struct sk_buff *skb, int offset);
+extern
__sum
16 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 /* __KERNEL__ */