Go to the documentation of this file.
43 "Single threaded pcap file mode",
46 "Multi threaded pcap file mode. Packets from "
47 "each flow are assigned to a single detect thread, "
48 "unlike \"pcap-file-auto\" where packets from "
49 "the same flow can be processed by any detect "
61 const char *file = NULL;
64 if (
ConfGet(
"pcap-file.file", &file) == 0) {
77 "packetpool",
"packetpool",
78 "packetpool",
"packetpool",
85 if (tm_module == NULL) {
91 if (tm_module == NULL) {
97 if (tm_module == NULL) {
136 const char *file = NULL;
137 if (
ConfGet(
"pcap-file.file", &file) == 0) {
160 if (thread_max > 1024)
164 if (queues == NULL) {
166 "RunmodeAutoFpCreatePickupQueuesString failed");
174 "packetpool",
"packetpool",
179 if (tv_receivepcap == NULL) {
183 if (tm_module == NULL) {
189 if (tm_module == NULL) {
200 for (thread = 0; thread < (uint16_t)thread_max; thread++) {
202 snprintf(qname,
sizeof(qname),
"pickup%u", thread+1);
204 SCLogDebug(
"tname %s, qname %s", tname, qname);
205 SCLogDebug(
"Assigning %s affinity to cpu %u", tname, cpu);
210 "packetpool",
"packetpool",
212 if (tv_detect_ncpu == NULL) {
217 if (tm_module == NULL) {
219 "TmModuleGetByName for FlowWorker failed");
231 if ((cpu + 1) == ncpus)
const char * thread_name_workers
TmEcode TmThreadSpawn(ThreadVars *tv)
Spawns a thread associated with the ThreadVars instance tv.
ThreadVars * TmThreadCreatePacketHandler(const char *name, const char *inq_name, const char *inqh_name, const char *outq_name, const char *outqh_name, const char *slots)
Creates and returns a TV instance for a Packet Processing Thread. This function doesn't support custo...
void TmThreadSetGroupName(ThreadVars *tv, const char *name)
void RunModeInitialize(void)
const char * RunModeFilePcapGetDefaultMode(void)
const char * thread_name_autofp
const char * thread_name_single
#define TM_THREAD_NAME_MAX
TmModule * TmModuleGetByName(const char *name)
get a tm module ptr by name
int ConfGet(const char *name, const char **vptr)
Retrieve the value of a configuration node.
char * RunmodeAutoFpCreatePickupQueuesString(int n)
create a queue string for autofp to pass to the flow queue handler.
Per thread variable structure.
#define TM_QUEUE_NAME_MAX
void TmSlotSetFuncAppend(ThreadVars *tv, TmModule *tm, const void *data)
Appends a new entry to the slots.
void TimeModeSetOffline(void)
TmEcode TmThreadSetCPU(ThreadVars *tv, uint8_t type)
void RunModeRegisterNewRunMode(enum RunModes runmode, const char *name, const char *description, int(*RunModeFunc)(void))
Registers a new runmode.
void PcapFileGlobalInit()
int TmThreadGetNbThreads(uint8_t type)
int RunModeFilePcapSingle(void)
Single thread version of the Pcap file processing.
void RunModeFilePcapRegister(void)
#define FatalError(x,...)
uint16_t UtilCpuGetNumProcessorsOnline(void)
Get the number of cpus online in the system.
float threading_detect_ratio
int RunModeFilePcapAutoFp(void)
RunModeFilePcapAutoFp set up the following thread packet handlers: