Friday, May 14, 2004

insert_rules, it is all about memory

insert_rules function is used while appending or inserting a rule to a table. It takes 7 arguments as I mentioned yesterday.

If chain_cache`s end_offset is bigger or equal to the total size of the chains in the table, it returns EINVAL. Else;

There is a struct named ipt_getinfo in iptc_handle_t structure. It holds valuable information about hooks, size, entry addresses etc.

struct ipt_getinfo
{
char name[IPT_TABLE_MAXNAMELEN]; // table name, filled by caller
unsigned int valid_hooks; // validated hooks by kernel
unsigned int hook_entry[NF_IP_NUMHOOKS]; // entry point for each hook (chain)
unsigned int underflow[NF_IP_NUMHOOKS]; // end of each hook
unsigned int num_entries; // number of entries
unsigned int size; // size of entries
};

to be continued...
Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?