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;
158 if (PacketIsIPv4(p)) {
159 const IPV4Hdr *ip4h = PacketGetIPv4(p);
164 }
else if (PacketIsIPv6(p)) {
165 const IPV6Hdr *ip6h = PacketGetIPv6(p);
175 if (PacketIsTCP(p) || PacketIsUDP(p)) {
178 }
else if (PacketIsICMPv4(p)) {
181 FlowSetICMPv4CounterPart(f);
182 }
else if (PacketIsICMPv6(p)) {
185 FlowSetICMPv6CounterPart(f);
186 }
else if (PacketIsSCTP(p)) {
189 }
else if (PacketIsESP(p)) {
224 static void FlowBypassFree(
void *x)
240 NULL, FlowBypassFree);
246 const char *
name = NULL;
248 name =
"flow.end.state.new";
250 name =
"flow.end.state.established";
252 name =
"flow.end.state.closed";
254 name =
"flow.end.state.local_bypassed";
255 #ifdef CAPTURE_OFFLOAD
256 }
else if (i == FLOW_STATE_CAPTURE_BYPASSED) {
257 name =
"flow.end.state.capture_bypassed";
266 const char *
name = NULL;
269 name =
"flow.end.tcp_state.none";
272 name =
"flow.end.tcp_state.syn_sent";
275 name =
"flow.end.tcp_state.syn_recv";
278 name =
"flow.end.tcp_state.established";
281 name =
"flow.end.tcp_state.fin_wait1";
284 name =
"flow.end.tcp_state.fin_wait2";
287 name =
"flow.end.tcp_state.time_wait";
290 name =
"flow.end.tcp_state.last_ack";
293 name =
"flow.end.tcp_state.close_wait";
296 name =
"flow.end.tcp_state.closing";
299 name =
"flow.end.tcp_state.closed";
#define ESP_GET_SPI(esph)
Get the spi field off a packet.
struct Packet_::@24::@31 icmp_s
struct Flow_::@118::@124 icmp_s
#define IPV6_GET_RAW_HLIM(ip6h)
FlowStorageId GetFlowBypassInfoID(void)
int ICMPv6GetCounterpart(uint8_t type)
FlowStorageId g_bypass_info_id
#define FLOW_SET_IPV6_SRC_ADDR_FROM_PACKET(ip6h, a)
void RegisterFlowBypassInfo(void)
#define SC_ATOMIC_ADD(name, val)
add a value to our atomic variable
FlowStorageId FlowRateGetStorageID(void)
struct Flow_ Flow
Flow data structure.
uint16_t flow_tcp_liberal
uint16_t flow_state[FLOW_STATE_SIZE]
#define FLOW_SET_IPV6_DST_ADDR_FROM_PACKET(ip6h, a)
uint8_t FlowGetReverseProtoMapping(uint8_t rproto)
#define FLOW_CHECK_MEMCAP(size)
check if a memory alloc would fit in the memcap
uint16_t flow_tcp_state[TCP_CLOSED+1]
#define FLOW_INITIALIZE(f)
@ FLOW_STATE_LOCAL_BYPASSED
struct Flow_::@120::@126 icmp_d
void(* BypassFree)(void *data)
Per thread variable structure.
unsigned int FlowStorageSize(void)
int FlowSetStorageById(Flow *f, FlowStorageId id, void *ptr)
FlowStorageId FlowStorageRegister(const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
struct Flow_::@118::@125 esp
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)
FlowStorageId MacSetGetFlowStorageID(void)
void * FlowGetStorageById(const Flow *f, FlowStorageId id)
void SCFlowRunInitCallbacks(ThreadVars *tv, Flow *f, const Packet *p)
void FlowFree(Flow *f)
cleanup & free the memory of a flow
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)
uint16_t vlan_id[VLAN_MAX_LAYERS]
Flow * FlowAlloc(void)
allocate a flow
void FlowEndCountersRegister(ThreadVars *t, FlowEndCounters *fec)
uint16_t StatsRegisterCounter(const char *name, struct ThreadVars_ *tv)
Registers a normal, unqualified counter.
#define DEBUG_VALIDATE_BUG_ON(exp)