unix socket: add 'runnning-mode' command

This command displays the active running mode ('autofp' for
example).
pull/299/head
Eric Leblond 13 years ago committed by Victor Julien
parent f4faff6ff9
commit 2f30485f7b

@ -611,6 +611,14 @@ TmEcode UnixManagerUptimeCommand(json_t *cmd,
SCReturnInt(TM_ECODE_OK);
}
TmEcode UnixManagerRunningModeCommand(json_t *cmd,
json_t *server_msg, void *data)
{
SCEnter();
json_object_set_new(server_msg, "message", json_string(RunmodeGetActive()));
SCReturnInt(TM_ECODE_OK);
}
TmEcode UnixManagerListCommand(json_t *cmd,
json_t *answer, void *data)
{
@ -801,6 +809,7 @@ void *UnixManagerThread(void *td)
UnixManagerRegisterCommand("command-list", UnixManagerListCommand, &command, 0);
UnixManagerRegisterCommand("version", UnixManagerVersionCommand, &command, 0);
UnixManagerRegisterCommand("uptime", UnixManagerUptimeCommand, &command, 0);
UnixManagerRegisterCommand("running-mode", UnixManagerRunningModeCommand, &command, 0);
#if 0
UnixManagerRegisterCommand("reload-rules", UnixManagerReloadRules, NULL, 0);
#endif

Loading…
Cancel
Save