12345678910111213141516171819202122232425262728 |
- #ifndef __FETCHBANNEDIPS_H
- #define __FETCHBANNEDIPS_H
- #include "Tree.h"
- #include "IPAddress.h"
- class FetchBannedIPs
- {
- public:
- // Run this if the user sent in one parameter.
- static void ProcessOneParameter(const char *argv1,bool useIpset);
- // Run this if the user sent in two parameters.
- static void ProcessTwoParameters(const char *argv1,const char *argv2,bool useIpset);
- // Runs if the user sent three parameters.
- static void ProcessThreeParameters(const char *argv1,const char *argv2,const char *argv3);
- // Show a message telling the user how to use this program.
- static void ShowHelpMessage();
- private:
- // List the current banned IPs from iptables.
- static void ListCurrent(bool useIpset);
- // Show the last time the banned list was modified.
- static void ShowLastBannedTime(const char *server);
- // Fetch banned IPs from the database and ban them.
- static void FetchAndBan(const char *server,Tree<IPAddress> *current_ips,bool actually_ban,int stop_count,bool useIpset);
- };
- #endif
|