Go to the documentation of this file.
125 static inline void FlowSetICMPv4CounterPart(
Flow *f)
131 f->
icmp_d.type = (uint8_t)ctype;
134 static inline void FlowSetICMPv6CounterPart(
Flow *f)
140 f->
icmp_d.type = (uint8_t)ctype;
156 if (PacketIsIPv4(p)) {
157 const IPV4Hdr *ip4h = PacketGetIPv4(p);
162 }
else if (PacketIsIPv6(p)) {
163 const IPV6Hdr *ip6h = PacketGetIPv6(p);
173 if (PacketIsTCP(p) || PacketIsUDP(p)) {
176 }
else if (PacketIsICMPv4(p)) {
179 FlowSetICMPv4CounterPart(f);
180 }
else if (PacketIsICMPv6(p)) {
183 FlowSetICMPv6CounterPart(f);
184 }
else if (PacketIsSCTP(p)) {
187 }
else if (PacketIsESP(p)) {
216 static void FlowBypassFree(
void *x)
232 NULL, FlowBypassFree);
238 const char *name = NULL;
240 name =
"flow.end.state.new";
242 name =
"flow.end.state.established";
244 name =
"flow.end.state.closed";
246 name =
"flow.end.state.local_bypassed";
247 #ifdef CAPTURE_OFFLOAD
248 }
else if (i == FLOW_STATE_CAPTURE_BYPASSED) {
249 name =
"flow.end.state.capture_bypassed";
258 const char *name = NULL;
261 name =
"flow.end.tcp_state.none";
264 name =
"flow.end.tcp_state.syn_sent";
267 name =
"flow.end.tcp_state.syn_recv";
270 name =
"flow.end.tcp_state.established";
273 name =
"flow.end.tcp_state.fin_wait1";
276 name =
"flow.end.tcp_state.fin_wait2";
279 name =
"flow.end.tcp_state.time_wait";
282 name =
"flow.end.tcp_state.last_ack";
285 name =
"flow.end.tcp_state.close_wait";
288 name =
"flow.end.tcp_state.closing";
291 name =
"flow.end.tcp_state.closed";
#define ESP_GET_SPI(esph)
Get the spi field off a packet.
#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
struct Flow_ Flow
Flow data structure.
uint16_t flow_tcp_liberal
uint16_t flow_state[FLOW_STATE_SIZE]
struct Flow_::@116::@122 icmp_d
struct Packet_::@29::@36 icmp_s
#define FLOW_SET_IPV6_DST_ADDR_FROM_PACKET(ip6h, a)
struct Flow_::@114::@120 icmp_s
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)
struct Flow_::@114::@121 esp
@ FLOW_STATE_LOCAL_BYPASSED
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 *))
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 FlowFree(Flow *f)
cleanup & free the memory of a flow
MacSet * MacSetInit(int size)
struct LiveDevice_ * livedev
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.
void FlowInit(Flow *f, const Packet *p)
#define DEBUG_VALIDATE_BUG_ON(exp)