Go to the documentation of this file.
126 static inline void FlowSetICMPv4CounterPart(
Flow *f)
132 f->
icmp_d.type = (uint8_t)ctype;
135 static inline void FlowSetICMPv6CounterPart(
Flow *f)
141 f->
icmp_d.type = (uint8_t)ctype;
157 if (PacketIsIPv4(p)) {
158 const IPV4Hdr *ip4h = PacketGetIPv4(p);
163 }
else if (PacketIsIPv6(p)) {
164 const IPV6Hdr *ip6h = PacketGetIPv6(p);
174 if (PacketIsTCP(p) || PacketIsUDP(p)) {
177 }
else if (PacketIsICMPv4(p)) {
180 FlowSetICMPv4CounterPart(f);
181 }
else if (PacketIsICMPv6(p)) {
184 FlowSetICMPv6CounterPart(f);
185 }
else if (PacketIsSCTP(p)) {
188 }
else if (PacketIsESP(p)) {
219 static void FlowBypassFree(
void *x)
235 NULL, FlowBypassFree);
241 const char *name = NULL;
243 name =
"flow.end.state.new";
245 name =
"flow.end.state.established";
247 name =
"flow.end.state.closed";
249 name =
"flow.end.state.local_bypassed";
250 #ifdef CAPTURE_OFFLOAD
251 }
else if (i == FLOW_STATE_CAPTURE_BYPASSED) {
252 name =
"flow.end.state.capture_bypassed";
261 const char *name = NULL;
264 name =
"flow.end.tcp_state.none";
267 name =
"flow.end.tcp_state.syn_sent";
270 name =
"flow.end.tcp_state.syn_recv";
273 name =
"flow.end.tcp_state.established";
276 name =
"flow.end.tcp_state.fin_wait1";
279 name =
"flow.end.tcp_state.fin_wait2";
282 name =
"flow.end.tcp_state.time_wait";
285 name =
"flow.end.tcp_state.last_ack";
288 name =
"flow.end.tcp_state.close_wait";
291 name =
"flow.end.tcp_state.closing";
294 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 SCFlowRunInitCallbacks(ThreadVars *tv, Flow *f, const Packet *p)
void FlowFree(Flow *f)
cleanup & free the memory of a flow
MacSet * MacSetInit(int size)
struct LiveDevice_ * livedev
void FlowInit(ThreadVars *tv, Flow *f, const Packet *p)
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)