| 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 |
unsigned int last_gc_count; /* length of list at most recent gc */ |
| 17 |
}; |
| 18 |
|
| 19 |
struct nf_conncount_data *nf_conncount_init(struct net *net, unsigned int keylen); |
| 20 |
void nf_conncount_destroy(struct net *net, struct nf_conncount_data *data); |
| 21 |
|
| 22 |
unsigned int nf_conncount_count_skb(struct net *net, |
| 23 |
const struct sk_buff *skb, |
| 24 |
u16 l3num, |
| 25 |
struct nf_conncount_data *data, |
| 26 |
const u32 *key); |
| 27 |
|
| 28 |
int nf_conncount_add_skb(struct net *net, const struct sk_buff *skb, |
| 29 |
u16 l3num, struct nf_conncount_list *list); |
| 30 |
|
| 31 |
void nf_conncount_list_init(struct nf_conncount_list *list); |
| 32 |
|
| 33 |
bool nf_conncount_gc_list(struct net *net, |
| 34 |
struct nf_conncount_list *list); |
| 35 |
|
| 36 |
void nf_conncount_cache_free(struct nf_conncount_list *list); |
| 37 |
|
| 38 |
#endif |