source: branches/samhain_3_1/include/sh_modules.h@ 552

Last change on this file since 552 was 259, checked in by katerina, 15 years ago

Use inotify in utmp module (ticket #177).

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