1 |
/* |
2 |
* Copyright (c) 2002 Erik Fears |
3 |
* Copyright (c) 2014-2020 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 |
|
27 |
#include "list.h" |
28 |
|
29 |
extern char linebuf[512]; |
30 |
extern char conffilebuf[512]; |
31 |
extern unsigned int lineno; |
32 |
extern FILE *conf_file; |
33 |
|
34 |
struct IRCConf |
35 |
{ |
36 |
char *nick; |
37 |
char *username; |
38 |
char *realname; |
39 |
char *server; |
40 |
int port; |
41 |
int tls; |
42 |
time_t readtimeout; |
43 |
time_t reconnectinterval; |
44 |
char *password; |
45 |
char *vhost; |
46 |
char *nickserv; |
47 |
char *oper; |
48 |
char *mode; |
49 |
char *away; |
50 |
char *connregex; |
51 |
char *kline; |
52 |
list_t channels; /* List of ChannelConf */ |
53 |
list_t performs; /* List of char * */ |
54 |
list_t notices; /* List of char * */ |
55 |
}; |
56 |
|
57 |
struct ChannelConf |
58 |
{ |
59 |
node_t node; /**< List node; linked into IRCItem->channels */ |
60 |
char *name; |
61 |
char *key; |
62 |
char *invite; |
63 |
}; |
64 |
|
65 |
struct OptionsConf |
66 |
{ |
67 |
unsigned int command_queue_size; |
68 |
time_t command_interval; |
69 |
time_t command_timeout; |
70 |
time_t negcache; |
71 |
time_t negcache_rebuild; |
72 |
unsigned int dns_fdlimit; |
73 |
time_t dns_timeout; |
74 |
char *pidfile; |
75 |
char *scanlog; |
76 |
}; |
77 |
|
78 |
struct UserConf |
79 |
{ |
80 |
node_t node; /**< List node; linked into UserItemList */ |
81 |
list_t masks; /* List of char * */ |
82 |
list_t scanners; /* List of char * */ |
83 |
}; |
84 |
|
85 |
struct ScannerConf |
86 |
{ |
87 |
node_t node; /**< List node; linked into ScannerItemList */ |
88 |
char *name; |
89 |
list_t protocols; |
90 |
char *vhost; |
91 |
int fd; |
92 |
char *target_ip; |
93 |
int target_port; |
94 |
int timeout; |
95 |
int max_read; |
96 |
list_t target_string; |
97 |
int target_string_created; |
98 |
}; |
99 |
|
100 |
struct ProtocolConf |
101 |
{ |
102 |
int type; |
103 |
unsigned int port; |
104 |
}; |
105 |
|
106 |
struct OpmConf |
107 |
{ |
108 |
list_t blacklists; |
109 |
char *dnsbl_from; |
110 |
char *dnsbl_to; |
111 |
char *sendmail; |
112 |
}; |
113 |
|
114 |
enum BlacklistType |
115 |
{ |
116 |
A_BITMASK = 1, |
117 |
A_REPLY |
118 |
}; |
119 |
|
120 |
struct BlacklistConf |
121 |
{ |
122 |
char *name; |
123 |
char *kline; |
124 |
enum BlacklistType type; |
125 |
unsigned int ipv4; |
126 |
unsigned int ipv6; |
127 |
int ban_unknown; |
128 |
list_t reply; |
129 |
unsigned int stats_recv; |
130 |
}; |
131 |
|
132 |
struct BlacklistReplyConf |
133 |
{ |
134 |
unsigned char number; |
135 |
char *type; |
136 |
}; |
137 |
|
138 |
struct ExemptConf |
139 |
{ |
140 |
list_t masks; |
141 |
}; |
142 |
|
143 |
|
144 |
/* Extern to actual config data declared in config.c */ |
145 |
extern struct IRCConf IRCItem; |
146 |
extern struct OptionsConf OptionsItem; |
147 |
extern struct OpmConf OpmItem; |
148 |
extern struct ExemptConf ExemptItem; |
149 |
extern list_t UserItemList; |
150 |
extern list_t ScannerItemList; |
151 |
|
152 |
extern void yyerror(const char *); |
153 |
extern void config_load(const char *); |
154 |
#endif /* CONFIG_H */ |