From: Ozgur AKAN <akan@aiqa.com>
To: netfilter-devel@lists.netfilter.org
Subject: inner structure of iptables
Date: Tue, 16 Mar 2004 17:12:34 +0200 [thread overview]
Message-ID: <40571962.5070701@aiqa.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]
I included some simple code to express myself clearly.
I have a problem with the 4th line. When we execute the code for the
first time these happen (I wrote down)
In the 1st line we create the pointer to the structure of the table
In the 2nd and 3rd line we get the adress of first chain and print its
name to screen.
In the 4th line "e = iptc_first_rule(chain, &h)" we get the adress of
the first rule of the first chain and by the loop it goes to next rule
until there is no next rule. How does it know that it is the last rule
of this chain? Why doesn`t it continue to read the first rule of next
chain? (Because there is no chain information here -> e =
iptc_next_rule(e, &h))
1 h = iptc_init(tablename);
2 for ( chain = iptc_first_chain(&h); chain; chain =
iptc_next_chain(&h)) {
3 printf("%s\n", chain);
4 for ( e = iptc_first_rule(chain, &h); e; e = iptc_next_rule(e,
&h)) {
5 printf("n. -%u- i. -%u-\n", e->ip.invflags, e->ip.invflags
& IPT_INV_SRCIP);
6 }
7 }
I hope my question is clear enough.
thanks,
Ozgur AKAN
[-- Attachment #2: Type: text/html, Size: 1678 bytes --]
next reply other threads:[~2004-03-16 15:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-16 15:12 Ozgur AKAN [this message]
2004-03-17 7:25 ` inner structure of iptables Henrik Nordstrom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40571962.5070701@aiqa.com \
--to=akan@aiqa.com \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.