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 "tm-modules.h"
33 #include "threadvars.h"
34 #include "util-debug.h"
35 
36 #include "output.h"
37 #include "alert-fastlog.h"
38 
39 #include "util-print.h"
40 #include "util-proto-name.h"
41 #include "util-logopenfile.h"
42 #include "suricata.h"
43 
44 #include "action-globals.h"
45 
46 #define DEFAULT_LOG_FILENAME "fast.log"
47 
48 #define MODULE_NAME "AlertFastLog"
49 
50 /* The largest that size allowed for one alert string. */
51 #define MAX_FASTLOG_ALERT_SIZE 2048
52 /* The largest alert buffer that will be written at one time, possibly
53  * holding multiple alerts. */
54 #define MAX_FASTLOG_BUFFER_SIZE (2 * MAX_FASTLOG_ALERT_SIZE)
55 
56 TmEcode AlertFastLogThreadInit(ThreadVars *, const void *, void **);
58 void AlertFastLogRegisterTests(void);
59 static void AlertFastLogDeInitCtx(OutputCtx *);
60 
61 static bool AlertFastLogCondition(ThreadVars *tv, void *thread_data, const Packet *p);
62 int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p);
63 
65 {
66  OutputPacketLoggerFunctions output_logger_functions = {
68  .ConditionFunc = AlertFastLogCondition,
69  .ThreadInitFunc = AlertFastLogThreadInit,
70  .ThreadDeinitFunc = AlertFastLogThreadDeinit,
71  .ThreadExitPrintStatsFunc = NULL,
72  };
73 
75  LOGGER_ALERT_FAST, MODULE_NAME, "fast", AlertFastLogInitCtx, &output_logger_functions);
77 }
78 
79 typedef struct AlertFastLogThread_ {
80  /** LogFileCtx has the pointer to the file and a mutex to allow multithreading */
83 
84 static bool AlertFastLogCondition(ThreadVars *tv, void *thread_data, const Packet *p)
85 {
86  return (p->alerts.cnt > 0);
87 }
88 
89 static inline void AlertFastLogOutputAlert(AlertFastLogThread *aft, char *buffer,
90  int alert_size)
91 {
92  /* Output the alert string and count alerts. Only need to lock here. */
93  aft->file_ctx->Write(buffer, alert_size, aft->file_ctx);
94 }
95 
96 int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p)
97 {
99  int i;
100  char timebuf[64];
101  int decoder_event = 0;
102 
103  CreateTimeString(p->ts, timebuf, sizeof(timebuf));
104 
105  char srcip[46], dstip[46];
106  if (PacketIsIPv4(p)) {
107  PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
108  PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
109  } else if (PacketIsIPv6(p)) {
110  PrintInetIPv6((const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip),
111  aft->file_ctx->compress_ipv6);
112  PrintInetIPv6((const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip),
113  aft->file_ctx->compress_ipv6);
114  } else {
115  decoder_event = 1;
116  }
117 
118  /* Buffer to store the generated alert strings. The buffer is
119  * filled with alert strings until it doesn't have room to store
120  * another full alert, only then is the buffer written. This is
121  * more efficient for multiple alerts and only slightly slower for
122  * single alerts.
123  */
124  char alert_buffer[MAX_FASTLOG_BUFFER_SIZE];
125 
126  char proto[16] = "";
127  const char *protoptr;
128  if (SCProtoNameValid(PacketGetIPProto(p))) {
129  protoptr = known_proto[PacketGetIPProto(p)];
130  } else {
131  snprintf(proto, sizeof(proto), "PROTO:%03" PRIu32, PacketGetIPProto(p));
132  protoptr = proto;
133  }
134  uint16_t src_port_or_icmp = p->sp;
135  uint16_t dst_port_or_icmp = p->dp;
136  if (PacketGetIPProto(p) == IPPROTO_ICMP || PacketGetIPProto(p) == IPPROTO_ICMPV6) {
137  src_port_or_icmp = p->icmp_s.type;
138  dst_port_or_icmp = p->icmp_s.code;
139  }
140  for (i = 0; i < p->alerts.cnt; i++) {
141  const PacketAlert *pa = &p->alerts.alerts[i];
142  if (unlikely(pa->s == NULL || (pa->action & ACTION_ALERT) == 0)) {
143  continue;
144  }
145 
146  const char *action = "";
147  if ((pa->action & ACTION_DROP) && EngineModeIsIPS()) {
148  action = "[Drop] ";
149  } else if (pa->action & ACTION_DROP) {
150  action = "[wDrop] ";
151  }
152 
153  /* Create the alert string without locking. */
154  int size = 0;
155  if (likely(decoder_event == 0)) {
156  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
157  "%s %s[**] [%" PRIu32 ":%" PRIu32 ":%"
158  PRIu32 "] %s [**] [Classification: %s] [Priority: %"PRIu32"]"
159  " {%s} %s:%" PRIu32 " -> %s:%" PRIu32 "\n", timebuf, action,
160  pa->s->gid, pa->s->id, pa->s->rev, pa->s->msg, pa->s->class_msg, pa->s->prio,
161  protoptr, srcip, src_port_or_icmp, dstip, dst_port_or_icmp);
162  } else {
163  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
164  "%s %s[**] [%" PRIu32 ":%" PRIu32
165  ":%" PRIu32 "] %s [**] [Classification: %s] [Priority: "
166  "%" PRIu32 "] [**] [Raw pkt: ", timebuf, action, pa->s->gid,
167  pa->s->id, pa->s->rev, pa->s->msg, pa->s->class_msg, pa->s->prio);
168  PrintBufferRawLineHex(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
169  GET_PKT_DATA(p), GET_PKT_LEN(p) < 32 ? GET_PKT_LEN(p) : 32);
170  uint64_t pcap_cnt = PcapPacketCntGet(p);
171  if (pcap_cnt != 0) {
172  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
173  "] [pcap file packet: %" PRIu64 "]\n", pcap_cnt);
174  } else {
175  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE, "]\n");
176  }
177  }
178 
179  /* Write the alert to output file */
180  AlertFastLogOutputAlert(aft, alert_buffer, size);
181  }
182 
183  return TM_ECODE_OK;
184 }
185 
186 TmEcode AlertFastLogThreadInit(ThreadVars *t, const void *initdata, void **data)
187 {
189  if (unlikely(aft == NULL))
190  return TM_ECODE_FAILED;
191  if(initdata == NULL)
192  {
193  SCLogDebug("Error getting context for AlertFastLog. \"initdata\" argument NULL");
194  SCFree(aft);
195  return TM_ECODE_FAILED;
196  }
197  /** Use the Output Context (file pointer and mutex) */
198  aft->file_ctx = ((OutputCtx *)initdata)->data;
199 
200  *data = (void *)aft;
201  return TM_ECODE_OK;
202 }
203 
205 {
206  AlertFastLogThread *aft = (AlertFastLogThread *)data;
207  if (aft == NULL) {
208  return TM_ECODE_OK;
209  }
210 
211  /* clear memory */
212  memset(aft, 0, sizeof(AlertFastLogThread));
213 
214  SCFree(aft);
215  return TM_ECODE_OK;
216 }
217 
218 /**
219  * \brief Create a new LogFileCtx for "fast" output style.
220  * \param conf The configuration node for this output.
221  * \return A LogFileCtx pointer on success, NULL on failure.
222  */
224 {
225  OutputInitResult result = { NULL, false };
226  LogFileCtx *logfile_ctx = LogFileNewCtx();
227  if (logfile_ctx == NULL) {
228  SCLogDebug("AlertFastLogInitCtx2: Could not create new LogFileCtx");
229  return result;
230  }
231 
232  if (SCConfLogOpenGeneric(conf, logfile_ctx, DEFAULT_LOG_FILENAME, 1) < 0) {
233  LogFileFreeCtx(logfile_ctx);
234  return result;
235  }
236 
237  OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx));
238  if (unlikely(output_ctx == NULL)) {
239  LogFileFreeCtx(logfile_ctx);
240  return result;
241  }
242 
243  output_ctx->data = logfile_ctx;
244  output_ctx->DeInit = AlertFastLogDeInitCtx;
245 
246  result.ctx = output_ctx;
247  result.ok = true;
248  return result;
249 }
250 
251 static void AlertFastLogDeInitCtx(OutputCtx *output_ctx)
252 {
253  LogFileCtx *logfile_ctx = (LogFileCtx *)output_ctx->data;
254  LogFileFreeCtx(logfile_ctx);
255  SCFree(output_ctx);
256 }
257 
258 /*------------------------------Unittests-------------------------------------*/
259 
260 #ifdef UNITTESTS
261 
262 #include "util-unittest-helper.h"
263 #include "detect-engine.h"
264 #include "detect-engine-build.h"
265 #include "detect-parse.h"
267 
268 static int AlertFastLogTest01(void)
269 {
270  uint8_t *buf = (uint8_t *) "GET /one/ HTTP/1.1\r\n"
271  "Host: one.example.org\r\n";
272 
273  uint16_t buflen = strlen((char *)buf);
274  Packet *p = NULL;
276  memset(&th_v, 0, sizeof(th_v));
278 
279  p = UTHBuildPacket(buf, buflen, IPPROTO_TCP);
280 
282  FAIL_IF(de_ctx == NULL);
283  de_ctx->flags |= DE_QUIET;
284 
288 
289  de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any "
290  "(msg:\"FastLog test\"; content:\"GET\"; "
291  "Classtype:unknown; sid:1;)");
292 
294  DetectEngineThreadCtx *det_ctx;
295  DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
296 
297  SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
298  FAIL_IF_NOT(p->alerts.cnt == 1);
299  FAIL_IF_NOT(strcmp(p->alerts.alerts[0].s->class_msg, "Unknown are we") == 0);
300 
301  UTHFreePackets(&p, 1);
302  DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
305  PASS;
306 }
307 
308 static int AlertFastLogTest02(void)
309 {
310  uint8_t *buf = (uint8_t *) "GET /one/ HTTP/1.1\r\n"
311  "Host: one.example.org\r\n";
312  uint16_t buflen = strlen((char *)buf);
313  Packet *p = NULL;
315 
316  memset(&th_v, 0, sizeof(th_v));
318 
319  p = UTHBuildPacket(buf, buflen, IPPROTO_TCP);
320 
322  FAIL_IF(de_ctx == NULL);
323  de_ctx->flags |= DE_QUIET;
324 
328 
329  de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any "
330  "(msg:\"FastLog test\"; content:\"GET\"; "
331  "Classtype:unknown; sid:1;)");
332 
334  DetectEngineThreadCtx *det_ctx;
335  DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
336 
337  SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
338  FAIL_IF_NOT(p->alerts.cnt == 1);
339  FAIL_IF_NOT(strcmp(p->alerts.alerts[0].s->class_msg, "Unknown are we") == 0);
340 
341  UTHFreePackets(&p, 1);
342  DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
345  PASS;
346 }
347 
348 #endif /* UNITTESTS */
349 
350 /**
351  * \brief This function registers unit tests for AlertFastLog API.
352  */
354 {
355 #ifdef UNITTESTS
356  UtRegisterTest("AlertFastLogTest01", AlertFastLogTest01);
357  UtRegisterTest("AlertFastLogTest02", AlertFastLogTest02);
358 #endif /* UNITTESTS */
359 }
AlertFastLogThread_
Definition: alert-fastlog.c:79
AlertFastLogger
int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p)
Definition: alert-fastlog.c:96
detect-engine.h
AlertFastLogRegisterTests
void AlertFastLogRegisterTests(void)
This function registers unit tests for AlertFastLog API.
Definition: alert-fastlog.c:353
PacketAlert_::s
const struct Signature_ * s
Definition: decode.h:254
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:101
LogFileNewCtx
LogFileCtx * LogFileNewCtx(void)
LogFileNewCtx() Get a new LogFileCtx.
Definition: util-logopenfile.c:734
PcapPacketCntGet
uint64_t PcapPacketCntGet(const Packet *p)
Definition: decode.c:1193
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:282
PacketAlerts_::cnt
uint16_t cnt
Definition: decode.h:289
action-globals.h
PrintInetIPv6
const char * PrintInetIPv6(const void *src, char *dst, socklen_t size, bool compress_ipv6)
Definition: util-print.c:209
AlertFastLogRegister
void AlertFastLogRegister(void)
Definition: alert-fastlog.c:64
LogFileCtx_
Definition: util-logopenfile.h:77
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:995
DetectEngineCtxFree
void DetectEngineCtxFree(DetectEngineCtx *)
Free a DetectEngineCtx::
Definition: detect-engine.c:2912
PacketAlerts_::alerts
PacketAlert * alerts
Definition: decode.h:293
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:449
tm-modules.h
DE_QUIET
#define DE_QUIET
Definition: detect.h:334
LogFileCtx_::Write
int(* Write)(const char *buffer, int buffer_len, struct LogFileCtx_ *fp)
Definition: util-logopenfile.h:92
known_proto
const char * known_proto[256]
Definition: util-proto-name.c:39
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:241
SigMatchSignatures
void SigMatchSignatures(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p)
wrapper for old tests
Definition: detect.c:3305
p
Packet * p
Definition: fuzz_dataset.c:30
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:186
MAX_FASTLOG_BUFFER_SIZE
#define MAX_FASTLOG_BUFFER_SIZE
Definition: alert-fastlog.c:54
GET_IPV6_DST_ADDR
#define GET_IPV6_DST_ADDR(p)
Definition: decode.h:205
Packet_::alerts
PacketAlerts alerts
Definition: decode.h:637
DEFAULT_LOG_FILENAME
#define DEFAULT_LOG_FILENAME
Definition: alert-fastlog.c:46
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:81
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:251
Packet_::icmp_s
struct Packet_::@32::@39 icmp_s
Signature_::gid
uint32_t gid
Definition: detect.h:742
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:200
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:22
OutputInitResult_::ctx
OutputCtx * ctx
Definition: output.h:47
DetectEngineThreadCtx_
Definition: detect.h:1316
Packet_::ts
SCTime_t ts
Definition: decode.h:570
util-print.h
GET_PKT_DATA
#define GET_PKT_DATA(p)
Definition: decode.h:210
AlertFastLogInitCtx
OutputInitResult AlertFastLogInitCtx(SCConfNode *conf)
Create a new LogFileCtx for "fast" output style.
Definition: alert-fastlog.c:223
detect.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:57
PrintInet
const char * PrintInet(int af, const void *src, char *dst, socklen_t size)
Definition: util-print.c:238
DetectEngineThreadCtxInit
TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data)
initialize thread specific detection engine context
Definition: detect-engine.c:3660
Packet_::sp
Port sp
Definition: decode.h:523
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:3618
ACTION_ALERT
#define ACTION_ALERT
Definition: action-globals.h:29
Packet_
Definition: decode.h:516
detect-engine-build.h
GET_PKT_LEN
#define GET_PKT_LEN(p)
Definition: decode.h:209
conf.h
TmEcode
TmEcode
Definition: tm-threads-common.h:80
util-proto-name.h
LogFileCtx_::compress_ipv6
bool compress_ipv6
Definition: util-logopenfile.h:156
SigGroupBuild
int SigGroupBuild(DetectEngineCtx *de_ctx)
Convert the signature list into the runtime match structure.
Definition: detect-engine-build.c:2300
StatsThreadInit
void StatsThreadInit(StatsThreadContext *stats)
Definition: counters.c:1332
alert-fastlog.h
Signature_::class_msg
char * class_msg
Definition: detect.h:767
MAX_FASTLOG_ALERT_SIZE
#define MAX_FASTLOG_ALERT_SIZE
Definition: alert-fastlog.c:51
th_v
ThreadVars * th_v
Definition: fuzz_dataset.c:29
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:199
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:3905
OutputPacketLoggerFunctions_::LogFunc
PacketLogger LogFunc
Definition: output.h:87
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:193
Signature_::rev
uint32_t rev
Definition: detect.h:743
LogFileFreeCtx
int LogFileFreeCtx(LogFileCtx *lf_ctx)
LogFileFreeCtx() Destroy a LogFileCtx (Close the file and free memory)
Definition: util-logopenfile.c:951
util-classification-config.h
DetectEngineCtx_::sig_list
Signature * sig_list
Definition: detect.h:1005
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:34
Signature_::prio
int prio
Definition: detect.h:744
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:498
GET_IPV6_SRC_ADDR
#define GET_IPV6_SRC_ADDR(p)
Definition: decode.h:204
SCFree
#define SCFree(p)
Definition: util-mem.h:61
util-logopenfile.h
Signature_::id
uint32_t id
Definition: detect.h:741
detect-parse.h
DetectEngineCtxInit
DetectEngineCtx * DetectEngineCtxInit(void)
Definition: detect-engine.c:2873
MODULE_NAME
#define MODULE_NAME
Definition: alert-fastlog.c:48
EngineModeIsIPS
int EngineModeIsIPS(void)
Definition: suricata.c:247
SCClassConfGenerateValidDummyClassConfigFD01
FILE * SCClassConfGenerateValidDummyClassConfigFD01(void)
Creates a dummy classification file, with all valid Classtypes, for testing purposes.
Definition: util-classification-config.c:586
suricata.h
PacketAlert_
Definition: decode.h:249
likely
#define likely(expr)
Definition: util-optimize.h:32
DetectEngineCtx_::flags
uint8_t flags
Definition: detect.h:997
Signature_::msg
char * msg
Definition: detect.h:764
flow.h
Packet_::dp
Port dp
Definition: decode.h:531
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
ThreadVars_::stats
StatsThreadContext stats
Definition: threadvars.h:120
SCConfNode_
Definition: conf.h:37
StatsThreadCleanup
void StatsThreadCleanup(StatsThreadContext *stats)
Definition: counters.c:1428
OutputPacketLoggerFunctions_
Definition: output.h:86
LOGGER_ALERT_FAST
@ LOGGER_ALERT_FAST
Definition: suricata-common.h:499
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:204
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:453