suricata
threadvars.h File Reference
#include "tm-queues.h"
#include "counters.h"
#include "packet-queue.h"
#include "util-atomic.h"
#include "util-storage.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   BIT_U32(0) /** thread is in use */
 
#define THV_INIT_DONE   BIT_U32(1) /** thread initialization done */
 
#define THV_PAUSE   BIT_U32(2) /** signal thread to pause itself */
 
#define THV_PAUSED   BIT_U32(3) /** the thread is paused atm */
 
#define THV_KILL   BIT_U32(4) /** thread has been asked to cleanup and exit */
 
#define THV_FAILED   BIT_U32(5) /** thread has encountered an error and failed */
 
#define THV_CLOSED   BIT_U32(6) /** thread done, should be joinable */
 
#define THV_DEINIT   BIT_U32(7)
 
#define THV_RUNNING_DONE
 
#define THV_KILL_PKTACQ   BIT_U32(9)
 
#define THV_FLOW_LOOP   BIT_U32(10)
 
#define THV_CAPTURE_INJECT_PKT   BIT_U32(11)
 
#define THV_DEAD   BIT_U32(12)
 
#define THV_RUNNING   BIT_U32(13)
 
#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

◆ THREAD_SET_AFFINITY

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

Thread setup flags:

Definition at line 143 of file threadvars.h.

◆ THREAD_SET_AFFTYPE

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

Definition at line 145 of file threadvars.h.

◆ THREAD_SET_PRIORITY

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

Definition at line 144 of file threadvars.h.

◆ THV_CAPTURE_INJECT_PKT

#define THV_CAPTURE_INJECT_PKT   BIT_U32(11)

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

Definition at line 54 of file threadvars.h.

◆ THV_CLOSED

#define THV_CLOSED   BIT_U32(6) /** thread done, should be joinable */

Definition at line 43 of file threadvars.h.

◆ THV_DEAD

#define THV_DEAD   BIT_U32(12)

thread has been joined with pthread_join()

Definition at line 55 of file threadvars.h.

◆ THV_DEINIT

#define THV_DEINIT   BIT_U32(7)

Definition at line 46 of file threadvars.h.

◆ THV_FAILED

#define THV_FAILED   BIT_U32(5) /** thread has encountered an error and failed */

Definition at line 42 of file threadvars.h.

◆ THV_FLOW_LOOP

#define THV_FLOW_LOOP   BIT_U32(10)

thread is in flow shutdown loop

Definition at line 49 of file threadvars.h.

◆ THV_INIT_DONE

#define THV_INIT_DONE   BIT_U32(1) /** thread initialization done */

Definition at line 38 of file threadvars.h.

◆ THV_KILL

#define THV_KILL   BIT_U32(4) /** thread has been asked to cleanup and exit */

Definition at line 41 of file threadvars.h.

◆ THV_KILL_PKTACQ

#define THV_KILL_PKTACQ   BIT_U32(9)

flag thread to stop packet acq

Definition at line 48 of file threadvars.h.

◆ THV_PAUSE

#define THV_PAUSE   BIT_U32(2) /** signal thread to pause itself */

Definition at line 39 of file threadvars.h.

◆ THV_PAUSED

#define THV_PAUSED   BIT_U32(3) /** the thread is paused atm */

Definition at line 40 of file threadvars.h.

◆ THV_RUNNING

#define THV_RUNNING   BIT_U32(13)

thread is running

Definition at line 56 of file threadvars.h.

◆ THV_RUNNING_DONE

#define THV_RUNNING_DONE
Value:
BIT_U32(8) /** thread has completed running and is entering
* the de-init phase */

Definition at line 47 of file threadvars.h.

◆ THV_USE

#define THV_USE   BIT_U32(0) /** thread is in use */

Thread flags set and read by threads to control the threads

Definition at line 37 of file threadvars.h.

Typedef Documentation

◆ ThreadVars

typedef struct ThreadVars_ ThreadVars

Per thread variable structure.

BIT_U32
#define BIT_U32(n)
Definition: suricata-common.h:400