suricata
threadvars.h File Reference
#include "util-affinity.h"
#include "tm-queues.h"
#include "counters.h"
#include "threads.h"
Include dependency graph for threadvars.h:

Go to the source code of this file.

Data Structures

struct  ThreadVars_
 Per thread variable structure. More...
 

Macros

#define THV_USE   1 /** thread is in use */
 
#define THV_INIT_DONE   (1 << 1) /** thread initialization done */
 
#define THV_PAUSE   (1 << 2) /** signal thread to pause itself */
 
#define THV_PAUSED   (1 << 3) /** the thread is paused atm */
 
#define THV_KILL   (1 << 4) /** thread has been asked to cleanup and exit */
 
#define THV_FAILED   (1 << 5) /** thread has encountered an error and failed */
 
#define THV_CLOSED   (1 << 6) /** thread done, should be joinable */
 
#define THV_DEINIT   (1 << 7)
 
#define THV_RUNNING_DONE
 
#define THV_KILL_PKTACQ   (1 << 9)
 
#define THV_FLOW_LOOP   (1 << 10)
 
#define THV_CAPTURE_INJECT_PKT   (1<<11)
 
#define THV_DEAD   (1 << 12)
 
#define THREAD_SET_AFFINITY   0x01 /** CPU/Core affinity */
 
#define THREAD_SET_PRIORITY   0x02 /** Real time priority */
 
#define THREAD_SET_AFFTYPE   0x04 /** Priority and affinity */
 

Typedefs

typedef struct ThreadVars_ ThreadVars
 Per thread variable structure. More...
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Definition in file threadvars.h.

Macro Definition Documentation

#define THREAD_SET_AFFINITY   0x01 /** CPU/Core affinity */

Thread setup flags:

Definition at line 116 of file threadvars.h.

Referenced by TmThreadSetCPUAffinity(), and TmThreadSetupOptions().

#define THREAD_SET_AFFTYPE   0x04 /** Priority and affinity */

Definition at line 118 of file threadvars.h.

Referenced by TmThreadSetCPU(), and TmThreadSetupOptions().

#define THREAD_SET_PRIORITY   0x02 /** Real time priority */

Definition at line 117 of file threadvars.h.

Referenced by TmThreadSetThreadPriority(), and TmThreadSetupOptions().

#define THV_CAPTURE_INJECT_PKT   (1<<11)

signal thread's capture method to create a fake packet to force through the engine. This is to force timely handling of maintenance taks like rule reloads even if no packets are read by the capture method.

Definition at line 53 of file threadvars.h.

Referenced by DetectEngineInspectBufferGeneric().

#define THV_CLOSED   (1 << 6) /** thread done, should be joinable */
#define THV_DEAD   (1 << 12)

thread has been joined with pthread_join()

Definition at line 54 of file threadvars.h.

Referenced by TmThreadRemove(), and TmThreadWaitOnThreadInit().

#define THV_DEINIT   (1 << 7)
#define THV_FAILED   (1 << 5) /** thread has encountered an error and failed */
#define THV_FLOW_LOOP   (1 << 10)

thread is in flow shutdown loop

Definition at line 48 of file threadvars.h.

Referenced by TmThreadDisableReceiveThreads(), and TmThreadsSlotVarRun().

#define THV_INIT_DONE   (1 << 1) /** thread initialization done */
#define THV_KILL_PKTACQ   (1 << 9)

flag thread to stop packet acq

Definition at line 47 of file threadvars.h.

Referenced by TmThreadDisableReceiveThreads(), and TmThreadsSlotVarRun().

#define THV_PAUSE   (1 << 2) /** signal thread to pause itself */
#define THV_PAUSED   (1 << 3) /** the thread is paused atm */

Definition at line 38 of file threadvars.h.

Referenced by StatsSetUI64(), and TmThreadsSlotVarRun().

#define THV_RUNNING_DONE
#define THV_USE   1 /** thread is in use */

Thread flags set and read by threads to control the threads

Definition at line 35 of file threadvars.h.

Referenced by TmThreadCreate().

Typedef Documentation

typedef struct ThreadVars_ ThreadVars

Per thread variable structure.