* target, match and checkentry functions
@ 2004-04-28 9:04 Ozgur AKAN
2004-04-28 12:57 ` Ozgur AKAN
2004-04-28 23:33 ` Henrik Nordstrom
0 siblings, 2 replies; 5+ messages in thread
From: Ozgur AKAN @ 2004-04-28 9:04 UTC (permalink / raw)
To: netfilter-devel@lists.netfilter.org
[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]
Hi,
I am reading ip_tables.h. There is a structure called ipt_target. In it
there is pointer to a function which is below.
unsigned int (*target <http://lxr.linux.no/ident?i=target>)(struct sk_buff <http://lxr.linux.no/ident?i=sk_buff> **pskb, .......)
I can not find the original function that this function pointer(*target) points. When I search for target, I see that it is defined in 6 files. Which one is used and when? How can I understand it? (this is same for match and checkentry functions)
6 files in which target is defined;
* net/ipv4/netfilter/ipt_ECN.c, line 104
<http://lxr.linux.no/source/net/ipv4/netfilter/ipt_ECN.c#L104>
* net/ipv4/netfilter/ipt_DSCP.c, line 25
<http://lxr.linux.no/source/net/ipv4/netfilter/ipt_DSCP.c#L25>
* net/ipv4/netfilter/ipt_MARK.c, line 11
<http://lxr.linux.no/source/net/ipv4/netfilter/ipt_MARK.c#L11>
* net/ipv4/netfilter/ipt_TOS.c, line 11
<http://lxr.linux.no/source/net/ipv4/netfilter/ipt_TOS.c#L11>
* net/ipv6/netfilter/ip6t_MARK.c, line 11
<http://lxr.linux.no/source/net/ipv6/netfilter/ip6t_MARK.c#L11>
thanks,
--
Ozgur Akan
[-- Attachment #2: Type: text/html, Size: 1630 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: target, match and checkentry functions
2004-04-28 9:04 target, match and checkentry functions Ozgur AKAN
@ 2004-04-28 12:57 ` Ozgur AKAN
2004-04-28 13:00 ` Thomas Jarosch
2004-04-28 23:33 ` Henrik Nordstrom
1 sibling, 1 reply; 5+ messages in thread
From: Ozgur AKAN @ 2004-04-28 12:57 UTC (permalink / raw)
To: netfilter-devel@lists.netfilter.org
....also I can not find where LABEL_ACCEPT is defined. I grep`ed all
kernel and iptables source but could not find! ( It is used in libiptc.c )
thanks to anyone who replies,
--
Ozgur Akan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: target, match and checkentry functions
2004-04-28 12:57 ` Ozgur AKAN
@ 2004-04-28 13:00 ` Thomas Jarosch
2004-04-28 13:41 ` Ozgur AKAN
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Jarosch @ 2004-04-28 13:00 UTC (permalink / raw)
To: netfilter-devel
> ....also I can not find where LABEL_ACCEPT is defined. I grep`ed all
> kernel and iptables source but could not find! ( It is used in libiptc.c )
>
> thanks to anyone who replies,
libipt4tc.c defines LABEL_ACCEPT as IPTC_LABEL_ACCEPT
if I'm not mistaken. IPTC_LABEL_ACCEPT is defined in libiptc.h
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: target, match and checkentry functions
2004-04-28 13:00 ` Thomas Jarosch
@ 2004-04-28 13:41 ` Ozgur AKAN
0 siblings, 0 replies; 5+ messages in thread
From: Ozgur AKAN @ 2004-04-28 13:41 UTC (permalink / raw)
Cc: netfilter-devel
>libipt4tc.c defines LABEL_ACCEPT as IPTC_LABEL_ACCEPT
>if I'm not mistaken. IPTC_LABEL_ACCEPT is defined in libiptc.h
>
>Thomas
>
>
>
yes you are completely right!
IPTC_LABEL_ACCEPT is defined as "ACCEPT". That was what I was looking for.
(my brain does not work well when glucose level decreses :) )
thanks,
--
Ozgur Akan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: target, match and checkentry functions
2004-04-28 9:04 target, match and checkentry functions Ozgur AKAN
2004-04-28 12:57 ` Ozgur AKAN
@ 2004-04-28 23:33 ` Henrik Nordstrom
1 sibling, 0 replies; 5+ messages in thread
From: Henrik Nordstrom @ 2004-04-28 23:33 UTC (permalink / raw)
To: Ozgur AKAN; +Cc: netfilter-devel@lists.netfilter.org
On Wed, 28 Apr 2004, Ozgur AKAN wrote:
> Hi,
>
> I am reading ip_tables.h. There is a structure called ipt_target. In it
> there is pointer to a function which is below.
>
> unsigned int (*target)(struct sk_buff **pskb, .......)
>
> I can not find the original function that this function pointer(*target)
> points. When I search for target, I see that it is defined in 6 files.
> Which one is used and when?
You can not find the original "target" function as there is none. It is
all dependent on which iptables target you are looking at.
This pointer is a pointer to the target function of the target defined by
this ipt_target structure instance. Each target has it's own ipt_target
instance with it's unique function pointer in the target field of
ipt_target.
> How can I understand it? (this is same for match and checkentry
> functions)
Same thing but for matches.
both targets and matches have checkentry functions.
> 6 files in which target is defined;
>
> * net/ipv4/netfilter/ipt_ECN.c, line 104
> <http://lxr.linux.no/source/net/ipv4/netfilter/ipt_ECN.c#L104>
> * net/ipv4/netfilter/ipt_DSCP.c, line 25
> <http://lxr.linux.no/source/net/ipv4/netfilter/ipt_DSCP.c#L25>
> * net/ipv4/netfilter/ipt_MARK.c, line 11
> <http://lxr.linux.no/source/net/ipv4/netfilter/ipt_MARK.c#L11>
> * net/ipv4/netfilter/ipt_TOS.c, line 11
> <http://lxr.linux.no/source/net/ipv4/netfilter/ipt_TOS.c#L11>
> * net/ipv6/netfilter/ip6t_MARK.c, line 11
> <http://lxr.linux.no/source/net/ipv6/netfilter/ip6t_MARK.c#L11>
Actually it is defined in a whole lot more files. Each
ip(6)t_[capital_letters].c defines a ipt_target instance with a
unique target function.
Each ip(6)t_[lowercase_letters].c defines a ipt_match instance with a
unique match function.
There is very many of them.
Regards
Henrik
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-04-28 23:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-28 9:04 target, match and checkentry functions Ozgur AKAN
2004-04-28 12:57 ` Ozgur AKAN
2004-04-28 13:00 ` Thomas Jarosch
2004-04-28 13:41 ` Ozgur AKAN
2004-04-28 23:33 ` Henrik Nordstrom
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.