]> err.no Git - linux-2.6/blobdiff - include/net/netfilter/nf_conntrack.h
[IPSEC]: Merge most of the output path
[linux-2.6] / include / net / netfilter / nf_conntrack.h
index f1e0fee9aa9c15374c691af46c6f62266086f682..4ac5ab187c2a0ad0281b4700d8d9420243be01e5 100644 (file)
@@ -82,6 +82,8 @@ struct nf_conn_help {
 
        union nf_conntrack_help help;
 
+       struct hlist_head expectations;
+
        /* Current number of expected connections */
        unsigned int expecting;
 };
@@ -114,12 +116,6 @@ struct nf_conn
        struct ip_conntrack_counter counters[IP_CT_DIR_MAX];
 #endif
 
-       /* Unique ID that identifies this conntrack*/
-       unsigned int id;
-
-       /* features - nat, helper, ... used by allocating system */
-       u_int32_t features;
-
 #if defined(CONFIG_NF_CONNTRACK_MARK)
        u_int32_t mark;
 #endif
@@ -133,9 +129,6 @@ struct nf_conn
 
        /* Extensions */
        struct nf_ct_ext *ext;
-
-       /* features dynamically at the end: helper, nat (both optional) */
-       char data[0];
 };
 
 static inline struct nf_conn *
@@ -178,6 +171,10 @@ static inline void nf_ct_put(struct nf_conn *ct)
 extern int nf_ct_l3proto_try_module_get(unsigned short l3proto);
 extern void nf_ct_l3proto_module_put(unsigned short l3proto);
 
+extern struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced);
+extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced,
+                                int size);
+
 extern struct nf_conntrack_tuple_hash *
 __nf_conntrack_find(const struct nf_conntrack_tuple *tuple,
                    const struct nf_conn *ignored_conntrack);
@@ -186,6 +183,10 @@ extern void nf_conntrack_hash_insert(struct nf_conn *ct);
 
 extern void nf_conntrack_flush(void);
 
+extern int nf_ct_get_tuplepr(const struct sk_buff *skb,
+                            unsigned int nhoff,
+                            u_int16_t l3num,
+                            struct nf_conntrack_tuple *tuple);
 extern int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse,
                                const struct nf_conntrack_tuple *orig);
 
@@ -219,9 +220,6 @@ extern void nf_conntrack_tcp_update(struct sk_buff *skb,
                                    struct nf_conn *conntrack,
                                    int dir);
 
-/* Call me when a conntrack is destroyed. */
-extern void (*nf_conntrack_destroyed)(struct nf_conn *conntrack);
-
 /* Fake conntrack entry for untracked connections */
 extern struct nf_conn nf_conntrack_untracked;
 
@@ -251,6 +249,7 @@ static inline int nf_ct_is_untracked(const struct sk_buff *skb)
        return (skb->nfct == &nf_conntrack_untracked.ct_general);
 }
 
+extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
 extern unsigned int nf_conntrack_htable_size;
 extern int nf_conntrack_checksum;
 extern atomic_t nf_conntrack_count;
@@ -265,35 +264,10 @@ do {                                                      \
        local_bh_enable();                              \
 } while (0)
 
-/* no helper, no nat */
-#define        NF_CT_F_BASIC   0
-/* for helper */
-#define        NF_CT_F_HELP    1
-/* for nat. */
-#define        NF_CT_F_NAT     2
-#define NF_CT_F_NUM    4
-
 extern int
 nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size);
 extern void
 nf_conntrack_unregister_cache(u_int32_t features);
 
-/* valid combinations:
- * basic: nf_conn, nf_conn .. nf_conn_help
- * nat: nf_conn .. nf_conn_nat, nf_conn .. nf_conn_nat .. nf_conn help
- */
-#ifdef CONFIG_NF_NAT_NEEDED
-#include <net/netfilter/nf_nat.h>
-static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
-{
-       unsigned int offset = sizeof(struct nf_conn);
-
-       if (!(ct->features & NF_CT_F_NAT))
-               return NULL;
-
-       offset = ALIGN(offset, __alignof__(struct nf_conn_nat));
-       return (struct nf_conn_nat *) ((void *)ct + offset);
-}
-#endif /* CONFIG_NF_NAT_NEEDED */
 #endif /* __KERNEL__ */
 #endif /* _NF_CONNTRACK_H */