suricata
alert-fastlog.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-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 Victor Julien <victor@inliniac.net>
22  *
23  * Logs alerts in a line based text format compatible to Snort's
24  * alert_fast format.
25  */
26 
27 #include "suricata-common.h"
28 #include "detect.h"
29 #include "flow.h"
30 #include "conf.h"
31 
32 #include "threads.h"
33 #include "tm-threads.h"
34 #include "threadvars.h"
35 #include "util-debug.h"
36 
37 #include "util-unittest.h"
38 #include "util-unittest-helper.h"
39 
40 #include "detect-parse.h"
41 #include "detect-engine.h"
42 #include "detect-engine-build.h"
43 #include "detect-engine-mpm.h"
44 #include "detect-reference.h"
46 
47 #include "output.h"
48 #include "alert-fastlog.h"
49 
50 #include "util-privs.h"
51 #include "util-print.h"
52 #include "util-proto-name.h"
53 #include "util-optimize.h"
54 #include "util-logopenfile.h"
55 #include "util-time.h"
56 
57 #include "action-globals.h"
58 
59 #define DEFAULT_LOG_FILENAME "fast.log"
60 
61 #define MODULE_NAME "AlertFastLog"
62 
63 /* The largest that size allowed for one alert string. */
64 #define MAX_FASTLOG_ALERT_SIZE 2048
65 /* The largest alert buffer that will be written at one time, possibly
66  * holding multiple alerts. */
67 #define MAX_FASTLOG_BUFFER_SIZE (2 * MAX_FASTLOG_ALERT_SIZE)
68 
69 TmEcode AlertFastLogThreadInit(ThreadVars *, const void *, void **);
71 void AlertFastLogRegisterTests(void);
72 static void AlertFastLogDeInitCtx(OutputCtx *);
73 
74 static bool AlertFastLogCondition(ThreadVars *tv, void *thread_data, const Packet *p);
75 int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p);
76 
78 {
79  OutputPacketLoggerFunctions output_logger_functions = {
81  .FlushFunc = NULL,
82  .ConditionFunc = AlertFastLogCondition,
83  .ThreadInitFunc = AlertFastLogThreadInit,
84  .ThreadDeinitFunc = AlertFastLogThreadDeinit,
85  .ThreadExitPrintStatsFunc = NULL,
86  };
87 
89  LOGGER_ALERT_FAST, MODULE_NAME, "fast", AlertFastLogInitCtx, &output_logger_functions);
91 }
92 
93 typedef struct AlertFastLogThread_ {
94  /** LogFileCtx has the pointer to the file and a mutex to allow multithreading */
97 
98 static bool AlertFastLogCondition(ThreadVars *tv, void *thread_data, const Packet *p)
99 {
100  return (p->alerts.cnt > 0);
101 }
102 
103 static inline void AlertFastLogOutputAlert(AlertFastLogThread *aft, char *buffer,
104  int alert_size)
105 {
106  /* Output the alert string and count alerts. Only need to lock here. */
107  aft->file_ctx->Write(buffer, alert_size, aft->file_ctx);
108 }
109 
110 int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p)
111 {
112  AlertFastLogThread *aft = (AlertFastLogThread *)data;
113  int i;
114  char timebuf[64];
115  int decoder_event = 0;
116 
117  CreateTimeString(p->ts, timebuf, sizeof(timebuf));
118 
119  char srcip[46], dstip[46];
120  if (PacketIsIPv4(p)) {
121  PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
122  PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
123  } else if (PacketIsIPv6(p)) {
124  PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
125  PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
126  } else {
127  decoder_event = 1;
128  }
129 
130  /* Buffer to store the generated alert strings. The buffer is
131  * filled with alert strings until it doesn't have room to store
132  * another full alert, only then is the buffer written. This is
133  * more efficient for multiple alerts and only slightly slower for
134  * single alerts.
135  */
136  char alert_buffer[MAX_FASTLOG_BUFFER_SIZE];
137 
138  char proto[16] = "";
139  const char *protoptr;
140  if (SCProtoNameValid(PacketGetIPProto(p))) {
141  protoptr = known_proto[PacketGetIPProto(p)];
142  } else {
143  snprintf(proto, sizeof(proto), "PROTO:%03" PRIu32, PacketGetIPProto(p));
144  protoptr = proto;
145  }
146  uint16_t src_port_or_icmp = p->sp;
147  uint16_t dst_port_or_icmp = p->dp;
148  if (PacketGetIPProto(p) == IPPROTO_ICMP || PacketGetIPProto(p) == IPPROTO_ICMPV6) {
149  src_port_or_icmp = p->icmp_s.type;
150  dst_port_or_icmp = p->icmp_s.code;
151  }
152  for (i = 0; i < p->alerts.cnt; i++) {
153  const PacketAlert *pa = &p->alerts.alerts[i];
154  if (unlikely(pa->s == NULL || (pa->action & ACTION_ALERT) == 0)) {
155  continue;
156  }
157 
158  const char *action = "";
159  if ((pa->action & ACTION_DROP) && EngineModeIsIPS()) {
160  action = "[Drop] ";
161  } else if (pa->action & ACTION_DROP) {
162  action = "[wDrop] ";
163  }
164 
165  /* Create the alert string without locking. */
166  int size = 0;
167  if (likely(decoder_event == 0)) {
168  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
169  "%s %s[**] [%" PRIu32 ":%" PRIu32 ":%"
170  PRIu32 "] %s [**] [Classification: %s] [Priority: %"PRIu32"]"
171  " {%s} %s:%" PRIu32 " -> %s:%" PRIu32 "\n", timebuf, action,
172  pa->s->gid, pa->s->id, pa->s->rev, pa->s->msg, pa->s->class_msg, pa->s->prio,
173  protoptr, srcip, src_port_or_icmp, dstip, dst_port_or_icmp);
174  } else {
175  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
176  "%s %s[**] [%" PRIu32 ":%" PRIu32
177  ":%" PRIu32 "] %s [**] [Classification: %s] [Priority: "
178  "%" PRIu32 "] [**] [Raw pkt: ", timebuf, action, pa->s->gid,
179  pa->s->id, pa->s->rev, pa->s->msg, pa->s->class_msg, pa->s->prio);
180  PrintBufferRawLineHex(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
181  GET_PKT_DATA(p), GET_PKT_LEN(p) < 32 ? GET_PKT_LEN(p) : 32);
182  uint64_t pcap_cnt = PcapPacketCntGet(p);
183  if (pcap_cnt != 0) {
184  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
185  "] [pcap file packet: %" PRIu64 "]\n", pcap_cnt);
186  } else {
187  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE, "]\n");
188  }
189  }
190 
191  /* Write the alert to output file */
192  AlertFastLogOutputAlert(aft, alert_buffer, size);
193  }
194 
195  return TM_ECODE_OK;
196 }
197 
198 TmEcode AlertFastLogThreadInit(ThreadVars *t, const void *initdata, void **data)
199 {
201  if (unlikely(aft == NULL))
202  return TM_ECODE_FAILED;
203  if(initdata == NULL)
204  {
205  SCLogDebug("Error getting context for AlertFastLog. \"initdata\" argument NULL");
206  SCFree(aft);
207  return TM_ECODE_FAILED;
208  }
209  /** Use the Output Context (file pointer and mutex) */
210  aft->file_ctx = ((OutputCtx *)initdata)->data;
211 
212  *data = (void *)aft;
213  return TM_ECODE_OK;
214 }
215 
217 {
218  AlertFastLogThread *aft = (AlertFastLogThread *)data;
219  if (aft == NULL) {
220  return TM_ECODE_OK;
221  }
222 
223  /* clear memory */
224  memset(aft, 0, sizeof(AlertFastLogThread));
225 
226  SCFree(aft);
227  return TM_ECODE_OK;
228 }
229 
230 /**
231  * \brief Create a new LogFileCtx for "fast" output style.
232  * \param conf The configuration node for this output.
233  * \return A LogFileCtx pointer on success, NULL on failure.
234  */
236 {
237  OutputInitResult result = { NULL, false };
238  LogFileCtx *logfile_ctx = LogFileNewCtx();
239  if (logfile_ctx == NULL) {
240  SCLogDebug("AlertFastLogInitCtx2: Could not create new LogFileCtx");
241  return result;
242  }
243 
244  if (SCConfLogOpenGeneric(conf, logfile_ctx, DEFAULT_LOG_FILENAME, 1) < 0) {
245  LogFileFreeCtx(logfile_ctx);
246  return result;
247  }
248 
249  OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx));
250  if (unlikely(output_ctx == NULL)) {
251  LogFileFreeCtx(logfile_ctx);
252  return result;
253  }
254 
255  output_ctx->data = logfile_ctx;
256  output_ctx->DeInit = AlertFastLogDeInitCtx;
257 
258  result.ctx = output_ctx;
259  result.ok = true;
260  return result;
261 }
262 
263 static void AlertFastLogDeInitCtx(OutputCtx *output_ctx)
264 {
265  LogFileCtx *logfile_ctx = (LogFileCtx *)output_ctx->data;
266  LogFileFreeCtx(logfile_ctx);
267  SCFree(output_ctx);
268 }
269 
270 /*------------------------------Unittests-------------------------------------*/
271 
272 #ifdef UNITTESTS
273 
274 static int AlertFastLogTest01(void)
275 {
276  uint8_t *buf = (uint8_t *) "GET /one/ HTTP/1.1\r\n"
277  "Host: one.example.org\r\n";
278 
279  uint16_t buflen = strlen((char *)buf);
280  Packet *p = NULL;
281  ThreadVars th_v;
282  memset(&th_v, 0, sizeof(th_v));
283  StatsThreadInit(&th_v.stats);
284 
285  p = UTHBuildPacket(buf, buflen, IPPROTO_TCP);
286 
288  FAIL_IF(de_ctx == NULL);
289  de_ctx->flags |= DE_QUIET;
290 
294 
295  de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any "
296  "(msg:\"FastLog test\"; content:\"GET\"; "
297  "Classtype:unknown; sid:1;)");
298 
300  DetectEngineThreadCtx *det_ctx;
301  DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
302 
303  SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
304  FAIL_IF_NOT(p->alerts.cnt == 1);
305  FAIL_IF_NOT(strcmp(p->alerts.alerts[0].s->class_msg, "Unknown are we") == 0);
306 
307  UTHFreePackets(&p, 1);
308  DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
310  StatsThreadCleanup(&th_v.stats);
311  PASS;
312 }
313 
314 static int AlertFastLogTest02(void)
315 {
316  uint8_t *buf = (uint8_t *) "GET /one/ HTTP/1.1\r\n"
317  "Host: one.example.org\r\n";
318  uint16_t buflen = strlen((char *)buf);
319  Packet *p = NULL;
320  ThreadVars th_v;
321 
322  memset(&th_v, 0, sizeof(th_v));
323  StatsThreadInit(&th_v.stats);
324 
325  p = UTHBuildPacket(buf, buflen, IPPROTO_TCP);
326 
328  FAIL_IF(de_ctx == NULL);
329  de_ctx->flags |= DE_QUIET;
330 
334 
335  de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any "
336  "(msg:\"FastLog test\"; content:\"GET\"; "
337  "Classtype:unknown; sid:1;)");
338 
340  DetectEngineThreadCtx *det_ctx;
341  DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
342 
343  SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
344  FAIL_IF_NOT(p->alerts.cnt == 1);
345  FAIL_IF_NOT(strcmp(p->alerts.alerts[0].s->class_msg, "Unknown are we") == 0);
346 
347  UTHFreePackets(&p, 1);
348  DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
350  StatsThreadCleanup(&th_v.stats);
351  PASS;
352 }
353 
354 #endif /* UNITTESTS */
355 
356 /**
357  * \brief This function registers unit tests for AlertFastLog API.
358  */
360 {
361 #ifdef UNITTESTS
362  UtRegisterTest("AlertFastLogTest01", AlertFastLogTest01);
363  UtRegisterTest("AlertFastLogTest02", AlertFastLogTest02);
364 #endif /* UNITTESTS */
365 }
tm-threads.h
AlertFastLogThread_
Definition: alert-fastlog.c:93
AlertFastLogger
int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p)
Definition: alert-fastlog.c:110
detect-engine.h
AlertFastLogRegisterTests
void AlertFastLogRegisterTests(void)
This function registers unit tests for AlertFastLog API.
Definition: alert-fastlog.c:359
PacketAlert_::s
const struct Signature_ * s
Definition: decode.h:252
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
UtRegisterTest
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
Definition: util-unittest.c:103
LogFileNewCtx
LogFileCtx * LogFileNewCtx(void)
LogFileNewCtx() Get a new LogFileCtx.
Definition: util-logopenfile.c:706
PcapPacketCntGet
uint64_t PcapPacketCntGet(const Packet *p)
Definition: decode.c:1104
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:282
PacketAlerts_::cnt
uint16_t cnt
Definition: decode.h:287
action-globals.h
threads.h
AlertFastLogRegister
void AlertFastLogRegister(void)
Definition: alert-fastlog.c:77
LogFileCtx_
Definition: util-logopenfile.h:72
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:933
DetectEngineCtxFree
void DetectEngineCtxFree(DetectEngineCtx *)
Free a DetectEngineCtx::
Definition: detect-engine.c:2684
PacketAlerts_::alerts
PacketAlert * alerts
Definition: decode.h:290
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
DE_QUIET
#define DE_QUIET
Definition: detect.h:329
util-privs.h
LogFileCtx_::Write
int(* Write)(const char *buffer, int buffer_len, struct LogFileCtx_ *fp)
Definition: util-logopenfile.h:87
known_proto
const char * known_proto[256]
Definition: util-proto-name.c:40
UTHBuildPacket
Packet * UTHBuildPacket(uint8_t *payload, uint16_t payload_len, uint8_t ipproto)
UTHBuildPacket is a wrapper that build packets with default ip and port fields.
Definition: util-unittest-helper.c:365
SigMatchSignatures
void SigMatchSignatures(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p)
wrapper for old tests
Definition: detect.c:2420
proto
uint8_t proto
Definition: decode-template.h:0
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:82
AlertFastLogThreadInit
TmEcode AlertFastLogThreadInit(ThreadVars *, const void *, void **)
Definition: alert-fastlog.c:198
MAX_FASTLOG_BUFFER_SIZE
#define MAX_FASTLOG_BUFFER_SIZE
Definition: alert-fastlog.c:67
GET_IPV6_DST_ADDR
#define GET_IPV6_DST_ADDR(p)
Definition: decode.h:204
Packet_::alerts
PacketAlerts alerts
Definition: decode.h:620
util-unittest.h
DEFAULT_LOG_FILENAME
#define DEFAULT_LOG_FILENAME
Definition: alert-fastlog.c:59
util-unittest-helper.h
FAIL_IF_NOT
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
Definition: util-unittest.h:82
OutputCtx_::data
void * data
Definition: tm-modules.h:91
AlertFastLogThread_::file_ctx
LogFileCtx * file_ctx
Definition: alert-fastlog.c:95
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:81
OutputCtx_
Definition: tm-modules.h:88
PacketAlert_::action
uint8_t action
Definition: decode.h:250
detect-reference.h
Packet_::icmp_s
struct Packet_::@32::@39 icmp_s
Signature_::gid
uint32_t gid
Definition: detect.h:714
util-debug.h
PASS
#define PASS
Pass the test.
Definition: util-unittest.h:105
GET_IPV4_DST_ADDR_PTR
#define GET_IPV4_DST_ADDR_PTR(p)
Definition: decode.h:199
PrintBufferRawLineHex
void PrintBufferRawLineHex(char *nbuf, int *offset, int max_size, const uint8_t *buf, uint32_t buflen)
print a buffer as hex on a single line
Definition: util-print.c:44
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:19
OutputInitResult_::ctx
OutputCtx * ctx
Definition: output.h:47
DetectEngineThreadCtx_
Definition: detect.h:1245
Packet_::ts
SCTime_t ts
Definition: decode.h:555
util-print.h
GET_PKT_DATA
#define GET_PKT_DATA(p)
Definition: decode.h:209
detect-engine-mpm.h
AlertFastLogInitCtx
OutputInitResult AlertFastLogInitCtx(SCConfNode *conf)
Create a new LogFileCtx for "fast" output style.
Definition: alert-fastlog.c:235
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
DetectEngineThreadCtxInit
TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data)
initialize thread specific detection engine context
Definition: detect-engine.c:3414
Packet_::sp
Port sp
Definition: decode.h:508
util-time.h
OutputInitResult_::ok
bool ok
Definition: output.h:48
SigInit
Signature * SigInit(DetectEngineCtx *de_ctx, const char *sigstr)
Parses a signature and adds it to the Detection Engine Context.
Definition: detect-parse.c:3104
ACTION_ALERT
#define ACTION_ALERT
Definition: action-globals.h:29
Packet_
Definition: decode.h:501
detect-engine-build.h
GET_PKT_LEN
#define GET_PKT_LEN(p)
Definition: decode.h:208
conf.h
TmEcode
TmEcode
Definition: tm-threads-common.h:80
util-proto-name.h
SigGroupBuild
int SigGroupBuild(DetectEngineCtx *de_ctx)
Convert the signature list into the runtime match structure.
Definition: detect-engine-build.c:2194
StatsThreadInit
void StatsThreadInit(StatsThreadContext *stats)
Definition: counters.c:1333
alert-fastlog.h
Signature_::class_msg
char * class_msg
Definition: detect.h:739
MAX_FASTLOG_ALERT_SIZE
#define MAX_FASTLOG_ALERT_SIZE
Definition: alert-fastlog.c:64
OutputInitResult_
Definition: output.h:46
FAIL_IF
#define FAIL_IF(expr)
Fail a test if expression evaluates to true.
Definition: util-unittest.h:71
GET_IPV4_SRC_ADDR_PTR
#define GET_IPV4_SRC_ADDR_PTR(p)
Definition: decode.h:198
PrintBufferData
#define PrintBufferData(buf, buf_offset_ptr, buf_size,...)
Definition: util-print.h:27
suricata-common.h
OutputCtx_::DeInit
void(* DeInit)(struct OutputCtx_ *)
Definition: tm-modules.h:94
ACTION_DROP
#define ACTION_DROP
Definition: action-globals.h:30
DetectEngineThreadCtxDeinit
TmEcode DetectEngineThreadCtxDeinit(ThreadVars *tv, void *data)
Definition: detect-engine.c:3651
OutputPacketLoggerFunctions_::LogFunc
PacketLogger LogFunc
Definition: output.h:88
OutputRegisterPacketModule
void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, OutputPacketLoggerFunctions *output_module_functions)
Register a packet output module.
Definition: output.c:195
Signature_::rev
uint32_t rev
Definition: detect.h:715
LogFileFreeCtx
int LogFileFreeCtx(LogFileCtx *lf_ctx)
LogFileFreeCtx() Destroy a LogFileCtx (Close the file and free memory)
Definition: util-logopenfile.c:920
util-classification-config.h
DetectEngineCtx_::sig_list
Signature * sig_list
Definition: detect.h:942
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:33
Signature_::prio
int prio
Definition: detect.h:716
util-optimize.h
threadvars.h
AlertFastLogThread
struct AlertFastLogThread_ AlertFastLogThread
SCConfLogOpenGeneric
int SCConfLogOpenGeneric(SCConfNode *conf, LogFileCtx *log_ctx, const char *default_filename, int rotate)
open a generic output "log file", which may be a regular file or a socket
Definition: util-logopenfile.c:480
GET_IPV6_SRC_ADDR
#define GET_IPV6_SRC_ADDR(p)
Definition: decode.h:203
SCFree
#define SCFree(p)
Definition: util-mem.h:61
util-logopenfile.h
Signature_::id
uint32_t id
Definition: detect.h:713
detect-parse.h
DetectEngineCtxInit
DetectEngineCtx * DetectEngineCtxInit(void)
Definition: detect-engine.c:2645
MODULE_NAME
#define MODULE_NAME
Definition: alert-fastlog.c:61
EngineModeIsIPS
int EngineModeIsIPS(void)
Definition: suricata.c:246
SCClassConfGenerateValidDummyClassConfigFD01
FILE * SCClassConfGenerateValidDummyClassConfigFD01(void)
Creates a dummy classification file, with all valid Classtypes, for testing purposes.
Definition: util-classification-config.c:586
PacketAlert_
Definition: decode.h:248
likely
#define likely(expr)
Definition: util-optimize.h:32
DetectEngineCtx_::flags
uint8_t flags
Definition: detect.h:935
Signature_::msg
char * msg
Definition: detect.h:736
flow.h
Packet_::dp
Port dp
Definition: decode.h:516
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
ThreadVars_::stats
StatsThreadContext stats
Definition: threadvars.h:121
SCConfNode_
Definition: conf.h:37
StatsThreadCleanup
void StatsThreadCleanup(StatsThreadContext *stats)
Definition: counters.c:1429
OutputPacketLoggerFunctions_
Definition: output.h:87
LOGGER_ALERT_FAST
@ LOGGER_ALERT_FAST
Definition: suricata-common.h:495
SCClassConfLoadClassificationConfigFile
bool SCClassConfLoadClassificationConfigFile(DetectEngineCtx *de_ctx, FILE *fd)
Loads the Classtype info from the classification.config file.
Definition: util-classification-config.c:519
AlertFastLogThreadDeinit
TmEcode AlertFastLogThreadDeinit(ThreadVars *, void *)
Definition: alert-fastlog.c:216
CreateTimeString
void CreateTimeString(const SCTime_t ts, char *str, size_t size)
Definition: util-time.c:272
output.h
SCClassConfDeInitContext
void SCClassConfDeInitContext(DetectEngineCtx *de_ctx)
Releases resources used by the Classification Config API.
Definition: util-classification-config.c:190
UTHFreePackets
void UTHFreePackets(Packet **p, int numpkts)
UTHFreePackets: function to release the allocated data from UTHBuildPacket and the packet itself.
Definition: util-unittest-helper.c:456