1 |
#ifndef CONFIG_H |
2 |
#define CONFIG_H |
3 |
|
4 |
#include <stdio.h> |
5 |
#include <time.h> |
6 |
#include "list.h" |
7 |
#include "libopm/src/opm_types.h" |
8 |
|
9 |
extern char linebuf[512]; |
10 |
extern int linenum; |
11 |
|
12 |
extern void yyerror(const char *); |
13 |
extern void config_load(const char *); |
14 |
|
15 |
|
16 |
struct IRCConf |
17 |
{ |
18 |
char *nick; |
19 |
char *username; |
20 |
char *realname; |
21 |
char *server; |
22 |
int port; |
23 |
time_t readtimeout; |
24 |
char *password; |
25 |
char *vhost; |
26 |
char *nickserv; |
27 |
char *oper; |
28 |
char *mode; |
29 |
char *away; |
30 |
char *connregex; |
31 |
char *kline; |
32 |
list_t *channels; /* List of ChannelConf */ |
33 |
list_t *performs; /* List of char * */ |
34 |
}; |
35 |
|
36 |
struct ChannelConf |
37 |
{ |
38 |
char *name; |
39 |
char *key; |
40 |
char *invite; |
41 |
}; |
42 |
|
43 |
struct OptionsConf |
44 |
{ |
45 |
int negcache; |
46 |
unsigned int dns_fdlimit; |
47 |
char *pidfile; |
48 |
char *scanlog; |
49 |
}; |
50 |
|
51 |
struct UserConf |
52 |
{ |
53 |
list_t *masks; /* List of char * */ |
54 |
list_t *scanners; /* List of char * */ |
55 |
}; |
56 |
|
57 |
struct ScannerConf |
58 |
{ |
59 |
char *name; |
60 |
list_t *protocols; |
61 |
char *vhost; |
62 |
int fd; |
63 |
char *target_ip; |
64 |
int target_port; |
65 |
int timeout; |
66 |
int max_read; |
67 |
list_t *target_string; |
68 |
int target_string_created; |
69 |
}; |
70 |
|
71 |
struct ProtocolConf |
72 |
{ |
73 |
int type; |
74 |
unsigned int port; |
75 |
}; |
76 |
|
77 |
struct OpmConf |
78 |
{ |
79 |
list_t *blacklists; |
80 |
char *dnsbl_from; |
81 |
char *dnsbl_to; |
82 |
char *sendmail; |
83 |
}; |
84 |
|
85 |
enum BlacklistType |
86 |
{ |
87 |
A_BITMASK = 1, |
88 |
A_REPLY |
89 |
}; |
90 |
|
91 |
struct BlacklistConf |
92 |
{ |
93 |
char *name; |
94 |
char *kline; |
95 |
enum BlacklistType type; |
96 |
int ban_unknown; |
97 |
list_t *reply; |
98 |
unsigned int stats_recv; |
99 |
}; |
100 |
|
101 |
struct BlacklistReplyConf |
102 |
{ |
103 |
char number; |
104 |
char *type; |
105 |
}; |
106 |
|
107 |
struct ExemptConf |
108 |
{ |
109 |
list_t *masks; |
110 |
}; |
111 |
|
112 |
|
113 |
/* Extern to actual config data declared in config.c */ |
114 |
extern struct IRCConf *IRCItem; |
115 |
extern struct OptionsConf *OptionsItem; |
116 |
extern struct OpmConf *OpmItem; |
117 |
extern struct ExemptConf *ExemptItem; |
118 |
extern list_t *UserItemList; |
119 |
extern list_t *ScannerItemList; |
120 |
|
121 |
#endif /* CONFIG_H */ |