diff options
author | Patrick McHardy <kaber@trash.net> | 2007-12-05 01:26:33 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:56:14 -0800 |
commit | 02f014d88831f73b895c1fe09badb66c88e932d3 (patch) | |
tree | 09aa75b8edeb240e62c4269f20630f8206c0e6d4 /include/net/netfilter/nf_queue.h | |
parent | 7a6c6653b3a977087ec64d76817c7ee6e1df5b60 (diff) | |
download | op-kernel-dev-02f014d88831f73b895c1fe09badb66c88e932d3.zip op-kernel-dev-02f014d88831f73b895c1fe09badb66c88e932d3.tar.gz |
[NETFILTER]: nf_queue: move list_head/skb/id to struct nf_info
Move common fields for queue management to struct nf_info and rename it
to struct nf_queue_entry. The avoids one allocation/free per packet and
simplifies the code a bit.
Alternatively we could add some private room at the tail, but since
all current users use identical structs this seems easier.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/netfilter/nf_queue.h')
-rw-r--r-- | include/net/netfilter/nf_queue.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h index 8c6b382..d030044 100644 --- a/include/net/netfilter/nf_queue.h +++ b/include/net/netfilter/nf_queue.h @@ -2,7 +2,11 @@ #define _NF_QUEUE_H /* Each queued (to userspace) skbuff has one of these. */ -struct nf_info { +struct nf_queue_entry { + struct list_head list; + struct sk_buff *skb; + unsigned int id; + struct nf_hook_ops *elem; int pf; unsigned int hook; @@ -11,12 +15,11 @@ struct nf_info { int (*okfn)(struct sk_buff *); }; -#define nf_info_reroute(x) ((void *)x + sizeof(struct nf_info)) +#define nf_queue_entry_reroute(x) ((void *)x + sizeof(struct nf_queue_entry)) /* Packet queuing */ struct nf_queue_handler { - int (*outfn)(struct sk_buff *skb, - struct nf_info *info, + int (*outfn)(struct nf_queue_entry *entry, unsigned int queuenum); char *name; }; @@ -26,7 +29,6 @@ extern int nf_register_queue_handler(int pf, extern int nf_unregister_queue_handler(int pf, const struct nf_queue_handler *qh); extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh); -extern void nf_reinject(struct sk_buff *skb, struct nf_info *info, - unsigned int verdict); +extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); #endif /* _NF_QUEUE_H */ |