]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/net/netfilter/nf_conntrack.h
netfilter: nf_conntrack: support conntrack templates
[net-next-2.6.git] / include / net / netfilter / nf_conntrack.h
index 5cf7270e3ffc3e94c6d80bd79168056e9c1e539f..5043d61c99a744b997256159e5546dd0b03e9dea 100644 (file)
@@ -272,6 +272,11 @@ nf_conntrack_alloc(struct net *net,
                   const struct nf_conntrack_tuple *repl,
                   gfp_t gfp);
 
+static inline int nf_ct_is_template(const struct nf_conn *ct)
+{
+       return test_bit(IPS_TEMPLATE_BIT, &ct->status);
+}
+
 /* It's confirmed if it is, or has been in the hash table. */
 static inline int nf_ct_is_confirmed(struct nf_conn *ct)
 {
@@ -293,11 +298,11 @@ extern unsigned int nf_conntrack_htable_size;
 extern unsigned int nf_conntrack_max;
 
 #define NF_CT_STAT_INC(net, count)     \
-       (per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++)
+       __this_cpu_inc((net)->ct.stat->count)
 #define NF_CT_STAT_INC_ATOMIC(net, count)              \
 do {                                                   \
        local_bh_disable();                             \
-       per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++;   \
+       __this_cpu_inc((net)->ct.stat->count);          \
        local_bh_enable();                              \
 } while (0)