Last change
on this file since 204 was 140, checked in by rainer, 17 years ago |
Utility function for threaded modules.
|
File size:
1.2 KB
|
Line | |
---|
1 |
|
---|
2 | #ifndef SH_MODULE_H
|
---|
3 | #define SH_MODULE_H
|
---|
4 |
|
---|
5 | #include "sh_pthread.h"
|
---|
6 |
|
---|
7 | typedef struct rconf
|
---|
8 | {
|
---|
9 | char * the_opt;
|
---|
10 | int (*func)(const char * opt);
|
---|
11 | } sh_rconf;
|
---|
12 |
|
---|
13 | typedef 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. */
|
---|
22 | int (* mod_init) (struct mod_type * arg);
|
---|
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 |
|
---|
42 | SH_MUTEX(mod_mutex);
|
---|
43 |
|
---|
44 | } sh_mtype;
|
---|
45 |
|
---|
46 |
|
---|
47 | extern sh_mtype modList[];
|
---|
48 |
|
---|
49 |
|
---|
50 | /* #ifndef SH_MODULE_H */
|
---|
51 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.