suricata
util-runmodes.c
Go to the documentation of this file.
1 /* Copyright (C) 2011-2019 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 Eric Leblond <eric@regit.org>
22  *
23  * Helper function for runmode.
24  *
25  */
26 
27 #include "suricata-common.h"
28 #include "tm-threads.h"
29 #include "conf.h"
30 #include "runmodes.h"
31 #include "runmode-af-packet.h"
32 #include "output.h"
33 #include "log-httplog.h"
34 
35 #include "detect-engine.h"
36 #include "detect-engine-mpm.h"
37 
38 #include "alert-fastlog.h"
39 #include "alert-debuglog.h"
40 
41 #include "util-debug.h"
42 #include "util-time.h"
43 #include "util-cpu.h"
44 #include "util-affinity.h"
45 #include "util-device.h"
46 
47 #include "util-runmodes.h"
48 
49 #include "flow-hash.h"
50 
51 /** \brief create a queue string for autofp to pass to
52  * the flow queue handler.
53  *
54  * The string will be "pickup1,pickup2,pickup3\0"
55  */
57 {
58  if (n > 1024)
59  return NULL;
60 
61  /* 13 because pickup12345, = 12 + \0 */
62  size_t queues_size = n * 13;
63  char qname[TM_QUEUE_NAME_MAX];
64 
65  char *queues = SCCalloc(1, queues_size);
66  if (unlikely(queues == NULL)) {
67  SCLogError("failed to alloc queues buffer: %s", strerror(errno));
68  return NULL;
69  }
70 
71  for (int thread = 0; thread < n; thread++) {
72  if (strlen(queues) > 0)
73  strlcat(queues, ",", queues_size);
74 
75  snprintf(qname, sizeof(qname), "pickup%d", (int16_t)thread+1);
76  strlcat(queues, qname, queues_size);
77  }
78 
79  SCLogDebug("%d %"PRIuMAX", queues %s", n, (uintmax_t)queues_size, queues);
80  return queues;
81 }
82 
83 /**
84  */
86  ConfigIfaceThreadsCountFunc ModThreadsCount, const char *recv_mod_name,
87  const char *decode_mod_name, const char *thread_name, const char *live_dev)
88 {
89  char tname[TM_THREAD_NAME_MAX];
90  char qname[TM_QUEUE_NAME_MAX];
91 
92  /* Available cpus */
93  int nlive = LiveGetDeviceCount();
94  uint16_t thread_max = TmThreadsGetWorkerThreadMax();
95 
96  char *queues = RunmodeAutoFpCreatePickupQueuesString(thread_max);
97  if (queues == NULL) {
98  FatalError("RunmodeAutoFpCreatePickupQueuesString failed");
99  }
100 
101  if ((nlive <= 1) && (live_dev != NULL)) {
102  SCLogDebug("live_dev %s", live_dev);
103 
104  void *aconf = ConfigParser(live_dev);
105  if (aconf == NULL) {
106  FatalError("Failed to allocate config for %s", live_dev);
107  }
108 
109  int threads_count = ModThreadsCount(aconf);
110  SCLogInfo("Going to use %" PRId32 " %s receive thread(s)",
111  threads_count, recv_mod_name);
112 
113  /* create the threads */
114  for (int thread = 0; thread < threads_count; thread++) {
115  snprintf(tname, sizeof(tname), "%s#%02d", thread_name, thread+1);
116  ThreadVars *tv_receive =
118  "packetpool", "packetpool",
119  queues, "flow", "pktacqloop");
120  if (tv_receive == NULL) {
121  FatalError("TmThreadsCreate failed");
122  }
123  TmModule *tm_module = TmModuleGetByName(recv_mod_name);
124  if (tm_module == NULL) {
125  FatalError("TmModuleGetByName failed for %s", recv_mod_name);
126  }
127  TmSlotSetFuncAppend(tv_receive, tm_module, aconf);
128 
129  tm_module = TmModuleGetByName(decode_mod_name);
130  if (tm_module == NULL) {
131  FatalError("TmModuleGetByName %s failed", decode_mod_name);
132  }
133  TmSlotSetFuncAppend(tv_receive, tm_module, NULL);
134 
135  TmThreadSetCPU(tv_receive, RECEIVE_CPU_SET);
136 
137  if (TmThreadSpawn(tv_receive) != TM_ECODE_OK) {
138  FatalError("TmThreadSpawn failed");
139  }
140  }
141  } else { /* Multiple input device */
142  SCLogInfo("Using %d live device(s).", nlive);
143 
144  for (int lthread = 0; lthread < nlive; lthread++) {
145  const char *dev = LiveGetDeviceName(lthread);
146  const char *visual_devname = LiveGetShortName(dev);
147 
148  if (dev == NULL) {
149  FatalError("Failed to lookup live dev %d", lthread);
150  }
151  SCLogDebug("dev %s", dev);
152 
153  void *aconf = ConfigParser(dev);
154  if (aconf == NULL) {
155  FatalError("Multidev: Failed to allocate config for %s (%d)", dev, lthread);
156  }
157 
158  int threads_count = ModThreadsCount(aconf);
159  for (int thread = 0; thread < threads_count; thread++) {
160  char *printable_threadname = SCMalloc(sizeof(char) * (strlen(thread_name)+5+strlen(dev)));
161  if (unlikely(printable_threadname == NULL)) {
162  FatalError("failed to alloc printable thread name: %s", strerror(errno));
163  }
164  snprintf(tname, sizeof(tname), "%s#%02d-%s", thread_name,
165  thread+1, visual_devname);
166  snprintf(printable_threadname, strlen(thread_name)+5+strlen(dev),
167  "%s#%02d-%s", thread_name, thread+1,
168  dev);
169 
170  ThreadVars *tv_receive =
172  "packetpool", "packetpool",
173  queues, "flow", "pktacqloop");
174  if (tv_receive == NULL) {
175  FatalError("TmThreadsCreate failed");
176  }
177  tv_receive->printable_name = printable_threadname;
178  TmModule *tm_module = TmModuleGetByName(recv_mod_name);
179  if (tm_module == NULL) {
180  FatalError("TmModuleGetByName failed for %s", recv_mod_name);
181  }
182  TmSlotSetFuncAppend(tv_receive, tm_module, aconf);
183 
184  tm_module = TmModuleGetByName(decode_mod_name);
185  if (tm_module == NULL) {
186  FatalError("TmModuleGetByName %s failed", decode_mod_name);
187  }
188  TmSlotSetFuncAppend(tv_receive, tm_module, NULL);
189 
190  TmThreadSetCPU(tv_receive, RECEIVE_CPU_SET);
191 
192  if (TmThreadSpawn(tv_receive) != TM_ECODE_OK) {
193  FatalError("TmThreadSpawn failed");
194  }
195  }
196  }
197  }
198 
199  for (uint16_t thread = 0; thread < thread_max; thread++) {
200  snprintf(tname, sizeof(tname), "%s#%02u", thread_name_workers, (uint16_t)(thread + 1));
201  snprintf(qname, sizeof(qname), "pickup%u", (uint16_t)(thread + 1));
202 
203  SCLogDebug("tname %s, qname %s", tname, qname);
204 
205  ThreadVars *tv_detect_ncpu =
207  qname, "flow",
208  "packetpool", "packetpool",
209  "varslot");
210  if (tv_detect_ncpu == NULL) {
211  FatalError("TmThreadsCreate failed");
212  }
213  TmModule *tm_module = TmModuleGetByName("FlowWorker");
214  if (tm_module == NULL) {
215  FatalError("TmModuleGetByName for FlowWorker failed");
216  }
217  TmSlotSetFuncAppend(tv_detect_ncpu, tm_module, NULL);
218 
219  TmThreadSetCPU(tv_detect_ncpu, WORKER_CPU_SET);
220 
221  TmThreadSetGroupName(tv_detect_ncpu, "Detect");
222 
223  tm_module = TmModuleGetByName("RespondReject");
224  if (tm_module == NULL) {
225  FatalError("TmModuleGetByName RespondReject failed");
226  }
227  TmSlotSetFuncAppend(tv_detect_ncpu, tm_module, NULL);
228 
229  if (TmThreadSpawn(tv_detect_ncpu) != TM_ECODE_OK) {
230  FatalError("TmThreadSpawn failed");
231  }
232  }
233 
234  SCFree(queues);
235  return 0;
236 }
237 
238 /**
239  */
240 static int RunModeSetLiveCaptureWorkersForDevice(ConfigIfaceThreadsCountFunc ModThreadsCount,
241  const char *recv_mod_name,
242  const char *decode_mod_name, const char *thread_name,
243  const char *live_dev, void *aconf,
244  unsigned char single_mode)
245 {
246  int threads_count;
247  uint16_t thread_max = TmThreadsGetWorkerThreadMax();
248 
249  if (single_mode) {
250  threads_count = 1;
251  } else {
252  threads_count = MIN(ModThreadsCount(aconf), thread_max);
253  SCLogInfo("%s: creating %" PRId32 " thread%s", live_dev, threads_count,
254  threads_count > 1 ? "s" : "");
255  }
256 
257  /* create the threads */
258  for (int thread = 0; thread < threads_count; thread++) {
259  char tname[TM_THREAD_NAME_MAX];
260  TmModule *tm_module = NULL;
261  const char *visual_devname = LiveGetShortName(live_dev);
262  char *printable_threadname = SCMalloc(sizeof(char) * (strlen(thread_name)+5+strlen(live_dev)));
263  if (unlikely(printable_threadname == NULL)) {
264  FatalError("failed to alloc printable thread name: %s", strerror(errno));
265  exit(EXIT_FAILURE);
266  }
267 
268  if (single_mode) {
269  snprintf(tname, sizeof(tname), "%s#01-%s", thread_name, visual_devname);
270  snprintf(printable_threadname, strlen(thread_name)+5+strlen(live_dev), "%s#01-%s",
271  thread_name, live_dev);
272  } else {
273  snprintf(tname, sizeof(tname), "%s#%02d-%s", thread_name,
274  thread+1, visual_devname);
275  snprintf(printable_threadname, strlen(thread_name)+5+strlen(live_dev), "%s#%02d-%s",
276  thread_name, thread+1, live_dev);
277  }
279  "packetpool", "packetpool",
280  "packetpool", "packetpool",
281  "pktacqloop");
282  if (tv == NULL) {
283  FatalError("TmThreadsCreate failed");
284  }
285  tv->printable_name = printable_threadname;
286 
287  tm_module = TmModuleGetByName(recv_mod_name);
288  if (tm_module == NULL) {
289  FatalError("TmModuleGetByName failed for %s", recv_mod_name);
290  }
291  TmSlotSetFuncAppend(tv, tm_module, aconf);
292 
293  tm_module = TmModuleGetByName(decode_mod_name);
294  if (tm_module == NULL) {
295  FatalError("TmModuleGetByName %s failed", decode_mod_name);
296  }
297  TmSlotSetFuncAppend(tv, tm_module, NULL);
298 
299  tm_module = TmModuleGetByName("FlowWorker");
300  if (tm_module == NULL) {
301  FatalError("TmModuleGetByName for FlowWorker failed");
302  }
303  TmSlotSetFuncAppend(tv, tm_module, NULL);
304 
305  tm_module = TmModuleGetByName("RespondReject");
306  if (tm_module == NULL) {
307  FatalError("TmModuleGetByName RespondReject failed");
308  }
309  TmSlotSetFuncAppend(tv, tm_module, NULL);
310 
312 
313  if (TmThreadSpawn(tv) != TM_ECODE_OK) {
314  FatalError("TmThreadSpawn failed");
315  }
316  }
317 
318  return 0;
319 }
320 
322  ConfigIfaceThreadsCountFunc ModThreadsCount, const char *recv_mod_name,
323  const char *decode_mod_name, const char *thread_name, const char *live_dev)
324 {
325  int nlive = LiveGetDeviceCount();
326  void *aconf;
327  int ldev;
328 
329  for (ldev = 0; ldev < nlive; ldev++) {
330  const char *live_dev_c = NULL;
331  if ((nlive <= 1) && (live_dev != NULL)) {
332  aconf = ConfigParser(live_dev);
333  live_dev_c = live_dev;
334  } else {
335  live_dev_c = LiveGetDeviceName(ldev);
336  aconf = ConfigParser(live_dev_c);
337  }
338  RunModeSetLiveCaptureWorkersForDevice(ModThreadsCount,
339  recv_mod_name,
340  decode_mod_name,
341  thread_name,
342  live_dev_c,
343  aconf,
344  0);
345  }
346 
347  return 0;
348 }
349 
351  ConfigIfaceThreadsCountFunc ModThreadsCount,
352  const char *recv_mod_name,
353  const char *decode_mod_name, const char *thread_name,
354  const char *live_dev)
355 {
356  int nlive = LiveGetDeviceCount();
357  const char *live_dev_c = NULL;
358  void *aconf;
359 
360  if (nlive > 1) {
361  FatalError("Can't use the 'single' runmode with multiple devices");
362  }
363 
364  if (live_dev != NULL) {
365  aconf = ConfigParser(live_dev);
366  live_dev_c = live_dev;
367  } else {
368  live_dev_c = LiveGetDeviceName(0);
369  aconf = ConfigParser(live_dev_c);
370  }
371 
372  return RunModeSetLiveCaptureWorkersForDevice(
373  ModThreadsCount,
374  recv_mod_name,
375  decode_mod_name,
376  thread_name,
377  live_dev_c,
378  aconf,
379  1);
380 }
381 
382 
383 /**
384  */
386  const char *recv_mod_name,
387  const char *verdict_mod_name,
388  const char *decode_mod_name)
389 {
390  SCEnter();
391  char tname[TM_THREAD_NAME_MAX];
392  TmModule *tm_module ;
393 
394  /* Available cpus */
395  const int nqueue = LiveGetDeviceCount();
396 
397  uint16_t thread_max = TmThreadsGetWorkerThreadMax();
398 
399  char *queues = RunmodeAutoFpCreatePickupQueuesString(thread_max);
400  if (queues == NULL) {
401  FatalError("RunmodeAutoFpCreatePickupQueuesString failed");
402  }
403 
404  /* create the threads */
405  for (int i = 0; i < nqueue; i++) {
406  const char *cur_queue = LiveGetDeviceName(i);
407  if (cur_queue == NULL) {
408  FatalError("invalid queue number");
409  }
410  memset(tname, 0, sizeof(tname));
411  snprintf(tname, sizeof(tname), "%s-%s", thread_name_autofp, cur_queue);
412 
413  ThreadVars *tv_receive =
415  "packetpool", "packetpool",
416  queues, "flow", "pktacqloop");
417  if (tv_receive == NULL) {
418  FatalError("TmThreadsCreate failed");
419  }
420  tm_module = TmModuleGetByName(recv_mod_name);
421  if (tm_module == NULL) {
422  FatalError("TmModuleGetByName failed for %s", recv_mod_name);
423  }
424  TmSlotSetFuncAppend(tv_receive, tm_module, (void *) ConfigParser(i));
425 
426  tm_module = TmModuleGetByName(decode_mod_name);
427  if (tm_module == NULL) {
428  FatalError("TmModuleGetByName %s failed", decode_mod_name);
429  }
430  TmSlotSetFuncAppend(tv_receive, tm_module, NULL);
431 
432  TmThreadSetCPU(tv_receive, RECEIVE_CPU_SET);
433 
434  if (TmThreadSpawn(tv_receive) != TM_ECODE_OK) {
435  FatalError("TmThreadSpawn failed");
436  }
437 
438  }
439  for (int thread = 0; thread < thread_max; thread++) {
440  snprintf(tname, sizeof(tname), "%s#%02u", thread_name_workers, (uint16_t)(thread + 1));
441  char qname[TM_QUEUE_NAME_MAX];
442  snprintf(qname, sizeof(qname), "pickup%u", (uint16_t)(thread + 1));
443 
444  SCLogDebug("tname %s, qname %s", tname, qname);
445 
446  ThreadVars *tv_detect_ncpu =
448  qname, "flow",
449  "verdict-queue", "simple",
450  "varslot");
451  if (tv_detect_ncpu == NULL) {
452  FatalError("TmThreadsCreate failed");
453  }
454 
455  tm_module = TmModuleGetByName("FlowWorker");
456  if (tm_module == NULL) {
457  FatalError("TmModuleGetByName for FlowWorker failed");
458  }
459  TmSlotSetFuncAppend(tv_detect_ncpu, tm_module, NULL);
460 
461  TmThreadSetCPU(tv_detect_ncpu, WORKER_CPU_SET);
462 
463  TmThreadSetGroupName(tv_detect_ncpu, "Detect");
464 
465  if (TmThreadSpawn(tv_detect_ncpu) != TM_ECODE_OK) {
466  FatalError("TmThreadSpawn failed");
467  }
468  }
469 
470  /* create the threads */
471  for (int i = 0; i < nqueue; i++) {
472  memset(tname, 0, sizeof(tname));
473  snprintf(tname, sizeof(tname), "%s#%02d", thread_name_verdict, i);
474 
475  ThreadVars *tv_verdict =
477  "verdict-queue", "simple",
478  "packetpool", "packetpool",
479  "varslot");
480  if (tv_verdict == NULL) {
481  FatalError("TmThreadsCreate failed");
482  }
483  tm_module = TmModuleGetByName(verdict_mod_name);
484  if (tm_module == NULL) {
485  FatalError("TmModuleGetByName %s failed", verdict_mod_name);
486  }
487  TmSlotSetFuncAppend(tv_verdict, tm_module, (void *)ConfigParser(i));
488 
489  tm_module = TmModuleGetByName("RespondReject");
490  if (tm_module == NULL) {
491  FatalError("TmModuleGetByName for RespondReject failed");
492  }
493  TmSlotSetFuncAppend(tv_verdict, tm_module, NULL);
494 
495  TmThreadSetCPU(tv_verdict, VERDICT_CPU_SET);
496 
497  if (TmThreadSpawn(tv_verdict) != TM_ECODE_OK) {
498  FatalError("TmThreadSpawn failed");
499  }
500  }
501 
502  SCFree(queues);
503  return 0;
504 }
505 
506 /**
507  */
509  const char *recv_mod_name,
510  const char *verdict_mod_name,
511  const char *decode_mod_name)
512 {
513  TmModule *tm_module = NULL;
514  const int nqueue = LiveGetDeviceCount();
515 
516  for (int i = 0; i < nqueue; i++) {
517  /* create the threads */
518  const char *cur_queue = LiveGetDeviceName(i);
519  if (cur_queue == NULL) {
520  FatalError("invalid queue number");
521  }
522 
523  char tname[TM_THREAD_NAME_MAX];
524  memset(tname, 0, sizeof(tname));
525  snprintf(tname, sizeof(tname), "%s-%s", thread_name_workers, cur_queue);
526 
528  "packetpool", "packetpool",
529  "packetpool", "packetpool",
530  "pktacqloop");
531  if (tv == NULL) {
532  FatalError("TmThreadsCreate failed");
533  }
534 
535  tm_module = TmModuleGetByName(recv_mod_name);
536  if (tm_module == NULL) {
537  FatalError("TmModuleGetByName failed for %s", recv_mod_name);
538  }
539  TmSlotSetFuncAppend(tv, tm_module, (void *) ConfigParser(i));
540 
541  tm_module = TmModuleGetByName(decode_mod_name);
542  if (tm_module == NULL) {
543  FatalError("TmModuleGetByName %s failed", decode_mod_name);
544  }
545  TmSlotSetFuncAppend(tv, tm_module, NULL);
546 
547  tm_module = TmModuleGetByName("FlowWorker");
548  if (tm_module == NULL) {
549  FatalError("TmModuleGetByName for FlowWorker failed");
550  }
551  TmSlotSetFuncAppend(tv, tm_module, NULL);
552 
553  tm_module = TmModuleGetByName(verdict_mod_name);
554  if (tm_module == NULL) {
555  FatalError("TmModuleGetByName %s failed", verdict_mod_name);
556  }
557  TmSlotSetFuncAppend(tv, tm_module, (void *) ConfigParser(i));
558 
559  tm_module = TmModuleGetByName("RespondReject");
560  if (tm_module == NULL) {
561  FatalError("TmModuleGetByName for RespondReject failed");
562  }
563  TmSlotSetFuncAppend(tv, tm_module, NULL);
564 
566 
567  if (TmThreadSpawn(tv) != TM_ECODE_OK) {
568  FatalError("TmThreadSpawn failed");
569  }
570  }
571 
572  return 0;
573 }
thread_name_workers
const char * thread_name_workers
Definition: runmodes.c:67
tm-threads.h
RunModeSetIPSAutoFp
int RunModeSetIPSAutoFp(ConfigIPSParserFunc ConfigParser, const char *recv_mod_name, const char *verdict_mod_name, const char *decode_mod_name)
Definition: util-runmodes.c:385
TmThreadSpawn
TmEcode TmThreadSpawn(ThreadVars *tv)
Spawns a thread associated with the ThreadVars instance tv.
Definition: tm-threads.c:1648
detect-engine.h
RECEIVE_CPU_SET
@ RECEIVE_CPU_SET
Definition: util-affinity.h:52
RunModeSetLiveCaptureWorkers
int RunModeSetLiveCaptureWorkers(ConfigIfaceParserFunc ConfigParser, ConfigIfaceThreadsCountFunc ModThreadsCount, const char *recv_mod_name, const char *decode_mod_name, const char *thread_name, const char *live_dev)
Definition: util-runmodes.c:321
alert-debuglog.h
LiveGetShortName
const char * LiveGetShortName(const char *dev)
Definition: util-device.c:266
runmode-af-packet.h
TmThreadCreatePacketHandler
ThreadVars * TmThreadCreatePacketHandler(const char *name, const char *inq_name, const char *inqh_name, const char *outq_name, const char *outqh_name, const char *slots)
Creates and returns a TV instance for a Packet Processing Thread. This function doesn't support custo...
Definition: tm-threads.c:1031
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
TmThreadSetGroupName
void TmThreadSetGroupName(ThreadVars *tv, const char *name)
Definition: tm-threads.c:1605
RunModeSetIPSWorker
int RunModeSetIPSWorker(ConfigIPSParserFunc ConfigParser, const char *recv_mod_name, const char *verdict_mod_name, const char *decode_mod_name)
Definition: util-runmodes.c:508
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:269
flow-hash.h
util-runmodes.h
thread_name_autofp
const char * thread_name_autofp
Definition: runmodes.c:65
MIN
#define MIN(x, y)
Definition: suricata-common.h:391
VERDICT_CPU_SET
@ VERDICT_CPU_SET
Definition: util-affinity.h:54
TM_THREAD_NAME_MAX
#define TM_THREAD_NAME_MAX
Definition: tm-threads.h:49
ConfigIfaceThreadsCountFunc
int(* ConfigIfaceThreadsCountFunc)(void *)
Definition: util-runmodes.h:28
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:82
RunModeSetLiveCaptureAutoFp
int RunModeSetLiveCaptureAutoFp(ConfigIfaceParserFunc ConfigParser, ConfigIfaceThreadsCountFunc ModThreadsCount, const char *recv_mod_name, const char *decode_mod_name, const char *thread_name, const char *live_dev)
Definition: util-runmodes.c:85
TmModuleGetByName
TmModule * TmModuleGetByName(const char *name)
get a tm module ptr by name
Definition: tm-modules.c:53
util-device.h
util-debug.h
RunmodeAutoFpCreatePickupQueuesString
char * RunmodeAutoFpCreatePickupQueuesString(int n)
create a queue string for autofp to pass to the flow queue handler.
Definition: util-runmodes.c:56
strlcat
size_t strlcat(char *, const char *src, size_t siz)
Definition: util-strlcatu.c:45
util-cpu.h
ConfigIPSParserFunc
void *(* ConfigIPSParserFunc)(int)
Definition: util-runmodes.h:27
SCEnter
#define SCEnter(...)
Definition: util-debug.h:271
detect-engine-mpm.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:57
util-affinity.h
util-time.h
TM_QUEUE_NAME_MAX
#define TM_QUEUE_NAME_MAX
Definition: tm-threads.h:48
conf.h
runmodes.h
SCLogInfo
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
Definition: util-debug.h:224
TmModule_
Definition: tm-modules.h:44
alert-fastlog.h
TmSlotSetFuncAppend
void TmSlotSetFuncAppend(ThreadVars *tv, TmModule *tm, const void *data)
Appends a new entry to the slots.
Definition: tm-threads.c:638
suricata-common.h
TmThreadSetCPU
TmEcode TmThreadSetCPU(ThreadVars *tv, uint8_t type)
Definition: tm-threads.c:811
LiveGetDeviceName
const char * LiveGetDeviceName(int number)
Get a pointer to the device name at idx.
Definition: util-device.c:184
FatalError
#define FatalError(...)
Definition: util-debug.h:502
TmThreadsGetWorkerThreadMax
uint16_t TmThreadsGetWorkerThreadMax(void)
Definition: tm-threads.c:2283
ThreadVars_::printable_name
char * printable_name
Definition: threadvars.h:65
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
log-httplog.h
ConfigIfaceParserFunc
void *(* ConfigIfaceParserFunc)(const char *)
Definition: util-runmodes.h:26
SCMalloc
#define SCMalloc(sz)
Definition: util-mem.h:47
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:261
SCFree
#define SCFree(p)
Definition: util-mem.h:61
thread_name_verdict
const char * thread_name_verdict
Definition: runmodes.c:68
RunModeSetLiveCaptureSingle
int RunModeSetLiveCaptureSingle(ConfigIfaceParserFunc ConfigParser, ConfigIfaceThreadsCountFunc ModThreadsCount, const char *recv_mod_name, const char *decode_mod_name, const char *thread_name, const char *live_dev)
Definition: util-runmodes.c:350
LiveGetDeviceCount
int LiveGetDeviceCount(void)
Get the number of registered devices.
Definition: util-device.c:164
WORKER_CPU_SET
@ WORKER_CPU_SET
Definition: util-affinity.h:53
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
output.h