|
|
|
@ -568,12 +568,16 @@ int RunModeSetLiveCaptureAutoFp(DetectEngineCtx *de_ctx,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int RunModeSetLiveCaptureSingle(DetectEngineCtx *de_ctx,
|
|
|
|
|
ConfigIfaceParserFunc configparser, char *recv_mod_name,
|
|
|
|
|
ConfigIfaceParserFunc configparser,
|
|
|
|
|
ConfigIfaceThreadsCountFunc mod_threads_count,
|
|
|
|
|
char *recv_mod_name,
|
|
|
|
|
char *decode_mod_name, char *thread_name,
|
|
|
|
|
const char *live_dev)
|
|
|
|
|
{
|
|
|
|
|
int nlive = LiveGetDeviceCount();
|
|
|
|
|
void *aconf;
|
|
|
|
|
int threads_count;
|
|
|
|
|
int thread;
|
|
|
|
|
|
|
|
|
|
if (nlive > 1) {
|
|
|
|
|
SCLogError(SC_ERR_RUNMODE,
|
|
|
|
@ -587,8 +591,19 @@ int RunModeSetLiveCaptureSingle(DetectEngineCtx *de_ctx,
|
|
|
|
|
char *live_dev_c = LiveGetDevice(0);
|
|
|
|
|
aconf = configparser(live_dev_c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
threads_count = mod_threads_count(aconf);
|
|
|
|
|
SCLogInfo("Going to use %" PRId32 " thread(s)", threads_count);
|
|
|
|
|
/* create the threads */
|
|
|
|
|
ThreadVars *tv = TmThreadCreatePacketHandler(thread_name,
|
|
|
|
|
for (thread = 0; thread < threads_count; thread++) {
|
|
|
|
|
char tname[12];
|
|
|
|
|
char *n_thread_name = NULL;
|
|
|
|
|
ThreadVars *tv = NULL;
|
|
|
|
|
TmModule *tm_module = NULL;
|
|
|
|
|
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s%"PRIu16, thread_name, thread+1);
|
|
|
|
|
n_thread_name = SCStrdup(tname);
|
|
|
|
|
tv = TmThreadCreatePacketHandler(n_thread_name,
|
|
|
|
|
"packetpool", "packetpool",
|
|
|
|
|
"packetpool", "packetpool",
|
|
|
|
|
"pktacqloop");
|
|
|
|
@ -597,7 +612,7 @@ int RunModeSetLiveCaptureSingle(DetectEngineCtx *de_ctx,
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TmModule *tm_module = TmModuleGetByName(recv_mod_name);
|
|
|
|
|
tm_module = TmModuleGetByName(recv_mod_name);
|
|
|
|
|
if (tm_module == NULL) {
|
|
|
|
|
printf("ERROR: TmModuleGetByName failed for %s\n", recv_mod_name);
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
@ -631,6 +646,7 @@ int RunModeSetLiveCaptureSingle(DetectEngineCtx *de_ctx,
|
|
|
|
|
printf("ERROR: TmThreadSpawn failed\n");
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|