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 int AlertFastLogCondition(ThreadVars *tv, void *thread_data, const Packet *p);
75 int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p);
76 
78 {
83 }
84 
85 typedef struct AlertFastLogThread_ {
86  /** LogFileCtx has the pointer to the file and a mutex to allow multithreading */
89 
90 int AlertFastLogCondition(ThreadVars *tv, void *thread_data, const Packet *p)
91 {
92  return (p->alerts.cnt ? TRUE : FALSE);
93 }
94 
95 static inline void AlertFastLogOutputAlert(AlertFastLogThread *aft, char *buffer,
96  int alert_size)
97 {
98  /* Output the alert string and count alerts. Only need to lock here. */
99  aft->file_ctx->Write(buffer, alert_size, aft->file_ctx);
100 }
101 
102 int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p)
103 {
104  AlertFastLogThread *aft = (AlertFastLogThread *)data;
105  int i;
106  char timebuf[64];
107  int decoder_event = 0;
108 
109  CreateTimeString(p->ts, timebuf, sizeof(timebuf));
110 
111  char srcip[46], dstip[46];
112  if (PKT_IS_IPV4(p)) {
113  PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
114  PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
115  } else if (PKT_IS_IPV6(p)) {
116  PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
117  PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
118  } else {
119  decoder_event = 1;
120  }
121 
122  /* Buffer to store the generated alert strings. The buffer is
123  * filled with alert strings until it doesn't have room to store
124  * another full alert, only then is the buffer written. This is
125  * more efficient for multiple alerts and only slightly slower for
126  * single alerts.
127  */
128  char alert_buffer[MAX_FASTLOG_BUFFER_SIZE];
129 
130  char proto[16] = "";
131  const char *protoptr;
133  protoptr = known_proto[IP_GET_IPPROTO(p)];
134  } else {
135  snprintf(proto, sizeof(proto), "PROTO:%03" PRIu32, IP_GET_IPPROTO(p));
136  protoptr = proto;
137  }
138  uint16_t src_port_or_icmp = p->sp;
139  uint16_t dst_port_or_icmp = p->dp;
140  if (IP_GET_IPPROTO(p) == IPPROTO_ICMP || IP_GET_IPPROTO(p) == IPPROTO_ICMPV6) {
141  src_port_or_icmp = p->icmp_s.type;
142  dst_port_or_icmp = p->icmp_s.code;
143  }
144  for (i = 0; i < p->alerts.cnt; i++) {
145  const PacketAlert *pa = &p->alerts.alerts[i];
146  if (unlikely(pa->s == NULL)) {
147  continue;
148  }
149 
150  const char *action = "";
151  if ((pa->action & ACTION_DROP) && EngineModeIsIPS()) {
152  action = "[Drop] ";
153  } else if (pa->action & ACTION_DROP) {
154  action = "[wDrop] ";
155  }
156 
157  /* Create the alert string without locking. */
158  int size = 0;
159  if (likely(decoder_event == 0)) {
160  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
161  "%s %s[**] [%" PRIu32 ":%" PRIu32 ":%"
162  PRIu32 "] %s [**] [Classification: %s] [Priority: %"PRIu32"]"
163  " {%s} %s:%" PRIu32 " -> %s:%" PRIu32 "\n", timebuf, action,
164  pa->s->gid, pa->s->id, pa->s->rev, pa->s->msg, pa->s->class_msg, pa->s->prio,
165  protoptr, srcip, src_port_or_icmp, dstip, dst_port_or_icmp);
166  } else {
167  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
168  "%s %s[**] [%" PRIu32 ":%" PRIu32
169  ":%" PRIu32 "] %s [**] [Classification: %s] [Priority: "
170  "%" PRIu32 "] [**] [Raw pkt: ", timebuf, action, pa->s->gid,
171  pa->s->id, pa->s->rev, pa->s->msg, pa->s->class_msg, pa->s->prio);
172  PrintBufferRawLineHex(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
173  GET_PKT_DATA(p), GET_PKT_LEN(p) < 32 ? GET_PKT_LEN(p) : 32);
174  if (p->pcap_cnt != 0) {
175  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE,
176  "] [pcap file packet: %"PRIu64"]\n", p->pcap_cnt);
177  } else {
178  PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE, "]\n");
179  }
180  }
181 
182  /* Write the alert to output file */
183  AlertFastLogOutputAlert(aft, alert_buffer, size);
184  }
185 
186  return TM_ECODE_OK;
187 }
188 
189 TmEcode AlertFastLogThreadInit(ThreadVars *t, const void *initdata, void **data)
190 {
192  if (unlikely(aft == NULL))
193  return TM_ECODE_FAILED;
194  memset(aft, 0, sizeof(AlertFastLogThread));
195  if(initdata == NULL)
196  {
197  SCLogDebug("Error getting context for AlertFastLog. \"initdata\" argument NULL");
198  SCFree(aft);
199  return TM_ECODE_FAILED;
200  }
201  /** Use the Ouptut Context (file pointer and mutex) */
202  aft->file_ctx = ((OutputCtx *)initdata)->data;
203 
204  *data = (void *)aft;
205  return TM_ECODE_OK;
206 }
207 
209 {
210  AlertFastLogThread *aft = (AlertFastLogThread *)data;
211  if (aft == NULL) {
212  return TM_ECODE_OK;
213  }
214 
215  /* clear memory */
216  memset(aft, 0, sizeof(AlertFastLogThread));
217 
218  SCFree(aft);
219  return TM_ECODE_OK;
220 }
221 
222 /**
223  * \brief Create a new LogFileCtx for "fast" output style.
224  * \param conf The configuration node for this output.
225  * \return A LogFileCtx pointer on success, NULL on failure.
226  */
228 {
229  OutputInitResult result = { NULL, false };
230  LogFileCtx *logfile_ctx = LogFileNewCtx();
231  if (logfile_ctx == NULL) {
232  SCLogDebug("AlertFastLogInitCtx2: Could not create new LogFileCtx");
233  return result;
234  }
235 
236  if (SCConfLogOpenGeneric(conf, logfile_ctx, DEFAULT_LOG_FILENAME, 1) < 0) {
237  LogFileFreeCtx(logfile_ctx);
238  return result;
239  }
240 
241  OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx));
242  if (unlikely(output_ctx == NULL)) {
243  LogFileFreeCtx(logfile_ctx);
244  return result;
245  }
246 
247  output_ctx->data = logfile_ctx;
248  output_ctx->DeInit = AlertFastLogDeInitCtx;
249 
250  result.ctx = output_ctx;
251  result.ok = true;
252  return result;
253 }
254 
255 static void AlertFastLogDeInitCtx(OutputCtx *output_ctx)
256 {
257  LogFileCtx *logfile_ctx = (LogFileCtx *)output_ctx->data;
258  LogFileFreeCtx(logfile_ctx);
259  SCFree(output_ctx);
260 }
261 
262 /*------------------------------Unittests-------------------------------------*/
263 
264 #ifdef UNITTESTS
265 
266 static int AlertFastLogTest01(void)
267 {
268  uint8_t *buf = (uint8_t *) "GET /one/ HTTP/1.1\r\n"
269  "Host: one.example.org\r\n";
270 
271  uint16_t buflen = strlen((char *)buf);
272  Packet *p = NULL;
273  ThreadVars th_v;
274  DetectEngineThreadCtx *det_ctx;
275 
276  memset(&th_v, 0, sizeof(th_v));
277  p = UTHBuildPacket(buf, buflen, IPPROTO_TCP);
278 
280  FAIL_IF(de_ctx == NULL);
281 
282  de_ctx->flags |= DE_QUIET;
283 
286 
287  de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any "
288  "(msg:\"FastLog test\"; content:\"GET\"; "
289  "Classtype:unknown; sid:1;)");
290 
292  DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
293 
294  SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
295  FAIL_IF_NOT(p->alerts.cnt == 1);
296  FAIL_IF_NOT(strcmp(p->alerts.alerts[0].s->class_msg, "Unknown are we") == 0);
297 
300  DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
302 
303  UTHFreePackets(&p, 1);
304  PASS;
305 }
306 
307 static int AlertFastLogTest02(void)
308 {
309  uint8_t *buf = (uint8_t *) "GET /one/ HTTP/1.1\r\n"
310  "Host: one.example.org\r\n";
311  uint16_t buflen = strlen((char *)buf);
312  Packet *p = NULL;
313  ThreadVars th_v;
314  DetectEngineThreadCtx *det_ctx;
315 
316  memset(&th_v, 0, sizeof(th_v));
317 
318  p = UTHBuildPacket(buf, buflen, IPPROTO_TCP);
319 
321  FAIL_IF(de_ctx == NULL);
322 
323  de_ctx->flags |= DE_QUIET;
324 
327 
328  de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any "
329  "(msg:\"FastLog test\"; content:\"GET\"; "
330  "Classtype:unknown; sid:1;)");
331 
333  DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
334 
335  SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
336  FAIL_IF_NOT(p->alerts.cnt == 1);
337  FAIL_IF_NOT(strcmp(p->alerts.alerts[0].s->class_msg, "Unknown are we") == 0);
338 
341  DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
343 
344  UTHFreePackets(&p, 1);
345  PASS;
346 }
347 
348 #endif /* UNITTESTS */
349 
350 /**
351  * \brief This function registers unit tests for AlertFastLog API.
352  */
354 {
355 
356 #ifdef UNITTESTS
357 
358  UtRegisterTest("AlertFastLogTest01", AlertFastLogTest01);
359  UtRegisterTest("AlertFastLogTest02", AlertFastLogTest02);
360 
361 #endif /* UNITTESTS */
362 
363 }
tm-threads.h
AlertFastLogThread_
Definition: alert-fastlog.c:85
AlertFastLogger
int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p)
Definition: alert-fastlog.c:102
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:267
PKT_IS_IPV6
#define PKT_IS_IPV6(p)
Definition: decode.h:246
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
AlertFastLogInitCtx
OutputInitResult AlertFastLogInitCtx(ConfNode *conf)
Create a new LogFileCtx for "fast" output style.
Definition: alert-fastlog.c:227
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:672
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:269
Packet_::pcap_cnt
uint64_t pcap_cnt
Definition: decode.h:594
PacketAlerts_::cnt
uint16_t cnt
Definition: decode.h:289
action-globals.h
threads.h
AlertFastLogRegister
void AlertFastLogRegister(void)
Definition: alert-fastlog.c:77
LogFileCtx_
Definition: util-logopenfile.h:73
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:785
DetectEngineCtxFree
void DetectEngineCtxFree(DetectEngineCtx *)
Free a DetectEngineCtx::
Definition: detect-engine.c:2442
PacketAlerts_::alerts
PacketAlert * alerts
Definition: decode.h:292
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:454
DE_QUIET
#define DE_QUIET
Definition: detect.h:287
util-privs.h
LogFileCtx_::Write
int(* Write)(const char *buffer, int buffer_len, struct LogFileCtx_ *fp)
Definition: util-logopenfile.h:89
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:337
SigMatchSignatures
void SigMatchSignatures(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p)
wrapper for old tests
Definition: detect.c:1809
proto
uint8_t proto
Definition: decode-template.h:0
SigCleanSignatures
void SigCleanSignatures(DetectEngineCtx *de_ctx)
Definition: detect-engine-build.c:46
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:85
AlertFastLogThreadInit
TmEcode AlertFastLogThreadInit(ThreadVars *, const void *, void **)
Definition: alert-fastlog.c:189
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:214
Packet_::alerts
PacketAlerts alerts
Definition: decode.h:588
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:81
AlertFastLogThread_::file_ctx
LogFileCtx * file_ctx
Definition: alert-fastlog.c:87
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:84
OutputCtx_
Definition: tm-modules.h:78
SCConfLogOpenGeneric
int SCConfLogOpenGeneric(ConfNode *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:465
PacketAlert_::action
uint8_t action
Definition: decode.h:265
detect-reference.h
Packet_::icmp_s
struct Packet_::@32::@42 icmp_s
Signature_::gid
uint32_t gid
Definition: detect.h:575
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:209
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:17
OutputInitResult_::ctx
OutputCtx * ctx
Definition: output.h:47
DetectEngineThreadCtx_
Definition: detect.h:1025
Packet_::ts
SCTime_t ts
Definition: decode.h:471
util-print.h
GET_PKT_DATA
#define GET_PKT_DATA(p)
Definition: decode.h:219
detect-engine-mpm.h
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:274
Packet_::sp
Port sp
Definition: decode.h:435
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:2129
TRUE
#define TRUE
Definition: suricata-common.h:33
SigGroupCleanup
int SigGroupCleanup(DetectEngineCtx *de_ctx)
Definition: detect-engine-build.c:2019
FALSE
#define FALSE
Definition: suricata-common.h:34
Packet_
Definition: decode.h:428
detect-engine-build.h
GET_PKT_LEN
#define GET_PKT_LEN(p)
Definition: decode.h:218
SCClassConfLoadClassficationConfigFile
bool SCClassConfLoadClassficationConfigFile(DetectEngineCtx *de_ctx, FILE *fd)
Loads the Classtype info from the classification.config file.
Definition: util-classification-config.c:526
conf.h
AlertFastLogCondition
int AlertFastLogCondition(ThreadVars *tv, void *thread_data, const Packet *p)
Definition: alert-fastlog.c:90
TmEcode
TmEcode
Definition: tm-threads-common.h:83
util-proto-name.h
SigGroupBuild
int SigGroupBuild(DetectEngineCtx *de_ctx)
Convert the signature list into the runtime match structure.
Definition: detect-engine-build.c:1951
alert-fastlog.h
Signature_::class_msg
char * class_msg
Definition: detect.h:603
MAX_FASTLOG_ALERT_SIZE
#define MAX_FASTLOG_ALERT_SIZE
Definition: alert-fastlog.c:64
OutputInitResult_
Definition: output.h:46
DetectEngineThreadCtxInit
TmEcode DetectEngineThreadCtxInit(ThreadVars *, void *, void **)
initialize thread specific detection engine context
Definition: detect-engine.c:3153
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:208
PrintBufferData
#define PrintBufferData(buf, buf_offset_ptr, buf_size,...)
Definition: util-print.h:29
suricata-common.h
DetectEngineThreadCtxDeinit
TmEcode DetectEngineThreadCtxDeinit(ThreadVars *, void *)
Definition: detect-engine.c:3367
OutputCtx_::DeInit
void(* DeInit)(struct OutputCtx_ *)
Definition: tm-modules.h:84
ACTION_DROP
#define ACTION_DROP
Definition: action-globals.h:30
Signature_::rev
uint32_t rev
Definition: detect.h:576
LogFileFreeCtx
int LogFileFreeCtx(LogFileCtx *lf_ctx)
LogFileFreeCtx() Destroy a LogFileCtx (Close the file and free memory)
Definition: util-logopenfile.c:899
util-classification-config.h
DetectEngineCtx_::sig_list
Signature * sig_list
Definition: detect.h:791
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
Signature_::prio
int prio
Definition: detect.h:577
util-optimize.h
OutputRegisterPacketModule
void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a packet output module.
Definition: output.c:175
threadvars.h
SCMalloc
#define SCMalloc(sz)
Definition: util-mem.h:47
AlertFastLogThread
struct AlertFastLogThread_ AlertFastLogThread
GET_IPV6_SRC_ADDR
#define GET_IPV6_SRC_ADDR(p)
Definition: decode.h:213
SCFree
#define SCFree(p)
Definition: util-mem.h:61
ConfNode_
Definition: conf.h:32
util-logopenfile.h
Signature_::id
uint32_t id
Definition: detect.h:574
detect-parse.h
IP_GET_IPPROTO
#define IP_GET_IPPROTO(p)
Definition: decode.h:257
DetectEngineCtxInit
DetectEngineCtx * DetectEngineCtxInit(void)
Definition: detect-engine.c:2403
MODULE_NAME
#define MODULE_NAME
Definition: alert-fastlog.c:61
EngineModeIsIPS
int EngineModeIsIPS(void)
Definition: suricata.c:211
SCClassConfGenerateValidDummyClassConfigFD01
FILE * SCClassConfGenerateValidDummyClassConfigFD01(void)
Creates a dummy classification file, with all valid Classtypes, for testing purposes.
Definition: util-classification-config.c:589
PacketAlert_
Definition: decode.h:263
likely
#define likely(expr)
Definition: util-optimize.h:32
DetectEngineCtx_::flags
uint8_t flags
Definition: detect.h:786
Signature_::msg
char * msg
Definition: detect.h:600
flow.h
Packet_::dp
Port dp
Definition: decode.h:443
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
PKT_IS_IPV4
#define PKT_IS_IPV4(p)
Definition: decode.h:245
LOGGER_ALERT_FAST
@ LOGGER_ALERT_FAST
Definition: suricata-common.h:466
AlertFastLogThreadDeinit
TmEcode AlertFastLogThreadDeinit(ThreadVars *, void *)
Definition: alert-fastlog.c:208
CreateTimeString
void CreateTimeString(const SCTime_t ts, char *str, size_t size)
Definition: util-time.c:272
output.h
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:468