suricata
alert-debuglog.c
Go to the documentation of this file.
1/* Copyright (C) 2007-2014 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
24#include "suricata-common.h"
25#include "suricata.h"
26
27#include "detect.h"
28#include "flow.h"
29#include "conf.h"
30#include "stream.h"
31#include "app-layer-protos.h"
32
33#include "threads.h"
34#include "threadvars.h"
35#include "tm-threads.h"
36
37#include "util-print.h"
38
39#include "pkt-var.h"
40
41#include "util-unittest.h"
42
43#include "util-debug.h"
44#include "util-validate.h"
45#include "util-buffer.h"
46
47#include "output.h"
48#include "alert-debuglog.h"
49#include "util-privs.h"
50#include "flow-var.h"
51#include "flow-bit.h"
52#include "util-var-name.h"
53#include "util-optimize.h"
54#include "util-logopenfile.h"
55#include "util-time.h"
56
58
59#define DEFAULT_LOG_FILENAME "alert-debug.log"
60
61#define MODULE_NAME "AlertDebugLog"
62
63typedef struct AlertDebugLogThread_ {
65 /** LogFileCtx has the pointer to the file and a mutex to allow multithreading */
68
69/**
70 * \brief Function to log the FlowVars into alert-debug.log
71 *
72 * \param aft Pointer to AlertDebugLog Thread
73 * \param p Pointer to the packet
74 *
75 */
76static void AlertDebugLogFlowVars(AlertDebugLogThread *aft, const Packet *p)
77{
78 const GenericVar *gv = p->flow->flowvar;
79 uint16_t i;
80 while (gv != NULL) {
81 if (gv->type == DETECT_FLOWBITS) {
82 FlowBit *fb = (FlowBit *)gv;
83 const char *fbname = VarNameStoreLookupById(fb->idx, VAR_TYPE_FLOW_BIT);
84 if (fbname) {
85 MemBufferWriteString(aft->buffer, "FLOWBIT: %s\n",
86 fbname);
87 }
88 } else if (gv->type == DETECT_FLOWVAR || gv->type == DETECT_FLOWINT) {
89 FlowVar *fv = (FlowVar *) gv;
90
91 if (fv->datatype == FLOWVAR_TYPE_STR) {
92 const char *fvname = VarNameStoreLookupById(fv->idx,
94 MemBufferWriteString(aft->buffer, "FLOWVAR: \"%s\" => \"",
95 fvname);
96 for (i = 0; i < fv->data.fv_str.value_len; i++) {
97 if (isprint(fv->data.fv_str.value[i])) {
99 fv->data.fv_str.value[i]);
100 } else {
101 MemBufferWriteString(aft->buffer, "\\%02X",
102 fv->data.fv_str.value[i]);
103 }
104 }
105 MemBufferWriteString(aft->buffer, "\"\n");
106 } else if (fv->datatype == FLOWVAR_TYPE_INT) {
107 const char *fvname = VarNameStoreLookupById(fv->idx,
109 MemBufferWriteString(aft->buffer, "FLOWINT: \"%s\" =>"
110 " %"PRIu32"\n", fvname, fv->data.fv_int.value);
111 }
112 }
113 gv = gv->next;
114 }
115}
116
117/**
118 * \brief Function to log the PktVars into alert-debug.log
119 *
120 * \param aft Pointer to AlertDebugLog Thread
121 * \param p Pointer to the packet
122 *
123 */
124static void AlertDebugLogPktVars(AlertDebugLogThread *aft, const Packet *p)
125{
126 const PktVar *pv = p->pktvar;
127
128 while (pv != NULL) {
129 const char *varname = VarNameStoreLookupById(pv->id, VAR_TYPE_PKT_VAR);
130 MemBufferWriteString(aft->buffer, "PKTVAR: %s\n", varname);
132 pv->value, pv->value_len);
133 pv = pv->next;
134 }
135}
136
137/** \todo doc
138 * assume we have aft lock */
139static int AlertDebugPrintStreamSegmentCallback(
140 const Packet *p, TcpSegment *seg, void *data, const uint8_t *buf, uint32_t buflen)
141{
143
144 MemBufferWriteString(aft->buffer, "STREAM DATA LEN: %"PRIu32"\n", buflen);
145 MemBufferWriteString(aft->buffer, "STREAM DATA:\n");
146
148 buf, buflen);
149
150 return 1;
151}
152
153static TmEcode AlertDebugLogger(ThreadVars *tv, const Packet *p, void *thread_data)
154{
155 AlertDebugLogThread *aft = (AlertDebugLogThread *)thread_data;
156 int i;
157 char timebuf[64];
158 const char *pkt_src_str = NULL;
159
160 if (p->alerts.cnt == 0)
161 return TM_ECODE_OK;
162
163 MemBufferReset(aft->buffer);
164
165 CreateTimeString(p->ts, timebuf, sizeof(timebuf));
166
167 MemBufferWriteString(aft->buffer, "+================\n"
168 "TIME: %s\n", timebuf);
169 if (p->pcap_cnt > 0) {
170 MemBufferWriteString(aft->buffer, "PCAP PKT NUM: %"PRIu64"\n", p->pcap_cnt);
171 }
172 pkt_src_str = PktSrcToString(p->pkt_src);
173 MemBufferWriteString(aft->buffer, "PKT SRC: %s\n", pkt_src_str);
174
175 char srcip[46], dstip[46];
176 if (PacketIsIPv4(p)) {
177 PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
178 PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
179 } else {
180 DEBUG_VALIDATE_BUG_ON(!(PacketIsIPv6(p)));
181 PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
182 PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
183 }
184
185 MemBufferWriteString(aft->buffer, "SRC IP: %s\n"
186 "DST IP: %s\n"
187 "PROTO: %" PRIu32 "\n",
188 srcip, dstip, p->proto);
189 if (PacketIsTCP(p) || PacketIsUDP(p)) {
190 MemBufferWriteString(aft->buffer, "SRC PORT: %" PRIu32 "\n"
191 "DST PORT: %" PRIu32 "\n",
192 p->sp, p->dp);
193 if (PacketIsTCP(p)) {
194 const TCPHdr *tcph = PacketGetTCP(p);
196 "TCP SEQ: %" PRIu32 "\n"
197 "TCP ACK: %" PRIu32 "\n",
198 TCP_GET_RAW_SEQ(tcph), TCP_GET_RAW_ACK(tcph));
199 }
200 }
201
202 /* flow stuff */
203 MemBufferWriteString(aft->buffer, "FLOW: to_server: %s, "
204 "to_client: %s\n",
205 p->flowflags & FLOW_PKT_TOSERVER ? "TRUE" : "FALSE",
206 p->flowflags & FLOW_PKT_TOCLIENT ? "TRUE" : "FALSE");
207
208 if (p->flow != NULL) {
209 int applayer = 0;
210 applayer = StreamTcpAppLayerIsDisabled(p->flow);
211 CreateTimeString(p->flow->startts, timebuf, sizeof(timebuf));
212 MemBufferWriteString(aft->buffer, "FLOW Start TS: %s\n", timebuf);
213 MemBufferWriteString(aft->buffer, "FLOW PKTS TODST: %"PRIu32"\n"
214 "FLOW PKTS TOSRC: %"PRIu32"\n"
215 "FLOW Total Bytes: %"PRIu64"\n",
219 "FLOW ACTION: DROP: %s\n"
220 "FLOW PAYLOAD: %s, APP_LAYER: %s\n"
221 "FLOW APP_LAYER: DETECTED: %s, PROTO %" PRIu16 "\n",
222 p->flow->flags & FLOW_ACTION_DROP ? "TRUE" : "FALSE",
223 p->flow->flags & FLOW_NOPAYLOAD_INSPECTION ? "TRUE" : "FALSE",
224 applayer ? "TRUE" : "FALSE",
225 (p->flow->alproto != ALPROTO_UNKNOWN) ? "TRUE" : "FALSE", p->flow->alproto);
226 AlertDebugLogFlowVars(aft, p);
227 }
228
229 AlertDebugLogPktVars(aft, p);
230
231/* any stuff */
232/* Sig details? */
233
235 "PACKET LEN: %" PRIu32 "\n"
236 "PACKET:\n",
237 GET_PKT_LEN(p));
240
241 MemBufferWriteString(aft->buffer, "ALERT CNT: %" PRIu32 "\n",
242 p->alerts.cnt);
243
244 for (i = 0; i < p->alerts.cnt; i++) {
245 const PacketAlert *pa = &p->alerts.alerts[i];
246 if (unlikely(pa->s == NULL)) {
247 continue;
248 }
249
251 "ALERT MSG [%02d]: %s\n"
252 "ALERT GID [%02d]: %" PRIu32 "\n"
253 "ALERT SID [%02d]: %" PRIu32 "\n"
254 "ALERT REV [%02d]: %" PRIu32 "\n"
255 "ALERT CLASS [%02d]: %s\n"
256 "ALERT PRIO [%02d]: %" PRIu32 "\n"
257 "ALERT FOUND IN [%02d]: %s\n",
258 i, pa->s->msg,
259 i, pa->s->gid,
260 i, pa->s->id,
261 i, pa->s->rev,
262 i, pa->s->class_msg ? pa->s->class_msg : "<none>",
263 i, pa->s->prio,
264 i,
265 pa->flags & PACKET_ALERT_FLAG_STREAM_MATCH ? "STREAM" :
266 (pa->flags & PACKET_ALERT_FLAG_STATE_MATCH ? "STATE" : "PACKET"));
267 if (pa->flags & PACKET_ALERT_FLAG_TX) {
269 "ALERT IN TX [%02d]: %"PRIu64"\n", i, pa->tx_id);
270 } else {
272 "ALERT IN TX [%02d]: N/A\n", i);
273 }
274 if (p->payload_len > 0) {
276 "PAYLOAD LEN: %" PRIu32 "\n"
277 "PAYLOAD:\n",
278 p->payload_len);
280 p->payload, p->payload_len);
281 }
284 /* This is an app layer or stream alert */
285 int ret;
286 uint8_t flag;
287 if (!(PacketIsTCP(p)) || p->flow == NULL || p->flow->protoctx == NULL) {
288 return TM_ECODE_OK;
289 }
290 /* IDS mode reverse the data */
291 /** \todo improve the order selection policy */
292 if (p->flowflags & FLOW_PKT_TOSERVER) {
294 } else {
296 }
297 ret = StreamSegmentForEach((const Packet *)p, flag,
298 AlertDebugPrintStreamSegmentCallback,
299 (void *)aft);
300 if (ret < 0) {
301 return TM_ECODE_FAILED;
302 }
303 }
304 }
305
306 aft->file_ctx->Write((const char *)MEMBUFFER_BUFFER(aft->buffer),
307 MEMBUFFER_OFFSET(aft->buffer), aft->file_ctx);
308
309 return TM_ECODE_OK;
310}
311
312static TmEcode AlertDebugLogDecoderEvent(ThreadVars *tv, const Packet *p, void *thread_data)
313{
314 AlertDebugLogThread *aft = (AlertDebugLogThread *)thread_data;
315 int i;
316 char timebuf[64];
317 const char *pkt_src_str = NULL;
318
319 if (p->alerts.cnt == 0)
320 return TM_ECODE_OK;
321
322 MemBufferReset(aft->buffer);
323
324 CreateTimeString(p->ts, timebuf, sizeof(timebuf));
325
327 "+================\n"
328 "TIME: %s\n", timebuf);
329 if (p->pcap_cnt > 0) {
331 "PCAP PKT NUM: %"PRIu64"\n", p->pcap_cnt);
332 }
333 pkt_src_str = PktSrcToString(p->pkt_src);
334 MemBufferWriteString(aft->buffer, "PKT SRC: %s\n", pkt_src_str);
336 "ALERT CNT: %" PRIu32 "\n", p->alerts.cnt);
337
338 for (i = 0; i < p->alerts.cnt; i++) {
339 const PacketAlert *pa = &p->alerts.alerts[i];
340 if (unlikely(pa->s == NULL)) {
341 continue;
342 }
343
345 "ALERT MSG [%02d]: %s\n"
346 "ALERT GID [%02d]: %" PRIu32 "\n"
347 "ALERT SID [%02d]: %" PRIu32 "\n"
348 "ALERT REV [%02d]: %" PRIu32 "\n"
349 "ALERT CLASS [%02d]: %s\n"
350 "ALERT PRIO [%02d]: %" PRIu32 "\n",
351 i, pa->s->msg,
352 i, pa->s->gid,
353 i, pa->s->id,
354 i, pa->s->rev,
355 i, pa->s->class_msg,
356 i, pa->s->prio);
357 }
358
360 "PACKET LEN: %" PRIu32 "\n"
361 "PACKET:\n",
362 GET_PKT_LEN(p));
365
366 aft->file_ctx->Write((const char *)MEMBUFFER_BUFFER(aft->buffer),
367 MEMBUFFER_OFFSET(aft->buffer), aft->file_ctx);
368
369 return TM_ECODE_OK;
370}
371
372static TmEcode AlertDebugLogThreadInit(ThreadVars *t, const void *initdata, void **data)
373{
375 if (unlikely(aft == NULL))
376 return TM_ECODE_FAILED;
377
378 if(initdata == NULL)
379 {
380 SCLogDebug("Error getting context for AlertDebugLog. \"initdata\" argument NULL");
381 SCFree(aft);
382 return TM_ECODE_FAILED;
383 }
384 /** Use the Output Context (file pointer and mutex) */
385 aft->file_ctx = ((OutputCtx *)initdata)->data;
386
387 /* 1 mb seems sufficient enough */
388 aft->buffer = MemBufferCreateNew(1 * 1024 * 1024);
389 if (aft->buffer == NULL) {
390 SCFree(aft);
391 return TM_ECODE_FAILED;
392 }
393
394 *data = (void *)aft;
395 return TM_ECODE_OK;
396}
397
398static TmEcode AlertDebugLogThreadDeinit(ThreadVars *t, void *data)
399{
401 if (aft == NULL) {
402 return TM_ECODE_OK;
403 }
404
405 MemBufferFree(aft->buffer);
406 /* clear memory */
407 memset(aft, 0, sizeof(AlertDebugLogThread));
408
409 SCFree(aft);
410 return TM_ECODE_OK;
411}
412
413static void AlertDebugLogDeInitCtx(OutputCtx *output_ctx)
414{
415 if (output_ctx != NULL) {
416 LogFileCtx *logfile_ctx = (LogFileCtx *)output_ctx->data;
417 if (logfile_ctx != NULL) {
418 LogFileFreeCtx(logfile_ctx);
419 }
420 SCFree(output_ctx);
421 }
422}
423
424/**
425 * \brief Create a new LogFileCtx for alert debug logging.
426 *
427 * \param SCConfNode containing configuration for this logger.
428 *
429 * \return output_ctx if succesful, NULL otherwise
430 */
431static OutputInitResult AlertDebugLogInitCtx(SCConfNode *conf)
432{
433 OutputInitResult result = { NULL, false };
434 LogFileCtx *file_ctx = NULL;
435
436 file_ctx = LogFileNewCtx();
437 if (file_ctx == NULL) {
438 SCLogDebug("couldn't create new file_ctx");
439 goto error;
440 }
441
442 if (SCConfLogOpenGeneric(conf, file_ctx, DEFAULT_LOG_FILENAME, 1) < 0) {
443 goto error;
444 }
445
446 OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx));
447 if (unlikely(output_ctx == NULL))
448 goto error;
449
450 output_ctx->data = file_ctx;
451 output_ctx->DeInit = AlertDebugLogDeInitCtx;
452
453 SCLogDebug("Alert debug log output initialized");
454 result.ctx = output_ctx;
455 result.ok = true;
456 return result;
457
458error:
459 if (file_ctx != NULL) {
460 LogFileFreeCtx(file_ctx);
461 }
462
463 return result;
464}
465
466static bool AlertDebugLogCondition(ThreadVars *tv, void *thread_data, const Packet *p)
467{
468 return (p->alerts.cnt > 0);
469}
470
471static int AlertDebugLogLogger(ThreadVars *tv, void *thread_data, const Packet *p)
472{
473 if (PacketIsIPv4(p) || PacketIsIPv6(p)) {
474 return AlertDebugLogger(tv, p, thread_data);
475 } else if (p->events.cnt > 0) {
476 return AlertDebugLogDecoderEvent(tv, p, thread_data);
477 }
478 return TM_ECODE_OK;
479}
480
482{
483 OutputPacketLoggerFunctions output_logger_functions = {
484 .LogFunc = AlertDebugLogLogger,
485 .FlushFunc = NULL,
486 .ConditionFunc = AlertDebugLogCondition,
487 .ThreadInitFunc = AlertDebugLogThreadInit,
488 .ThreadDeinitFunc = AlertDebugLogThreadDeinit,
489 .ThreadExitPrintStatsFunc = NULL,
490 };
491
492 OutputRegisterPacketModule(LOGGER_ALERT_DEBUG, MODULE_NAME, "alert-debug", AlertDebugLogInitCtx,
493 &output_logger_functions);
494}
#define MODULE_NAME
void AlertDebugLogRegister(void)
#define DEFAULT_LOG_FILENAME
struct AlertDebugLogThread_ AlertDebugLogThread
@ ALPROTO_UNKNOWN
uint8_t flags
Definition decode-gre.h:0
#define TCP_GET_RAW_SEQ(tcph)
Definition decode-tcp.h:80
#define TCP_GET_RAW_ACK(tcph)
Definition decode-tcp.h:81
#define GET_IPV6_DST_ADDR(p)
Definition decode.h:204
#define GET_IPV4_SRC_ADDR_PTR(p)
Definition decode.h:198
#define GET_PKT_DATA(p)
Definition decode.h:209
#define GET_IPV6_SRC_ADDR(p)
Definition decode.h:203
#define GET_PKT_LEN(p)
Definition decode.h:208
#define GET_IPV4_DST_ADDR_PTR(p)
Definition decode.h:199
@ DETECT_FLOWBITS
#define FLOWVAR_TYPE_INT
Definition flow-var.h:34
#define FLOWVAR_TYPE_STR
Definition flow-var.h:33
#define FLOW_NOPAYLOAD_INSPECTION
Definition flow.h:67
#define FLOW_PKT_TOSERVER
Definition flow.h:233
#define FLOW_ACTION_DROP
Definition flow.h:70
#define FLOW_PKT_TOCLIENT
Definition flow.h:234
ThreadVars * tv
#define PACKET_ALERT_FLAG_TX
Definition decode.h:272
#define PACKET_ALERT_FLAG_STREAM_MATCH
Definition decode.h:270
#define PACKET_ALERT_FLAG_STATE_MATCH
Definition decode.h:268
const char * PktSrcToString(enum PktSrcEnum pkt_src)
Definition decode.c:855
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:196
int StreamTcpAppLayerIsDisabled(Flow *f)
int StreamSegmentForEach(const Packet *p, uint8_t flag, StreamSegmentCallback CallbackFunc, void *data)
Definition stream.c:40
#define STREAM_DUMP_TOCLIENT
Definition stream.h:32
#define STREAM_DUMP_TOSERVER
Definition stream.h:33
uint32_t idx
Definition flow-bit.h:33
uint32_t value
Definition flow-var.h:46
uint16_t value_len
Definition flow-var.h:41
uint8_t * value
Definition flow-var.h:40
uint8_t datatype
Definition flow-var.h:57
uint32_t idx
Definition flow-var.h:59
FlowVarTypeInt fv_int
Definition flow-var.h:65
FlowVarTypeStr fv_str
Definition flow-var.h:64
union FlowVar_::@124 data
uint32_t flags
Definition flow.h:421
GenericVar * flowvar
Definition flow.h:489
uint64_t tosrcbytecnt
Definition flow.h:498
void * protoctx
Definition flow.h:441
uint64_t todstbytecnt
Definition flow.h:497
uint32_t todstpktcnt
Definition flow.h:495
uint32_t tosrcpktcnt
Definition flow.h:496
SCTime_t startts
Definition flow.h:493
uint16_t type
Definition util-var.h:54
struct GenericVar_ * next
Definition util-var.h:57
int(* Write)(const char *buffer, int buffer_len, struct LogFileCtx_ *fp)
uint8_t buffer[]
Definition util-buffer.h:30
uint32_t size
Definition util-buffer.h:28
uint32_t offset
Definition util-buffer.h:29
void * data
Definition tm-modules.h:91
void(* DeInit)(struct OutputCtx_ *)
Definition tm-modules.h:94
OutputCtx * ctx
Definition output.h:47
const struct Signature_ * s
Definition decode.h:252
uint8_t flags
Definition decode.h:251
uint64_t tx_id
Definition decode.h:253
uint16_t cnt
Definition decode.h:287
PacketAlert * alerts
Definition decode.h:290
uint8_t flowflags
Definition decode.h:532
uint64_t pcap_cnt
Definition decode.h:626
SCTime_t ts
Definition decode.h:555
uint8_t pkt_src
Definition decode.h:611
Port sp
Definition decode.h:508
PktVar * pktvar
Definition decode.h:597
PacketAlerts alerts
Definition decode.h:620
struct Flow_ * flow
Definition decode.h:546
PacketEngineEvents events
Definition decode.h:630
uint8_t * payload
Definition decode.h:605
uint16_t payload_len
Definition decode.h:606
uint8_t proto
Definition decode.h:523
Port dp
Definition decode.h:516
struct PktVar_ * next
Definition decode.h:313
uint16_t value_len
Definition decode.h:317
uint32_t id
Definition decode.h:312
uint8_t * value
Definition decode.h:319
uint32_t rev
Definition detect.h:715
int prio
Definition detect.h:716
char * class_msg
Definition detect.h:739
uint32_t id
Definition detect.h:713
char * msg
Definition detect.h:736
uint32_t gid
Definition detect.h:714
Per thread variable structure.
Definition threadvars.h:58
@ LOGGER_ALERT_DEBUG
@ TM_ECODE_FAILED
@ TM_ECODE_OK
void MemBufferWriteString(MemBuffer *dst, const char *fmt,...)
MemBuffer * MemBufferCreateNew(uint32_t size)
Definition util-buffer.c:32
void MemBufferFree(MemBuffer *buffer)
Definition util-buffer.c:86
#define MEMBUFFER_BUFFER(mem_buffer)
Get the MemBuffers underlying buffer.
Definition util-buffer.h:51
#define MEMBUFFER_OFFSET(mem_buffer)
Get the MemBuffers current offset.
Definition util-buffer.h:56
#define SCLogDebug(...)
Definition util-debug.h:275
int LogFileFreeCtx(LogFileCtx *lf_ctx)
LogFileFreeCtx() Destroy a LogFileCtx (Close the file and free memory)
LogFileCtx * LogFileNewCtx(void)
LogFileNewCtx() Get a new LogFileCtx.
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
#define SCFree(p)
Definition util-mem.h:61
#define SCCalloc(nm, sz)
Definition util-mem.h:53
#define unlikely(expr)
void PrintRawDataToBuffer(uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32_t dst_buf_size, const uint8_t *src_buf, uint32_t src_buf_len)
Definition util-print.c:149
const char * PrintInet(int af, const void *src, char *dst, socklen_t size)
Definition util-print.c:231
void CreateTimeString(const SCTime_t ts, char *str, size_t size)
Definition util-time.c:272
#define DEBUG_VALIDATE_BUG_ON(exp)
const char * VarNameStoreLookupById(const uint32_t id, const enum VarTypes type)
find name for id+type at packet time. As the active store won't be modified, we don't need locks.
@ VAR_TYPE_FLOW_BIT
Definition util-var.h:36
@ VAR_TYPE_FLOW_VAR
Definition util-var.h:39
@ VAR_TYPE_PKT_VAR
Definition util-var.h:33
@ VAR_TYPE_FLOW_INT
Definition util-var.h:37