suricata
flow-var.c File Reference
#include "suricata-common.h"
#include "threads.h"
#include "flow-var.h"
#include "flow.h"
#include "detect.h"
#include "util-debug.h"
Include dependency graph for flow-var.c:

Go to the source code of this file.

Functions

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

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t
Pablo Rincon pablo.nosp@m..rin.nosp@m.con.c.nosp@m.resp.nosp@m.o@gma.nosp@m.il.c.nosp@m.om

Flow level variable support for complex detection rules Supported types atm are String and Integers

Definition in file flow-var.c.

Function Documentation

◆ FlowVarAddIdValue()

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

◆ FlowVarAddInt()

void FlowVarAddInt ( Flow f,
uint32_t  idx,
uint32_t  value 
)

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

References FlowVarAddIntNoLock().

Here is the call graph for this function:

◆ FlowVarAddIntNoLock()

void FlowVarAddIntNoLock ( Flow f,
uint32_t  idx,
uint32_t  value 
)

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 fv)

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()