|
suricata
|

Go to the source code of this file.
Data Structures | |
| struct | DetectLoaderTask_ |
| struct | DetectLoaderControl_ |
Typedefs | |
| typedef int(* | LoaderFunc) (void *ctx, int loader_id) |
| typedef void(* | LoaderFreeFunc) (void *ctx) |
| typedef struct DetectLoaderTask_ | DetectLoaderTask |
| typedef struct DetectLoaderControl_ | DetectLoaderControl |
Functions | |
| int | DetectLoaderQueueTask (int loader_id, LoaderFunc Func, void *func_ctx, LoaderFreeFunc FreeFunc) |
| int | DetectLoadersSync (void) |
| wait for loader tasks to complete | |
| void | DetectLoadersInit (void) |
| void | TmThreadContinueDetectLoaderThreads (void) |
| Unpauses all threads present in tv_root. | |
| void | DetectLoaderThreadSpawn (void) |
| spawn the detect loader manager thread | |
| void | TmModuleDetectLoaderRegister (void) |
Detect loader API, for using multiple 'loader' threads that can load multiple detection engines in parallel.
Definition in file detect-engine-loader.h.
| typedef struct DetectLoaderControl_ DetectLoaderControl |
| typedef struct DetectLoaderTask_ DetectLoaderTask |
| typedef void(* LoaderFreeFunc) (void *ctx) |
Definition at line 35 of file detect-engine-loader.h.
| typedef int(* LoaderFunc) (void *ctx, int loader_id) |
| ctx | function specific data |
| loader_id | id of the loader that executed the task |
Definition at line 34 of file detect-engine-loader.h.
| int DetectLoaderQueueTask | ( | int | loader_id, |
| LoaderFunc | Func, | ||
| void * | func_ctx, | ||
| LoaderFreeFunc | FreeFunc | ||
| ) |
| loader | -1 for auto select |
| loader_id | or negative in case of error |
Definition at line 527 of file detect-engine-loader.c.
References DetectLoaderTask_::ctx, DetectLoaderTask_::FreeFunc, DetectLoaderTask_::Func, DetectLoaderControl_::m, next, SCCalloc, SCLogDebug, SCMutexLock, SCMutexUnlock, and TAILQ_INSERT_TAIL.
| void DetectLoadersInit | ( | void | ) |
Definition at line 604 of file detect-engine-loader.c.
References BUG_ON, FatalError, NLOADERS, SCCalloc, SCConfGetInt(), and SCLogInfo.
Referenced by DetectEngineMultiTenantSetup().


| int DetectLoadersSync | ( | void | ) |
wait for loader tasks to complete
| result | 0 for ok, -1 for errors |
Definition at line 561 of file detect-engine-loader.c.
References ThreadVars_::ctrl_cond, ThreadVars_::ctrl_mutex, DetectLoaderControl_::m, DetectLoaderControl_::result, SCCtrlMutexLock, SCCtrlMutexUnlock, SCLogDebug, SCLogError, SCMutexLock, SCMutexUnlock, TAILQ_EMPTY, and DetectLoaderControl_::tv.
Referenced by DetectEngineLoadTenantBlocking(), DetectEngineMultiTenantSetup(), DetectEngineReloadTenantBlocking(), and DetectEngineReloadTenantsBlocking().

| void DetectLoaderThreadSpawn | ( | void | ) |
spawn the detect loader manager thread
Definition at line 749 of file detect-engine-loader.c.
References FatalError, name, thread_name_detect_loader, TM_ECODE_OK, TM_THREAD_NAME_MAX, TmThreadCreateCmdThreadByName(), and TmThreadSpawn().
Referenced by DetectEngineMultiTenantSetup().


| void TmModuleDetectLoaderRegister | ( | void | ) |
Definition at line 765 of file detect-engine-loader.c.
References TmModule_::cap_flags, TmModule_::flags, TmModule_::Management, TmModule_::name, name, SC_ATOMIC_INIT, SCLogDebug, TmModule_::ThreadDeinit, TmModule_::ThreadInit, TM_FLAG_MANAGEMENT_TM, TMM_DETECTLOADER, and tmm_modules.
Referenced by DetectEngineMultiTenantSetup().

| void TmThreadContinueDetectLoaderThreads | ( | void | ) |
Unpauses all threads present in tv_root.
Definition at line 649 of file detect-engine-loader.c.
References ThreadVars_::name, ThreadVars_::next, SCMutexLock, SCMutexUnlock, TmThreadContinue(), tv, tv_root, tv_root_lock, and TVT_MAX.
Referenced by DetectEngineMultiTenantSetup().

