source: trunk/include/sh_modules.h@ 153

Last change on this file since 153 was 140, checked in by rainer, 17 years ago

Utility function for threaded modules.

File size: 1.2 KB
RevLine 
[1]1
2#ifndef SH_MODULE_H
3#define SH_MODULE_H
4
[140]5#include "sh_pthread.h"
[1]6
7typedef struct rconf
8{
9 char * the_opt;
[68]10 int (*func)(const char * opt);
[1]11} sh_rconf;
12
13typedef struct mod_type
14{
15 /* The name of the module */
16 char * name;
17
18 /* Set by samhain to 1 on successful initialization, else 0 */
19 int initval;
20
21 /* The initialization function. Return 0 on success. */
[140]22 int (* mod_init) (struct mod_type * arg);
[1]23
24 /* The timer function. Return 0 if NOT time to check. */
25 int (* mod_timer) (time_t tcurrent);
26
27 /* The check function. Return 0 on success. */
28 int (* mod_check) (void);
29
30 /* The cleanup function. Return 0 on success. */
31 int (* mod_cleanup) (void);
32
33 /* The preparation for reconfiguration. Return 0 on success. */
34 int (* mod_reconf) (void);
35
36 /* Section header in config file */
37 char * conf_section;
38
39 /* A table of key/handler_function for config file entries */
40 sh_rconf * conf_table;
41
[140]42 SH_MUTEX(mod_mutex);
43
[1]44} sh_mtype;
45
46
47extern sh_mtype modList[];
48
49
50/* #ifndef SH_MODULE_H */
51#endif
Note: See TracBrowser for help on using the repository browser.