Skip to contentSkip to conversation

how to fill ipt_entry for simple rule

DISCUSSION Andriy T. Yanko 1 participant 1 message Jul 9, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

Hi

I'd like create a simple rule for INPUT chain with my progam wich use libiptc like it do iptables progam:
iptables -A INPUT -s 192.168.1.1 - j ACCEPT

Please tell me how I must fill ipt_entry for this simple example?

---------------------------------------------------------------
...
iptc_handle_t h;
const struct ipt_entry e;

h=iptc_init("filter");
/* now must fill struct e, but how? */

iptc_append_entry("INPUT",&e,&h);
iptc_commit(&h);
...
---------------------------------------------------------------

Signature · 5 lines
Andriy T. Yanko
[email protected]

*   Avoid The Gates of Hell use Linux
**  Wenn ich sterbe, legt mir eine Birne in mein Grab ...