suricata
flow-var.h File Reference
#include "flow.h"
#include "util-var.h"
Include dependency graph for flow-var.h:

Go to the source code of this file.

Data Structures

struct  FlowVarTypeStr
 
struct  FlowVarTypeInt_
 
struct  FlowVar_
 

Macros

#define FLOWVAR_TYPE_STR   1
 
#define FLOWVAR_TYPE_INT   2
 

Typedefs

typedef struct FlowVarTypeStr FlowVarTypeStr
 
typedef struct FlowVarTypeInt_ FlowVarTypeInt
 
typedef struct FlowVar_ FlowVar
 

Functions

void FlowVarAddIdValue (Flow *, uint32_t id, uint8_t *value, uint16_t size)
 
void FlowVarAddKeyValue (Flow *f, uint8_t *key, uint16_t keysize, uint8_t *value, uint16_t size)
 
void FlowVarAddIntNoLock (Flow *, uint32_t, uint32_t)
 
void FlowVarAddInt (Flow *, uint32_t, uint32_t)
 
FlowVarFlowVarGet (Flow *, uint32_t)
 get the flowvar with index 'idx' from the flow More...
 
FlowVarFlowVarGetByKey (Flow *f, const uint8_t *key, uint16_t keylen)
 get the flowvar with index 'idx' from the flow More...
 
void FlowVarFree (FlowVar *)
 
void FlowVarPrint (GenericVar *)
 

Detailed Description

Macro Definition Documentation

◆ FLOWVAR_TYPE_INT

#define FLOWVAR_TYPE_INT   2

Definition at line 35 of file flow-var.h.

◆ FLOWVAR_TYPE_STR

#define FLOWVAR_TYPE_STR   1

Available data types for Flowvars

Definition at line 34 of file flow-var.h.

Typedef Documentation

◆ FlowVar

typedef struct FlowVar_ FlowVar

Generic Flowvar Structure

◆ FlowVarTypeInt

Struct used to hold the integer data type for flowvars

◆ FlowVarTypeStr

Struct used to hold the string data type for flowvars

Function Documentation

◆ FlowVarAddIdValue()

void FlowVarAddIdValue ( Flow ,
uint32_t  id,
uint8_t *  value,
uint16_t  size 
)

◆ FlowVarAddInt()

void FlowVarAddInt ( Flow ,
uint32_t  ,
uint32_t   
)

Definition at line 156 of file flow-var.c.

References FlowVarAddIntNoLock().

Here is the call graph for this function:

◆ FlowVarAddIntNoLock()

void FlowVarAddIntNoLock ( Flow ,
uint32_t  ,
uint32_t   
)

Definition at line 135 of file flow-var.c.

References FlowVar_::data, FlowVar_::datatype, DETECT_FLOWVAR, Flow_::flowvar, FLOWVAR_TYPE_INT, FlowVarGet(), FlowVar_::fv_int, GenericVarAppend(), FlowVar_::idx, FlowVar_::next, SCMalloc, FlowVar_::type, unlikely, and FlowVarTypeInt_::value.

Referenced by DetectFlowintMatch(), and FlowVarAddInt().

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

◆ FlowVarAddKeyValue()

void FlowVarAddKeyValue ( Flow f,
uint8_t *  key,
uint16_t  keysize,
uint8_t *  value,
uint16_t  size 
)

◆ FlowVarFree()

void FlowVarFree ( FlowVar )

Definition at line 161 of file flow-var.c.

References FlowVar_::data, FlowVar_::datatype, FLOWVAR_TYPE_STR, FlowVar_::fv_str, SCFree, and FlowVarTypeStr::value.

Referenced by GenericVarFree().

Here is the caller graph for this function:

◆ FlowVarGet()

FlowVar* FlowVarGet ( Flow f,
uint32_t  idx 
)

get the flowvar with index 'idx' from the flow

Note
flow is not locked by this function, caller is responsible

Definition at line 78 of file flow-var.c.

References DETECT_FLOWVAR, Flow_::flowvar, GenericVar_::idx, GenericVar_::next, and GenericVar_::type.

Referenced by DetectFlowintMatch(), DetectFlowvarMatch(), FlowVarAddIdValue(), and FlowVarAddIntNoLock().

Here is the caller graph for this function:

◆ FlowVarGetByKey()

FlowVar* FlowVarGetByKey ( Flow f,
const uint8_t *  key,
uint16_t  keylen 
)

get the flowvar with index 'idx' from the flow

Note
flow is not locked by this function, caller is responsible

Definition at line 54 of file flow-var.c.

References DETECT_FLOWVAR, Flow_::flowvar, GenericVar_::idx, FlowVar_::key, FlowVar_::keylen, GenericVar_::next, and GenericVar_::type.

◆ FlowVarPrint()