* register an hook
@ 2010-04-23 8:55 Nicola Padovano
2010-04-23 10:27 ` Jan Engelhardt
0 siblings, 1 reply; 5+ messages in thread
From: Nicola Padovano @ 2010-04-23 8:55 UTC (permalink / raw)
To: netfilter-devel
hi all.
i've read how to register an hook in netfilter. and i found two ways.
the first uses, this routines:
unsigned int my_hook(unsigned int hooknum,
struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff *))
{
}
int nf_register_hook(struct nf_hook_ops *reg)
int nf_unregister_hook(struct nf_hook_ops *reg)
the second instead:
static unsigned int xt_tarpit_target(struct sk_buff *skb,
const struct xt_target_param *par)
and:
xt_register_target(&xt_tarpit_reg);
xt_unregister_target(&xt_tarpit_reg);
which is the difference?
thank you!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: register an hook
2010-04-23 8:55 register an hook Nicola Padovano
@ 2010-04-23 10:27 ` Jan Engelhardt
2010-04-23 10:50 ` Nicola Padovano
0 siblings, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2010-04-23 10:27 UTC (permalink / raw)
To: Nicola Padovano; +Cc: netfilter-devel
On Friday 2010-04-23 10:55, Nicola Padovano wrote:
>hi all.
>i've read how to register an hook in netfilter. and i found two ways.
>
>the first uses, this routines:
>
>
> unsigned int my_hook(unsigned int hooknum,
> struct sk_buff *skb,
> const struct net_device *in,
> const struct net_device *out,
> int (*okfn)(struct sk_buff *))
> {
> }
>
>int nf_register_hook(struct nf_hook_ops *reg)
>int nf_unregister_hook(struct nf_hook_ops *reg)
>
>the second instead:
>
>static unsigned int xt_tarpit_target(struct sk_buff *skb,
> const struct xt_target_param *par)
>
>and:
>xt_register_target(&xt_tarpit_reg);
>xt_unregister_target(&xt_tarpit_reg);
>
>
>which is the difference?
That a target is not a hook.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: register an hook
2010-04-23 10:27 ` Jan Engelhardt
@ 2010-04-23 10:50 ` Nicola Padovano
2010-04-23 12:25 ` Jan Engelhardt
0 siblings, 1 reply; 5+ messages in thread
From: Nicola Padovano @ 2010-04-23 10:50 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: netfilter-devel
what's the difference? what is a target?
I'm analyzing the tarpit patch
(http://enterprise.bih.harvard.edu/pub/tarpit-updates/tarpit-2.6.29.patch)
and i've found only the registration of that target. and so, how it
works, if there isn't an hook registration?
help me, please :(
On Fri, Apr 23, 2010 at 12:27 PM, Jan Engelhardt <jengelh@medozas.de> wrote:
> On Friday 2010-04-23 10:55, Nicola Padovano wrote:
>
>>hi all.
>>i've read how to register an hook in netfilter. and i found two ways.
>>
>>the first uses, this routines:
>>
>>
>> unsigned int my_hook(unsigned int hooknum,
>> struct sk_buff *skb,
>> const struct net_device *in,
>> const struct net_device *out,
>> int (*okfn)(struct sk_buff *))
>> {
>> }
>>
>>int nf_register_hook(struct nf_hook_ops *reg)
>>int nf_unregister_hook(struct nf_hook_ops *reg)
>>
>>the second instead:
>>
>>static unsigned int xt_tarpit_target(struct sk_buff *skb,
>> const struct xt_target_param *par)
>>
>>and:
>>xt_register_target(&xt_tarpit_reg);
>>xt_unregister_target(&xt_tarpit_reg);
>>
>>
>>which is the difference?
>
> That a target is not a hook.
>
--
Nicola Padovano
e-mail: nicola.padovano@gmail.com
web: http://npadov.blogspot.com/
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: register an hook
2010-04-23 10:50 ` Nicola Padovano
@ 2010-04-23 12:25 ` Jan Engelhardt
2010-04-24 11:39 ` Nicola Padovano
0 siblings, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2010-04-23 12:25 UTC (permalink / raw)
To: Nicola Padovano; +Cc: netfilter-devel
On Friday 2010-04-23 12:50, Nicola Padovano wrote:
>what's the difference? what is a target?
>I'm analyzing the tarpit patch
>(http://enterprise.bih.harvard.edu/pub/tarpit-updates/tarpit-2.6.29.patch)
>and i've found only the registration of that target. and so, how it
>works, if there isn't an hook registration?
>
>help me, please :(
Targets are invoked via Xtables which is a hook user.
targets: http://en.wikipedia.org/wiki/Iptables
tarpit: http://xtables-addons.sf.net/
and subsequently: http://jengelh.medozas.de/documents/Netfilter_Modules.pdf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: register an hook
2010-04-23 12:25 ` Jan Engelhardt
@ 2010-04-24 11:39 ` Nicola Padovano
0 siblings, 0 replies; 5+ messages in thread
From: Nicola Padovano @ 2010-04-24 11:39 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: netfilter-devel
ok jan, thank you! i'm sorry but i'm a very newbie in this field.
anyway i've have some questions.
first of all: if i program a new target i don't have interest in the
management of the hooks? is it right? and why?
second question: when the checkentry function is used?
thank you again :)
On Fri, Apr 23, 2010 at 2:25 PM, Jan Engelhardt <jengelh@medozas.de> wrote:
> On Friday 2010-04-23 12:50, Nicola Padovano wrote:
>
>>what's the difference? what is a target?
>>I'm analyzing the tarpit patch
>>(http://enterprise.bih.harvard.edu/pub/tarpit-updates/tarpit-2.6.29.patch)
>>and i've found only the registration of that target. and so, how it
>>works, if there isn't an hook registration?
>>
>>help me, please :(
>
> Targets are invoked via Xtables which is a hook user.
>
> targets: http://en.wikipedia.org/wiki/Iptables
> tarpit: http://xtables-addons.sf.net/
> and subsequently: http://jengelh.medozas.de/documents/Netfilter_Modules.pdf
>
--
Nicola Padovano
e-mail: nicola.padovano@gmail.com
web: http://npadov.blogspot.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-24 11:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-23 8:55 register an hook Nicola Padovano
2010-04-23 10:27 ` Jan Engelhardt
2010-04-23 10:50 ` Nicola Padovano
2010-04-23 12:25 ` Jan Engelhardt
2010-04-24 11:39 ` Nicola Padovano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).