|
|
|
|
@ -147,7 +147,7 @@ int RunModeSetLiveCaptureAutoFp(ConfigIfaceParserFunc ConfigParser,
|
|
|
|
|
|
|
|
|
|
/* create the threads */
|
|
|
|
|
for (thread = 0; thread < threads_count; thread++) {
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s%02d", thread_name, thread+1);
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#%02d", thread_name, thread+1);
|
|
|
|
|
char *thread_name = SCStrdup(tname);
|
|
|
|
|
if (unlikely(thread_name == NULL)) {
|
|
|
|
|
SCLogError(SC_ERR_MEM_ALLOC, "Can't allocate thread name");
|
|
|
|
|
@ -191,7 +191,7 @@ int RunModeSetLiveCaptureAutoFp(ConfigIfaceParserFunc ConfigParser,
|
|
|
|
|
|
|
|
|
|
for (lthread = 0; lthread < nlive; lthread++) {
|
|
|
|
|
char *live_dev = LiveGetDeviceName(lthread);
|
|
|
|
|
char visual_devname[12] = "";
|
|
|
|
|
char visual_devname[11] = "";
|
|
|
|
|
int shortening_result;
|
|
|
|
|
void *aconf;
|
|
|
|
|
int threads_count;
|
|
|
|
|
@ -217,7 +217,7 @@ int RunModeSetLiveCaptureAutoFp(ConfigIfaceParserFunc ConfigParser,
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s%02d-%s", thread_name,
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#%02d-%s", thread_name,
|
|
|
|
|
thread+1, visual_devname);
|
|
|
|
|
|
|
|
|
|
char *thread_name = SCStrdup(tname);
|
|
|
|
|
@ -258,7 +258,7 @@ int RunModeSetLiveCaptureAutoFp(ConfigIfaceParserFunc ConfigParser,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (thread = 0; thread < thread_max; thread++) {
|
|
|
|
|
snprintf(tname, sizeof(tname), "W%02d", thread+1);
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#%02d", thread_name_workers, thread+1);
|
|
|
|
|
snprintf(qname, sizeof(qname), "pickup%d", thread+1);
|
|
|
|
|
|
|
|
|
|
SCLogDebug("tname %s, qname %s", tname, qname);
|
|
|
|
|
@ -334,21 +334,21 @@ static int RunModeSetLiveCaptureWorkersForDevice(ConfigIfaceThreadsCountFunc Mod
|
|
|
|
|
for (thread = 0; thread < threads_count; thread++) {
|
|
|
|
|
char tname[TM_THREAD_NAME_MAX];
|
|
|
|
|
char *n_thread_name = NULL;
|
|
|
|
|
char visual_devname[12] = "";
|
|
|
|
|
char visual_devname[11] = "";
|
|
|
|
|
int shortening_result;
|
|
|
|
|
ThreadVars *tv = NULL;
|
|
|
|
|
TmModule *tm_module = NULL;
|
|
|
|
|
|
|
|
|
|
if (single_mode) {
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s01", thread_name);
|
|
|
|
|
} else {
|
|
|
|
|
shortening_result = LiveSafeDeviceName(live_dev, visual_devname, sizeof(visual_devname));
|
|
|
|
|
if (shortening_result != 0) {
|
|
|
|
|
SCLogError(SC_ERR_INVALID_VALUE, "Could not shorten long devicename: %s", live_dev);
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s%02d-%s", thread_name,
|
|
|
|
|
if (single_mode) {
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#01-%s", thread_name, visual_devname);
|
|
|
|
|
} else {
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#%02d-%s", thread_name,
|
|
|
|
|
thread+1, visual_devname);
|
|
|
|
|
}
|
|
|
|
|
tv = TmThreadCreatePacketHandler(tname,
|
|
|
|
|
@ -521,7 +521,7 @@ int RunModeSetIPSAutoFp(ConfigIPSParserFunc ConfigParser,
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
memset(tname, 0, sizeof(tname));
|
|
|
|
|
snprintf(tname, sizeof(tname), "RX-Q%s", cur_queue);
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s-Q%s", thread_name_autofp, cur_queue);
|
|
|
|
|
|
|
|
|
|
ThreadVars *tv_receive =
|
|
|
|
|
TmThreadCreatePacketHandler(tname,
|
|
|
|
|
@ -554,7 +554,7 @@ int RunModeSetIPSAutoFp(ConfigIPSParserFunc ConfigParser,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
for (thread = 0; thread < thread_max; thread++) {
|
|
|
|
|
snprintf(tname, sizeof(tname), "W%02d", thread+1);
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#%02d", thread_name_workers, thread+1);
|
|
|
|
|
snprintf(qname, sizeof(qname), "pickup%d", thread+1);
|
|
|
|
|
|
|
|
|
|
SCLogDebug("tname %s, qname %s", tname, qname);
|
|
|
|
|
@ -599,7 +599,7 @@ int RunModeSetIPSAutoFp(ConfigIPSParserFunc ConfigParser,
|
|
|
|
|
/* create the threads */
|
|
|
|
|
for (int i = 0; i < nqueue; i++) {
|
|
|
|
|
memset(tname, 0, sizeof(tname));
|
|
|
|
|
snprintf(tname, sizeof(tname), "TX%02d", i);
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#%02d", thread_name_verdict, i);
|
|
|
|
|
|
|
|
|
|
ThreadVars *tv_verdict =
|
|
|
|
|
TmThreadCreatePacketHandler(tname,
|
|
|
|
|
@ -658,7 +658,7 @@ int RunModeSetIPSWorker(ConfigIPSParserFunc ConfigParser,
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
memset(tname, 0, sizeof(tname));
|
|
|
|
|
snprintf(tname, sizeof(tname), "W-Q%s", cur_queue);
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s-Q%s", thread_name_workers, cur_queue);
|
|
|
|
|
|
|
|
|
|
tv = TmThreadCreatePacketHandler(tname,
|
|
|
|
|
"packetpool", "packetpool",
|
|
|
|
|
|