Iptables help
hello.
Currently i'm developing something similar to iptables.I wud like to know
where does the iptables store the rules and the format in which it sotres the rules. If i can know this , my task to store it in good format becomes a bit easier and more standardised . I shall be very grateful and am very very helpful
thanx
Indiatimes Email now powered by APIC Advantage. Help!
Help
Quoted 3 lines · On Mon, 4 Apr 2005, dpadalkar2001 wrote:
Currently i'm developing something similar to iptables.I wud like to know
where does the iptables store the rules and the format in which it sotres the rules.
iptables stores rules in a linear table (with jumps), uploaded to the kernel as a binary blob. There is one such blob per table type (filter, nat, mangle, ...), and each hook has it's own entrypoint in the table.
This structure is managed by libiptc. Relevant structures can be found in include/linux/netfilter_ipv4/ip_tables.h. The main binary table descriptor is ipt_replace, and is immediately followed by a list of ipt_entry, each followed by a list of ipt_match and a final ipt_target.
I do not remember what the underflow thing is about.
Quoted 2 lines
If i can know this , my task to store it in good format becomes a bit easier and more standardised . I shall be very grateful and am very very helpful
You may want to look at the HiPAC project
this uses very efficient tree structures for storing the ruleset.