suricata
|
#include "suricata-common.h"
#include "threads.h"
#include "flow.h"
#include "flow-private.h"
#include "flow-util.h"
#include "flow-var.h"
#include "app-layer.h"
#include "util-var.h"
#include "util-debug.h"
#include "flow-storage.h"
#include "detect.h"
#include "detect-engine-state.h"
#include "decode-icmpv4.h"
Go to the source code of this file.
Functions | |
Flow * | FlowAlloc (void) |
allocate a flow More... | |
void | FlowFree (Flow *f) |
cleanup & free the memory of a flow More... | |
uint8_t | FlowGetProtoMapping (uint8_t proto) |
Function to map the protocol to the defined FLOW_PROTO_* enumeration. More... | |
uint8_t | FlowGetReverseProtoMapping (uint8_t rproto) |
void | FlowInit (Flow *f, const Packet *p) |
int | GetFlowBypassInfoID (void) |
void | RegisterFlowBypassInfo (void) |
Variables | |
int | g_bypass_info_id = -1 |
Flow utility functions
Definition in file flow-util.c.
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 51 of file flow-util.c.
References FLOW_CHECK_MEMCAP, FLOW_INITIALIZE, FlowStorageSize(), SC_ATOMIC_ADD, SC_ATOMIC_SUB, SCMalloc, and unlikely.
Referenced by FlowGetFromFlowKey(), and LLVMFuzzerTestOneInput().
void FlowFree | ( | Flow * | f | ) |
cleanup & free the memory of a flow
f | flow to clear & destroy |
Definition at line 80 of file flow-util.c.
References FLOW_DESTROY, FlowStorageSize(), SC_ATOMIC_SUB, and SCFree.
Referenced by 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 95 of file flow-util.c.
References FLOW_PROTO_DEFAULT, FLOW_PROTO_ICMP, FLOW_PROTO_TCP, FLOW_PROTO_UDP, and proto.
Referenced by AppLayerParserGetEventInfo(), AppLayerParserGetEventInfoById(), AppLayerParserParse(), AppLayerParserProtocolGetLoggerBits(), AppLayerParserProtocolHasLogger(), AppLayerParserProtocolIsTxEventAware(), AppLayerParserProtoIsRegistered(), AppLayerRegisterThreadCounters(), FlowGetFromFlowKey(), FlowSetProtoFreeFunc(), FlowShutdown(), and LLVMFuzzerTestOneInput().
uint8_t FlowGetReverseProtoMapping | ( | uint8_t | rproto | ) |
Definition at line 109 of file flow-util.c.
References FLOW_PROTO_ICMP, FLOW_PROTO_TCP, and FLOW_PROTO_UDP.
Referenced by AppLayerParserThreadCtxAlloc(), and AppLayerParserThreadCtxFree().
Definition at line 143 of file flow-util.c.
References Flow_::dp, Flow_::dst, Flow_::flags, FLOW_IPV4, FLOW_IPV6, FLOW_SET_IPV4_DST_ADDR_FROM_PACKET, FLOW_SET_IPV4_SRC_ADDR_FROM_PACKET, FLOW_SET_IPV6_DST_ADDR_FROM_PACKET, FLOW_SET_IPV6_SRC_ADDR_FROM_PACKET, Flow_::icmp_s, Packet_::icmp_s, Packet_::icmpv4h, IPV4_GET_IPTTL, IPV6_GET_HLIM, Flow_::livedev, Packet_::livedev, Flow_::max_ttl_toserver, Flow_::min_ttl_toserver, PKT_IS_IPV4, PKT_IS_IPV6, Flow_::proto, Packet_::proto, Flow_::recursion_level, Packet_::recursion_level, SCEnter, SCLogDebug, SET_TCP_DST_PORT, SET_TCP_SRC_PORT, SET_UDP_DST_PORT, SET_UDP_SRC_PORT, Flow_::sp, Flow_::src, Packet_::tcph, Packet_::udph, Flow_::vlan_id, Packet_::vlan_id, Flow_::vlan_idx, and Packet_::vlan_idx.
int GetFlowBypassInfoID | ( | void | ) |
Definition at line 220 of file flow-util.c.
References g_bypass_info_id.
Referenced by EveAddFlow(), and PacketBypassCallback().
void RegisterFlowBypassInfo | ( | void | ) |
Definition at line 238 of file flow-util.c.
References FlowStorageRegister(), and g_bypass_info_id.
Referenced by PostConfLoadedSetup().
int g_bypass_info_id = -1 |
Definition at line 218 of file flow-util.c.
Referenced by GetFlowBypassInfoID(), and RegisterFlowBypassInfo().