1 |
/* |
2 |
* Copyright (c) 2002 Erik Fears |
3 |
* Copyright (c) 2014-2015 ircd-hybrid development team |
4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
6 |
* it under the terms of the GNU General Public License as published by |
7 |
* the Free Software Foundation; either version 2 of the License, or |
8 |
* (at your option) any later version. |
9 |
* |
10 |
* This program is distributed in the hope that it will be useful, |
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
* GNU General Public License for more details. |
14 |
* |
15 |
* You should have received a copy of the GNU General Public License |
16 |
* along with this program; if not, write to the Free Software |
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
18 |
* USA |
19 |
*/ |
20 |
|
21 |
#ifndef CONFIG_H |
22 |
#define CONFIG_H |
23 |
|
24 |
#include <stdio.h> |
25 |
#include <time.h> |
26 |
#include "list.h" |
27 |
#include "libopm/src/opm_types.h" |
28 |
|
29 |
extern char linebuf[512]; |
30 |
extern unsigned int linenum; |
31 |
|
32 |
struct IRCConf |
33 |
{ |
34 |
char *nick; |
35 |
char *username; |
36 |
char *realname; |
37 |
char *server; |
38 |
int port; |
39 |
time_t readtimeout; |
40 |
time_t reconnectinterval; |
41 |
char *password; |
42 |
char *vhost; |
43 |
char *nickserv; |
44 |
char *oper; |
45 |
char *mode; |
46 |
char *away; |
47 |
char *connregex; |
48 |
char *kline; |
49 |
list_t *channels; /* List of ChannelConf */ |
50 |
list_t *performs; /* List of char * */ |
51 |
list_t *notices; /* List of char * */ |
52 |
}; |
53 |
|
54 |
struct ChannelConf |
55 |
{ |
56 |
char *name; |
57 |
char *key; |
58 |
char *invite; |
59 |
}; |
60 |
|
61 |
struct OptionsConf |
62 |
{ |
63 |
time_t negcache; |
64 |
time_t negcache_rebuild; |
65 |
unsigned int dns_fdlimit; |
66 |
time_t dns_timeout; |
67 |
char *pidfile; |
68 |
char *scanlog; |
69 |
}; |
70 |
|
71 |
struct UserConf |
72 |
{ |
73 |
list_t *masks; /* List of char * */ |
74 |
list_t *scanners; /* List of char * */ |
75 |
}; |
76 |
|
77 |
struct ScannerConf |
78 |
{ |
79 |
char *name; |
80 |
list_t *protocols; |
81 |
char *vhost; |
82 |
int fd; |
83 |
char *target_ip; |
84 |
int target_port; |
85 |
int timeout; |
86 |
int max_read; |
87 |
list_t *target_string; |
88 |
int target_string_created; |
89 |
}; |
90 |
|
91 |
struct ProtocolConf |
92 |
{ |
93 |
int type; |
94 |
unsigned int port; |
95 |
}; |
96 |
|
97 |
struct OpmConf |
98 |
{ |
99 |
list_t *blacklists; |
100 |
char *dnsbl_from; |
101 |
char *dnsbl_to; |
102 |
char *sendmail; |
103 |
}; |
104 |
|
105 |
enum BlacklistType |
106 |
{ |
107 |
A_BITMASK = 1, |
108 |
A_REPLY |
109 |
}; |
110 |
|
111 |
struct BlacklistConf |
112 |
{ |
113 |
char *name; |
114 |
char *kline; |
115 |
enum BlacklistType type; |
116 |
int ban_unknown; |
117 |
list_t *reply; |
118 |
unsigned int stats_recv; |
119 |
}; |
120 |
|
121 |
struct BlacklistReplyConf |
122 |
{ |
123 |
unsigned char number; |
124 |
char *type; |
125 |
}; |
126 |
|
127 |
struct ExemptConf |
128 |
{ |
129 |
list_t *masks; |
130 |
}; |
131 |
|
132 |
|
133 |
/* Extern to actual config data declared in config.c */ |
134 |
extern struct IRCConf *IRCItem; |
135 |
extern struct OptionsConf *OptionsItem; |
136 |
extern struct OpmConf *OpmItem; |
137 |
extern struct ExemptConf *ExemptItem; |
138 |
extern list_t *UserItemList; |
139 |
extern list_t *ScannerItemList; |
140 |
|
141 |
extern void yyerror(const char *); |
142 |
extern void config_load(const char *); |
143 |
#endif /* CONFIG_H */ |