suricata
output-json-flow.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2025 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 Victor Julien <victor@inliniac.net>
22  *
23  * Implements Flow JSON logging portion of the engine.
24  */
25 
26 #include "suricata-common.h"
27 #include "detect.h"
28 #include "pkt-var.h"
29 #include "conf.h"
30 #include "app-layer-parser.h"
31 
32 #include "threads.h"
33 #include "threadvars.h"
34 #include "tm-threads.h"
35 
36 #include "util-print.h"
37 #include "util-unittest.h"
38 
39 #include "util-debug.h"
40 
41 #include "output.h"
42 #include "util-privs.h"
43 #include "util-buffer.h"
44 #include "util-device-private.h"
45 #include "util-proto-name.h"
46 #include "util-logopenfile.h"
47 #include "util-time.h"
48 #include "output-json.h"
49 #include "output-json-flow.h"
50 
51 #include "stream-tcp.h"
52 #include "stream-tcp-private.h"
53 #include "flow-storage.h"
54 #include "util-exception-policy.h"
55 
56 static SCJsonBuilder *CreateEveHeaderFromFlow(const Flow *f)
57 {
58  char timebuf[64];
59  char srcip[46] = {0}, dstip[46] = {0};
60  Port sp, dp;
61 
62  SCJsonBuilder *jb = SCJbNewObject();
63  if (unlikely(jb == NULL)) {
64  return NULL;
65  }
66 
67  SCTime_t ts = TimeGet();
68 
69  CreateIsoTimeString(ts, timebuf, sizeof(timebuf));
70 
71  if ((f->flags & FLOW_DIR_REVERSED) == 0) {
72  if (FLOW_IS_IPV4(f)) {
73  PrintInet(AF_INET, (const void *)&(f->src.addr_data32[0]), srcip, sizeof(srcip));
74  PrintInet(AF_INET, (const void *)&(f->dst.addr_data32[0]), dstip, sizeof(dstip));
75  } else if (FLOW_IS_IPV6(f)) {
76  PrintInet(AF_INET6, (const void *)&(f->src.address), srcip, sizeof(srcip));
77  PrintInet(AF_INET6, (const void *)&(f->dst.address), dstip, sizeof(dstip));
78  }
79  sp = f->sp;
80  dp = f->dp;
81  } else {
82  if (FLOW_IS_IPV4(f)) {
83  PrintInet(AF_INET, (const void *)&(f->dst.addr_data32[0]), srcip, sizeof(srcip));
84  PrintInet(AF_INET, (const void *)&(f->src.addr_data32[0]), dstip, sizeof(dstip));
85  } else if (FLOW_IS_IPV6(f)) {
86  PrintInet(AF_INET6, (const void *)&(f->dst.address), srcip, sizeof(srcip));
87  PrintInet(AF_INET6, (const void *)&(f->src.address), dstip, sizeof(dstip));
88  }
89  sp = f->dp;
90  dp = f->sp;
91  }
92 
93  /* time */
94  SCJbSetString(jb, "timestamp", timebuf);
95 
96  CreateEveFlowId(jb, (const Flow *)f);
97 
98 #if 0 // TODO
99  /* sensor id */
100  if (sensor_id >= 0)
101  json_object_set_new(js, "sensor_id", json_integer(sensor_id));
102 #endif
103 
104  /* input interface */
105  if (f->livedev) {
106  SCJbSetString(jb, "in_iface", f->livedev->dev);
107  }
108 
109  JB_SET_STRING(jb, "event_type", "flow");
110 
111  /* vlan */
112  if (f->vlan_idx > 0) {
113  SCJbOpenArray(jb, "vlan");
114  SCJbAppendUint(jb, f->vlan_id[0]);
115  if (f->vlan_idx > 1) {
116  SCJbAppendUint(jb, f->vlan_id[1]);
117  }
118  if (f->vlan_idx > 2) {
119  SCJbAppendUint(jb, f->vlan_id[2]);
120  }
121  SCJbClose(jb);
122  }
123 
124  /* tuple */
125  SCJbSetString(jb, "src_ip", srcip);
126  switch(f->proto) {
127  case IPPROTO_ICMP:
128  break;
129  case IPPROTO_UDP:
130  case IPPROTO_TCP:
131  case IPPROTO_SCTP:
132  SCJbSetUint(jb, "src_port", sp);
133  break;
134  }
135  SCJbSetString(jb, "dest_ip", dstip);
136  switch(f->proto) {
137  case IPPROTO_ICMP:
138  break;
139  case IPPROTO_UDP:
140  case IPPROTO_TCP:
141  case IPPROTO_SCTP:
142  SCJbSetUint(jb, "dest_port", dp);
143  break;
144  }
145 
146  if (SCProtoNameValid(f->proto)) {
147  SCJbSetString(jb, "proto", known_proto[f->proto]);
148  } else {
149  char proto[4];
150  snprintf(proto, sizeof(proto), "%"PRIu8"", f->proto);
151  SCJbSetString(jb, "proto", proto);
152  }
153 
154  switch (f->proto) {
155  case IPPROTO_ICMP:
156  case IPPROTO_ICMPV6:
157  SCJbSetUint(jb, "icmp_type", f->icmp_s.type);
158  SCJbSetUint(jb, "icmp_code", f->icmp_s.code);
159  if (f->tosrcpktcnt) {
160  SCJbSetUint(jb, "response_icmp_type", f->icmp_d.type);
161  SCJbSetUint(jb, "response_icmp_code", f->icmp_d.code);
162  }
163  break;
164  case IPPROTO_ESP:
165  SCJbSetUint(jb, "spi", f->esp.spi);
166  break;
167  }
168  return jb;
169 }
170 
171 void EveAddAppProto(Flow *f, SCJsonBuilder *js)
172 {
173  if (f->alproto) {
174  SCJbSetString(js, "app_proto", AppProtoToString(f->alproto));
175  }
176  if (f->alproto_ts && f->alproto_ts != f->alproto) {
177  SCJbSetString(js, "app_proto_ts", AppProtoToString(f->alproto_ts));
178  }
179  if (f->alproto_tc && f->alproto_tc != f->alproto) {
180  SCJbSetString(js, "app_proto_tc", AppProtoToString(f->alproto_tc));
181  }
182  if (f->alproto_orig != f->alproto && f->alproto_orig != ALPROTO_UNKNOWN) {
183  SCJbSetString(js, "app_proto_orig", AppProtoToString(f->alproto_orig));
184  }
185  if (f->alproto_expect != f->alproto && f->alproto_expect != ALPROTO_UNKNOWN) {
186  SCJbSetString(js, "app_proto_expected", AppProtoToString(f->alproto_expect));
187  }
188 
189 }
190 
191 void EveAddFlow(Flow *f, SCJsonBuilder *js)
192 {
194  if (fc) {
195  SCJbSetUint(js, "pkts_toserver", f->todstpktcnt + fc->todstpktcnt);
196  SCJbSetUint(js, "pkts_toclient", f->tosrcpktcnt + fc->tosrcpktcnt);
197  SCJbSetUint(js, "bytes_toserver", f->todstbytecnt + fc->todstbytecnt);
198  SCJbSetUint(js, "bytes_toclient", f->tosrcbytecnt + fc->tosrcbytecnt);
199 
200  SCJbOpenObject(js, "bypassed");
201  SCJbSetUint(js, "pkts_toserver", fc->todstpktcnt);
202  SCJbSetUint(js, "pkts_toclient", fc->tosrcpktcnt);
203  SCJbSetUint(js, "bytes_toserver", fc->todstbytecnt);
204  SCJbSetUint(js, "bytes_toclient", fc->tosrcbytecnt);
205  SCJbClose(js);
206  } else {
207  SCJbSetUint(js, "pkts_toserver", f->todstpktcnt);
208  SCJbSetUint(js, "pkts_toclient", f->tosrcpktcnt);
209  SCJbSetUint(js, "bytes_toserver", f->todstbytecnt);
210  SCJbSetUint(js, "bytes_toclient", f->tosrcbytecnt);
211  }
212 
213  char timebuf1[64];
214  CreateIsoTimeString(f->startts, timebuf1, sizeof(timebuf1));
215  SCJbSetString(js, "start", timebuf1);
216 }
217 
218 static void EveExceptionPolicyLog(SCJsonBuilder *js, uint16_t flag)
219 {
221  SCJbStartObject(js);
222  SCJbSetString(js, "target",
224  SCJbSetString(js, "policy",
227  SCJbClose(js);
228  }
230  SCJbStartObject(js);
231  SCJbSetString(js, "target",
233  SCJbSetString(js, "policy",
236  SCJbClose(js);
237  }
239  SCJbStartObject(js);
240  SCJbSetString(js, "target",
242  SCJbSetString(js, "policy",
245  true));
246  SCJbClose(js);
247  }
249  SCJbStartObject(js);
250  SCJbSetString(
252  SCJbSetString(js, "policy",
255  SCJbClose(js);
256  }
257  if (flag & EXCEPTION_TARGET_FLAG_MIDSTREAM) {
258  SCJbStartObject(js);
259  SCJbSetString(
261  SCJbSetString(js, "policy",
264  SCJbClose(js);
265  }
267  SCJbStartObject(js);
268  SCJbSetString(js, "target",
270  SCJbSetString(js, "policy",
273  SCJbClose(js);
274  }
275 }
276 
277 /* Eve format logging */
278 static void EveFlowLogJSON(OutputJsonThreadCtx *aft, SCJsonBuilder *jb, Flow *f)
279 {
280  EveAddAppProto(f, jb);
281  SCJbOpenObject(jb, "flow");
282  EveAddFlow(f, jb);
283 
284  char timebuf2[64];
285  CreateIsoTimeString(f->lastts, timebuf2, sizeof(timebuf2));
286  SCJbSetString(jb, "end", timebuf2);
287 
288  uint64_t age = (SCTIME_SECS(f->lastts) - SCTIME_SECS(f->startts));
289  SCJbSetUint(jb, "age", age);
290 
292  JB_SET_TRUE(jb, "emergency");
293 
294  const int flow_state = f->flow_state;
295  switch (flow_state) {
296  case FLOW_STATE_NEW:
297  JB_SET_STRING(jb, "state", "new");
298  break;
300  JB_SET_STRING(jb, "state", "established");
301  break;
302  case FLOW_STATE_CLOSED:
303  JB_SET_STRING(jb, "state", "closed");
304  break;
306  JB_SET_STRING(jb, "state", "bypassed");
307  JB_SET_STRING(jb, "bypass", "local");
308  break;
309 #ifdef CAPTURE_OFFLOAD
310  case FLOW_STATE_CAPTURE_BYPASSED:
311  JB_SET_STRING(jb, "state", "bypassed");
312  JB_SET_STRING(jb, "bypass", "capture");
313  break;
314 #endif
315  case FLOW_STATE_SIZE:
317  SCLogDebug("invalid flow state: %d, contact developers", flow_state);
318  }
319 
320  const char *reason = NULL;
322  reason = "tcp_reuse";
323  else if (f->flow_end_flags & FLOW_END_FLAG_FORCED)
324  reason = "forced";
326  reason = "shutdown";
328  reason = "timeout";
329  else
330  reason = "unknown";
331 
332  SCJbSetString(jb, "reason", reason);
333 
334  SCJbSetBool(jb, "alerted", FlowHasAlerts(f));
335  if (f->flags & FLOW_WRONG_THREAD)
336  JB_SET_TRUE(jb, "wrong_thread");
337 
338  if (f->flags & FLOW_IS_ELEPHANT)
339  JB_SET_TRUE(jb, "elephant");
340 
341  if (f->flags & FLOW_ACTION_DROP) {
342  JB_SET_STRING(jb, "action", "drop");
343  } else if (f->flags & FLOW_ACTION_ACCEPT) {
344  JB_SET_STRING(jb, "action", "accept");
345  } else if (f->flags & FLOW_ACTION_PASS) {
346  JB_SET_STRING(jb, "action", "pass");
347  }
348  if (f->applied_exception_policy != 0) {
349  SCJbOpenArray(jb, "exception_policy");
350  EveExceptionPolicyLog(jb, f->applied_exception_policy);
351  SCJbClose(jb); /* close array */
352  }
353 
354  if (f->alstate) {
355  uint64_t tx_id = AppLayerParserGetTxCnt(f, f->alstate);
356  if (tx_id) {
357  SCJbSetUint(jb, "tx_cnt", tx_id);
358  }
359  }
360 
361  /* Close flow. */
362  SCJbClose(jb);
363 
364  EveAddCommonOptions(&aft->ctx->cfg, NULL, f, jb, LOG_DIR_FLOW);
365 
366  /* TCP */
367  if (f->proto == IPPROTO_TCP) {
368  SCJbOpenObject(jb, "tcp");
369 
370  TcpSession *ssn = f->protoctx;
371 
372  char hexflags[3];
373  snprintf(hexflags, sizeof(hexflags), "%02x",
374  ssn ? ssn->tcp_packet_flags : 0);
375  SCJbSetString(jb, "tcp_flags", hexflags);
376 
377  snprintf(hexflags, sizeof(hexflags), "%02x",
378  ssn ? ssn->client.tcp_flags : 0);
379  SCJbSetString(jb, "tcp_flags_ts", hexflags);
380 
381  snprintf(hexflags, sizeof(hexflags), "%02x",
382  ssn ? ssn->server.tcp_flags : 0);
383  SCJbSetString(jb, "tcp_flags_tc", hexflags);
384 
385  EveTcpFlags(ssn ? ssn->tcp_packet_flags : 0, jb);
386 
387  if (ssn) {
388  const char *tcp_state = StreamTcpStateAsString(ssn->state);
389  if (tcp_state != NULL)
390  SCJbSetString(jb, "state", tcp_state);
392  JB_SET_TRUE(jb, "tc_gap");
393  }
395  JB_SET_TRUE(jb, "ts_gap");
396  }
397 
398  SCJbSetUint(jb, "ts_max_regions", ssn->client.sb.max_regions);
399  SCJbSetUint(jb, "tc_max_regions", ssn->server.sb.max_regions);
400 
401  if (ssn->urg_offset_ts)
402  SCJbSetUint(jb, "ts_urgent_oob_data", ssn->urg_offset_ts);
403  if (ssn->urg_offset_tc)
404  SCJbSetUint(jb, "tc_urgent_oob_data", ssn->urg_offset_tc);
405  }
406 
407  /* Close tcp. */
408  SCJbClose(jb);
409  }
410 }
411 
412 static int JsonFlowLogger(ThreadVars *tv, void *thread_data, Flow *f)
413 {
414  SCEnter();
415  OutputJsonThreadCtx *thread = thread_data;
416 
417  /* reset */
418  MemBufferReset(thread->buffer);
419 
420  SCJsonBuilder *jb = CreateEveHeaderFromFlow(f);
421  if (unlikely(jb == NULL)) {
423  }
424 
425  EveFlowLogJSON(thread, jb, f);
426 
427  OutputJsonBuilderBuffer(tv, NULL, f, jb, thread);
428  SCJbFree(jb);
429 
431 }
432 
434 {
435  /* register as child of eve-log */
436  OutputRegisterFlowSubModule(LOGGER_JSON_FLOW, "eve-log", "JsonFlowLog", "eve-log.flow",
438 }
util-device-private.h
tm-threads.h
ts
uint64_t ts
Definition: source-erf-file.c:55
FLOW_IS_IPV6
#define FLOW_IS_IPV6(f)
Definition: flow.h:172
Flow_::icmp_s
struct Flow_::@118::@124 icmp_s
FLOW_STATE_ESTABLISHED
@ FLOW_STATE_ESTABLISHED
Definition: flow.h:505
CreateIsoTimeString
void CreateIsoTimeString(const SCTime_t ts, char *str, size_t size)
Definition: util-time.c:209
OutputJsonThreadCtx_::ctx
OutputJsonCtx * ctx
Definition: output-json.h:84
EveAddFlow
void EveAddFlow(Flow *f, SCJsonBuilder *js)
Definition: output-json-flow.c:191
Flow_::startts
SCTime_t startts
Definition: flow.h:493
stream-tcp.h
OutputJsonCtx_::cfg
OutputJsonCommonSettings cfg
Definition: output-json.h:78
GetFlowBypassInfoID
FlowStorageId GetFlowBypassInfoID(void)
Definition: flow-util.c:222
FlowBypassInfo_
Definition: flow.h:529
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:269
Flow_::proto
uint8_t proto
Definition: flow.h:378
EveAddAppProto
void EveAddAppProto(Flow *f, SCJsonBuilder *js)
Definition: output-json-flow.c:171
JsonLogThreadInit
TmEcode JsonLogThreadInit(ThreadVars *t, const void *initdata, void **data)
Definition: output-json-common.c:99
threads.h
Flow_
Flow data structure.
Definition: flow.h:356
AppProtoToString
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
Definition: app-layer-protos.c:40
EXCEPTION_TARGET_FLAG_APPLAYER_ERROR
#define EXCEPTION_TARGET_FLAG_APPLAYER_ERROR
Definition: util-exception-policy-types.h:49
Flow_::alproto_orig
AppProto alproto_orig
Definition: flow.h:456
SCProtoNameValid
bool SCProtoNameValid(uint16_t proto)
Function to check if the received protocol number is valid and do we have corresponding name entry fo...
Definition: util-proto-name.c:453
StreamingBuffer_::max_regions
uint16_t max_regions
Definition: util-streaming-buffer.h:114
EveTcpFlags
void EveTcpFlags(const uint8_t flags, SCJsonBuilder *js)
jsonify tcp flags field Only add 'true' fields in an attempt to keep things reasonably compact.
Definition: output-json.c:450
FlowBypassInfo_::tosrcbytecnt
uint64_t tosrcbytecnt
Definition: flow.h:534
TcpSession_::urg_offset_ts
uint16_t urg_offset_ts
Definition: stream-tcp-private.h:291
util-privs.h
known_proto
const char * known_proto[256]
Definition: util-proto-name.c:40
FLOW_ACTION_DROP
#define FLOW_ACTION_DROP
Definition: flow.h:70
TcpStream_::flags
uint16_t flags
Definition: stream-tcp-private.h:107
OutputJsonBuilderBuffer
void OutputJsonBuilderBuffer(ThreadVars *tv, const Packet *p, Flow *f, SCJsonBuilder *js, OutputJsonThreadCtx *ctx)
Definition: output-json.c:992
proto
uint8_t proto
Definition: decode-template.h:0
CreateEveFlowId
void CreateEveFlowId(SCJsonBuilder *js, const Flow *f)
Definition: output-json.c:700
Flow_::dp
Port dp
Definition: flow.h:372
Flow_::protoctx
void * protoctx
Definition: flow.h:441
ExceptionPolicyTargetFlagToString
const char * ExceptionPolicyTargetFlagToString(uint8_t target_flag)
Definition: util-exception-policy.c:95
JsonFlowLogRegister
void JsonFlowLogRegister(void)
Definition: output-json-flow.c:433
util-unittest.h
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:81
Flow_::flow_state
FlowStateType flow_state
Definition: flow.h:412
OutputJsonThreadCtx_
Definition: output-json.h:83
LOGGER_JSON_FLOW
@ LOGGER_JSON_FLOW
Definition: suricata-common.h:503
Flow_::tosrcbytecnt
uint64_t tosrcbytecnt
Definition: flow.h:498
OutputJsonLogInitSub
OutputInitResult OutputJsonLogInitSub(SCConfNode *conf, OutputCtx *parent_ctx)
Definition: output-json-common.c:82
FLOW_ACTION_PASS
#define FLOW_ACTION_PASS
Definition: flow.h:117
Flow_::dst
FlowAddress dst
Definition: flow.h:359
OutputRegisterFlowSubModule
void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a flow output sub-module.
Definition: output.c:472
FLOW_STATE_LOCAL_BYPASSED
@ FLOW_STATE_LOCAL_BYPASSED
Definition: flow.h:507
EXCEPTION_TARGET_FLAG_DEFRAG_MEMCAP
#define EXCEPTION_TARGET_FLAG_DEFRAG_MEMCAP
Definition: util-exception-policy-types.h:44
ExceptionPolicyTargetPolicy
enum ExceptionPolicy ExceptionPolicyTargetPolicy(uint8_t target_flag)
Definition: util-exception-policy.c:115
util-debug.h
JB_SET_STRING
#define JB_SET_STRING(jb, key, val)
Definition: rust.h:26
output-json-flow.h
FlowBypassInfo_::todstbytecnt
uint64_t todstbytecnt
Definition: flow.h:536
Flow_::icmp_d
struct Flow_::@120::@126 icmp_d
EveAddCommonOptions
void EveAddCommonOptions(const OutputJsonCommonSettings *cfg, const Packet *p, const Flow *f, SCJsonBuilder *js, enum SCOutputJsonLogDirection dir)
Definition: output-json.c:398
Flow_::todstpktcnt
uint32_t todstpktcnt
Definition: flow.h:495
output-json.h
util-exception-policy.h
FlowAddress_::address
union FlowAddress_::@117 address
TcpSession_::urg_offset_tc
uint16_t urg_offset_tc
Definition: stream-tcp-private.h:292
Flow_::lastts
SCTime_t lastts
Definition: flow.h:410
util-print.h
SCEnter
#define SCEnter(...)
Definition: util-debug.h:271
detect.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
PrintInet
const char * PrintInet(int af, const void *src, char *dst, socklen_t size)
Definition: util-print.c:231
Flow_::flow_end_flags
uint8_t flow_end_flags
Definition: flow.h:447
pkt-var.h
TcpSession_::state
uint8_t state
Definition: stream-tcp-private.h:285
FlowBypassInfo_::todstpktcnt
uint64_t todstpktcnt
Definition: flow.h:535
FLOW_WRONG_THREAD
#define FLOW_WRONG_THREAD
Definition: flow.h:110
util-time.h
JB_SET_TRUE
#define JB_SET_TRUE(jb, key)
Definition: rust.h:27
LiveDevice_::dev
char * dev
Definition: util-device-private.h:33
TcpSession_::tcp_packet_flags
uint8_t tcp_packet_flags
Definition: stream-tcp-private.h:290
Flow_::esp
struct Flow_::@118::@125 esp
LOG_DIR_FLOW
@ LOG_DIR_FLOW
Definition: output-eve-bindgen.h:33
app-layer-parser.h
Flow_::todstbytecnt
uint64_t todstbytecnt
Definition: flow.h:497
FLOW_IS_IPV4
#define FLOW_IS_IPV4(f)
Definition: flow.h:170
TimeGet
SCTime_t TimeGet(void)
Definition: util-time.c:152
stream-tcp-private.h
FLOW_END_FLAG_TCPREUSE
#define FLOW_END_FLAG_TCPREUSE
Definition: flow.h:246
conf.h
Port
uint16_t Port
Definition: decode.h:218
FLOW_END_FLAG_EMERGENCY
#define FLOW_END_FLAG_EMERGENCY
Definition: flow.h:242
SCTime_t
Definition: util-time.h:40
STREAMTCP_STREAM_FLAG_HAS_GAP
#define STREAMTCP_STREAM_FLAG_HAS_GAP
Definition: stream-tcp-private.h:217
EXCEPTION_TARGET_FLAG_REASSEMBLY_MEMCAP
#define EXCEPTION_TARGET_FLAG_REASSEMBLY_MEMCAP
Definition: util-exception-policy-types.h:46
Flow_::vlan_idx
uint8_t vlan_idx
Definition: flow.h:382
FLOW_IS_ELEPHANT
#define FLOW_IS_ELEPHANT
Definition: flow.h:59
util-proto-name.h
FlowBypassInfo_::tosrcpktcnt
uint64_t tosrcpktcnt
Definition: flow.h:533
Flow_::alproto_expect
AppProto alproto_expect
Definition: flow.h:459
FLOW_STATE_SIZE
#define FLOW_STATE_SIZE
Definition: flow.h:515
FlowGetStorageById
void * FlowGetStorageById(const Flow *f, FlowStorageId id)
Definition: flow-storage.c:40
Flow_::src
FlowAddress src
Definition: flow.h:359
EXCEPTION_TARGET_FLAG_MIDSTREAM
#define EXCEPTION_TARGET_FLAG_MIDSTREAM
Definition: util-exception-policy-types.h:48
flow-storage.h
OutputJsonThreadCtx_::buffer
MemBuffer * buffer
Definition: output-json.h:86
Flow_::applied_exception_policy
uint8_t applied_exception_policy
Definition: flow.h:473
FLOW_STATE_NEW
@ FLOW_STATE_NEW
Definition: flow.h:504
suricata-common.h
EXCEPTION_TARGET_FLAG_SESSION_MEMCAP
#define EXCEPTION_TARGET_FLAG_SESSION_MEMCAP
Definition: util-exception-policy-types.h:45
TcpStream_::sb
StreamingBuffer sb
Definition: stream-tcp-private.h:135
SCTIME_SECS
#define SCTIME_SECS(t)
Definition: util-time.h:57
TcpSession_::client
TcpStream client
Definition: stream-tcp-private.h:297
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
Flow_::livedev
struct LiveDevice_ * livedev
Definition: flow.h:398
FLOW_ACTION_ACCEPT
#define FLOW_ACTION_ACCEPT
Definition: flow.h:62
threadvars.h
TcpSession_::server
TcpStream server
Definition: stream-tcp-private.h:296
FLOW_STATE_CLOSED
@ FLOW_STATE_CLOSED
Definition: flow.h:506
ExceptionPolicyEnumToString
const char * ExceptionPolicyEnumToString(enum ExceptionPolicy policy, bool is_json)
Definition: util-exception-policy.c:39
Flow_::alproto_ts
AppProto alproto_ts
Definition: flow.h:451
util-logopenfile.h
Flow_::alstate
void * alstate
Definition: flow.h:479
Flow_::flags
uint32_t flags
Definition: flow.h:421
util-buffer.h
ALPROTO_UNKNOWN
@ ALPROTO_UNKNOWN
Definition: app-layer-protos.h:29
FLOW_END_FLAG_SHUTDOWN
#define FLOW_END_FLAG_SHUTDOWN
Definition: flow.h:245
EXCEPTION_TARGET_FLAG_FLOW_MEMCAP
#define EXCEPTION_TARGET_FLAG_FLOW_MEMCAP
Definition: util-exception-policy-types.h:47
StreamTcpStateAsString
const char * StreamTcpStateAsString(const enum TcpState state)
Definition: stream-tcp.c:7112
Flow_::vlan_id
uint16_t vlan_id[VLAN_MAX_LAYERS]
Definition: flow.h:380
FlowHasAlerts
int FlowHasAlerts(const Flow *f)
Check if flow has alerts.
Definition: flow.c:163
FLOW_END_FLAG_TIMEOUT
#define FLOW_END_FLAG_TIMEOUT
Definition: flow.h:243
IPPROTO_SCTP
#define IPPROTO_SCTP
Definition: decode.h:1215
Flow_::sp
Port sp
Definition: flow.h:361
JsonLogThreadDeinit
TmEcode JsonLogThreadDeinit(ThreadVars *t, void *data)
Definition: output-json-common.c:132
TcpSession_
Definition: stream-tcp-private.h:283
Flow_::alproto_tc
AppProto alproto_tc
Definition: flow.h:452
Flow_::alproto
AppProto alproto
application level protocol
Definition: flow.h:450
FLOW_END_FLAG_FORCED
#define FLOW_END_FLAG_FORCED
Definition: flow.h:244
FLOW_DIR_REVERSED
#define FLOW_DIR_REVERSED
Definition: flow.h:112
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:275
AppLayerParserGetTxCnt
uint64_t AppLayerParserGetTxCnt(const Flow *f, void *alstate)
Definition: app-layer-parser.c:1101
TcpStream_::tcp_flags
uint8_t tcp_flags
Definition: stream-tcp-private.h:111
DEBUG_VALIDATE_BUG_ON
#define DEBUG_VALIDATE_BUG_ON(exp)
Definition: util-validate.h:102
Flow_::tosrcpktcnt
uint32_t tosrcpktcnt
Definition: flow.h:496
output.h