suricata
runmode-pcap-file.c File Reference
#include "suricata-common.h"
#include "tm-threads.h"
#include "conf.h"
#include "runmodes.h"
#include "runmode-pcap-file.h"
#include "output.h"
#include "detect-engine.h"
#include "source-pcap-file.h"
#include "util-debug.h"
#include "util-time.h"
#include "util-cpu.h"
#include "util-affinity.h"
#include "util-runmodes.h"
Include dependency graph for runmode-pcap-file.c:

Go to the source code of this file.

Functions

const char * RunModeFilePcapGetDefaultMode (void)
 
void RunModeFilePcapRegister (void)
 
int RunModeFilePcapSingle (void)
 Single thread version of the Pcap file processing. More...
 
int RunModeFilePcapAutoFp (void)
 RunModeFilePcapAutoFp set up the following thread packet handlers: More...
 

Function Documentation

◆ RunModeFilePcapAutoFp()

int RunModeFilePcapAutoFp ( void  )

RunModeFilePcapAutoFp set up the following thread packet handlers:

  • Receive thread (from pcap file)
  • Decode thread
  • Stream thread
  • Detect: If we have only 1 cpu, it will setup one Detect thread If we have more than one, it will setup num_cpus - 1 starting from the second cpu available.
  • Outputs thread By default the threads will use the first cpu available except the Detection threads if we have more than one cpu.
Return values
0If all goes well. (If any problem is detected the engine will exit()).

Definition at line 118 of file runmode-pcap-file.c.

References ConfGet(), FatalError, PcapFileGlobalInit(), RECEIVE_CPU_SET, RunmodeAutoFpCreatePickupQueuesString(), SCEnter, SCFree, SCLogDebug, thread_name_autofp, thread_name_workers, threading_detect_ratio, TimeModeSetOffline(), TM_ECODE_OK, TM_QUEUE_NAME_MAX, TM_THREAD_NAME_MAX, TmModuleGetByName(), TmSlotSetFuncAppend(), TmThreadCreatePacketHandler(), TmThreadGetNbThreads(), TmThreadSetCPU(), TmThreadSetGroupName(), TmThreadSpawn(), UtilCpuGetNumProcessorsOnline(), and WORKER_CPU_SET.

Referenced by RunModeFilePcapRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunModeFilePcapGetDefaultMode()

const char* RunModeFilePcapGetDefaultMode ( void  )

Definition at line 35 of file runmode-pcap-file.c.

◆ RunModeFilePcapRegister()

void RunModeFilePcapRegister ( void  )

Definition at line 40 of file runmode-pcap-file.c.

References RUNMODE_PCAP_FILE, RunModeFilePcapAutoFp(), RunModeFilePcapSingle(), and RunModeRegisterNewRunMode().

Here is the call graph for this function:

◆ RunModeFilePcapSingle()

int RunModeFilePcapSingle ( void  )

Single thread version of the Pcap file processing.

Definition at line 53 of file runmode-pcap-file.c.

References ConfGet(), FatalError, PcapFileGlobalInit(), thread_name_single, TimeModeSetOffline(), TM_ECODE_OK, TM_THREAD_NAME_MAX, TmModuleGetByName(), TmSlotSetFuncAppend(), TmThreadCreatePacketHandler(), TmThreadSetCPU(), TmThreadSpawn(), tv, and WORKER_CPU_SET.

Referenced by RunModeFilePcapRegister().

Here is the call graph for this function:
Here is the caller graph for this function: