|
|
|
@ -25,9 +25,6 @@
|
|
|
|
|
#include "runmode-lib.h"
|
|
|
|
|
#include "runmodes.h"
|
|
|
|
|
#include "tm-threads.h"
|
|
|
|
|
#include "util-device.h"
|
|
|
|
|
|
|
|
|
|
static int g_thread_id = 0;
|
|
|
|
|
|
|
|
|
|
/** \brief register runmodes for suricata as a library */
|
|
|
|
|
void RunModeIdsLibRegister(void)
|
|
|
|
@ -59,11 +56,11 @@ const char *RunModeLibGetDefaultMode(void)
|
|
|
|
|
return "live";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ThreadVars *SCRunModeLibCreateThreadVars(void)
|
|
|
|
|
ThreadVars *SCRunModeLibCreateThreadVars(int worker_id)
|
|
|
|
|
{
|
|
|
|
|
char tname[TM_THREAD_NAME_MAX];
|
|
|
|
|
TmModule *tm_module = NULL;
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#%02d", thread_name_workers, ++g_thread_id);
|
|
|
|
|
snprintf(tname, sizeof(tname), "%s#%02d", thread_name_workers, worker_id);
|
|
|
|
|
|
|
|
|
|
ThreadVars *tv = TmThreadCreatePacketHandler(
|
|
|
|
|
tname, "packetpool", "packetpool", "packetpool", "packetpool", "lib");
|
|
|
|
@ -142,7 +139,6 @@ void RunModeDestroyWorker(void *td)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tv->stream_pq = NULL;
|
|
|
|
|
--g_thread_id;
|
|
|
|
|
SCLogDebug("%s ending", tv->name);
|
|
|
|
|
TmThreadsSetFlag(tv, THV_CLOSED);
|
|
|
|
|
}
|
|
|
|
|