diff --git a/src/cmsg.h b/src/cmsg.h index a646376..457c2b5 100644 --- a/src/cmsg.h +++ b/src/cmsg.h @@ -18,7 +18,7 @@ enum f2b_cmsg_type { CMD_SHUTDOWN, CMD_JAIL_STATUS = 16, CMD_JAIL_SET, - CMD_JAIL_IP_SHOW, + CMD_JAIL_IP_STATUS, CMD_JAIL_IP_BAN, CMD_JAIL_IP_RELEASE, CMD_MAX_NUMBER, diff --git a/src/commands.c b/src/commands.c index 9442380..e9140e7 100644 --- a/src/commands.c +++ b/src/commands.c @@ -53,8 +53,8 @@ struct f2b_cmd_t { .tokens = { "jail", "", "set", "", "", NULL }, .help = "Set parameter of given jail", }, - [CMD_JAIL_IP_SHOW] = { - .tokens = { "jail", "", "show", "", NULL }, + [CMD_JAIL_IP_STATUS] = { + .tokens = { "jail", "", "status", "", NULL }, .help = "Show ip status in given jail", }, [CMD_JAIL_IP_BAN] = { @@ -143,10 +143,10 @@ f2b_cmd_parse(const char *src, char *buf, size_t buflen) { strlcat(buf, "\n", buflen); return CMD_JAIL_SET; } - if (tokenc == 4 && strcmp(tokens[2], "show") == 0) { + if (tokenc == 4 && strcmp(tokens[2], "status") == 0) { strlcat(buf, tokens[3], buflen); strlcat(buf, "\n", buflen); - return CMD_JAIL_IP_SHOW; + return CMD_JAIL_IP_STATUS; } if (tokenc == 4 && strcmp(tokens[2], "ban") == 0) { strlcat(buf, tokens[3], buflen); diff --git a/src/daemon.c b/src/daemon.c index 43f17cd..6c451b6 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -110,7 +110,7 @@ f2b_cmsg_process(const f2b_cmsg_t *msg, char *res, size_t ressize) { } } - if (jail && (msg->type >= CMD_JAIL_IP_SHOW && msg->type <= CMD_JAIL_IP_RELEASE)) { + if (jail && (msg->type >= CMD_JAIL_IP_STATUS && msg->type <= CMD_JAIL_IP_RELEASE)) { if (args[1] == NULL) { strlcpy(res, "can't find ip: no args", ressize); return; @@ -142,7 +142,7 @@ f2b_cmsg_process(const f2b_cmsg_t *msg, char *res, size_t ressize) { } } else if (msg->type == CMD_JAIL_STATUS) { f2b_jail_get_status(jail, res, ressize); - } else if (msg->type == CMD_JAIL_IP_SHOW) { + } else if (msg->type == CMD_JAIL_IP_STATUS) { f2b_ipaddr_status(addr, res, ressize); } else if (msg->type == CMD_JAIL_IP_BAN) { f2b_jail_ban(jail, addr);