add /proc/net/netfilter/nf_queue]
Subsystems (2)
PATCH 1/1 add /proc/net/netfilter/nf_queue]
I forgot to Cc the list with this one...
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Hi Dave!
Please apply to your net-2.6.14 tree, thanks.
Signature · 4 lines
- Harald Welte <[email protected]> http://gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
[NETFILTER] add /proc/net/netfilter interface to nf_queue
This patch adds a /proc/net/netfilter/nf_queue file, similar to the recently-added /proc/net/netfilter/nf_log. It indicates which queue handler is registered to which protocol family. This is useful since there are now multiple queue handlers in the treee (ip[6]_queue, nfnetlink_queue).
---
commit 920c6ab53de92da82f0e3dc7de30ae6f1d0dd3a8
tree bdf86e03da89db980b19331efabb85125a915ef5
parent 6a85f7cafea91c2eea692828c7c1602d2da4f4c4
author Harald Welte <[email protected]> Mo, 08 Aug 2005 08:57:08 +0200 committer Harald Welte <[email protected]> Mo, 08 Aug 2005 08:57:08 +0200
include/linux/netfilter.h | 13 +++-- net/ipv4/netfilter/ip_queue.c | 9 +++ net/ipv6/netfilter/ip6_queue.c | 9 +++ net/netfilter/nf_queue.c | 105 ++++++++++++++++++++++++++++++++------- net/netfilter/nfnetlink_queue.c | 12 +++- 5 files changed, 114 insertions(+), 34 deletions(-)
include/linux/netfilter.h +8 -5
@@ -225,13 +225,16 @@ int nf_getsockopt(struct sock *sk, int p int *len);/* Packet queuing */ -typedef int (*nf_queue_outfn_t )(struct sk_buff *skb, -struct nf_info *info, -unsigned int queuenum,void *data); +struct nf_queue_handler { +int (*outfn)(struct sk_buff *skb,struct nf_info *info, +unsigned int queuenum,void *data); +void *data; +char *name; +};extern int nf_register_queue_handler (int pf, -nf_queue_outfn_t outfn,void *data); +struct nf_queue_handler *qh);extern int nf_unregister_queue_handler (int pf); -extern void nf_unregister_queue_handlers (nf_queue_outfn_t outfn); +extern void nf_unregister_queue_handlers (struct nf_queue_handler *qh);extern void nf_reinject (struct sk_buff *skb,struct nf_info *info,unsigned int verdict);
net/ipv4/netfilter/ip_queue.c +7 -2
@@ -649,6 +649,11 @@ ipq_get_info(char *buffer, char **start, }#endif /* CONFIG_PROC_FS */ +static struct nf_queue_handler nfqh = { + .name ="ip_queue" , + .outfn = &ipq_enqueue_packet, +}; +static int init_or_cleanup (int init) {
@@ -677,7 +682,7 @@ init_or_cleanup(int init)register_netdevice_notifier (&ipq_dev_notifier); ipq_sysctl_header =register_sysctl_table (ipq_root_table,0 ); - status =nf_register_queue_handler (PF_INET , ipq_enqueue_packet,NULL ); + status =nf_register_queue_handler (PF_INET , &nfqh);if (status <0 ) {printk (KERN_ERR "ip_queue: failed to register queue handler\n" ); goto cleanup_sysctl;
@@ -685,7 +690,7 @@ init_or_cleanup(int init)return status; cleanup: -nf_unregister_queue_handlers (&ipq_enqueue_packet); +nf_unregister_queue_handlers (&nfqh);synchronize_net ();ipq_flush (NF_DROP );
net/ipv6/netfilter/ip6_queue.c +7 -2
@@ -645,6 +645,11 @@ ipq_get_info(char *buffer, char **start,return len; } +static struct nf_queue_handler nfqh = { + .name ="ip6_queue" , + .outfn = &ipq_enqueue_packet, +}; +static int init_or_cleanup (int init) {
@@ -672,7 +677,7 @@ init_or_cleanup(int init)register_netdevice_notifier (&ipq_dev_notifier); ipq_sysctl_header =register_sysctl_table (ipq_root_table,0 ); - status =nf_register_queue_handler (PF_INET6 , ipq_enqueue_packet,NULL ); + status =nf_register_queue_handler (PF_INET6 , &nfqh);if (status <0 ) {printk (KERN_ERR "ip6_queue: failed to register queue handler\n" ); goto cleanup_sysctl;
@@ -680,7 +685,7 @@ init_or_cleanup(int init)return status; cleanup: -nf_unregister_queue_handlers (&ipq_enqueue_packet); +nf_unregister_queue_handlers (&nfqh);synchronize_net ();ipq_flush (NF_DROP );
net/netfilter/nf_queue.c +85 -20
165 lines not on this page · raw message
net/netfilter/nfnetlink_queue.c +7 -5
@@ -809,6 +809,11 @@ static const int nfqa_cfg_min[NFQA_CFG_M [NFQA_CFG_PARAMS-1] = sizeof(struct nfqnl_msg_config_params), }; +static struct nf_queue_handler nfqh = { + .name ="nf_queue" , + .outfn = &nfqnl_enqueue_packet, +}; +static int nfqnl_recv_config (struct sock *ctnl,struct sk_buff *skb,struct nlmsghdr *nlh,struct nfattr *nfqa[],int *errp)
@@ -854,10 +859,7 @@ nfqnl_recv_config(struct sock *ctnl, strcase NFQNL_CFG_CMD_PF_BIND :QDEBUG ("registering queue handler for pf=%u\n" ,ntohs (cmd->pf)); - ret =nf_register_queue_handler (ntohs (cmd->pf), - nfqnl_enqueue_packet, -NULL ); - + ret =nf_register_queue_handler (ntohs (cmd->pf), &nfqh);break ;case NFQNL_CFG_CMD_PF_UNBIND : QDEBUG("unregistering queue handler for pf=%u\n",
@@ -1062,7 +1064,7 @@ init_or_cleanup(int init)return status; cleanup: -nf_unregister_queue_handlers (nfqnl_enqueue_packet); +nf_unregister_queue_handlers (&nfqh);unregister_netdevice_notifier (&nfqnl_dev_notifier);#ifdef CONFIG_PROC_FS remove_proc_entry ("nfnetlink_queue" , proc_net_netfilter);