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, OutputJsonCommonSettings *cfg)
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)) {
77  (const void *)&(f->src.address), srcip, sizeof(srcip), cfg->compress_ipv6);
79  (const void *)&(f->dst.address), dstip, sizeof(dstip), cfg->compress_ipv6);
80  }
81  sp = f->sp;
82  dp = f->dp;
83  } else {
84  if (FLOW_IS_IPV4(f)) {
85  PrintInet(AF_INET, (const void *)&(f->dst.addr_data32[0]), srcip, sizeof(srcip));
86  PrintInet(AF_INET, (const void *)&(f->src.addr_data32[0]), dstip, sizeof(dstip));
87  } else if (FLOW_IS_IPV6(f)) {
89  (const void *)&(f->dst.address), srcip, sizeof(srcip), cfg->compress_ipv6);
91  (const void *)&(f->src.address), dstip, sizeof(dstip), cfg->compress_ipv6);
92  }
93  sp = f->dp;
94  dp = f->sp;
95  }
96 
97  /* time */
98  SCJbSetString(jb, "timestamp", timebuf);
99 
100  CreateEveFlowId(jb, (const Flow *)f);
101 
102 #if 0 // TODO
103  /* sensor id */
104  if (sensor_id >= 0)
105  json_object_set_new(js, "sensor_id", json_integer(sensor_id));
106 #endif
107 
108  /* input interface */
109  if (f->livedev) {
110  SCJbSetString(jb, "in_iface", f->livedev->dev);
111  }
112 
113  JB_SET_STRING(jb, "event_type", "flow");
114 
115  /* vlan */
116  if (f->vlan_idx > 0) {
117  SCJbOpenArray(jb, "vlan");
118  SCJbAppendUint(jb, f->vlan_id[0]);
119  if (f->vlan_idx > 1) {
120  SCJbAppendUint(jb, f->vlan_id[1]);
121  }
122  if (f->vlan_idx > 2) {
123  SCJbAppendUint(jb, f->vlan_id[2]);
124  }
125  SCJbClose(jb);
126  }
127 
128  /* tuple */
129  SCJbSetString(jb, "src_ip", srcip);
130  switch(f->proto) {
131  case IPPROTO_ICMP:
132  break;
133  case IPPROTO_UDP:
134  case IPPROTO_TCP:
135  case IPPROTO_SCTP:
136  SCJbSetUint(jb, "src_port", sp);
137  break;
138  }
139  SCJbSetString(jb, "dest_ip", dstip);
140  switch(f->proto) {
141  case IPPROTO_ICMP:
142  break;
143  case IPPROTO_UDP:
144  case IPPROTO_TCP:
145  case IPPROTO_SCTP:
146  SCJbSetUint(jb, "dest_port", dp);
147  break;
148  }
149 
150  /* ip version */
151  if (FLOW_IS_IPV4(f)) {
152  SCJbSetUint(jb, "ip_v", 4);
153  } else if (FLOW_IS_IPV6(f)) {
154  SCJbSetUint(jb, "ip_v", 6);
155  }
156 
157  if (SCProtoNameValid(f->proto)) {
158  SCJbSetString(jb, "proto", known_proto[f->proto]);
159  } else {
160  char proto[4];
161  snprintf(proto, sizeof(proto), "%"PRIu8"", f->proto);
162  SCJbSetString(jb, "proto", proto);
163  }
164 
165  switch (f->proto) {
166  case IPPROTO_ICMP:
167  case IPPROTO_ICMPV6:
168  SCJbSetUint(jb, "icmp_type", f->icmp_s.type);
169  SCJbSetUint(jb, "icmp_code", f->icmp_s.code);
170  if (f->tosrcpktcnt) {
171  SCJbSetUint(jb, "response_icmp_type", f->icmp_d.type);
172  SCJbSetUint(jb, "response_icmp_code", f->icmp_d.code);
173  }
174  break;
175  case IPPROTO_ESP:
176  SCJbSetUint(jb, "spi", f->esp.spi);
177  break;
178  }
179  return jb;
180 }
181 
182 void EveAddAppProto(Flow *f, SCJsonBuilder *js)
183 {
184  if (f->alproto) {
185  SCJbSetString(js, "app_proto", AppProtoToString(f->alproto));
186  }
187  if (f->alproto_ts && f->alproto_ts != f->alproto) {
188  SCJbSetString(js, "app_proto_ts", AppProtoToString(f->alproto_ts));
189  }
190  if (f->alproto_tc && f->alproto_tc != f->alproto) {
191  SCJbSetString(js, "app_proto_tc", AppProtoToString(f->alproto_tc));
192  }
193  if (f->alproto_orig != f->alproto && f->alproto_orig != ALPROTO_UNKNOWN) {
194  SCJbSetString(js, "app_proto_orig", AppProtoToString(f->alproto_orig));
195  }
196  if (f->alproto_expect != f->alproto && f->alproto_expect != ALPROTO_UNKNOWN) {
197  SCJbSetString(js, "app_proto_expected", AppProtoToString(f->alproto_expect));
198  }
199 
200 }
201 
202 void EveAddFlow(Flow *f, SCJsonBuilder *js)
203 {
205  if (fc) {
206  SCJbSetUint(js, "pkts_toserver", f->todstpktcnt + fc->todstpktcnt);
207  SCJbSetUint(js, "pkts_toclient", f->tosrcpktcnt + fc->tosrcpktcnt);
208  SCJbSetUint(js, "bytes_toserver", f->todstbytecnt + fc->todstbytecnt);
209  SCJbSetUint(js, "bytes_toclient", f->tosrcbytecnt + fc->tosrcbytecnt);
210 
211  SCJbOpenObject(js, "bypassed");
212  SCJbSetUint(js, "pkts_toserver", fc->todstpktcnt);
213  SCJbSetUint(js, "pkts_toclient", fc->tosrcpktcnt);
214  SCJbSetUint(js, "bytes_toserver", fc->todstbytecnt);
215  SCJbSetUint(js, "bytes_toclient", fc->tosrcbytecnt);
216  SCJbClose(js);
217  } else {
218  SCJbSetUint(js, "pkts_toserver", f->todstpktcnt);
219  SCJbSetUint(js, "pkts_toclient", f->tosrcpktcnt);
220  SCJbSetUint(js, "bytes_toserver", f->todstbytecnt);
221  SCJbSetUint(js, "bytes_toclient", f->tosrcbytecnt);
222  }
223 
224  char timebuf1[64];
225  CreateIsoTimeString(f->startts, timebuf1, sizeof(timebuf1));
226  SCJbSetString(js, "start", timebuf1);
227 }
228 
229 static void EveExceptionPolicyLog(SCJsonBuilder *js, uint16_t flag)
230 {
232  SCJbStartObject(js);
233  SCJbSetString(js, "target",
235  SCJbSetString(js, "policy",
238  SCJbClose(js);
239  }
241  SCJbStartObject(js);
242  SCJbSetString(js, "target",
244  SCJbSetString(js, "policy",
247  SCJbClose(js);
248  }
250  SCJbStartObject(js);
251  SCJbSetString(js, "target",
253  SCJbSetString(js, "policy",
256  true));
257  SCJbClose(js);
258  }
260  SCJbStartObject(js);
261  SCJbSetString(
263  SCJbSetString(js, "policy",
266  SCJbClose(js);
267  }
268  if (flag & EXCEPTION_TARGET_FLAG_MIDSTREAM) {
269  SCJbStartObject(js);
270  SCJbSetString(
272  SCJbSetString(js, "policy",
275  SCJbClose(js);
276  }
278  SCJbStartObject(js);
279  SCJbSetString(js, "target",
281  SCJbSetString(js, "policy",
284  SCJbClose(js);
285  }
286 }
287 
288 /* Eve format logging */
289 static void EveFlowLogJSON(OutputJsonThreadCtx *aft, SCJsonBuilder *jb, Flow *f)
290 {
291  EveAddAppProto(f, jb);
292  SCJbOpenObject(jb, "flow");
293  EveAddFlow(f, jb);
294 
295  char timebuf2[64];
296  CreateIsoTimeString(f->lastts, timebuf2, sizeof(timebuf2));
297  SCJbSetString(jb, "end", timebuf2);
298 
299  uint64_t age = (SCTIME_SECS(f->lastts) - SCTIME_SECS(f->startts));
300  SCJbSetUint(jb, "age", age);
301 
303  JB_SET_TRUE(jb, "emergency");
304 
305  const int flow_state = f->flow_state;
306  switch (flow_state) {
307  case FLOW_STATE_NEW:
308  JB_SET_STRING(jb, "state", "new");
309  break;
311  JB_SET_STRING(jb, "state", "established");
312  break;
313  case FLOW_STATE_CLOSED:
314  JB_SET_STRING(jb, "state", "closed");
315  break;
317  JB_SET_STRING(jb, "state", "bypassed");
318  JB_SET_STRING(jb, "bypass", "local");
319  break;
320 #ifdef CAPTURE_OFFLOAD
321  case FLOW_STATE_CAPTURE_BYPASSED:
322  JB_SET_STRING(jb, "state", "bypassed");
323  JB_SET_STRING(jb, "bypass", "capture");
324  break;
325 #endif
326  case FLOW_STATE_SIZE:
328  SCLogDebug("invalid flow state: %d, contact developers", flow_state);
329  }
330 
331  const char *reason = NULL;
333  reason = "tcp_reuse";
334  else if (f->flow_end_flags & FLOW_END_FLAG_FORCED)
335  reason = "forced";
337  reason = "shutdown";
339  reason = "timeout";
340  else
341  reason = "unknown";
342 
343  SCJbSetString(jb, "reason", reason);
344 
345  SCJbSetBool(jb, "alerted", FlowHasAlerts(f));
346  if (f->flags & FLOW_WRONG_THREAD)
347  JB_SET_TRUE(jb, "wrong_thread");
348 
350  JB_SET_TRUE(jb, "elephant");
351  SCJbOpenArray(jb, "elephant_direction");
353  SCJbAppendString(jb, "toserver");
355  SCJbAppendString(jb, "toclient");
356 
357  SCJbClose(jb);
358  }
359 
360  if (f->flags & FLOW_ACTION_DROP) {
361  JB_SET_STRING(jb, "action", "drop");
362  } else if (f->flags & FLOW_ACTION_ACCEPT) {
363  JB_SET_STRING(jb, "action", "accept");
364  } else if (f->flags & FLOW_ACTION_PASS) {
365  JB_SET_STRING(jb, "action", "pass");
366  }
367  if (f->applied_exception_policy != 0) {
368  SCJbOpenArray(jb, "exception_policy");
369  EveExceptionPolicyLog(jb, f->applied_exception_policy);
370  SCJbClose(jb); /* close array */
371  }
372 
373  if (f->alstate) {
374  uint64_t tx_id = AppLayerParserGetTxCnt(f, f->alstate);
375  if (tx_id) {
376  SCJbSetUint(jb, "tx_cnt", tx_id);
377  }
378  }
379 
380  /* Close flow. */
381  SCJbClose(jb);
382 
383  EveAddCommonOptions(&aft->ctx->cfg, NULL, f, jb, LOG_DIR_FLOW);
384 
385  /* TCP */
386  if (f->proto == IPPROTO_TCP) {
387  SCJbOpenObject(jb, "tcp");
388 
389  TcpSession *ssn = f->protoctx;
390 
391  char hexflags[3];
392  snprintf(hexflags, sizeof(hexflags), "%02x",
393  ssn ? ssn->tcp_packet_flags : 0);
394  SCJbSetString(jb, "tcp_flags", hexflags);
395 
396  snprintf(hexflags, sizeof(hexflags), "%02x",
397  ssn ? ssn->client.tcp_flags : 0);
398  SCJbSetString(jb, "tcp_flags_ts", hexflags);
399 
400  snprintf(hexflags, sizeof(hexflags), "%02x",
401  ssn ? ssn->server.tcp_flags : 0);
402  SCJbSetString(jb, "tcp_flags_tc", hexflags);
403 
404  EveTcpFlags(ssn ? ssn->tcp_packet_flags : 0, jb);
405 
406  if (ssn) {
407  const char *tcp_state = StreamTcpStateAsString(ssn->state);
408  if (tcp_state != NULL)
409  SCJbSetString(jb, "state", tcp_state);
411  JB_SET_TRUE(jb, "tc_gap");
412  }
414  JB_SET_TRUE(jb, "ts_gap");
415  }
416 
417  SCJbSetUint(jb, "ts_max_regions", ssn->client.sb.max_regions);
418  SCJbSetUint(jb, "tc_max_regions", ssn->server.sb.max_regions);
419 
420  if (ssn->urg_offset_ts)
421  SCJbSetUint(jb, "ts_urgent_oob_data", ssn->urg_offset_ts);
422  if (ssn->urg_offset_tc)
423  SCJbSetUint(jb, "tc_urgent_oob_data", ssn->urg_offset_tc);
424  }
425 
426  /* Close tcp. */
427  SCJbClose(jb);
428  }
429 }
430 
431 static int JsonFlowLogger(ThreadVars *tv, void *thread_data, Flow *f)
432 {
433  SCEnter();
434  OutputJsonThreadCtx *thread = thread_data;
435 
436  /* reset */
437  MemBufferReset(thread->buffer);
438 
439  SCJsonBuilder *jb = CreateEveHeaderFromFlow(f, &thread->ctx->cfg);
440  if (unlikely(jb == NULL)) {
442  }
443 
444  EveFlowLogJSON(thread, jb, f);
445 
446  OutputJsonBuilderBuffer(tv, NULL, f, jb, thread);
447  SCJbFree(jb);
448 
450 }
451 
453 {
454  /* register as child of eve-log */
455  OutputRegisterFlowSubModule(LOGGER_JSON_FLOW, "eve-log", "JsonFlowLog", "eve-log.flow",
457 }
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:163
Flow_::flags
uint64_t flags
Definition: flow.h:396
FLOW_STATE_ESTABLISHED
@ FLOW_STATE_ESTABLISHED
Definition: flow.h:498
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:86
EveAddFlow
void EveAddFlow(Flow *f, SCJsonBuilder *js)
Definition: output-json-flow.c:202
Flow_::startts
SCTime_t startts
Definition: flow.h:486
stream-tcp.h
OutputJsonCtx_::cfg
OutputJsonCommonSettings cfg
Definition: output-json.h:80
GetFlowBypassInfoID
FlowStorageId GetFlowBypassInfoID(void)
Definition: flow-util.c:222
FlowBypassInfo_
Definition: flow.h:522
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
FLOW_IS_ELEPHANT_TOCLIENT
#define FLOW_IS_ELEPHANT_TOCLIENT
Definition: flow.h:60
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:282
Flow_::esp
struct Flow_::@121::@128 esp
Flow_::proto
uint8_t proto
Definition: flow.h:369
EveAddAppProto
void EveAddAppProto(Flow *f, SCJsonBuilder *js)
Definition: output-json-flow.c:182
JsonLogThreadInit
TmEcode JsonLogThreadInit(ThreadVars *t, const void *initdata, void **data)
Definition: output-json-common.c:99
threads.h
PrintInetIPv6
const char * PrintInetIPv6(const void *src, char *dst, socklen_t size, bool compress_ipv6)
Definition: util-print.c:209
Flow_
Flow data structure.
Definition: flow.h:347
OutputJsonCommonSettings_
Definition: output-json.h:62
AppProtoToString
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
Definition: app-layer-protos.c:41
EXCEPTION_TARGET_FLAG_APPLAYER_ERROR
#define EXCEPTION_TARGET_FLAG_APPLAYER_ERROR
Definition: util-exception-policy-types.h:52
Flow_::alproto_orig
AppProto alproto_orig
Definition: flow.h:449
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:450
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:527
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:69
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:1003
proto
uint8_t proto
Definition: decode-template.h:0
CreateEveFlowId
void CreateEveFlowId(SCJsonBuilder *js, const Flow *f)
Definition: output-json.c:688
Flow_::dp
Port dp
Definition: flow.h:363
Flow_::protoctx
void * protoctx
Definition: flow.h:426
ExceptionPolicyTargetFlagToString
const char * ExceptionPolicyTargetFlagToString(uint8_t target_flag)
Definition: util-exception-policy.c:97
JsonFlowLogRegister
void JsonFlowLogRegister(void)
Definition: output-json-flow.c:452
util-unittest.h
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:81
Flow_::flow_state
FlowStateType flow_state
Definition: flow.h:413
OutputJsonThreadCtx_
Definition: output-json.h:85
LOGGER_JSON_FLOW
@ LOGGER_JSON_FLOW
Definition: suricata-common.h:503
Flow_::tosrcbytecnt
uint64_t tosrcbytecnt
Definition: flow.h:491
OutputJsonLogInitSub
OutputInitResult OutputJsonLogInitSub(SCConfNode *conf, OutputCtx *parent_ctx)
Definition: output-json-common.c:82
FLOW_ACTION_PASS
#define FLOW_ACTION_PASS
Definition: flow.h:116
Flow_::dst
FlowAddress dst
Definition: flow.h:350
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:494
FLOW_STATE_LOCAL_BYPASSED
@ FLOW_STATE_LOCAL_BYPASSED
Definition: flow.h:500
EXCEPTION_TARGET_FLAG_DEFRAG_MEMCAP
#define EXCEPTION_TARGET_FLAG_DEFRAG_MEMCAP
Definition: util-exception-policy-types.h:47
ExceptionPolicyTargetPolicy
enum ExceptionPolicy ExceptionPolicyTargetPolicy(uint8_t target_flag)
Definition: util-exception-policy.c:117
util-debug.h
JB_SET_STRING
#define JB_SET_STRING(jb, key, val)
Definition: rust.h:35
output-json-flow.h
FlowBypassInfo_::todstbytecnt
uint64_t todstbytecnt
Definition: flow.h:529
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:488
output-json.h
util-exception-policy.h
TcpSession_::urg_offset_tc
uint16_t urg_offset_tc
Definition: stream-tcp-private.h:292
Flow_::lastts
SCTime_t lastts
Definition: flow.h:411
util-print.h
SCEnter
#define SCEnter(...)
Definition: util-debug.h:284
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:238
Flow_::flow_end_flags
uint8_t flow_end_flags
Definition: flow.h:440
pkt-var.h
TcpSession_::state
uint8_t state
Definition: stream-tcp-private.h:285
FlowBypassInfo_::todstpktcnt
uint64_t todstpktcnt
Definition: flow.h:528
FLOW_WRONG_THREAD
#define FLOW_WRONG_THREAD
Definition: flow.h:109
util-time.h
JB_SET_TRUE
#define JB_SET_TRUE(jb, key)
Definition: rust.h:36
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
LOG_DIR_FLOW
@ LOG_DIR_FLOW
Definition: output-eve-bindgen.h:35
app-layer-parser.h
Flow_::todstbytecnt
uint64_t todstbytecnt
Definition: flow.h:490
FLOW_IS_IPV4
#define FLOW_IS_IPV4(f)
Definition: flow.h:161
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:237
conf.h
Port
uint16_t Port
Definition: decode.h:219
FLOW_END_FLAG_EMERGENCY
#define FLOW_END_FLAG_EMERGENCY
Definition: flow.h:233
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:49
Flow_::vlan_idx
uint8_t vlan_idx
Definition: flow.h:373
util-proto-name.h
FlowBypassInfo_::tosrcpktcnt
uint64_t tosrcpktcnt
Definition: flow.h:526
Flow_::alproto_expect
AppProto alproto_expect
Definition: flow.h:452
FLOW_STATE_SIZE
#define FLOW_STATE_SIZE
Definition: flow.h:508
FlowGetStorageById
void * FlowGetStorageById(const Flow *f, FlowStorageId id)
Definition: flow-storage.c:40
Flow_::src
FlowAddress src
Definition: flow.h:350
OutputJsonCommonSettings_::compress_ipv6
bool compress_ipv6
Definition: output-json.h:66
EXCEPTION_TARGET_FLAG_MIDSTREAM
#define EXCEPTION_TARGET_FLAG_MIDSTREAM
Definition: util-exception-policy-types.h:51
flow-storage.h
OutputJsonThreadCtx_::buffer
MemBuffer * buffer
Definition: output-json.h:88
Flow_::applied_exception_policy
uint8_t applied_exception_policy
Definition: flow.h:466
FLOW_STATE_NEW
@ FLOW_STATE_NEW
Definition: flow.h:497
suricata-common.h
Flow_::icmp_d
struct Flow_::@123::@129 icmp_d
EXCEPTION_TARGET_FLAG_SESSION_MEMCAP
#define EXCEPTION_TARGET_FLAG_SESSION_MEMCAP
Definition: util-exception-policy-types.h:48
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:33
Flow_::livedev
struct LiveDevice_ * livedev
Definition: flow.h:392
FLOW_ACTION_ACCEPT
#define FLOW_ACTION_ACCEPT
Definition: flow.h:63
threadvars.h
TcpSession_::server
TcpStream server
Definition: stream-tcp-private.h:296
FLOW_STATE_CLOSED
@ FLOW_STATE_CLOSED
Definition: flow.h:499
ExceptionPolicyEnumToString
const char * ExceptionPolicyEnumToString(enum ExceptionPolicy policy, bool is_json)
Definition: util-exception-policy.c:39
FlowAddress_::address
union FlowAddress_::@120 address
Flow_::alproto_ts
AppProto alproto_ts
Definition: flow.h:444
util-logopenfile.h
Flow_::alstate
void * alstate
Definition: flow.h:472
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:236
EXCEPTION_TARGET_FLAG_FLOW_MEMCAP
#define EXCEPTION_TARGET_FLAG_FLOW_MEMCAP
Definition: util-exception-policy-types.h:50
StreamTcpStateAsString
const char * StreamTcpStateAsString(const enum TcpState state)
Definition: stream-tcp.c:7290
Flow_::vlan_id
uint16_t vlan_id[VLAN_MAX_LAYERS]
Definition: flow.h:371
FlowHasAlerts
int FlowHasAlerts(const Flow *f)
Check if flow has alerts.
Definition: flow.c:165
FLOW_END_FLAG_TIMEOUT
#define FLOW_END_FLAG_TIMEOUT
Definition: flow.h:234
IPPROTO_SCTP
#define IPPROTO_SCTP
Definition: decode.h:1255
Flow_::icmp_s
struct Flow_::@121::@127 icmp_s
Flow_::sp
Port sp
Definition: flow.h:352
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:445
Flow_::alproto
AppProto alproto
application level protocol
Definition: flow.h:443
FLOW_END_FLAG_FORCED
#define FLOW_END_FLAG_FORCED
Definition: flow.h:235
FLOW_DIR_REVERSED
#define FLOW_DIR_REVERSED
Definition: flow.h:111
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:288
AppLayerParserGetTxCnt
uint64_t AppLayerParserGetTxCnt(const Flow *f, void *alstate)
Definition: app-layer-parser.c:1126
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:489
FLOW_IS_ELEPHANT_TOSERVER
#define FLOW_IS_ELEPHANT_TOSERVER
Definition: flow.h:59
output.h