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");
75 "packetpool",
"packetpool",
76 "packetpool",
"packetpool",
83 if (tm_module == NULL) {
84 FatalError(
"TmModuleGetByName failed for ReceivePcap");
89 if (tm_module == NULL) {
90 FatalError(
"TmModuleGetByName DecodePcap failed");
95 if (tm_module == NULL) {
96 FatalError(
"TmModuleGetByName for FlowWorker failed");
132 const char *file = NULL;
133 if (
ConfGet(
"pcap-file.file", &file) == 0) {
134 FatalError(
"Failed retrieving pcap-file from Conf");
156 if (thread_max > 1024)
160 if (queues == NULL) {
161 FatalError(
"RunmodeAutoFpCreatePickupQueuesString failed");
169 "packetpool",
"packetpool",
174 if (tv_receivepcap == NULL) {
178 if (tm_module == NULL) {
179 FatalError(
"TmModuleGetByName failed for ReceivePcap");
184 if (tm_module == NULL) {
185 FatalError(
"TmModuleGetByName DecodePcap failed");
195 for (thread = 0; thread < (uint16_t)thread_max; thread++) {
197 snprintf(qname,
sizeof(qname),
"pickup%d", thread + 1);
199 SCLogDebug(
"tname %s, qname %s", tname, qname);
200 SCLogDebug(
"Assigning %s affinity to cpu %u", tname, cpu);
205 "packetpool",
"packetpool",
207 if (tv_detect_ncpu == NULL) {
212 if (tm_module == NULL) {
213 FatalError(
"TmModuleGetByName for FlowWorker failed");
225 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)
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: