1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
-
- typedef struct dp_conf {
- int pktint;
- int interval;
- int debug;
- int bltime;
- int queue;
- int dryrun;
- } dp_conf;
-
- typedef struct dp_accounting {
- unsigned char remoteid[256];
- int len;
- int count;
- UT_hash_handle hh;
- } dp_accounting;
-
- typedef struct dp_blacklist {
- unsigned char remoteid[256];
- int len;
- time_t expire;
- UT_hash_handle hh;
- } dp_blacklist;
-
- // global hash lists
- static dp_accounting *accountings = NULL;
- static dp_blacklist *blacklists = NULL;
- // timestamp for cleanup interval
- static time_t dp_accountingtime = 0;
- static time_t dp_cleanuptime = 0;
-
- static int dp_callback (
- struct nfq_q_handle*,
- struct nfgenmsg*,
- struct nfq_data*,
- void*);
-
- void usage (char*);
- int dhcp_check (struct nfq_data*, dp_conf*);
- dp_conf *load_config (dp_conf*, char*);
- void nfq_start (dp_conf*);
- void dp_accounting_add (dp_conf*, unsigned char *, int);
- int dp_accounting_check (dp_conf*, unsigned char *, int);
- void dp_blacklist_add (dp_conf*, unsigned char *, int);
- int dp_blacklist_check (dp_conf*, unsigned char *, int);
- void dp_hash_cleanup (dp_conf*);
- void dp_log (unsigned char *, int, char *, ...);
|