Go to the documentation of this file.
128 static inline void FlowSetICMPv4CounterPart(
Flow *f)
134 f->
icmp_d.type = (uint8_t)ctype;
137 static inline void FlowSetICMPv6CounterPart(
Flow *f)
143 f->
icmp_d.type = (uint8_t)ctype;
162 if (PacketIsIPv4(
p)) {
163 const IPV4Hdr *ip4h = PacketGetIPv4(
p);
168 }
else if (PacketIsIPv6(
p)) {
169 const IPV6Hdr *ip6h = PacketGetIPv6(
p);
179 if (PacketIsTCP(
p) || PacketIsUDP(
p)) {
182 }
else if (PacketIsICMPv4(
p)) {
185 FlowSetICMPv4CounterPart(f);
186 }
else if (PacketIsICMPv6(
p)) {
189 FlowSetICMPv6CounterPart(f);
190 }
else if (PacketIsSCTP(
p)) {
193 }
else if (PacketIsESP(
p)) {
228 static void FlowBypassFree(
void *x)
249 const char *
name = NULL;
251 name =
"flow.end.state.new";
253 name =
"flow.end.state.established";
255 name =
"flow.end.state.closed";
257 name =
"flow.end.state.local_bypassed";
258 #ifdef CAPTURE_OFFLOAD
259 }
else if (i == FLOW_STATE_CAPTURE_BYPASSED) {
260 name =
"flow.end.state.capture_bypassed";
269 const char *
name = NULL;
272 name =
"flow.end.tcp_state.none";
275 name =
"flow.end.tcp_state.syn_sent";
278 name =
"flow.end.tcp_state.syn_recv";
281 name =
"flow.end.tcp_state.established";
284 name =
"flow.end.tcp_state.fin_wait1";
287 name =
"flow.end.tcp_state.fin_wait2";
290 name =
"flow.end.tcp_state.time_wait";
293 name =
"flow.end.tcp_state.last_ack";
296 name =
"flow.end.tcp_state.close_wait";
299 name =
"flow.end.tcp_state.closing";
302 name =
"flow.end.tcp_state.closed";
#define ESP_GET_SPI(esph)
Get the spi field off a packet.
#define IPV6_GET_RAW_HLIM(ip6h)
void * SCFlowGetStorageById(const Flow *f, SCFlowStorageId id)
int ICMPv6GetCounterpart(uint8_t type)
StatsCounterId StatsRegisterCounter(const char *name, StatsThreadContext *stats)
Registers a normal, unqualified counter.
struct Flow_::@121::@128 esp
#define FLOW_SET_IPV6_SRC_ADDR_FROM_PACKET(ip6h, a)
void RegisterFlowBypassInfo(void)
unsigned int SCFlowStorageSize(void)
#define SC_ATOMIC_ADD(name, val)
add a value to our atomic variable
SCFlowStorageId FlowRateGetStorageID(void)
SCFlowStorageId g_bypass_info_id
#define FLOW_SET_IPV6_DST_ADDR_FROM_PACKET(ip6h, a)
SCFlowStorageId GetFlowBypassInfoID(void)
StatsCounterId flow_tcp_state[TCP_CLOSED+1]
uint8_t FlowGetReverseProtoMapping(uint8_t rproto)
SCFlowStorageId SCFlowStorageRegister(const char *name, void(*Free)(void *))
struct Packet_::@32::@39 icmp_s
#define FLOW_CHECK_MEMCAP(size)
check if a memory alloc would fit in the memcap
#define FLOW_INITIALIZE(f)
@ FLOW_STATE_LOCAL_BYPASSED
void(* BypassFree)(void *data)
StatsCounterId flow_tcp_liberal
Per thread variable structure.
int SCFlowSetStorageById(Flow *f, SCFlowStorageId id, void *ptr)
bool MacSetFlowStorageEnabled(void)
#define SC_ATOMIC_SUB(name, val)
sub a value from our atomic variable
uint8_t FlowGetProtoMapping(uint8_t proto)
Function to map the protocol to the defined FLOW_PROTO_* enumeration.
#define IPV4_GET_RAW_IPTTL(ip4h)
int ICMPv4GetCounterpart(uint8_t type)
Data structures and function prototypes for keeping state for the detection engine.
#define FLOW_SET_IPV4_SRC_ADDR_FROM_PACKET(ip4h, a)
void SCFlowRunInitCallbacks(ThreadVars *tv, Flow *f, const Packet *p)
void FlowFree(Flow *f)
cleanup & free the memory of a flow
struct Flow_::@123::@129 icmp_d
FlowRateStore * FlowRateStoreInit(void)
MacSet * MacSetInit(int size)
void FlowInit(ThreadVars *tv, Flow *f, const Packet *p)
bool FlowRateStorageEnabled(void)
uint16_t vlan_id[VLAN_MAX_LAYERS]
#define FLOW_SET_IPV4_DST_ADDR_FROM_PACKET(ip4h, a)
StatsCounterId flow_state[FLOW_STATE_SIZE]
uint16_t vlan_id[VLAN_MAX_LAYERS]
struct Flow_::@121::@127 icmp_s
Flow * FlowAlloc(void)
allocate a flow
void FlowEndCountersRegister(ThreadVars *t, FlowEndCounters *fec)
#define DEBUG_VALIDATE_BUG_ON(exp)
FlowThreadId thread_id[2]
SCFlowStorageId MacSetGetFlowStorageID(void)