suricata
flow-timeout.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2017 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Anoop Saldanha <anoopsaldanha@gmail.com>
22  */
23 
24 #include "suricata-common.h"
25 #include "suricata.h"
26 #include "decode.h"
27 #include "conf.h"
28 #include "threadvars.h"
29 #include "tm-threads.h"
30 #include "runmodes.h"
31 
32 #include "util-random.h"
33 #include "util-time.h"
34 
35 #include "flow.h"
36 #include "flow-queue.h"
37 #include "flow-hash.h"
38 #include "flow-util.h"
39 #include "flow-var.h"
40 #include "flow-private.h"
41 #include "flow-manager.h"
42 #include "flow-timeout.h"
43 #include "pkt-var.h"
44 #include "host.h"
45 
46 #include "stream-tcp-private.h"
47 #include "stream-tcp-reassemble.h"
48 #include "stream-tcp.h"
49 
50 #include "util-unittest.h"
51 #include "util-unittest-helper.h"
52 #include "util-byte.h"
53 
54 #include "util-debug.h"
55 #include "util-privs.h"
56 
57 #include "detect.h"
58 #include "detect-engine-state.h"
59 #include "stream.h"
60 
61 #include "app-layer-parser.h"
62 #include "app-layer.h"
63 
64 #include "util-profiling.h"
65 
66 /**
67  * \internal
68  * \brief Pseudo packet setup for flow forced reassembly.
69  *
70  * \param direction Direction of the packet. 0 indicates toserver and 1
71  * indicates toclient.
72  * \param f Pointer to the flow.
73  * \param ssn Pointer to the tcp session.
74  * \param dummy Indicates to create a dummy pseudo packet. Not all pseudo
75  * packets need to force reassembly, in which case we just
76  * set dummy ack/seq values.
77  */
78 static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p,
79  int direction,
80  Flow *f,
81  TcpSession *ssn)
82 {
83  p->tenant_id = f->tenant_id;
84  p->datalink = DLT_RAW;
85  p->proto = IPPROTO_TCP;
86  FlowReference(&p->flow, f);
87  p->flags |= PKT_STREAM_EST;
88  p->flags |= PKT_STREAM_EOF;
89  p->flags |= PKT_HAS_FLOW;
91  p->vlan_id[0] = f->vlan_id[0];
92  p->vlan_id[1] = f->vlan_id[1];
93  p->vlan_idx = f->vlan_idx;
94  p->livedev = (struct LiveDevice_ *)f->livedev;
95 
98  }
101  }
102 
103  if (direction == 0)
105  else
108  p->payload = NULL;
109  p->payload_len = 0;
110 
111  /* apply reversed flow logic after setting direction to the packet */
112  direction ^= ((f->flags & FLOW_DIR_REVERSED) != 0);
113 
114  if (FLOW_IS_IPV4(f)) {
115  if (direction == 0) {
118  p->sp = f->sp;
119  p->dp = f->dp;
120  } else {
123  p->sp = f->dp;
124  p->dp = f->sp;
125  }
126 
127  /* Check if we have enough room in direct data. We need ipv4 hdr + tcp hdr.
128  * Force an allocation if it is not the case.
129  */
130  if (GET_PKT_DIRECT_MAX_SIZE(p) < 40) {
131  if (PacketCallocExtPkt(p, 40) == -1) {
132  goto error;
133  }
134  }
135  /* set the ip header */
136  p->ip4h = (IPV4Hdr *)GET_PKT_DATA(p);
137  /* version 4 and length 20 bytes for the tcp header */
138  p->ip4h->ip_verhl = 0x45;
139  p->ip4h->ip_tos = 0;
140  p->ip4h->ip_len = htons(40);
141  p->ip4h->ip_id = 0;
142  p->ip4h->ip_off = 0;
143  p->ip4h->ip_ttl = 64;
144  p->ip4h->ip_proto = IPPROTO_TCP;
145  //p->ip4h->ip_csum =
146  if (direction == 0) {
147  p->ip4h->s_ip_src.s_addr = f->src.addr_data32[0];
148  p->ip4h->s_ip_dst.s_addr = f->dst.addr_data32[0];
149  } else {
150  p->ip4h->s_ip_src.s_addr = f->dst.addr_data32[0];
151  p->ip4h->s_ip_dst.s_addr = f->src.addr_data32[0];
152  }
153 
154  /* set the tcp header */
155  p->tcph = (TCPHdr *)((uint8_t *)GET_PKT_DATA(p) + 20);
156 
157  SET_PKT_LEN(p, 40); /* ipv4 hdr + tcp hdr */
158 
159  } else if (FLOW_IS_IPV6(f)) {
160  if (direction == 0) {
163  p->sp = f->sp;
164  p->dp = f->dp;
165  } else {
168  p->sp = f->dp;
169  p->dp = f->sp;
170  }
171 
172  /* Check if we have enough room in direct data. We need ipv6 hdr + tcp hdr.
173  * Force an allocation if it is not the case.
174  */
175  if (GET_PKT_DIRECT_MAX_SIZE(p) < 60) {
176  if (PacketCallocExtPkt(p, 60) == -1) {
177  goto error;
178  }
179  }
180  /* set the ip header */
181  p->ip6h = (IPV6Hdr *)GET_PKT_DATA(p);
182  /* version 6 */
183  p->ip6h->s_ip6_vfc = 0x60;
184  p->ip6h->s_ip6_flow = 0;
185  p->ip6h->s_ip6_nxt = IPPROTO_TCP;
186  p->ip6h->s_ip6_plen = htons(20);
187  p->ip6h->s_ip6_hlim = 64;
188  if (direction == 0) {
189  p->ip6h->s_ip6_src[0] = f->src.addr_data32[0];
190  p->ip6h->s_ip6_src[1] = f->src.addr_data32[1];
191  p->ip6h->s_ip6_src[2] = f->src.addr_data32[2];
192  p->ip6h->s_ip6_src[3] = f->src.addr_data32[3];
193  p->ip6h->s_ip6_dst[0] = f->dst.addr_data32[0];
194  p->ip6h->s_ip6_dst[1] = f->dst.addr_data32[1];
195  p->ip6h->s_ip6_dst[2] = f->dst.addr_data32[2];
196  p->ip6h->s_ip6_dst[3] = f->dst.addr_data32[3];
197  } else {
198  p->ip6h->s_ip6_src[0] = f->dst.addr_data32[0];
199  p->ip6h->s_ip6_src[1] = f->dst.addr_data32[1];
200  p->ip6h->s_ip6_src[2] = f->dst.addr_data32[2];
201  p->ip6h->s_ip6_src[3] = f->dst.addr_data32[3];
202  p->ip6h->s_ip6_dst[0] = f->src.addr_data32[0];
203  p->ip6h->s_ip6_dst[1] = f->src.addr_data32[1];
204  p->ip6h->s_ip6_dst[2] = f->src.addr_data32[2];
205  p->ip6h->s_ip6_dst[3] = f->src.addr_data32[3];
206  }
207 
208  /* set the tcp header */
209  p->tcph = (TCPHdr *)((uint8_t *)GET_PKT_DATA(p) + 40);
210 
211  SET_PKT_LEN(p, 60); /* ipv6 hdr + tcp hdr */
212  }
213 
214  p->tcph->th_offx2 = 0x50;
215  p->tcph->th_flags |= TH_ACK;
216  p->tcph->th_win = 10;
217  p->tcph->th_urp = 0;
218 
219  /* to server */
220  if (direction == 0) {
221  p->tcph->th_sport = htons(f->sp);
222  p->tcph->th_dport = htons(f->dp);
223 
224  p->tcph->th_seq = htonl(ssn->client.next_seq);
225  p->tcph->th_ack = htonl(ssn->server.last_ack);
226 
227  /* to client */
228  } else {
229  p->tcph->th_sport = htons(f->dp);
230  p->tcph->th_dport = htons(f->sp);
231 
232  p->tcph->th_seq = htonl(ssn->server.next_seq);
233  p->tcph->th_ack = htonl(ssn->client.last_ack);
234  }
235 
236  if (FLOW_IS_IPV4(f)) {
237  p->tcph->th_sum = TCPChecksum(p->ip4h->s_ip_addrs,
238  (uint16_t *)p->tcph, 20, 0);
239  /* calc ipv4 csum as we may log it and barnyard might reject
240  * a wrong checksum */
241  p->ip4h->ip_csum = IPV4Checksum((uint16_t *)p->ip4h,
242  IPV4_GET_RAW_HLEN(p->ip4h), 0);
243  } else if (FLOW_IS_IPV6(f)) {
244  p->tcph->th_sum = TCPChecksum(p->ip6h->s_ip6_addrs,
245  (uint16_t *)p->tcph, 20, 0);
246  }
247 
248  memset(&p->ts, 0, sizeof(struct timeval));
249  TimeGet(&p->ts);
250 
251  if (direction == 0) {
252  if (f->alparser && !STREAM_HAS_SEEN_DATA(&ssn->client)) {
254  }
255  } else {
256  if (f->alparser && !STREAM_HAS_SEEN_DATA(&ssn->server)) {
258  }
259  }
260 
261  return p;
262 
263 error:
264  FlowDeReference(&p->flow);
265  return NULL;
266 }
267 
269  Flow *f,
270  TcpSession *ssn);
272  Flow *f,
273  TcpSession *ssn)
274 {
275  PacketPoolWait();
277  if (p == NULL) {
278  return NULL;
279  }
280 
282 
283  return FlowForceReassemblyPseudoPacketSetup(p, direction, f, ssn);
284 }
285 
286 /**
287  * \brief Check if a flow needs forced reassembly, or any other processing
288  *
289  * \param f *LOCKED* flow
290  *
291  * \retval 0 no
292  * \retval 1 yes
293  */
295 {
296 
297  if (f == NULL || f->protoctx == NULL) {
298  SCReturnInt(0);
299  }
300 
301  TcpSession *ssn = (TcpSession *)f->protoctx;
302  int client = StreamNeedsReassembly(ssn, STREAM_TOSERVER);
303  int server = StreamNeedsReassembly(ssn, STREAM_TOCLIENT);
304 
305  /* if state is not fully closed we assume that we haven't fully
306  * inspected the app layer state yet */
307  if (ssn->state >= TCP_ESTABLISHED && ssn->state != TCP_CLOSED)
308  {
311  }
312 
313  /* if app layer still needs some love, push through */
314  if (f->alproto != ALPROTO_UNKNOWN && f->alstate != NULL) {
315  const uint64_t total_txs = AppLayerParserGetTxCnt(f, f->alstate);
316 
318  {
320  }
322  {
324  }
325  }
326 
327  /* nothing to do */
328  if (client == STREAM_HAS_UNPROCESSED_SEGMENTS_NONE &&
330  SCReturnInt(0);
331  }
332 
333  f->ffr_ts = client;
334  f->ffr_tc = server;
335  SCReturnInt(1);
336 }
337 
338 /**
339  * \internal
340  * \brief Forces reassembly for flow if it needs it.
341  *
342  * The function requires flow to be locked beforehand.
343  *
344  * \param f Pointer to the flow.
345  *
346  * \retval 0 This flow doesn't need any reassembly processing; 1 otherwise.
347  */
349 {
350  const int thread_id = (int)f->thread_id[0];
351  TmThreadsInjectFlowById(f, thread_id);
352 }
353 
354 /**
355  * \internal
356  * \brief Forces reassembly for flows that need it.
357  *
358  * When this function is called we're running in virtually dead engine,
359  * so locking the flows is not strictly required. The reasons it is still
360  * done are:
361  * - code consistency
362  * - silence complaining profilers
363  * - allow us to aggressively check using debug valdation assertions
364  * - be robust in case of future changes
365  * - locking overhead if neglectable when no other thread fights us
366  *
367  * \param q The queue to process flows from.
368  */
369 static inline void FlowForceReassemblyForHash(void)
370 {
371  for (uint32_t idx = 0; idx < flow_config.hash_size; idx++) {
372  FlowBucket *fb = &flow_hash[idx];
373 
375  FBLOCK_LOCK(fb);
376 
377  Flow *f = fb->head;
378  Flow *prev_f = NULL;
379 
380  /* we need to loop through all the flows in the queue */
381  while (f != NULL) {
382  Flow *next_f = f->next;
384 
385  FLOWLOCK_WRLOCK(f);
386 
387  /* Get the tcp session for the flow */
388  TcpSession *ssn = (TcpSession *)f->protoctx;
389  /* \todo Also skip flows that shouldn't be inspected */
390  if (ssn == NULL) {
391  FLOWLOCK_UNLOCK(f);
392  prev_f = f;
393  f = next_f;
394  continue;
395  }
396 
397  /* in case of additional work, we pull the flow out of the
398  * hash and xfer ownership to the injected packet(s) */
399  if (FlowForceReassemblyNeedReassembly(f) == 1) {
400  RemoveFromHash(f, prev_f);
403  f = next_f;
404  continue;
405  }
406 
407  FLOWLOCK_UNLOCK(f);
408 
409  /* next flow in the queue */
410  prev_f = f;
411  f = f->next;
412  }
413  FBLOCK_UNLOCK(fb);
414  }
415  return;
416 }
417 
418 /**
419  * \brief Force reassembly for all the flows that have unprocessed segments.
420  */
422 {
423  /* Carry out flow reassembly for unattended flows */
424  FlowForceReassemblyForHash();
425  return;
426 }
Flow_::ffr_tc
uint8_t ffr_tc
Definition: flow.h:381
util-byte.h
host.h
tm-threads.h
Packet_::proto
uint8_t proto
Definition: decode.h:436
DecodeSetNoPacketInspectionFlag
#define DecodeSetNoPacketInspectionFlag(p)
Set the No packet inspection Flag for the packet.
Definition: decode.h:995
FlowForceReassemblyForFlow
void FlowForceReassemblyForFlow(Flow *f)
Definition: flow-timeout.c:348
Flow_::ffr_ts
uint8_t ffr_ts
Definition: flow.h:380
FLOW_IS_IPV6
#define FLOW_IS_IPV6(f)
Definition: flow.h:154
PKT_HAS_FLOW
#define PKT_HAS_FLOW
Definition: decode.h:1109
IPV4Hdr_::ip_ttl
uint8_t ip_ttl
Definition: decode-ipv4.h:77
flow-util.h
FBLOCK_LOCK
#define FBLOCK_LOCK(fb)
Definition: flow-hash.h:71
Packet_::vlan_id
uint16_t vlan_id[2]
Definition: decode.h:441
stream-tcp.h
FlowCnf_::hash_size
uint32_t hash_size
Definition: flow.h:285
Packet_::payload
uint8_t * payload
Definition: decode.h:549
Packet_::flags
uint32_t flags
Definition: decode.h:449
Packet_::vlan_idx
uint8_t vlan_idx
Definition: decode.h:442
flow-private.h
Flow_
Flow data structure.
Definition: flow.h:347
LiveDevice_
Definition: util-device.h:40
flow-hash.h
FLOW_NOPAYLOAD_INSPECTION
#define FLOW_NOPAYLOAD_INSPECTION
Definition: flow.h:62
Flow_::vlan_id
uint16_t vlan_id[2]
Definition: flow.h:367
FlowForceReassembly
void FlowForceReassembly(void)
Force reassembly for all the flows that have unprocessed segments.
Definition: flow-timeout.c:421
IPV4Hdr_::ip_id
uint16_t ip_id
Definition: decode-ipv4.h:75
FLOW_PKT_TOSERVER
#define FLOW_PKT_TOSERVER
Definition: flow.h:219
TCP_ESTABLISHED
@ TCP_ESTABLISHED
Definition: stream-tcp-private.h:143
IPV4Hdr_::ip_tos
uint8_t ip_tos
Definition: decode-ipv4.h:73
StreamNeedsReassembly
int StreamNeedsReassembly(const TcpSession *ssn, uint8_t direction)
see what if any work the TCP session still needs
Definition: stream-tcp-reassemble.c:789
util-privs.h
stream-tcp-reassemble.h
Flow_::dp
Port dp
Definition: flow.h:359
Packet_::flowflags
uint8_t flowflags
Definition: decode.h:445
APP_LAYER_PARSER_EOF_TS
#define APP_LAYER_PARSER_EOF_TS
Definition: app-layer-parser.h:41
Flow_::protoctx
void * protoctx
Definition: flow.h:441
GET_PKT_DIRECT_MAX_SIZE
#define GET_PKT_DIRECT_MAX_SIZE(p)
Definition: decode.h:233
Packet_::payload_len
uint16_t payload_len
Definition: decode.h:550
util-unittest.h
util-unittest-helper.h
FLOWLOCK_UNLOCK
#define FLOWLOCK_UNLOCK(fb)
Definition: flow.h:264
TmThreadsInjectFlowById
void TmThreadsInjectFlowById(Flow *f, const int id)
inject a flow into a threads flow queue
Definition: tm-threads.c:2308
FLOW_COPY_IPV6_ADDR_TO_PACKET
#define FLOW_COPY_IPV6_ADDR_TO_PACKET(fa, pa)
Definition: flow.h:167
Packet_::datalink
int datalink
Definition: decode.h:583
TcpStream_::last_ack
uint32_t last_ack
Definition: stream-tcp-private.h:103
IPV4Hdr_::ip_len
uint16_t ip_len
Definition: decode-ipv4.h:74
Flow_::alparser
AppLayerParserState * alparser
Definition: flow.h:475
Flow_::dst
FlowAddress dst
Definition: flow.h:350
SET_PKT_LEN
#define SET_PKT_LEN(p, len)
Definition: decode.h:235
decode.h
util-debug.h
AppLayerParserGetTransactionActive
uint64_t AppLayerParserGetTransactionActive(const Flow *f, AppLayerParserState *pstate, uint8_t direction)
Definition: app-layer-parser.c:1105
STREAM_HAS_SEEN_DATA
#define STREAM_HAS_SEEN_DATA(stream)
Definition: stream-tcp-private.h:92
PKT_PSEUDO_STREAM_END
#define PKT_PSEUDO_STREAM_END
Definition: decode.h:1110
DecodeSetNoPayloadInspectionFlag
#define DecodeSetNoPayloadInspectionFlag(p)
Set the No payload inspection Flag for the packet.
Definition: decode.h:983
STREAM_TOSERVER
#define STREAM_TOSERVER
Definition: stream.h:31
FLOWLOCK_WRLOCK
#define FLOWLOCK_WRLOCK(fb)
Definition: flow.h:261
FlowForceReassemblyNeedReassembly
int FlowForceReassemblyNeedReassembly(Flow *f)
Check if a flow needs forced reassembly, or any other processing.
Definition: flow-timeout.c:294
GET_PKT_DATA
#define GET_PKT_DATA(p)
Definition: decode.h:231
STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION
Definition: stream-tcp.h:174
PacketPoolWaitForN
void PacketPoolWaitForN(int n)
Wait until we have the requested amount of packets in the pool.
Definition: tmqh-packetpool.c:113
detect.h
Flow_::flow_end_flags
uint8_t flow_end_flags
Definition: flow.h:447
pkt-var.h
Packet_::sp
Port sp
Definition: decode.h:421
IPV4_GET_RAW_HLEN
#define IPV4_GET_RAW_HLEN(ip4h)
Definition: decode-ipv4.h:95
TcpSession_::state
uint8_t state
Definition: stream-tcp-private.h:262
TH_ACK
#define TH_ACK
Definition: decode-tcp.h:38
util-time.h
app-layer-parser.h
FLOW_IS_IPV4
#define FLOW_IS_IPV4(f)
Definition: flow.h:152
util-profiling.h
PacketCallocExtPkt
int PacketCallocExtPkt(Packet *p, int datalen)
Definition: decode.c:195
PacketPoolWait
void PacketPoolWait(void)
Definition: tmqh-packetpool.c:84
stream.h
IPV6Hdr_
Definition: decode-ipv6.h:32
Packet_
Definition: decode.h:414
stream-tcp-private.h
APP_LAYER_PARSER_EOF_TC
#define APP_LAYER_PARSER_EOF_TC
Definition: app-layer-parser.h:42
conf.h
Packet_::ip4h
IPV4Hdr * ip4h
Definition: decode.h:509
FBLOCK_UNLOCK
#define FBLOCK_UNLOCK(fb)
Definition: flow-hash.h:73
Packet_::livedev
struct LiveDevice_ * livedev
Definition: decode.h:562
PKT_STREAM_EOF
#define PKT_STREAM_EOF
Definition: decode.h:1108
Flow_::vlan_idx
uint8_t vlan_idx
Definition: flow.h:375
detect-engine-state.h
Data structures and function prototypes for keeping state for the detection engine.
flow-timeout.h
flow-queue.h
FLOW_PKT_TOCLIENT
#define FLOW_PKT_TOCLIENT
Definition: flow.h:220
runmodes.h
Flow_::src
FlowAddress src
Definition: flow.h:350
Flow_::next
struct Flow_ * next
Definition: flow.h:394
IPV4Hdr_
Definition: decode-ipv4.h:71
TCP_CLOSED
@ TCP_CLOSED
Definition: stream-tcp-private.h:150
flow_hash
FlowBucket * flow_hash
Definition: flow-hash.c:56
Packet_::flow
struct Flow_ * flow
Definition: decode.h:451
Packet_::tenant_id
uint32_t tenant_id
Definition: decode.h:603
Packet_::ts
struct timeval ts
Definition: decode.h:457
flow-manager.h
suricata-common.h
Packet_::tcph
TCPHdr * tcph
Definition: decode.h:531
flow_config
FlowConfig flow_config
Definition: flow.c:98
STREAM_TOCLIENT
#define STREAM_TOCLIENT
Definition: stream.h:32
FlowForceReassemblyPseudoPacketGet
Packet * FlowForceReassemblyPseudoPacketGet(int direction, Flow *f, TcpSession *ssn)
Definition: flow-timeout.c:271
TcpSession_::client
TcpStream client
Definition: stream-tcp-private.h:272
Flow_::livedev
struct LiveDevice_ * livedev
Definition: flow.h:396
PACKET_PROFILING_START
#define PACKET_PROFILING_START(p)
Definition: util-profiling.h:92
TcpStream_::next_seq
uint32_t next_seq
Definition: stream-tcp-private.h:102
threadvars.h
TcpSession_::server
TcpStream server
Definition: stream-tcp-private.h:271
Flow_::alstate
void * alstate
Definition: flow.h:476
Flow_::flags
uint32_t flags
Definition: flow.h:421
PacketPoolGetPacket
Packet * PacketPoolGetPacket(void)
Get a new packet from the packet pool.
Definition: tmqh-packetpool.c:185
ALPROTO_UNKNOWN
@ ALPROTO_UNKNOWN
Definition: app-layer-protos.h:29
util-random.h
FLOW_PKT_ESTABLISHED
#define FLOW_PKT_ESTABLISHED
Definition: flow.h:221
TimeGet
void TimeGet(struct timeval *tv)
Definition: util-time.c:153
IPV4Hdr_::ip_csum
uint16_t ip_csum
Definition: decode-ipv4.h:79
FLOW_END_FLAG_SHUTDOWN
#define FLOW_END_FLAG_SHUTDOWN
Definition: flow.h:236
suricata.h
Packet_::dst
Address dst
Definition: decode.h:419
AppLayerParserStateSetFlag
void AppLayerParserStateSetFlag(AppLayerParserState *pstate, uint8_t flag)
Definition: app-layer-parser.c:1640
STREAM_HAS_UNPROCESSED_SEGMENTS_NONE
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NONE
Definition: stream-tcp.h:171
FLOW_NOPACKET_INSPECTION
#define FLOW_NOPACKET_INSPECTION
Definition: flow.h:60
IPV4Hdr_::ip_off
uint16_t ip_off
Definition: decode-ipv4.h:76
Flow_::sp
Port sp
Definition: flow.h:352
Packet_::ip6h
IPV6Hdr * ip6h
Definition: decode.h:511
TcpSession_
Definition: stream-tcp-private.h:260
flow.h
Flow_::alproto
AppProto alproto
application level protocol
Definition: flow.h:450
Packet_::dp
Port dp
Definition: decode.h:429
FLOW_DIR_REVERSED
#define FLOW_DIR_REVERSED
Definition: flow.h:107
IPV4Hdr_::ip_proto
uint8_t ip_proto
Definition: decode-ipv4.h:78
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:304
flow-var.h
AppLayerParserGetTxCnt
uint64_t AppLayerParserGetTxCnt(const Flow *f, void *alstate)
Definition: app-layer-parser.c:1048
IPV4Hdr_::ip_verhl
uint8_t ip_verhl
Definition: decode-ipv4.h:72
Packet_::src
Address src
Definition: decode.h:418
Flow_::tenant_id
uint32_t tenant_id
Definition: flow.h:416
PKT_STREAM_EST
#define PKT_STREAM_EST
Definition: decode.h:1107
Flow_::thread_id
FlowThreadId thread_id[2]
Definition: flow.h:392
app-layer.h
FLOW_COPY_IPV4_ADDR_TO_PACKET
#define FLOW_COPY_IPV4_ADDR_TO_PACKET(fa, pa)
Definition: flow.h:162