|
|
|
@ -65,6 +65,14 @@ struct f2b_cmd_t {
|
|
|
|
|
.tokens = { "jail", "<jailname>", "release", "<ip>", NULL }, |
|
|
|
|
.help = "Forcefully release some ip in given jail", |
|
|
|
|
}, |
|
|
|
|
[CMD_JAIL_REGEX_STATS] = { |
|
|
|
|
.tokens = { "jail", "<jailname>", "regex", "stats", NULL }, |
|
|
|
|
.help = "Show matches stats for jail regexps", |
|
|
|
|
}, |
|
|
|
|
[CMD_JAIL_REGEX_ADD] = { |
|
|
|
|
.tokens = { "jail", "<jailname>", "regex", "add", "<regex>", NULL }, |
|
|
|
|
.help = "Add new regexp to jail", |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
void |
|
|
|
@ -158,6 +166,14 @@ f2b_cmd_parse(const char *src, char *buf, size_t buflen) {
|
|
|
|
|
strlcat(buf, "\n", buflen); |
|
|
|
|
return CMD_JAIL_IP_RELEASE; |
|
|
|
|
} |
|
|
|
|
if (tokenc == 4 && strcmp(tokens[2], "regex") == 0 && strcmp(tokens[3], "stats") == 0) { |
|
|
|
|
return CMD_JAIL_REGEX_STATS; |
|
|
|
|
} |
|
|
|
|
if (tokenc == 5 && strcmp(tokens[2], "regex") == 0 && strcmp(tokens[3], "add") == 0) { |
|
|
|
|
strlcat(buf, tokens[4], buflen); |
|
|
|
|
strlcat(buf, "\n", buflen); |
|
|
|
|
return CMD_JAIL_REGEX_ADD; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return CMD_NONE; |
|
|
|
|