FetchBannedIPs.h 998 B

12345678910111213141516171819202122232425262728
  1. #ifndef __FETCHBANNEDIPS_H
  2. #define __FETCHBANNEDIPS_H
  3. #include "Tree.h"
  4. #include "IPAddress.h"
  5. class FetchBannedIPs
  6. {
  7. public:
  8. // Run this if the user sent in one parameter.
  9. static void ProcessOneParameter(const char *argv1,bool useIpset);
  10. // Run this if the user sent in two parameters.
  11. static void ProcessTwoParameters(const char *argv1,const char *argv2,bool useIpset);
  12. // Runs if the user sent three parameters.
  13. static void ProcessThreeParameters(const char *argv1,const char *argv2,const char *argv3);
  14. // Show a message telling the user how to use this program.
  15. static void ShowHelpMessage();
  16. private:
  17. // List the current banned IPs from iptables.
  18. static void ListCurrent(bool useIpset);
  19. // Show the last time the banned list was modified.
  20. static void ShowLastBannedTime(const char *server);
  21. // Fetch banned IPs from the database and ban them.
  22. static void FetchAndBan(const char *server,Tree<IPAddress> *current_ips,bool actually_ban,int stop_count,bool useIpset);
  23. };
  24. #endif