suricata
output-json-anomaly.c
Go to the documentation of this file.
1 /* Copyright (C) 2019-2021 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 Jeff Lucovsky <jeff@lucovsky.org>
22  *
23  * Logs anomalies in JSON format.
24  *
25  */
26 
27 #include "suricata-common.h"
28 #include "debug.h"
29 #include "detect.h"
30 #include "flow.h"
31 #include "conf.h"
32 #include "app-layer.h"
33 #include "app-layer-events.h"
34 #include "app-layer-parser.h"
35 
36 #include "threads.h"
37 #include "tm-threads.h"
38 #include "threadvars.h"
39 #include "util-debug.h"
40 
41 #include "util-misc.h"
42 
43 #include "detect-parse.h"
44 #include "detect-engine.h"
45 #include "util-logopenfile.h"
46 
47 #include "output.h"
48 #include "output-json.h"
49 #include "output-json-anomaly.h"
50 
51 #include "util-byte.h"
52 #include "util-enum.h"
53 #include "util-privs.h"
54 #include "util-print.h"
55 #include "util-proto-name.h"
56 #include "util-optimize.h"
57 #include "util-buffer.h"
58 #include "util-validate.h"
59 
60 #define MODULE_NAME "JsonAnomalyLog"
61 
62 #define ANOMALY_EVENT_TYPE "anomaly"
63 #define LOG_JSON_DECODE_TYPE BIT_U16(0)
64 #define LOG_JSON_STREAM_TYPE BIT_U16(1)
65 #define LOG_JSON_APPLAYER_TYPE BIT_U16(2)
66 #define LOG_JSON_PACKETHDR BIT_U16(3)
67 
68 #define LOG_JSON_PACKET_TYPE (LOG_JSON_DECODE_TYPE | LOG_JSON_STREAM_TYPE)
69 #define ANOMALY_DEFAULTS LOG_JSON_APPLAYER_TYPE
70 
71 #define TX_ID_UNUSED UINT64_MAX
72 
73 typedef struct AnomalyJsonOutputCtx_ {
74  uint16_t flags;
77 
78 typedef struct JsonAnomalyLogThread_ {
82 
83 /*
84  * Restrict the anomaly logger count due to decoder state maintenance issues
85  */
86 
87 #define MAX_ANOMALY_LOGGERS 1
88 static int anomaly_loggers = 0;
89 static bool OutputAnomalyLoggerEnable(void)
90 {
91  if (anomaly_loggers < MAX_ANOMALY_LOGGERS) {
92  anomaly_loggers++;
93  return true;
94  }
95  return false;
96 }
97 
98 static void OutputAnomalyLoggerDisable(void)
99 {
100  if (anomaly_loggers)
101  anomaly_loggers--;
102 }
103 
104 static int AnomalyDecodeEventJson(ThreadVars *tv, JsonAnomalyLogThread *aft,
105  const Packet *p)
106 {
107  const uint16_t log_type = aft->json_output_ctx->flags;
108  const bool log_stream = log_type & LOG_JSON_STREAM_TYPE;
109  const bool log_decode = log_type & LOG_JSON_DECODE_TYPE;
110 
111  for (int i = 0; i < p->events.cnt; i++) {
112  uint8_t event_code = p->events.events[i];
113  bool is_decode = EVENT_IS_DECODER_PACKET_ERROR(event_code);
114  if (is_decode && !log_decode)
115  continue;
116  if (!is_decode && !log_stream)
117  continue;
118 
119  JsonBuilder *js = CreateEveHeader(
121  if (unlikely(js == NULL)) {
122  return TM_ECODE_OK;
123  }
124 
125  jb_open_object(js, ANOMALY_EVENT_TYPE);
126 
127  if (event_code < DECODE_EVENT_MAX) {
128  const char *event = DEvents[event_code].event_name;
129  if (EVENT_IS_DECODER_PACKET_ERROR(event_code)) {
130  JB_SET_STRING(js, "type", "decode");
131  } else {
132  JB_SET_STRING(js, "type", "stream");
133  }
134  jb_set_string(js, "event", event);
135  } else {
136  JB_SET_STRING(js, "type", "unknown");
137  jb_set_uint(js, "code", event_code);
138  }
139 
140  /* Close anomaly object. */
141  jb_close(js);
142 
144  EvePacket(p, js, GET_PKT_LEN(p) < 32 ? GET_PKT_LEN(p) : 32);
145  }
146 
147  OutputJsonBuilderBuffer(js, aft->ctx);
148  jb_free(js);
149  }
150 
151  return TM_ECODE_OK;
152 }
153 
154 static int AnomalyAppLayerDecoderEventJson(JsonAnomalyLogThread *aft,
155  const Packet *p, AppLayerDecoderEvents *decoder_events,
156  bool is_pktlayer, const char *layer, uint64_t tx_id)
157 {
158  const char *alprotoname = AppLayerGetProtoName(p->flow->alproto);
159 
160  SCLogDebug("decoder_events %p event_count %d (last logged %d) %s",
161  decoder_events, decoder_events->cnt,
162  decoder_events->event_last_logged,
163  tx_id != TX_ID_UNUSED ? "tx" : "no-tx");
164 
165  for (int i = decoder_events->event_last_logged; i < decoder_events->cnt; i++) {
166  JsonBuilder *js;
167  if (tx_id != TX_ID_UNUSED) {
169  aft->json_output_ctx->eve_ctx);
170  } else {
171  js = CreateEveHeader(
173  }
174  if (unlikely(js == NULL)) {
175  return TM_ECODE_OK;
176  }
177 
178 
179  jb_open_object(js, ANOMALY_EVENT_TYPE);
180 
181  jb_set_string(js, "app_proto", alprotoname);
182 
183  const char *event_name = NULL;
184  uint8_t event_code = decoder_events->events[i];
185  AppLayerEventType event_type;
186  int r;
187  if (is_pktlayer) {
188  r = AppLayerGetEventInfoById(event_code, &event_name, &event_type);
189  } else {
191  event_code, &event_name, &event_type);
192  }
193  if (r == 0) {
194  JB_SET_STRING(js, "type", "applayer");
195  jb_set_string(js, "event", event_name);
196  } else {
197  JB_SET_STRING(js, "type", "unknown");
198  jb_set_uint(js, "code", event_code);
199  }
200 
201  jb_set_string(js, "layer", layer);
202 
203  /* anomaly */
204  jb_close(js);
205  OutputJsonBuilderBuffer(js, aft->ctx);
206  jb_free(js);
207 
208  /* Current implementation assumes a single owner for this value */
209  decoder_events->event_last_logged++;
210  }
211 
212  return TM_ECODE_OK;
213 }
214 
215 static int JsonAnomalyTxLogger(ThreadVars *tv, void *thread_data, const Packet *p,
216  Flow *f, void *state, void *tx, uint64_t tx_id)
217 {
218  JsonAnomalyLogThread *aft = thread_data;
220  return TM_ECODE_OK;
221  }
222 
223  AppLayerDecoderEvents *decoder_events;
224  decoder_events = AppLayerParserGetEventsByTx(f->proto, f->alproto, tx);
225  if (decoder_events && decoder_events->event_last_logged < decoder_events->cnt) {
226  SCLogDebug("state %p, tx: %p, tx_id: %"PRIu64, state, tx, tx_id);
227  AnomalyAppLayerDecoderEventJson(aft, p, decoder_events, false,
228  "proto_parser", tx_id);
229  }
230  return TM_ECODE_OK;
231 }
232 
233 static inline bool AnomalyHasParserEvents(const Packet *p)
234 {
235  return (p->flow && p->flow->alparser &&
237 }
238 
239 static inline bool AnomalyHasPacketAppLayerEvents(const Packet *p)
240 {
241  return p->app_layer_events && p->app_layer_events->cnt;
242 }
243 
244 static int AnomalyJson(ThreadVars *tv, JsonAnomalyLogThread *aft, const Packet *p)
245 {
246  int rc = TM_ECODE_OK;
247 
248  /* decode or stream */
250  if (p->events.cnt) {
251  rc = AnomalyDecodeEventJson(tv, aft, p);
252  }
253  }
254 
255  /* applayer */
257  /* app layer proto detect events */
258  if (rc == TM_ECODE_OK && AnomalyHasPacketAppLayerEvents(p)) {
259  rc = AnomalyAppLayerDecoderEventJson(aft, p, p->app_layer_events,
260  true, "proto_detect", TX_ID_UNUSED);
261  }
262 
263  /* parser state events */
264  if (rc == TM_ECODE_OK && AnomalyHasParserEvents(p)) {
265  SCLogDebug("Checking for anomaly events; alproto %d", p->flow->alproto);
267  if (parser_events && (parser_events->event_last_logged < parser_events->cnt)) {
268  rc = AnomalyAppLayerDecoderEventJson(aft, p, parser_events,
269  false, "parser", TX_ID_UNUSED);
270  }
271  }
272  }
273 
274  return rc;
275 }
276 
277 static int JsonAnomalyLogger(ThreadVars *tv, void *thread_data, const Packet *p)
278 {
279  JsonAnomalyLogThread *aft = thread_data;
280  return AnomalyJson(tv, aft, p);
281 }
282 
283 static int JsonAnomalyLogCondition(ThreadVars *tv, void *thread_data, const Packet *p)
284 {
285  return p->events.cnt > 0 ||
286  (p->app_layer_events && p->app_layer_events->cnt > 0) ||
287  AnomalyHasParserEvents(p);
288 }
289 
290 static TmEcode JsonAnomalyLogThreadInit(ThreadVars *t, const void *initdata, void **data)
291 {
293  if (unlikely(aft == NULL)) {
294  return TM_ECODE_FAILED;
295  }
296 
297  if (initdata == NULL) {
298  SCLogDebug("Error getting context for EveLogAnomaly. \"initdata\" argument NULL");
299  goto error_exit;
300  }
301 
302  /** Use the Output Context (file pointer and mutex) */
303  AnomalyJsonOutputCtx *json_output_ctx = ((OutputCtx *)initdata)->data;
304 
305  aft->ctx = CreateEveThreadCtx(t, json_output_ctx->eve_ctx);
306  if (!aft->ctx) {
307  goto error_exit;
308  }
309  aft->json_output_ctx = json_output_ctx;
310 
311  *data = (void *)aft;
312  return TM_ECODE_OK;
313 
314 error_exit:
315  SCFree(aft);
316  return TM_ECODE_FAILED;
317 }
318 
319 static TmEcode JsonAnomalyLogThreadDeinit(ThreadVars *t, void *data)
320 {
322  if (aft == NULL) {
323  return TM_ECODE_OK;
324  }
325 
326  FreeEveThreadCtx(aft->ctx);
327 
328  /* clear memory */
329  memset(aft, 0, sizeof(JsonAnomalyLogThread));
330 
331  SCFree(aft);
332  return TM_ECODE_OK;
333 }
334 
335 static void JsonAnomalyLogDeInitCtxSubHelper(OutputCtx *output_ctx)
336 {
337  SCLogDebug("cleaning up sub output_ctx %p", output_ctx);
338 
339  AnomalyJsonOutputCtx *json_output_ctx = (AnomalyJsonOutputCtx *) output_ctx->data;
340 
341  if (json_output_ctx != NULL) {
342  SCFree(json_output_ctx);
343  }
344  SCFree(output_ctx);
345 }
346 
347 static void JsonAnomalyLogDeInitCtxSub(OutputCtx *output_ctx)
348 {
349  OutputAnomalyLoggerDisable();
350 
351  JsonAnomalyLogDeInitCtxSubHelper(output_ctx);
352 }
353 
354 #define DEFAULT_LOG_FILENAME "anomaly.json"
355 static void SetFlag(const ConfNode *conf, const char *name, uint16_t flag, uint16_t *out_flags)
356 {
357  DEBUG_VALIDATE_BUG_ON(conf == NULL);
358  const char *setting = ConfNodeLookupChildValue(conf, name);
359  if (setting != NULL) {
360  if (ConfValIsTrue(setting)) {
361  *out_flags |= flag;
362  } else {
363  *out_flags &= ~flag;
364  }
365  }
366 }
367 
368 static void JsonAnomalyLogConf(AnomalyJsonOutputCtx *json_output_ctx,
369  ConfNode *conf)
370 {
371  static bool warn_no_flags = false;
372  static bool warn_no_packet = false;
373  uint16_t flags = ANOMALY_DEFAULTS;
374  if (conf != NULL) {
375  /* Check for metadata to enable/disable. */
376  ConfNode *typeconf = ConfNodeLookupChild(conf, "types");
377  if (typeconf != NULL) {
378  SetFlag(typeconf, "applayer", LOG_JSON_APPLAYER_TYPE, &flags);
379  SetFlag(typeconf, "stream", LOG_JSON_STREAM_TYPE, &flags);
380  SetFlag(typeconf, "decode", LOG_JSON_DECODE_TYPE, &flags);
381  }
382  SetFlag(conf, "packethdr", LOG_JSON_PACKETHDR, &flags);
383  }
384  if (((flags & (LOG_JSON_DECODE_TYPE | LOG_JSON_PACKETHDR)) == LOG_JSON_PACKETHDR) && !warn_no_packet) {
385  SCLogWarning(SC_WARN_ANOMALY_CONFIG, "Anomaly logging configured to include packet headers, however decode "
386  "type logging has not been selected. Packet headers will not be logged.");
387  warn_no_packet = true;
389  }
390 
391  if (flags == 0 && !warn_no_flags) {
392  SCLogWarning(SC_WARN_ANOMALY_CONFIG, "Anomaly logging has been configured; however, no logging types "
393  "have been selected. Select one or more logging types.");
394  warn_no_flags = true;
395  }
396  json_output_ctx->flags |= flags;
397 }
398 
399 static OutputInitResult JsonAnomalyLogInitCtxHelper(ConfNode *conf, OutputCtx *parent_ctx)
400 {
401  OutputInitResult result = { NULL, false };
402  OutputJsonCtx *ajt = parent_ctx->data;
403  AnomalyJsonOutputCtx *json_output_ctx = NULL;
404 
405  OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx));
406  if (unlikely(output_ctx == NULL))
407  return result;
408 
409  json_output_ctx = SCCalloc(1, sizeof(AnomalyJsonOutputCtx));
410  if (unlikely(json_output_ctx == NULL)) {
411  goto error;
412  }
413 
414  JsonAnomalyLogConf(json_output_ctx, conf);
415  json_output_ctx->eve_ctx = ajt;
416 
417  output_ctx->data = json_output_ctx;
418  output_ctx->DeInit = JsonAnomalyLogDeInitCtxSubHelper;
419 
420  result.ctx = output_ctx;
421  result.ok = true;
422  return result;
423 
424 error:
425  SCFree(output_ctx);
426 
427  return result;
428 }
429 
430 /**
431  * \brief Create a new LogFileCtx for "fast" output style.
432  * \param conf The configuration node for this output.
433  * \return A LogFileCtx pointer on success, NULL on failure.
434  */
435 static OutputInitResult JsonAnomalyLogInitCtxSub(ConfNode *conf, OutputCtx *parent_ctx)
436 {
437 
438  if (!OutputAnomalyLoggerEnable()) {
439  OutputInitResult result = { NULL, false };
440  SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'anomaly' logger "
441  "can be enabled");
442  return result;
443  }
444 
445  OutputInitResult result = JsonAnomalyLogInitCtxHelper(conf, parent_ctx);
446  if (result.ok) {
447  result.ctx->DeInit = JsonAnomalyLogDeInitCtxSub;
448  }
449 
450  return result;
451 }
452 
454 {
456  "eve-log.anomaly", JsonAnomalyLogInitCtxSub, JsonAnomalyLogger,
457  JsonAnomalyLogCondition, JsonAnomalyLogThreadInit, JsonAnomalyLogThreadDeinit,
458  NULL);
459 
461  "eve-log.anomaly", JsonAnomalyLogInitCtxHelper, ALPROTO_UNKNOWN,
462  JsonAnomalyTxLogger, JsonAnomalyLogThreadInit,
463  JsonAnomalyLogThreadDeinit, NULL);
464 }
util-byte.h
tm-threads.h
detect-engine.h
TX_ID_UNUSED
#define TX_ID_UNUSED
Definition: output-json-anomaly.c:71
LOG_JSON_PACKET_TYPE
#define LOG_JSON_PACKET_TYPE
Definition: output-json-anomaly.c:68
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
SC_WARN_ANOMALY_CONFIG
@ SC_WARN_ANOMALY_CONFIG
Definition: util-error.h:356
PacketEngineEvents_::events
uint8_t events[PACKET_ENGINE_EVENT_MAX]
Definition: decode.h:317
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:296
AppLayerParserGetEventsByTx
AppLayerDecoderEvents * AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alproto, void *tx)
Definition: app-layer-parser.c:879
FreeEveThreadCtx
void FreeEveThreadCtx(OutputJsonThreadCtx *ctx)
Definition: output-json-common.c:73
Flow_::proto
uint8_t proto
Definition: flow.h:375
threads.h
OutputJsonCtx_
Definition: output-json.h:81
MAX_ANOMALY_LOGGERS
#define MAX_ANOMALY_LOGGERS
Definition: output-json-anomaly.c:87
Flow_
Flow data structure.
Definition: flow.h:353
AppLayerEventType
enum AppLayerEventType_ AppLayerEventType
AnomalyJsonOutputCtx_::flags
uint16_t flags
Definition: output-json-anomaly.c:74
AppLayerDecoderEvents_::event_last_logged
uint8_t event_last_logged
Definition: app-layer-events.h:42
OutputJsonBuilderBuffer
int OutputJsonBuilderBuffer(JsonBuilder *js, OutputJsonThreadCtx *ctx)
Definition: output-json.c:960
CreateEveThreadCtx
OutputJsonThreadCtx * CreateEveThreadCtx(ThreadVars *t, OutputJsonCtx *ctx)
Definition: output-json-common.c:44
LOG_JSON_APPLAYER_TYPE
#define LOG_JSON_APPLAYER_TYPE
Definition: output-json-anomaly.c:65
util-privs.h
JsonAnomalyLogThread_::ctx
OutputJsonThreadCtx * ctx
Definition: output-json-anomaly.c:80
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:83
ANOMALY_DEFAULTS
#define ANOMALY_DEFAULTS
Definition: output-json-anomaly.c:69
AppLayerDecoderEvents_
Data structure to store app layer decoder events.
Definition: app-layer-events.h:34
Packet_::app_layer_events
AppLayerDecoderEvents * app_layer_events
Definition: decode.h:600
Packet_::events
PacketEngineEvents events
Definition: decode.h:598
ConfValIsTrue
int ConfValIsTrue(const char *val)
Check if a value is true.
Definition: conf.c:521
OutputCtx_::data
void * data
Definition: tm-modules.h:81
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:82
ANOMALY_EVENT_TYPE
#define ANOMALY_EVENT_TYPE
Definition: output-json-anomaly.c:62
AppLayerParserGetEventInfoById
int AppLayerParserGetEventInfoById(uint8_t ipproto, AppProto alproto, int event_id, const char **event_name, AppLayerEventType *event_type)
Definition: app-layer-parser.c:1149
OutputCtx_
Definition: tm-modules.h:78
OutputJsonThreadCtx_
Definition: output-json.h:89
Flow_::alparser
AppLayerParserState * alparser
Definition: flow.h:485
AnomalyJsonOutputCtx_::eve_ctx
OutputJsonCtx * eve_ctx
Definition: output-json-anomaly.c:75
LOG_JSON_PACKETHDR
#define LOG_JSON_PACKETHDR
Definition: output-json-anomaly.c:66
JsonAnomalyLogRegister
void JsonAnomalyLogRegister(void)
Definition: output-json-anomaly.c:453
util-debug.h
JB_SET_STRING
#define JB_SET_STRING(jb, key, val)
Definition: rust.h:37
SC_ERR_CONF_YAML_ERROR
@ SC_ERR_CONF_YAML_ERROR
Definition: util-error.h:274
OutputInitResult_::ctx
OutputCtx * ctx
Definition: output.h:45
DEvents
const struct DecodeEvents_ DEvents[]
Definition: decode-events.c:29
output-json.h
CreateEveHeader
JsonBuilder * CreateEveHeader(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, OutputJsonCtx *eve_ctx)
Definition: output-json.c:822
util-print.h
detect.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:56
OutputInitResult_::ok
bool ok
Definition: output.h:46
AppLayerGetEventInfoById
int AppLayerGetEventInfoById(int event_id, const char **event_name, AppLayerEventType *event_type)
Definition: app-layer-events.c:51
app-layer-parser.h
AppLayerDecoderEvents_::cnt
uint8_t cnt
Definition: app-layer-events.h:38
CreateEveHeaderWithTxId
JsonBuilder * CreateEveHeaderWithTxId(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, uint64_t tx_id, OutputJsonCtx *eve_ctx)
Definition: output-json.c:905
JsonAnomalyLogThread
struct JsonAnomalyLogThread_ JsonAnomalyLogThread
output-json-anomaly.h
MODULE_NAME
#define MODULE_NAME
Definition: output-json-anomaly.c:60
Packet_
Definition: decode.h:433
GET_PKT_LEN
#define GET_PKT_LEN(p)
Definition: decode.h:226
conf.h
TmEcode
TmEcode
Definition: tm-threads-common.h:81
util-proto-name.h
LOG_JSON_STREAM_TYPE
#define LOG_JSON_STREAM_TYPE
Definition: output-json-anomaly.c:64
DecodeEvents_::event_name
const char * event_name
Definition: decode-events.h:302
ConfNodeLookupChild
ConfNode * ConfNodeLookupChild(const ConfNode *node, const char *name)
Lookup a child configuration node by name.
Definition: conf.c:770
OutputInitResult_
Definition: output.h:44
Packet_::flow
struct Flow_ * flow
Definition: decode.h:470
LOG_DIR_PACKET
@ LOG_DIR_PACKET
Definition: output-json.h:39
flags
uint8_t flags
Definition: decode-gre.h:0
suricata-common.h
OutputCtx_::DeInit
void(* DeInit)(struct OutputCtx_ *)
Definition: tm-modules.h:84
OutputRegisterPacketSubModule
void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a packet output sub-module.
Definition: output.c:217
JsonAnomalyLogThread_::json_output_ctx
AnomalyJsonOutputCtx * json_output_ctx
Definition: output-json-anomaly.c:79
LOG_JSON_DECODE_TYPE
#define LOG_JSON_DECODE_TYPE
Definition: output-json-anomaly.c:63
SCLogError
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
Definition: util-debug.h:255
JsonAnomalyLogThread_
Definition: output-json-anomaly.c:78
EvePacket
void EvePacket(const Packet *p, JsonBuilder *js, unsigned long max_length)
Jsonify a packet.
Definition: output-json.c:438
OutputRegisterTxSubModule
void OutputRegisterTxSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Definition: output.c:412
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:31
util-optimize.h
app-layer-events.h
threadvars.h
util-validate.h
SCLogWarning
#define SCLogWarning(err_code,...)
Macro used to log WARNING messages.
Definition: util-debug.h:242
SCFree
#define SCFree(p)
Definition: util-mem.h:61
ConfNode_
Definition: conf.h:32
util-logopenfile.h
AppLayerParserGetDecoderEvents
AppLayerDecoderEvents * AppLayerParserGetDecoderEvents(AppLayerParserState *pstate)
Definition: app-layer-parser.c:866
detect-parse.h
util-buffer.h
AppLayerGetProtoName
const char * AppLayerGetProtoName(AppProto alproto)
Given the internal protocol id, returns a string representation of the protocol.
Definition: app-layer.c:928
AnomalyJsonOutputCtx_
Definition: output-json-anomaly.c:73
ALPROTO_UNKNOWN
@ ALPROTO_UNKNOWN
Definition: app-layer-protos.h:29
DECODE_EVENT_MAX
@ DECODE_EVENT_MAX
Definition: decode-events.h:293
util-misc.h
flow.h
Flow_::alproto
AppProto alproto
application level protocol
Definition: flow.h:460
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
util-enum.h
AppLayerParserHasDecoderEvents
bool AppLayerParserHasDecoderEvents(AppLayerParserState *pstate)
Definition: app-layer-parser.c:1456
AppLayerDecoderEvents_::events
uint8_t * events
Definition: app-layer-events.h:36
DEBUG_VALIDATE_BUG_ON
#define DEBUG_VALIDATE_BUG_ON(exp)
Definition: util-validate.h:111
debug.h
output.h
AnomalyJsonOutputCtx
struct AnomalyJsonOutputCtx_ AnomalyJsonOutputCtx
app-layer.h
LOGGER_JSON_ANOMALY
@ LOGGER_JSON_ANOMALY
Definition: suricata-common.h:480
PacketEngineEvents_::cnt
uint8_t cnt
Definition: decode.h:316
EVENT_IS_DECODER_PACKET_ERROR
#define EVENT_IS_DECODER_PACKET_ERROR(e)
Definition: decode-events.h:296
ConfNodeLookupChildValue
const char * ConfNodeLookupChildValue(const ConfNode *node, const char *name)
Lookup the value of a child configuration node by name.
Definition: conf.c:798