|
|
|
@ -444,3 +444,24 @@ f2b_jail_cmd_status(char *res, size_t ressize, const char *name) {
|
|
|
|
|
jail->incr_bantime, jail->incr_findtime, |
|
|
|
|
jail->bancount, jail->matchcount); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
f2b_jail_cmd_ip_status(char *res, size_t ressize, const char *name, const char *ip) { |
|
|
|
|
f2b_jail_t *jail = NULL; |
|
|
|
|
f2b_ipaddr_t *addr = NULL; |
|
|
|
|
|
|
|
|
|
assert(res != NULL); |
|
|
|
|
assert(name != NULL); |
|
|
|
|
assert(ip != NULL); |
|
|
|
|
|
|
|
|
|
if ((jail = f2b_jail_find(jails, name)) == NULL) { |
|
|
|
|
snprintf(res, ressize, "can't find jail '%s'", name); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((addr = f2b_addrlist_lookup(jail->ipaddrs, ip)) == NULL) { |
|
|
|
|
snprintf(res, ressize, "can't find ip '%s' in jail '%s'", ip, name); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
f2b_ipaddr_status(addr, res, ressize); |
|
|
|
|
} |
|
|
|
|