rules: add exclude actions

This commit is contained in:
Vaxry
2025-04-15 14:54:26 +01:00
parent 50fbc7f5ac
commit 871284672c
4 changed files with 30 additions and 9 deletions

View File

@@ -12,7 +12,8 @@ class CConfig {
CConfig();
enum eConfigIPAction : uint8_t {
IP_ACTION_DENY = 0,
IP_ACTION_NONE = 0,
IP_ACTION_DENY,
IP_ACTION_ALLOW,
IP_ACTION_CHALLENGE
};
@@ -20,8 +21,9 @@ class CConfig {
struct SIPRangeConfig {
std::string action = "";
std::vector<std::string> ip_ranges;
int difficulty = -1;
std::string exclude_regex = "";
int difficulty = -1;
std::string exclude_regex = "";
std::string action_on_exclude = "";
};
struct SIPRangeConfigParsed {
@@ -29,6 +31,7 @@ class CConfig {
std::vector<CIPRange> ip_ranges;
int difficulty = -1;
std::unique_ptr<re2::RE2> exclude_regex;
eConfigIPAction action_on_exclude = IP_ACTION_NONE;
};
struct SConfig {