~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to include/net/netfilter/nf_conntrack_timestamp.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _NF_CONNTRACK_TSTAMP_H
 
2
#define _NF_CONNTRACK_TSTAMP_H
 
3
 
 
4
#include <net/net_namespace.h>
 
5
#include <linux/netfilter/nf_conntrack_common.h>
 
6
#include <linux/netfilter/nf_conntrack_tuple_common.h>
 
7
#include <net/netfilter/nf_conntrack.h>
 
8
#include <net/netfilter/nf_conntrack_extend.h>
 
9
 
 
10
struct nf_conn_tstamp {
 
11
        u_int64_t start;
 
12
        u_int64_t stop;
 
13
};
 
14
 
 
15
static inline
 
16
struct nf_conn_tstamp *nf_conn_tstamp_find(const struct nf_conn *ct)
 
17
{
 
18
#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
 
19
        return nf_ct_ext_find(ct, NF_CT_EXT_TSTAMP);
 
20
#else
 
21
        return NULL;
 
22
#endif
 
23
}
 
24
 
 
25
static inline
 
26
struct nf_conn_tstamp *nf_ct_tstamp_ext_add(struct nf_conn *ct, gfp_t gfp)
 
27
{
 
28
#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
 
29
        struct net *net = nf_ct_net(ct);
 
30
 
 
31
        if (!net->ct.sysctl_tstamp)
 
32
                return NULL;
 
33
 
 
34
        return nf_ct_ext_add(ct, NF_CT_EXT_TSTAMP, gfp);
 
35
#else
 
36
        return NULL;
 
37
#endif
 
38
};
 
39
 
 
40
static inline bool nf_ct_tstamp_enabled(struct net *net)
 
41
{
 
42
        return net->ct.sysctl_tstamp != 0;
 
43
}
 
44
 
 
45
static inline void nf_ct_set_tstamp(struct net *net, bool enable)
 
46
{
 
47
        net->ct.sysctl_tstamp = enable;
 
48
}
 
49
 
 
50
#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
 
51
extern int nf_conntrack_tstamp_init(struct net *net);
 
52
extern void nf_conntrack_tstamp_fini(struct net *net);
 
53
#else
 
54
static inline int nf_conntrack_tstamp_init(struct net *net)
 
55
{
 
56
        return 0;
 
57
}
 
58
 
 
59
static inline void nf_conntrack_tstamp_fini(struct net *net)
 
60
{
 
61
        return;
 
62
}
 
63
#endif /* CONFIG_NF_CONNTRACK_TIMESTAMP */
 
64
 
 
65
#endif /* _NF_CONNTRACK_TSTAMP_H */