#ifndef _IPT_ACC_H_target #define _IPT_ACC_H_target #define SO_IP_ACC 82 #define SO_IP_ACC_INFO SO_IP_ACC #define SO_IP_ACC_BLOCK SO_IP_ACC_INFO+1 #define IP_ACC_SET_NONE 0 #define IP_ACC_SET_FLUSH 1 #define IP_ACC_SET_HASH 2 #define IP_ACC_SET_LIMIT 4 #define IP_ACC_GET_LIST 8 #define ACC_BLK_SZ 4096 #define ACC_HASH_SZ 4096 #define ACC_HEAP_BLK_SZ 4096 #define ACC_ENTRIES_PER_BLOCK 170 #define ACC_HASH_MOD 1021 struct acc_entry { __u32 src; __u16 sprt; __u32 dst; __u16 dprt; __u8 proto; __u32 mark; __u64 count; __u8 hooknum; // char dev[IFNAMSIZ]; // That's how we can add interface support // Netfilter hooks are done similary, but mark is more flexible and doesn't require to write code :) struct acc_entry *next; }; struct acc_block { struct acc_block *next; int fill[3]; struct acc_entry bl[ACC_ENTRIES_PER_BLOCK]; }; struct acc_ctrl { __u32 hash_size; __u32 hash_module; __u64 lost; __u32 blocks_count; __u32 free_count; struct timeval time_on; struct timeval time_off; struct acc_entry **hash; struct acc_block *heap; struct acc_block *last_heap; }; struct ip_acc_set_rq { int op; int hash_size; int mem_limit; }; struct ip_acc_get_info { struct timeval time_on; struct timeval time_off; __u32 blocks; __u64 lost; }; struct ip_acc_get_block { int block; int fill[3]; struct acc_entry bl[170]; }; struct ipt_acc_target_info { unsigned long mark; }; #endif /*_IPT_ACC_H_target*/