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

#define FLOWVAR_TYPE_INT   2

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

Referenced by DetectFlowintMatch(), FlowVarAddIntNoLock(), FlowVarPrint(), and JsonAddStringN().

#define FLOWVAR_TYPE_STR   1

Available data types for Flowvars

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

Referenced by FlowVarAddIdValue(), FlowVarAddKeyValue(), FlowVarFree(), FlowVarPrint(), and JsonAddStringN().

Typedef Documentation

typedef struct FlowVar_ FlowVar

Generic Flowvar Structure

Struct used to hold the integer data type for flowvars

Struct used to hold the string data type for flowvars

Function Documentation

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

Flowvar Interface API

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

References FlowVar_::data, FlowVar_::datatype, DETECT_FLOWVAR, Flow_::flowvar, FLOWVAR_TYPE_STR, FlowVarGet(), FlowVar_::fv_str, GenericVarAppend(), FlowVar_::idx, FlowVar_::next, SCCalloc, FlowVar_::type, unlikely, FlowVarTypeStr::value, and FlowVarTypeStr::value_len.

Referenced by DetectFlowvarPostMatchSetup().

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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:

void FlowVarAddKeyValue ( Flow f,
uint8_t *  key,
uint16_t  keysize,
uint8_t *  value,
uint16_t  size 
)
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:

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(), DetectLuaRegister(), DetectPcrePayloadMatch(), FlowVarAddIdValue(), and FlowVarAddIntNoLock().

Here is the caller graph for this function:

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.