ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/conf.h
(Generate patch)

Comparing ircd-hybrid/trunk/include/conf.h (file contents):
Revision 3473 by michael, Sun May 4 15:40:26 2014 UTC vs.
Revision 5584 by michael, Sun Feb 15 15:02:36 2015 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (c) 1997-2014 ircd-hybrid development team
4 > *  Copyright (c) 1997-2015 ircd-hybrid development team
5   *
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
# Line 15 | Line 15
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
18 > *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19   *  USA
20   */
21  
# Line 34 | Line 34
34  
35   #define CONF_NOREASON "<No reason supplied>"
36  
37 #define IsConfOperator(x)       ((x)->type == CONF_OPER)
37   #define IsConfKill(x)           ((x)->type == CONF_KLINE)
38   #define IsConfClient(x)         ((x)->type == CONF_CLIENT)
39   #define IsConfGline(x)          ((x)->type == CONF_GLINE)
40  
41   /* MaskItem->flags */
42 < #define CONF_FLAGS_DO_IDENTD            0x00000001
43 < #define CONF_FLAGS_NO_TILDE             0x00000004
44 < #define CONF_FLAGS_NEED_IDENTD          0x00000008
45 < #define CONF_FLAGS_EXEMPTKLINE          0x00000010
46 < #define CONF_FLAGS_NOLIMIT              0x00000020
47 < #define CONF_FLAGS_SPOOF_IP             0x00000040
48 < #define CONF_FLAGS_SPOOF_NOTICE         0x00000080
49 < #define CONF_FLAGS_REDIR                0x00000100
50 < #define CONF_FLAGS_EXEMPTGLINE          0x00000200
51 < #define CONF_FLAGS_CAN_FLOOD            0x00000400
52 < #define CONF_FLAGS_NEED_PASSWORD        0x00000800
53 < #define CONF_FLAGS_ALLOW_AUTO_CONN      0x00001000
54 < #define CONF_FLAGS_ENCRYPTED            0x00002000
55 < #define CONF_FLAGS_IN_DATABASE          0x00004000
56 < #define CONF_FLAGS_EXEMPTRESV           0x00008000
57 < #define CONF_FLAGS_SSL                  0x00010000
59 < #define CONF_FLAGS_WEBIRC               0x00020000
42 > #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  
59   /* Macros for struct MaskItem */
60 < #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 IsConfDoIdentd(x)       ((x)->flags & CONF_FLAGS_DO_IDENTD)
70 < #define IsConfDoSpoofIp(x)      ((x)->flags & CONF_FLAGS_SPOOF_IP)
71 < #define IsConfSpoofNotice(x)    ((x)->flags & CONF_FLAGS_SPOOF_NOTICE)
72 < #define IsConfEncrypted(x)      ((x)->flags & CONF_FLAGS_ENCRYPTED)
75 < #define SetConfEncrypted(x)     ((x)->flags |= CONF_FLAGS_ENCRYPTED)
76 < #define ClearConfEncrypted(x)   ((x)->flags &= ~CONF_FLAGS_ENCRYPTED)
77 < #define IsConfAllowAutoConn(x)  ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN)
78 < #define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN)
60 > #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   #define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN)
74 < #define IsConfRedir(x)          ((x)->flags & CONF_FLAGS_REDIR)
75 < #define IsConfSSL(x)      ((x)->flags & CONF_FLAGS_SSL)
76 < #define SetConfSSL(x)     ((x)->flags |= CONF_FLAGS_SSL)
77 < #define ClearConfSSL(x)   ((x)->flags &= ~CONF_FLAGS_SSL)
84 < #define IsConfDatabase(x)      ((x)->flags & CONF_FLAGS_IN_DATABASE)
85 < #define SetConfDatabase(x)     ((x)->flags |= CONF_FLAGS_IN_DATABASE)
74 > #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  
79  
80   /* shared/cluster server entry types
81   * These defines are used for both shared and cluster.
82   */
83 < #define SHARED_KLINE            0x0001
84 < #define SHARED_UNKLINE          0x0002
85 < #define SHARED_XLINE            0x0004
86 < #define SHARED_UNXLINE          0x0008
87 < #define SHARED_RESV             0x0010
88 < #define SHARED_UNRESV           0x0020
89 < #define SHARED_LOCOPS           0x0040
90 < #define SHARED_DLINE            0x0080
91 < #define SHARED_UNDLINE          0x0100
83 > #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   #define SHARED_ALL              (SHARED_KLINE | SHARED_UNKLINE |\
93                                   SHARED_XLINE | SHARED_UNXLINE |\
94                                   SHARED_RESV | SHARED_UNRESV |\
# Line 117 | Line 109 | enum maskitem_type
109    CONF_CRESV    = 1 <<  9,
110    CONF_NRESV    = 1 << 10,
111    CONF_SERVICE  = 1 << 11,
112 <  CONF_OPER     = 1 << 12,
112 >  CONF_OPER     = 1 << 12
113   };
114  
115   enum
# Line 129 | Line 121 | enum
121    TOO_FAST       = -5
122   };
123  
132 struct conf_parser_context
133 {
134  unsigned int boot;
135  unsigned int pass;
136  FILE *conf_file;
137 };
138
124   struct split_nuh_item
125   {
126    dlink_node node;
# Line 180 | Line 165 | struct MaskItem
165    char              *spasswd;  /* Password to send. */
166    char              *reason;
167    char              *certfp;
168 +  char              *whois;
169    char              *cipher_list;
170    void              *rsa_public_key;
171   };
# Line 195 | Line 181 | struct exempt
181    struct irc_ssaddr addr;
182    int bits;
183    int type;
184 <  int coid;
184 >  int country_id;
185   };
186  
187   struct CidrItem
# Line 205 | Line 191 | struct CidrItem
191    unsigned int number_on_this_cidr;
192   };
193  
194 < struct config_file_entry
194 > struct
195 > {
196 >  unsigned int boot;
197 >  unsigned int pass;
198 >  FILE *conf_file;
199 > } conf_parser_ctx;
200 >
201 > struct
202   {
203 <  const char *dpath;          /* DPATH if set from command line */
203 >  const char *dpath;
204    const char *mpath;
205    const char *spath;
206    const char *configfile;
# Line 217 | Line 210 | struct config_file_entry
210    const char *dlinefile;
211    const char *resvfile;
212  
213 <  char *egdpool_path;
214 <  char *service_name;
215 <
216 <  int gline_min_cidr;
217 <  int gline_min_cidr6;
225 <  int dots_in_ident;
226 <  int failed_oper_notice;
227 <  int anti_spam_exit_message_time;
213 >  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    unsigned int max_accept;
219    unsigned int max_watch;
220 <  int max_nick_time;
220 >  unsigned int away_time;
221 >  unsigned int away_count;
222 >  unsigned int max_nick_time;
223    unsigned int max_nick_changes;
224 <  int ts_max_delta;
225 <  int ts_warn_delta;
226 <  int anti_nick_flood;
227 <  int warn_no_connect_block;
228 <  int invisible_on_connect;
229 <  int stats_e_disabled;
230 <  int stats_o_oper_only;
231 <  int stats_k_oper_only;
232 <  int stats_i_oper_only;
233 <  int stats_P_oper_only;
234 <  int stats_u_oper_only;
235 <  int short_motd;
236 <  int no_oper_flood;
237 <  int true_no_oper_flood;
238 <  int oper_pass_resv;
239 <  int glines;
240 <  int hide_spoof_ips;
241 <  int tkline_expire_notices;
242 <  int opers_bypass_callerid;
243 <  int ignore_bogus_ts;
244 <  int pace_wait;
245 <  int pace_wait_simple;
246 <  int gline_time;
247 <  int gline_request_time;
248 <  int oper_only_umodes;
257 <  int oper_umodes;
224 >  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_i_oper_only;
231 >  unsigned int stats_k_oper_only;
232 >  unsigned int stats_m_oper_only;
233 >  unsigned int stats_o_oper_only;
234 >  unsigned int stats_P_oper_only;
235 >  unsigned int stats_u_oper_only;
236 >  unsigned int short_motd;
237 >  unsigned int no_oper_flood;
238 >  unsigned int oper_pass_resv;
239 >  unsigned int glines;
240 >  unsigned int tkline_expire_notices;
241 >  unsigned int opers_bypass_callerid;
242 >  unsigned int ignore_bogus_ts;
243 >  unsigned int pace_wait;
244 >  unsigned int pace_wait_simple;
245 >  unsigned int gline_time;
246 >  unsigned int gline_request_time;
247 >  unsigned int oper_only_umodes;
248 >  unsigned int oper_umodes;
249    unsigned int max_targets;
250 <  int caller_id_wait;
251 <  int min_nonwildcard;
252 <  int min_nonwildcard_simple;
253 <  int kill_chase_time_limit;
254 <  int default_floodcount;
255 <  /* 0 == don't use throttle... */
256 <  int throttle_time;
257 <  int use_egd;
258 <  int ping_cookie;
259 <  int disable_auth;
260 <  int cycle_on_host_change;
261 < };
262 <
263 < struct config_channel_entry
264 < {
265 <  int disable_fake_channels;
266 <  int knock_delay;
267 <  int knock_delay_channel;
250 >  unsigned int caller_id_wait;
251 >  unsigned int min_nonwildcard;
252 >  unsigned int min_nonwildcard_simple;
253 >  unsigned int kill_chase_time_limit;
254 >  unsigned int default_floodcount;
255 >  unsigned int throttle_count;
256 >  unsigned int throttle_time;
257 >  unsigned int ping_cookie;
258 >  unsigned int disable_auth;
259 >  unsigned int cycle_on_host_change;
260 > } ConfigGeneral;
261 >
262 > struct
263 > {
264 >  unsigned int disable_fake_channels;
265 >  unsigned int invite_client_count;
266 >  unsigned int invite_client_time;
267 >  unsigned int knock_client_count;
268 >  unsigned int knock_client_time;
269 >  unsigned int knock_delay_channel;
270    unsigned int max_bans;
271 <  unsigned int max_chans_per_user;
272 <  unsigned int max_chans_per_oper;
273 <  int no_create_on_split;
274 <  int no_join_on_split;
275 <  int default_split_server_count;
276 <  int default_split_user_count;
277 < };
271 >  unsigned int max_channels;
272 >  unsigned int default_join_flood_count;
273 >  unsigned int default_join_flood_time;
274 >  unsigned int no_create_on_split;
275 >  unsigned int no_join_on_split;
276 >  unsigned int default_split_server_count;
277 >  unsigned int default_split_user_count;
278 > } ConfigChannel;
279  
280 < struct config_server_hide
280 > struct
281   {
282    char *hidden_name;
283 <  int flatten_links;
284 <  int disable_remote_commands;
285 <  int hide_servers;
286 <  int hide_services;
287 <  int links_delay;
288 <  int links_disabled;
289 <  int hidden;
290 <  int hide_server_ips;
291 < };
292 <
293 < struct server_info
294 < {
283 >  unsigned int flatten_links;
284 >  unsigned int disable_remote_commands;
285 >  unsigned int hide_servers;
286 >  unsigned int hide_services;
287 >  unsigned int links_delay;
288 >  unsigned int links_disabled;
289 >  unsigned int hidden;
290 >  unsigned int hide_server_ips;
291 > } ConfigServerHide;
292 >
293 > struct
294 > {
295 > #ifdef HAVE_LIBCRYPTO
296 >  const EVP_MD *message_digest_algorithm;
297 > #endif
298    char *sid;
299    char *name;
300    char *description;
# Line 307 | Line 304 | struct server_info
304    void *rsa_private_key;
305    void *server_ctx;
306    void *client_ctx;
307 <  int hub;
308 <  struct irc_ssaddr ip;
312 <  struct irc_ssaddr ip6;
313 <  unsigned int max_clients;
307 >  unsigned int hub;
308 >  unsigned int default_max_clients;
309    unsigned int max_nick_length;
310    unsigned int max_topic_length;
311 <  int specific_ipv4_vhost;
312 <  int specific_ipv6_vhost;
313 <  struct sockaddr_in dns_host;
314 <  int can_use_v6;
315 < };
311 >  unsigned int specific_ipv4_vhost;
312 >  unsigned int specific_ipv6_vhost;
313 >  struct irc_ssaddr ip;
314 >  struct irc_ssaddr ip6;
315 > } ConfigServerInfo;
316  
317 < struct admin_info
317 > struct
318   {
319    char *name;
320    char *description;
321    char *email;
322 < };
322 > } ConfigAdminInfo;
323  
324 < struct logging_entry
324 > struct
325   {
326    unsigned int use_logging;
327 < };
327 > } ConfigLog;
328  
329   extern dlink_list flatten_links;
330   extern dlink_list server_items;
# Line 340 | Line 335 | extern dlink_list oconf_items;
335   extern dlink_list service_items;
336   extern dlink_list nresv_items;
337   extern dlink_list cresv_items;
338 < extern struct conf_parser_context conf_parser_ctx;
344 < extern struct logging_entry ConfigLoggingEntry;
345 < extern struct config_file_entry ConfigFileEntry;/* defined in ircd.c*/
346 < extern struct config_channel_entry ConfigChannel;/* defined in channel.c*/
347 < extern struct config_server_hide ConfigServerHide; /* defined in s_conf.c */
348 < extern struct server_info ServerInfo;       /* defined in ircd.c */
349 < extern struct admin_info AdminInfo;        /* defined in ircd.c */
338 >
339   extern int valid_wild_card_simple(const char *);
340   extern int valid_wild_card(struct Client *, int, int, ...);
341   /* End GLOBAL section */
342  
354 extern void init_ip_hash_table(void);
355 extern void count_ip_hash(unsigned int *, uint64_t *);
356 extern void remove_one_ip(struct irc_ssaddr *);
343   extern struct MaskItem *conf_make(enum maskitem_type);
344   extern void read_conf_files(int);
345   extern int attach_conf(struct Client *, struct MaskItem *);
# Line 374 | Line 360 | extern void conf_free(struct MaskItem *)
360   extern void yyerror(const char *);
361   extern void conf_error_report(const char *);
362   extern void cleanup_tklines(void *);
363 < extern int rehash(int);
363 > extern int conf_rehash(int);
364   extern void lookup_confhost(struct MaskItem *);
365   extern void conf_add_class_to_conf(struct MaskItem *, const char *);
366  
# Line 394 | Line 380 | extern int match_conf_password(const cha
380  
381   #define CLEANUP_TKLINES_TIME 60
382  
383 < extern void cluster_a_line(struct Client *, const char *, int, int, const char *,...);
383 > extern void cluster_a_line(struct Client *, const char *, unsigned int, unsigned int, const char *,...);
384   #endif /* INCLUDED_s_conf_h */

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)