ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/include/conf.h
Revision: 4821
Committed: Sat Nov 1 17:49:55 2014 UTC (11 years, 8 months ago) by michael
Content type: text/x-chdr
File size: 12068 byte(s)
Log Message:
- Renamed exempt::coid to exempt::country_id

File Contents

# User Rev Content
1 adx 30 /*
2 michael 2865 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 adx 30 *
4 michael 2865 * Copyright (c) 1997-2014 ircd-hybrid development team
5 adx 30 *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18 michael 4564 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 adx 30 * USA
20     */
21    
22 michael 2865 /*! \file conf.h
23     * \brief A header for the configuration functions.
24     * \version $Id$
25     */
26    
27 adx 30 #ifndef INCLUDED_s_conf_h
28     #define INCLUDED_s_conf_h
29 michael 912 #include "config.h"
30 adx 30 #include "ircd_defs.h"
31     #include "client.h"
32 michael 1632 #include "conf_class.h"
33 adx 30
34 michael 967
35 michael 1646 #define CONF_NOREASON "<No reason supplied>"
36 adx 30
37 michael 1798 #define IsConfOperator(x) ((x)->type == CONF_OPER)
38     #define IsConfKill(x) ((x)->type == CONF_KLINE)
39     #define IsConfClient(x) ((x)->type == CONF_CLIENT)
40     #define IsConfGline(x) ((x)->type == CONF_GLINE)
41 michael 967
42 michael 1798 /* MaskItem->flags */
43 michael 4777 #define CONF_FLAGS_NO_TILDE 0x00000001U
44     #define CONF_FLAGS_NEED_IDENTD 0x00000002U
45     #define CONF_FLAGS_EXEMPTKLINE 0x00000004U
46     #define CONF_FLAGS_NOLIMIT 0x00000008U
47     #define CONF_FLAGS_SPOOF_IP 0x00000010U
48     #define CONF_FLAGS_SPOOF_NOTICE 0x00000020U
49     #define CONF_FLAGS_REDIR 0x00000040U
50     #define CONF_FLAGS_EXEMPTGLINE 0x00000080U
51     #define CONF_FLAGS_CAN_FLOOD 0x00000100U
52     #define CONF_FLAGS_NEED_PASSWORD 0x00000200U
53     #define CONF_FLAGS_ALLOW_AUTO_CONN 0x00000400U
54     #define CONF_FLAGS_ENCRYPTED 0x00000800U
55     #define CONF_FLAGS_IN_DATABASE 0x00001000U
56     #define CONF_FLAGS_EXEMPTRESV 0x00002000U
57     #define CONF_FLAGS_SSL 0x00004000U
58     #define CONF_FLAGS_WEBIRC 0x00008000U
59 michael 967
60 michael 1798 /* Macros for struct MaskItem */
61 michael 4341 #define IsConfWebIRC(x) ((x)->flags & CONF_FLAGS_WEBIRC)
62     #define IsNoTilde(x) ((x)->flags & CONF_FLAGS_NO_TILDE)
63     #define IsConfCanFlood(x) ((x)->flags & CONF_FLAGS_CAN_FLOOD)
64     #define IsNeedPassword(x) ((x)->flags & CONF_FLAGS_NEED_PASSWORD)
65     #define IsNeedIdentd(x) ((x)->flags & CONF_FLAGS_NEED_IDENTD)
66     #define IsConfExemptKline(x) ((x)->flags & CONF_FLAGS_EXEMPTKLINE)
67     #define IsConfExemptLimits(x) ((x)->flags & CONF_FLAGS_NOLIMIT)
68     #define IsConfExemptGline(x) ((x)->flags & CONF_FLAGS_EXEMPTGLINE)
69     #define IsConfExemptResv(x) ((x)->flags & CONF_FLAGS_EXEMPTRESV)
70     #define IsConfDoSpoofIp(x) ((x)->flags & CONF_FLAGS_SPOOF_IP)
71     #define IsConfSpoofNotice(x) ((x)->flags & CONF_FLAGS_SPOOF_NOTICE)
72     #define IsConfAllowAutoConn(x) ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN)
73     #define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN)
74 michael 1798 #define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN)
75 michael 4341 #define IsConfRedir(x) ((x)->flags & CONF_FLAGS_REDIR)
76     #define IsConfSSL(x) ((x)->flags & CONF_FLAGS_SSL)
77     #define IsConfDatabase(x) ((x)->flags & CONF_FLAGS_IN_DATABASE)
78     #define SetConfDatabase(x) ((x)->flags |= CONF_FLAGS_IN_DATABASE)
79 michael 1798
80    
81 michael 2865 /* shared/cluster server entry types
82 michael 1798 * These defines are used for both shared and cluster.
83     */
84 michael 3926 #define SHARED_KLINE 0x00000001U
85     #define SHARED_UNKLINE 0x00000002U
86     #define SHARED_XLINE 0x00000004U
87     #define SHARED_UNXLINE 0x00000008U
88     #define SHARED_RESV 0x00000010U
89     #define SHARED_UNRESV 0x00000020U
90     #define SHARED_LOCOPS 0x00000040U
91     #define SHARED_DLINE 0x00000080U
92     #define SHARED_UNDLINE 0x00000100U
93 michael 1798 #define SHARED_ALL (SHARED_KLINE | SHARED_UNKLINE |\
94     SHARED_XLINE | SHARED_UNXLINE |\
95     SHARED_RESV | SHARED_UNRESV |\
96     SHARED_LOCOPS | SHARED_DLINE | SHARED_UNDLINE)
97    
98    
99 michael 1632 enum maskitem_type
100     {
101 michael 2995 CONF_CLIENT = 1 << 0,
102     CONF_SERVER = 1 << 1,
103     CONF_KLINE = 1 << 2,
104     CONF_DLINE = 1 << 3,
105     CONF_EXEMPT = 1 << 4,
106     CONF_CLUSTER = 1 << 5,
107     CONF_XLINE = 1 << 6,
108     CONF_ULINE = 1 << 7,
109     CONF_GLINE = 1 << 8,
110     CONF_CRESV = 1 << 9,
111     CONF_NRESV = 1 << 10,
112     CONF_SERVICE = 1 << 11,
113 michael 3662 CONF_OPER = 1 << 12
114 michael 1632 };
115 adx 30
116 michael 3093 enum
117     {
118     NOT_AUTHORIZED = -1,
119     I_LINE_FULL = -2,
120     TOO_MANY = -3,
121     BANNED_CLIENT = -4,
122     TOO_FAST = -5
123     };
124    
125 michael 593 struct split_nuh_item
126     {
127     dlink_node node;
128    
129     char *nuhmask;
130     char *nickptr;
131     char *userptr;
132     char *hostptr;
133    
134     size_t nicksize;
135     size_t usersize;
136     size_t hostsize;
137     };
138    
139 michael 1632 struct MaskItem
140 adx 30 {
141 michael 1644 dlink_node node;
142     dlink_list leaf_list;
143     dlink_list hub_list;
144 michael 1858 dlink_list exempt_list;
145 michael 1632 enum maskitem_type type;
146 michael 1644 unsigned int dns_failed;
147     unsigned int dns_pending;
148     unsigned int flags;
149     unsigned int modes;
150     unsigned int port;
151     unsigned int count;
152     unsigned int aftype;
153     unsigned int active;
154     unsigned int htype;
155     unsigned int ref_count; /* Number of *LOCAL* clients using this */
156     int bits;
157 michael 1649 time_t until; /* Hold action until this time (calendar time) */
158 michael 1644 time_t setat;
159     struct irc_ssaddr bind; /* ip to bind to for outgoing connect */
160     struct irc_ssaddr addr; /* ip to connect to */
161     struct ClassItem *class; /* Class of connection */
162     char *name;
163 michael 1649 char *user; /* user part of user@host */
164 michael 1644 char *host; /* host part of user@host */
165     char *passwd;
166     char *spasswd; /* Password to send. */
167     char *reason;
168 michael 2228 char *certfp;
169 michael 1644 char *cipher_list;
170     void *rsa_public_key;
171 adx 30 };
172    
173 michael 1858 struct exempt
174     {
175     dlink_node node;
176     char *name;
177     char *user;
178     char *host;
179     size_t len;
180     time_t when;
181     struct irc_ssaddr addr;
182     int bits;
183     int type;
184 michael 4821 int country_id;
185 michael 1858 };
186    
187 adx 30 struct CidrItem
188     {
189 michael 1013 dlink_node node;
190 adx 30 struct irc_ssaddr mask;
191 michael 1644 unsigned int number_on_this_cidr;
192 adx 30 };
193    
194 michael 4079 struct
195 adx 30 {
196 michael 4079 unsigned int boot;
197     unsigned int pass;
198     FILE *conf_file;
199     } conf_parser_ctx;
200    
201     struct
202     {
203 michael 4341 const char *dpath;
204 michael 3239 const char *mpath;
205     const char *spath;
206 adx 30 const char *configfile;
207     const char *klinefile;
208 michael 1702 const char *glinefile;
209 adx 30 const char *xlinefile;
210     const char *dlinefile;
211 michael 1702 const char *resvfile;
212 adx 30
213 michael 3871 unsigned int gline_min_cidr;
214     unsigned int gline_min_cidr6;
215     unsigned int dots_in_ident;
216     unsigned int failed_oper_notice;
217     unsigned int anti_spam_exit_message_time;
218 michael 950 unsigned int max_accept;
219     unsigned int max_watch;
220 michael 4314 unsigned int away_time;
221     unsigned int away_count;
222 michael 3871 unsigned int max_nick_time;
223 michael 950 unsigned int max_nick_changes;
224 michael 3871 unsigned int ts_max_delta;
225     unsigned int ts_warn_delta;
226     unsigned int anti_nick_flood;
227     unsigned int warn_no_connect_block;
228     unsigned int invisible_on_connect;
229     unsigned int stats_e_disabled;
230     unsigned int stats_o_oper_only;
231     unsigned int stats_k_oper_only;
232     unsigned int stats_i_oper_only;
233     unsigned int stats_P_oper_only;
234     unsigned int stats_u_oper_only;
235     unsigned int short_motd;
236     unsigned int no_oper_flood;
237     unsigned int true_no_oper_flood;
238     unsigned int oper_pass_resv;
239     unsigned int glines;
240     unsigned int hide_spoof_ips;
241     unsigned int tkline_expire_notices;
242     unsigned int opers_bypass_callerid;
243     unsigned int ignore_bogus_ts;
244     unsigned int pace_wait;
245     unsigned int pace_wait_simple;
246     unsigned int gline_time;
247     unsigned int gline_request_time;
248 michael 3675 unsigned int oper_only_umodes;
249     unsigned int oper_umodes;
250 michael 3283 unsigned int max_targets;
251 michael 3871 unsigned int caller_id_wait;
252     unsigned int min_nonwildcard;
253     unsigned int min_nonwildcard_simple;
254     unsigned int kill_chase_time_limit;
255     unsigned int default_floodcount;
256 michael 3876 unsigned int throttle_count;
257 michael 3871 unsigned int throttle_time;
258     unsigned int ping_cookie;
259     unsigned int disable_auth;
260     unsigned int cycle_on_host_change;
261 michael 4341 } ConfigGeneral;
262 adx 30
263 michael 4079 struct
264 adx 30 {
265 michael 3871 unsigned int disable_fake_channels;
266 michael 3863 unsigned int invite_client_count;
267     unsigned int invite_client_time;
268     unsigned int knock_client_count;
269     unsigned int knock_client_time;
270 michael 3871 unsigned int knock_delay_channel;
271 adx 30 unsigned int max_bans;
272 michael 3934 unsigned int max_channels;
273 michael 3871 unsigned int no_create_on_split;
274     unsigned int no_join_on_split;
275     unsigned int default_split_server_count;
276     unsigned int default_split_user_count;
277 michael 4079 } ConfigChannel;
278 adx 30
279 michael 4079 struct
280 adx 30 {
281 michael 1013 char *hidden_name;
282 michael 3871 unsigned int flatten_links;
283     unsigned int disable_remote_commands;
284     unsigned int hide_servers;
285     unsigned int hide_services;
286     unsigned int links_delay;
287     unsigned int links_disabled;
288     unsigned int hidden;
289     unsigned int hide_server_ips;
290 michael 4079 } ConfigServerHide;
291 adx 30
292 michael 4079 struct
293 adx 30 {
294 michael 4115 #ifdef HAVE_LIBCRYPTO
295     const EVP_MD *message_digest_algorithm;
296     #endif
297 michael 1013 char *sid;
298 adx 30 char *name;
299     char *description;
300     char *network_name;
301     char *network_desc;
302     char *rsa_private_key_file;
303 michael 1644 void *rsa_private_key;
304     void *server_ctx;
305     void *client_ctx;
306 michael 3871 unsigned int hub;
307 michael 1013 unsigned int max_clients;
308 michael 1751 unsigned int max_nick_length;
309     unsigned int max_topic_length;
310 michael 3871 unsigned int specific_ipv4_vhost;
311     unsigned int specific_ipv6_vhost;
312 michael 4345 struct irc_ssaddr ip;
313     struct irc_ssaddr ip6;
314 michael 4341 } ConfigServerInfo;
315 adx 30
316 michael 4079 struct
317 adx 30 {
318     char *name;
319     char *description;
320     char *email;
321 michael 4341 } ConfigAdminInfo;
322 adx 30
323 michael 4079 struct
324 adx 30 {
325     unsigned int use_logging;
326 michael 4341 } ConfigLog;
327 adx 30
328 michael 2156 extern dlink_list flatten_links;
329 adx 30 extern dlink_list server_items;
330     extern dlink_list cluster_items;
331 michael 1622 extern dlink_list xconf_items;
332 michael 1922 extern dlink_list uconf_items;
333     extern dlink_list oconf_items;
334 michael 1157 extern dlink_list service_items;
335 michael 2174 extern dlink_list nresv_items;
336     extern dlink_list cresv_items;
337 michael 3494
338 michael 2130 extern int valid_wild_card_simple(const char *);
339 adx 30 extern int valid_wild_card(struct Client *, int, int, ...);
340     /* End GLOBAL section */
341    
342 michael 1632 extern struct MaskItem *conf_make(enum maskitem_type);
343 adx 30 extern void read_conf_files(int);
344 michael 1632 extern int attach_conf(struct Client *, struct MaskItem *);
345 adx 30 extern int attach_connect_block(struct Client *, const char *, const char *);
346 michael 1644 extern int check_client(struct Client *);
347 adx 30
348 michael 1644
349 michael 1632 extern void detach_conf(struct Client *, enum maskitem_type);
350     extern struct MaskItem *find_conf_name(dlink_list *, const char *, enum maskitem_type);
351 adx 30 extern int conf_connect_allowed(struct irc_ssaddr *, int);
352     extern char *oper_privs_as_string(const unsigned int);
353 michael 593 extern void split_nuh(struct split_nuh_item *);
354 michael 1632 extern struct MaskItem *find_matching_name_conf(enum maskitem_type, const char *,
355     const char *, const char *, unsigned int);
356     extern struct MaskItem *find_exact_name_conf(enum maskitem_type, const struct Client *, const char *,
357 adx 30 const char *, const char *);
358 michael 1632 extern void conf_free(struct MaskItem *);
359 adx 30 extern void yyerror(const char *);
360 michael 1751 extern void conf_error_report(const char *);
361 adx 30 extern void cleanup_tklines(void *);
362     extern int rehash(int);
363 michael 1647 extern void lookup_confhost(struct MaskItem *);
364 michael 1632 extern void conf_add_class_to_conf(struct MaskItem *, const char *);
365 adx 30
366 michael 1364 extern const char *get_oper_name(const struct Client *);
367 adx 30
368     /* XXX should the parse_aline stuff go into another file ?? */
369 michael 2865 #define AWILD 0x1 /* check wild cards */
370 adx 30 extern int parse_aline(const char *, struct Client *, int, char **,
371 michael 2865 int, char **, char **, time_t *, char **, char **);
372 adx 30 extern int valid_comment(struct Client *, char *, int);
373    
374    
375     #define TK_SECONDS 0
376     #define TK_MINUTES 1
377 michael 2313 extern time_t valid_tkline(const char *, const int);
378 michael 1632 extern int match_conf_password(const char *, const struct MaskItem *);
379 adx 30
380 michael 1370 #define CLEANUP_TKLINES_TIME 60
381 adx 30
382 michael 2865 extern void cluster_a_line(struct Client *, const char *, int, int, const char *,...);
383 adx 30 #endif /* INCLUDED_s_conf_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision