A userspace application that filters DHCP floods to protect a DHCP server. It uses the Netfilter userspace packet queuing API.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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);