Rev | Line | |
---|
[1] | 1 |
|
---|
| 2 | #ifndef SH_MODULE_H
|
---|
| 3 | #define SH_MODULE_H
|
---|
| 4 |
|
---|
[140] | 5 | #include "sh_pthread.h"
|
---|
[1] | 6 |
|
---|
[259] | 7 | enum
|
---|
| 8 | {
|
---|
[496] | 9 | SH_MODFL_NOTIMER = (1 << 0),
|
---|
| 10 | SH_MODFL_NEEDPAUSED = (1 << 1),
|
---|
| 11 | SH_MODFL_ISPAUSED = (1 << 2)
|
---|
[259] | 12 | };
|
---|
| 13 |
|
---|
| 14 |
|
---|
[1] | 15 | typedef struct rconf
|
---|
| 16 | {
|
---|
| 17 | char * the_opt;
|
---|
[68] | 18 | int (*func)(const char * opt);
|
---|
[1] | 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 |
|
---|
[259] | 29 | /* Flags: SH_MOD_NOTIMER */
|
---|
| 30 | int flags;
|
---|
| 31 |
|
---|
[1] | 32 | /* The initialization function. Return 0 on success. */
|
---|
[140] | 33 | int (* mod_init) (struct mod_type * arg);
|
---|
[1] | 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. */
|
---|
[253] | 39 | /* Return nonzero on fatal error or if module is disabled. */
|
---|
[1] | 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 |
|
---|
[140] | 54 | SH_MUTEX(mod_mutex);
|
---|
| 55 |
|
---|
[1] | 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.