ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/include/conf.h
Revision: 4341
Committed: Sat Aug 2 16:53:48 2014 UTC (9 years, 8 months ago) by michael
Content type: text/x-chdr
File size: 12261 byte(s)
Log Message:
- Renamed structures to meet code conventions

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

Properties

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