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