ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/include/conf.h
Revision: 5024
Committed: Fri Dec 12 15:18:29 2014 UTC (11 years, 7 months ago) by michael
Content type: text/x-chdr
File size: 11984 byte(s)
Log Message:
- Added general::stats_m_oper_only configuration option

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

Properties

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