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