Rename 'worker' running mode to 'workers'

This patch renamed the 'worker' running mode into 'workers'. Thus,
there is only one name in Suricata for the same thing. Backward
compatibility is ensured by replacing "worker" by "workers" when
the old name is used. A warning is printed in the log when the old
name is used.
remotes/origin/HEAD
Eric Leblond 13 years ago committed by Victor Julien
parent 34f0897163
commit a3465fb971

@ -66,7 +66,7 @@ void RunModeIpsIPFWRegister(void)
"Multi threaded IPFW IPS mode with respect to flow", "Multi threaded IPFW IPS mode with respect to flow",
RunModeIpsIPFWAutoFp); RunModeIpsIPFWAutoFp);
RunModeRegisterNewRunMode(RUNMODE_IPFW, "worker", RunModeRegisterNewRunMode(RUNMODE_IPFW, "workers",
"Multi queue IPFW IPS mode with one thread per queue", "Multi queue IPFW IPS mode with one thread per queue",
RunModeIpsIPFWWorker); RunModeIpsIPFWWorker);

@ -64,7 +64,7 @@ void RunModeIpsNFQRegister(void)
"Multi threaded NFQ IPS mode with respect to flow", "Multi threaded NFQ IPS mode with respect to flow",
RunModeIpsNFQAutoFp); RunModeIpsNFQAutoFp);
RunModeRegisterNewRunMode(RUNMODE_NFQ, "worker", RunModeRegisterNewRunMode(RUNMODE_NFQ, "workers",
"Multi queue NFQ IPS mode with one thread per queue", "Multi queue NFQ IPS mode with one thread per queue",
RunModeIpsNFQWorker); RunModeIpsNFQWorker);
return; return;

@ -270,7 +270,14 @@ void RunModeDispatch(int runmode, const char *custom_mode, DetectEngineCtx *de_c
SCLogError(SC_ERR_UNKNOWN_RUN_MODE, "Unknown runtime mode. Aborting"); SCLogError(SC_ERR_UNKNOWN_RUN_MODE, "Unknown runtime mode. Aborting");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} /* if (custom_mode == NULL) */ } else { /* if (custom_mode == NULL) */
/* Add compability with old 'worker' name */
if (!strcmp("worker", custom_mode)) {
SCLogWarning(SC_ERR_RUNMODE, "'worker' mode have been renamed "
"to 'workers', please modify your setup.");
custom_mode = SCStrdup("workers");
}
}
RunMode *mode = RunModeGetCustomMode(runmode, custom_mode); RunMode *mode = RunModeGetCustomMode(runmode, custom_mode);
if (mode == NULL) { if (mode == NULL) {

@ -193,9 +193,9 @@ static inline void IPFWMutexInit(IPFWQueueVars *nq)
{ {
char *active_runmode = RunmodeGetActive(); char *active_runmode = RunmodeGetActive();
if (active_runmode && !strcmp("worker", active_runmode)) { if (active_runmode && !strcmp("workers", active_runmode)) {
nq->use_mutex = 0; nq->use_mutex = 0;
SCLogInfo("IPFW running in 'worker' runmode, will not use mutex."); SCLogInfo("IPFW running in 'workers' runmode, will not use mutex.");
} else { } else {
nq->use_mutex = 1; nq->use_mutex = 1;
} }

@ -262,9 +262,9 @@ static inline void NFQMutexInit(NFQQueueVars *nq)
{ {
char *active_runmode = RunmodeGetActive(); char *active_runmode = RunmodeGetActive();
if (active_runmode && !strcmp("worker", active_runmode)) { if (active_runmode && !strcmp("workers", active_runmode)) {
nq->use_mutex = 0; nq->use_mutex = 0;
SCLogInfo("NFQ running in 'worker' runmode, will not use mutex."); SCLogInfo("NFQ running in 'workers' runmode, will not use mutex.");
} else { } else {
nq->use_mutex = 1; nq->use_mutex = 1;
} }

Loading…
Cancel
Save