suricata
|
Go to the source code of this file.
Data Structures | |
struct | FlowEndCounters_ |
Macros | |
#define | RESET_COUNTERS(f) |
#define | FLOW_INITIALIZE(f) |
#define | FLOW_RECYCLE(f) |
macro to recycle a flow before it goes into the spare queue for reuse. More... | |
#define | FLOW_DESTROY(f) |
#define | FLOW_CHECK_MEMCAP(size) |
check if a memory alloc would fit in the memcap More... | |
Typedefs | |
typedef struct FlowEndCounters_ | FlowEndCounters |
Functions | |
Flow * | FlowAlloc (void) |
allocate a flow More... | |
void | FlowFree (Flow *) |
cleanup & free the memory of a flow More... | |
uint8_t | FlowGetProtoMapping (uint8_t) |
Function to map the protocol to the defined FLOW_PROTO_* enumeration. More... | |
void | FlowInit (ThreadVars *, Flow *, const Packet *) |
uint8_t | FlowGetReverseProtoMapping (uint8_t rproto) |
void | FlowEndCountersRegister (ThreadVars *t, FlowEndCounters *fec) |
Definition in file flow-util.h.
#define FLOW_CHECK_MEMCAP | ( | size | ) |
check if a memory alloc would fit in the memcap
size | memory allocation size to check |
1 | it fits |
0 | no fit |
Definition at line 137 of file flow-util.h.
#define FLOW_DESTROY | ( | f | ) |
Definition at line 122 of file flow-util.h.
#define FLOW_INITIALIZE | ( | f | ) |
Definition at line 39 of file flow-util.h.
#define FLOW_RECYCLE | ( | f | ) |
macro to recycle a flow before it goes into the spare queue for reuse.
Note that the lnext, lprev, hnext fields are untouched, those are managed by the queueing code. Same goes for fb (FlowBucket ptr) field.
Definition at line 82 of file flow-util.h.
#define RESET_COUNTERS | ( | f | ) |
Definition at line 31 of file flow-util.h.
typedef struct FlowEndCounters_ FlowEndCounters |
Flow* FlowAlloc | ( | void | ) |
allocate a flow
We check against the memuse counter. If it passes that check we increment the counter first, then we try to alloc.
f | the flow or NULL on out of memory |
Definition at line 55 of file flow-util.c.
References FLOW_CHECK_MEMCAP, FLOW_INITIALIZE, FlowStorageSize(), SC_ATOMIC_ADD, SC_ATOMIC_SUB, SCCalloc, and unlikely.
Referenced by LLVMFuzzerTestOneInput().
void FlowEndCountersRegister | ( | ThreadVars * | t, |
FlowEndCounters * | fec | ||
) |
Definition at line 238 of file flow-util.c.
References FlowEndCounters_::flow_state, FLOW_STATE_CLOSED, FLOW_STATE_ESTABLISHED, FLOW_STATE_LOCAL_BYPASSED, FLOW_STATE_NEW, FLOW_STATE_SIZE, FlowEndCounters_::flow_tcp_liberal, FlowEndCounters_::flow_tcp_state, StatsRegisterCounter(), TCP_CLOSE_WAIT, TCP_CLOSED, TCP_CLOSING, TCP_ESTABLISHED, TCP_FIN_WAIT1, TCP_FIN_WAIT2, TCP_LAST_ACK, TCP_NONE, TCP_SYN_RECV, TCP_SYN_SENT, and TCP_TIME_WAIT.
void FlowFree | ( | Flow * | f | ) |
cleanup & free the memory of a flow
f | flow to clear & destroy |
Definition at line 83 of file flow-util.c.
References FLOW_DESTROY, FlowStorageSize(), SC_ATOMIC_SUB, and SCFree.
Referenced by FlowReset(), FlowShutdown(), LLVMFuzzerTestOneInput(), and UTHBuildPacketOfFlows().
uint8_t FlowGetProtoMapping | ( | uint8_t | proto | ) |
Function to map the protocol to the defined FLOW_PROTO_* enumeration.
proto | protocol which is needed to be mapped |
Definition at line 98 of file flow-util.c.
References FLOW_PROTO_DEFAULT, FLOW_PROTO_ICMP, FLOW_PROTO_TCP, FLOW_PROTO_UDP, and proto.
Referenced by AppLayerParserApplyTxConfig(), AppLayerParserGetEventInfo(), AppLayerParserGetEventInfoById(), AppLayerParserParse(), AppLayerParserProtocolGetLoggerBits(), AppLayerParserProtocolHasLogger(), AppLayerParserProtoIsRegistered(), FlowReset(), FlowSetProtoFreeFunc(), FlowShutdown(), and LLVMFuzzerTestOneInput().
uint8_t FlowGetReverseProtoMapping | ( | uint8_t | rproto | ) |
Definition at line 112 of file flow-util.c.
References FLOW_PROTO_ICMP, FLOW_PROTO_TCP, and FLOW_PROTO_UDP.
Referenced by AppLayerParserThreadCtxAlloc(), and AppLayerParserThreadCtxFree().
void FlowInit | ( | ThreadVars * | , |
Flow * | , | ||
const Packet * | |||
) |
Definition at line 146 of file flow-util.c.
References Flow_::livedev, Packet_::livedev, Flow_::proto, Packet_::proto, Flow_::recursion_level, Packet_::recursion_level, SCEnter, SCLogDebug, Flow_::vlan_id, Packet_::vlan_id, Flow_::vlan_idx, and Packet_::vlan_idx.