]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/ip_vs.h
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6-omap-h63xx.git] / include / net / ip_vs.h
index 49c717e3b040075562728bbda430369adf89aa93..67ea2c0c0ab75a1fb1a40dd31c734c6326f73cca 100644 (file)
@@ -7,6 +7,7 @@
 #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)                      \
@@ -463,10 +464,10 @@ struct ip_vs_protocol {
                        unsigned int proto_off,
                        int inverse);
 
-       int (*snat_handler)(struct sk_buff **pskb,
+       int (*snat_handler)(struct sk_buff *skb,
                            struct ip_vs_protocol *pp, struct ip_vs_conn *cp);
 
-       int (*dnat_handler)(struct sk_buff **pskb,
+       int (*dnat_handler)(struct sk_buff *skb,
                            struct ip_vs_protocol *pp, struct ip_vs_conn *cp);
 
        int (*csum_check)(struct sk_buff *skb, struct ip_vs_protocol *pp);
@@ -519,6 +520,10 @@ struct ip_vs_conn {
        spinlock_t              lock;           /* lock for state transition */
        volatile __u16          flags;          /* status flags */
        volatile __u16          state;          /* state info */
+       volatile __u16          old_state;      /* old state, to be used for
+                                                * state transition triggerd
+                                                * synchronization
+                                                */
 
        /* Control members */
        struct ip_vs_conn       *control;       /* Master control connection */
@@ -653,11 +658,11 @@ struct ip_vs_app
 
        /* output hook: return false if can't linearize. diff set for TCP.  */
        int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *,
-                      struct sk_buff **, int *diff);
+                      struct sk_buff *, int *diff);
 
        /* input hook: return false if can't linearize. diff set for TCP. */
        int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *,
-                     struct sk_buff **, int *diff);
+                     struct sk_buff *, int *diff);
 
        /* ip_vs_app initializer */
        int (*init_conn)(struct ip_vs_app *, struct ip_vs_conn *);
@@ -831,8 +836,8 @@ register_ip_vs_app_inc(struct ip_vs_app *app, __u16 proto, __u16 port);
 extern int ip_vs_app_inc_get(struct ip_vs_app *inc);
 extern void ip_vs_app_inc_put(struct ip_vs_app *inc);
 
-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_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb);
+extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
 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);
@@ -900,6 +905,10 @@ extern int ip_vs_use_count_inc(void);
 extern void ip_vs_use_count_dec(void);
 extern int ip_vs_control_init(void);
 extern void ip_vs_control_cleanup(void);
+extern struct ip_vs_dest *
+ip_vs_find_dest(__be32 daddr, __be16 dport,
+                __be32 vaddr, __be16 vport, __u16 protocol);
+extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp);
 
 
 /*
@@ -983,18 +992,23 @@ static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
        return fwd;
 }
 
-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 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 __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum)
+{
+       __be32 diff[2] = { ~old, new };
+
+       return csum_partial((char *) diff, sizeof(diff), oldsum);
+}
 
-static inline u16 ip_vs_check_diff(u32 old, u32 new, u16 oldsum)
+static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
 {
-       u32 diff[2] = { old, new };
+       __be16 diff[2] = { ~old, new };
 
-       return csum_fold(csum_partial((char *) diff, sizeof(diff),
-                                     oldsum ^ 0xFFFF));
+       return csum_partial((char *) diff, sizeof(diff), oldsum);
 }
 
 #endif /* __KERNEL__ */