unix socket: add 'capture-mode' command

This patch displays what capture mode is used.
pull/299/head
Eric Leblond 13 years ago committed by Victor Julien
parent 74a9fc4b66
commit c961056ed8

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

Loading…
Cancel
Save