Line | |
---|
1 |
|
---|
2 | #ifndef SH_MODULE_H
|
---|
3 | #define SH_MODULE_H
|
---|
4 |
|
---|
5 | #include "sh_pthread.h"
|
---|
6 |
|
---|
7 | enum
|
---|
8 | {
|
---|
9 | SH_MODFL_NOTIMER = (1 << 0),
|
---|
10 | SH_MODFL_NEEDPAUSED = (1 << 1),
|
---|
11 | SH_MODFL_ISPAUSED = (1 << 2)
|
---|
12 | };
|
---|
13 |
|
---|
14 |
|
---|
15 | typedef struct rconf
|
---|
16 | {
|
---|
17 | char * the_opt;
|
---|
18 | int (*func)(const char * opt);
|
---|
19 | } sh_rconf;
|
---|
20 |
|
---|
21 | typedef struct mod_type
|
---|
22 | {
|
---|
23 | /* The name of the module */
|
---|
24 | char * name;
|
---|
25 |
|
---|
26 | /* Set by samhain to 1 on successful initialization, else 0 */
|
---|
27 | int initval;
|
---|
28 |
|
---|
29 | /* Flags: SH_MOD_NOTIMER */
|
---|
30 | int flags;
|
---|
31 |
|
---|
32 | /* The initialization function. Return 0 on success. */
|
---|
33 | int (* mod_init) (struct mod_type * arg);
|
---|
34 |
|
---|
35 | /* The timer function. Return 0 if NOT time to check. */
|
---|
36 | int (* mod_timer) (time_t tcurrent);
|
---|
37 |
|
---|
38 | /* The check function. Return 0 on success. */
|
---|
39 | /* Return nonzero on fatal error or if module is disabled. */
|
---|
40 | int (* mod_check) (void);
|
---|
41 |
|
---|
42 | /* The cleanup function. Return 0 on success. */
|
---|
43 | int (* mod_cleanup) (void);
|
---|
44 |
|
---|
45 | /* The preparation for reconfiguration. Return 0 on success. */
|
---|
46 | int (* mod_reconf) (void);
|
---|
47 |
|
---|
48 | /* Section header in config file */
|
---|
49 | char * conf_section;
|
---|
50 |
|
---|
51 | /* A table of key/handler_function for config file entries */
|
---|
52 | sh_rconf * conf_table;
|
---|
53 |
|
---|
54 | SH_MUTEX(mod_mutex);
|
---|
55 |
|
---|
56 | } sh_mtype;
|
---|
57 |
|
---|
58 |
|
---|
59 | extern sh_mtype modList[];
|
---|
60 |
|
---|
61 |
|
---|
62 | /* #ifndef SH_MODULE_H */
|
---|
63 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.