-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2024 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Thread Module functions
*/
-#include "suricata-common.h"
-#include "packet-queue.h"
-#include "tm-threads.h"
+#include "tm-modules.h"
#include "util-debug.h"
-#include "threads.h"
-#include "util-logopenfile.h"
TmModule tmm_modules[TMM_SIZE];
void TmModuleDebugList(void)
{
- TmModule *t;
- uint16_t i;
-
- for (i = 0; i < TMM_SIZE; i++) {
- t = &tmm_modules[i];
+ for (uint16_t i = 0; i < TMM_SIZE; i++) {
+ TmModule *t = &tmm_modules[i];
if (t->name == NULL)
continue;
* \retval ptr to the module or NULL */
TmModule *TmModuleGetByName(const char *name)
{
- TmModule *t;
- uint16_t i;
-
- for (i = 0; i < TMM_SIZE; i++) {
- t = &tmm_modules[i];
+ for (uint16_t i = 0; i < TMM_SIZE; i++) {
+ TmModule *t = &tmm_modules[i];
if (t->name == NULL)
continue;
*/
TmModule *TmModuleGetById(int id)
{
-
if (id < 0 || id >= TMM_SIZE) {
SCLogError("Threading module with the id "
"\"%d\" doesn't exist",
*/
int TmModuleGetIDForTM(TmModule *tm)
{
- TmModule *t;
- int i;
-
- for (i = 0; i < TMM_SIZE; i++) {
- t = &tmm_modules[i];
+ for (uint16_t i = 0; i < TMM_SIZE; i++) {
+ TmModule *t = &tmm_modules[i];
if (t->name == NULL)
continue;
void TmModuleRunInit(void)
{
- TmModule *t;
- uint16_t i;
-
- for (i = 0; i < TMM_SIZE; i++) {
- t = &tmm_modules[i];
+ for (uint16_t i = 0; i < TMM_SIZE; i++) {
+ TmModule *t = &tmm_modules[i];
if (t->name == NULL)
continue;
void TmModuleRunDeInit(void)
{
- TmModule *t;
- uint16_t i;
-
- for (i = 0; i < TMM_SIZE; i++) {
- t = &tmm_modules[i];
+ for (uint16_t i = 0; i < TMM_SIZE; i++) {
+ TmModule *t = &tmm_modules[i];
if (t->name == NULL)
continue;
void TmModuleRegisterTests(void)
{
#ifdef UNITTESTS
- TmModule *t;
- uint16_t i;
-
- for (i = 0; i < TMM_SIZE; i++) {
- t = &tmm_modules[i];
+ for (uint16_t i = 0; i < TMM_SIZE; i++) {
+ TmModule *t = &tmm_modules[i];
if (t->name == NULL)
continue;