A userspace application that filters DHCP floods to protect a DHCP server. It uses the Netfilter userspace packet queuing API.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dhcp_protect.h 671B

12345678910111213141516171819202122232425
  1. typedef struct dp_conf {
  2. int pktint;
  3. int interval;
  4. int debug;
  5. int bltime;
  6. int queue;
  7. } dp_conf;
  8. typedef struct dp_blacklist {
  9. char remoteid[256];
  10. int len;
  11. int count;
  12. UT_hash_handle hh;
  13. } dp_blacklist;
  14. static dp_blacklist *blacklists = NULL;
  15. static time_t dp_timestamp = 0;
  16. void usage (char*);
  17. dp_conf *load_config (dp_conf*, char*);
  18. u_int32_t dhcp_check (struct nfq_data*, int*, dp_conf*);
  19. static int dp_callback (struct nfq_q_handle*, struct nfgenmsg*, struct nfq_data*, void*);
  20. void nfq_start (dp_conf*);
  21. void dp_blacklist_count (dp_conf*, unsigned char *, int);
  22. int dp_blacklist_check (dp_conf*, unsigned char *, int);