Friday, November 23, 2007

iptables

If there are many tables must be update, you have to create new handel when table changes.

iptc_handle_t myhandle = NULL;
if (myhandle)
 iptc_free(&myhandle);
myhandle = create_handle(currentTable, "modprobe");
if (noflush == 0) {
 for_each_chain(flush_entries, verbose, 1, &myhandle);
 for_each_chain(delete_chain, verbose, 0, &myhandle) ;
}


FYI:
iptables-save.c
netfilter

No comments: