Go to the documentation of this file.
127 static inline void FlowSetICMPv4CounterPart(
Flow *f)
133 f->
icmp_d.type = (uint8_t)ctype;
136 static inline void FlowSetICMPv6CounterPart(
Flow *f)
142 f->
icmp_d.type = (uint8_t)ctype;
161 if (PacketIsIPv4(p)) {
162 const IPV4Hdr *ip4h = PacketGetIPv4(p);
167 }
else if (PacketIsIPv6(p)) {
168 const IPV6Hdr *ip6h = PacketGetIPv6(p);
178 if (PacketIsTCP(p) || PacketIsUDP(p)) {
181 }
else if (PacketIsICMPv4(p)) {
184 FlowSetICMPv4CounterPart(f);
185 }
else if (PacketIsICMPv6(p)) {
188 FlowSetICMPv6CounterPart(f);
189 }
else if (PacketIsSCTP(p)) {
192 }
else if (PacketIsESP(p)) {
227 static void FlowBypassFree(
void *x)
248 const char *
name = NULL;
250 name =
"flow.end.state.new";
252 name =
"flow.end.state.established";
254 name =
"flow.end.state.closed";
256 name =
"flow.end.state.local_bypassed";
257 #ifdef CAPTURE_OFFLOAD
258 }
else if (i == FLOW_STATE_CAPTURE_BYPASSED) {
259 name =
"flow.end.state.capture_bypassed";
268 const char *
name = NULL;
271 name =
"flow.end.tcp_state.none";
274 name =
"flow.end.tcp_state.syn_sent";
277 name =
"flow.end.tcp_state.syn_recv";
280 name =
"flow.end.tcp_state.established";
283 name =
"flow.end.tcp_state.fin_wait1";
286 name =
"flow.end.tcp_state.fin_wait2";
289 name =
"flow.end.tcp_state.time_wait";
292 name =
"flow.end.tcp_state.last_ack";
295 name =
"flow.end.tcp_state.close_wait";
298 name =
"flow.end.tcp_state.closing";
301 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)
struct LiveDevice_ * livedev
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)
struct LiveDevice_ * livedev
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)