Warning: This file is not a C or C++ file. It does not have highlighting.
1 | #ifndef _NF_CONNTRACK_COUNT_H |
---|---|
2 | #define _NF_CONNTRACK_COUNT_H |
3 | |
4 | #include <linux/list.h> |
5 | #include <linux/spinlock.h> |
6 | #include <net/netfilter/nf_conntrack_tuple.h> |
7 | #include <net/netfilter/nf_conntrack_zones.h> |
8 | |
9 | struct nf_conncount_data; |
10 | |
11 | struct nf_conncount_list { |
12 | spinlock_t list_lock; |
13 | u32 last_gc; /* jiffies at most recent gc */ |
14 | struct list_head head; /* connections with the same filtering key */ |
15 | unsigned int count; /* length of list */ |
16 | }; |
17 | |
18 | struct nf_conncount_data *nf_conncount_init(struct net *net, unsigned int family, |
19 | unsigned int keylen); |
20 | void nf_conncount_destroy(struct net *net, unsigned int family, |
21 | struct nf_conncount_data *data); |
22 | |
23 | unsigned int nf_conncount_count(struct net *net, |
24 | struct nf_conncount_data *data, |
25 | const u32 *key, |
26 | const struct nf_conntrack_tuple *tuple, |
27 | const struct nf_conntrack_zone *zone); |
28 | |
29 | int nf_conncount_add(struct net *net, struct nf_conncount_list *list, |
30 | const struct nf_conntrack_tuple *tuple, |
31 | const struct nf_conntrack_zone *zone); |
32 | |
33 | void nf_conncount_list_init(struct nf_conncount_list *list); |
34 | |
35 | bool nf_conncount_gc_list(struct net *net, |
36 | struct nf_conncount_list *list); |
37 | |
38 | void nf_conncount_cache_free(struct nf_conncount_list *list); |
39 | |
40 | #endif |
41 |
Warning: This file is not a C or C++ file. It does not have highlighting.