Go to the documentation of this file.
45 "Multi threaded pcap file mode. Packets from "
46 "each flow are assigned to a single detect thread, "
47 "unlike \"pcap-file-auto\" where packets from "
48 "the same flow can be processed by any detect "
60 const char *file = NULL;
63 if (
ConfGet(
"pcap-file.file", &file) == 0) {
64 FatalError(
"Failed retrieving pcap-file from Conf");
76 "packetpool",
"packetpool",
77 "packetpool",
"packetpool",
84 if (tm_module == NULL) {
85 FatalError(
"TmModuleGetByName failed for ReceivePcap");
90 if (tm_module == NULL) {
91 FatalError(
"TmModuleGetByName DecodePcap failed");
96 if (tm_module == NULL) {
97 FatalError(
"TmModuleGetByName for FlowWorker failed");
135 const char *file = NULL;
136 if (
ConfGet(
"pcap-file.file", &file) == 0) {
137 FatalError(
"Failed retrieving pcap-file from Conf");
159 if (thread_max > 1024)
163 if (queues == NULL) {
164 FatalError(
"RunmodeAutoFpCreatePickupQueuesString failed");
172 "packetpool",
"packetpool",
177 if (tv_receivepcap == NULL) {
181 if (tm_module == NULL) {
182 FatalError(
"TmModuleGetByName failed for ReceivePcap");
187 if (tm_module == NULL) {
188 FatalError(
"TmModuleGetByName DecodePcap failed");
198 for (thread = 0; thread < (uint16_t)thread_max; thread++) {
200 snprintf(qname,
sizeof(qname),
"pickup%d", thread + 1);
202 SCLogDebug(
"tname %s, qname %s", tname, qname);
203 SCLogDebug(
"Assigning %s affinity to cpu %u", tname, cpu);
208 "packetpool",
"packetpool",
210 if (tv_detect_ncpu == NULL) {
215 if (tm_module == NULL) {
216 FatalError(
"TmModuleGetByName for FlowWorker failed");
228 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
void RunModeRegisterNewRunMode(enum RunModes runmode, const char *name, const char *description, int(*RunModeFunc)(void), void(*RunModeIsIPSEnabled)(void))
Registers a new runmode.
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)
int TmThreadGetNbThreads(uint8_t type)
int RunModeFilePcapSingle(void)
Single thread version of the Pcap file processing.
void RunModeFilePcapRegister(void)
void PcapFileGlobalInit(void)
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: