Add function to display current capture mode

This patch adds a function to display the capture mode.
pull/299/head
Eric Leblond 13 years ago committed by Victor Julien
parent 2f30485f7b
commit 74a9fc4b66

@ -162,6 +162,20 @@ char *RunmodeGetActive(void)
return active_runmode;
}
/**
* Return the running mode
*
* The returned string must not be freed.
*
* \return a string containing the current running mode
*/
const char *RunModeGetMainMode(void)
{
int mainmode = RunmodeGetCurrent();
return RunModeTranslateModeToName(mainmode);
}
/**
* \brief Register all runmodes in the engine.
*/

@ -41,6 +41,7 @@ enum {
};
char *RunmodeGetActive(void);
const char *RunModeGetMainMode(void);
void RunModeListRunmodes(void);
void RunModeDispatch(int, const char *, DetectEngineCtx *);

@ -242,6 +242,11 @@ int RunmodeIsUnittests(void) {
return 0;
}
int RunmodeGetCurrent(void)
{
return run_mode;
}
static void SignalHandlerSigint(/*@unused@*/ int sig) {
sigint_count = 1;
suricata_ctl_flags |= SURICATA_STOP;

@ -151,6 +151,7 @@ void SignalHandlerSigusr2EngineShutdown(int);
void SignalHandlerSigusr2Idle(int sig);
int RunmodeIsUnittests(void);
int RunmodeGetCurrent(void);
extern int run_mode;

Loading…
Cancel
Save