You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
suricata/src/tm-modules.c

64 lines
1.3 KiB
C

/* Copyright (c) 2008 Victor Julien <victor@inliniac.net> */
#include "eidps-common.h"
#include "packet-queue.h"
#include "tm-modules.h"
#include "util-debug.h"
void TmModuleDebugList(void) {
TmModule *t;
uint16_t i;
for (i = 0; i < TMM_SIZE; i++) {
t = &tmm_modules[i];
if (t->name == NULL)
continue;
SCLogDebug("%s:%p\n", t->name, t->Func);
}
}
/** \brief get a tm module ptr by name
* \param name name string
* \retval ptr to the module or NULL */
TmModule *TmModuleGetByName(char *name) {
TmModule *t;
uint16_t i;
for (i = 0; i < TMM_SIZE; i++) {
t = &tmm_modules[i];
if (t->name == NULL)
continue;
if (strcmp(t->name, name) == 0)
return t;
}
return NULL;
}
/** \brief register all unittests for the tm modules */
void TmModuleRegisterTests(void) {
#ifdef UNITTESTS
TmModule *t;
uint16_t i;
for (i = 0; i < TMM_SIZE; i++) {
t = &tmm_modules[i];
if (t->name == NULL)
continue;
if (t->RegisterTests == NULL) {
SCLogDebug("threading module %s has no unittest "
"registration function.", t->name);
} else {
t->RegisterTests();
}
}
#endif /* UNITTESTS */
}