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-7.2/include/s_conf.h (file contents), Revision 1005 by michael, Mon Aug 31 23:07:43 2009 UTC vs.
ircd-hybrid-8/include/conf.h (file contents), Revision 1495 by michael, Sun Aug 5 09:35:42 2012 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  s_conf.h: A header for the configuration functions.
3 > *  conf.h: A header for the configuration functions.
4   *
5   *  Copyright (C) 2005 by the past and present ircd coders, and others.
6   *
# Line 28 | Line 28
28   #ifdef HAVE_LIBCRYPTO
29   #include <openssl/rsa.h>
30   #endif
31 – #include "fileio.h"             /* FBFILE */
31   #include "ircd_defs.h"
32   #include "motd.h"               /* MessageFile */
33   #include "client.h"
34   #include "hook.h"
36 – #include "pcre.h"
35  
36  
39 – #define CONF_SERVER_INFO_TLS_VERSION_SSLV3 0x1
40 – #define CONF_SERVER_INFO_TLS_VERSION_TLSV1 0x2
41 –
37   struct Client;
38  
39   extern struct Callback *client_check_cb;
# Line 47 | Line 42 | struct conf_parser_context
42   {
43    unsigned int boot;
44    unsigned int pass;
45 <  FBFILE *conf_file;
45 >  FILE *conf_file;
46   };
47  
48   extern struct conf_parser_context conf_parser_ctx;
# Line 72 | Line 67 | typedef enum
67    GLINE_TYPE,
68    CRESV_TYPE,    
69    NRESV_TYPE,
70 <  GDENY_TYPE
70 >  SERVICE_TYPE
71   } ConfType;
72  
73   struct split_nuh_item
# Line 91 | Line 86 | struct split_nuh_item
86  
87   struct ConfItem
88   {
89 +  dlink_node node;      /* link into known ConfItems of this type */
90 +
91    char *name;           /* Primary key */
92 <  pcre *regexpname;
96 <  dlink_node node;      /* link into known ConfItems of this type */
92 >  void *regexpname;
93    unsigned int flags;
94    ConfType type;
95   };
# Line 122 | Line 118 | struct AccessItem
118    unsigned int     status;   /* If CONF_ILLEGAL, delete when no clients */
119    unsigned int     flags;
120    unsigned int     modes;
121 +  unsigned int     port;
122    int              clients;  /* Number of *LOCAL* clients using this */
123 <  struct irc_ssaddr my_ipnum; /* ip to bind to for outgoing connect */
124 <  struct irc_ssaddr ipnum;      /* ip to connect to */
123 >  int              bits;
124 >  int              type;
125 >  struct irc_ssaddr bind;  /* ip to bind to for outgoing connect */
126 >  struct irc_ssaddr addr;  /* ip to connect to */
127    char *           host;     /* host part of user@host */
128    char *           passwd;
129    char *           spasswd;  /* Password to send. */
130    char *           reason;
131    char *           oper_reason;
132    char *           user;     /* user part of user@host */
134 –  int              port;
135 –  char *           fakename;   /* Mask name */
133    time_t           hold;     /* Hold action until this time (calendar time) */
134    struct ConfItem *class_ptr;  /* Class of connection */
135    int              aftype;
136   #ifdef HAVE_LIBCRYPTO
137 +  /* certs */
138 +  char *cipher_list;
139    char *           rsa_public_key_file;
140    RSA *            rsa_public_key;
142 –  struct EncCapability *cipher_preference;
141   #endif
142 <  pcre *regexuser;
143 <  pcre *regexhost;
142 >  void *regexuser;
143 >  void *regexhost;
144 >  dlink_list leaf_list;
145 >  dlink_list hub_list;
146   };
147  
148   struct ClassItem
149   {
150 +  dlink_list list_ipv4;         /* base of per cidr ipv4 client link list */
151 +  dlink_list list_ipv6;         /* base of per cidr ipv6 client link list */
152    unsigned int max_sendq;
153    int con_freq;
154    int ping_freq;
# Line 160 | Line 162 | struct ClassItem
162    int cidr_bitlen_ipv4;
163    int cidr_bitlen_ipv6;
164    int number_per_cidr;
163 –  dlink_list list_ipv4;         /* base of per cidr ipv4 client link list */
164 –  dlink_list list_ipv6;         /* base of per cidr ipv6 client link list */
165    int active;
166   };
167  
168   struct CidrItem
169   {
170 +  dlink_node node;
171    struct irc_ssaddr mask;
172    int number_on_this_cidr;
172 –  dlink_node node;
173   };
174  
175 – #define ConFreq(x)      ((x)->con_freq)
176 – #define PingFreq(x)     ((x)->ping_freq)
177 – #define PingWarning(x)  ((x)->ping_warning)
178 – #define MaxTotal(x)     ((x)->max_total)
179 – #define MaxGlobal(x)    ((x)->max_global)
180 – #define MaxLocal(x)     ((x)->max_local)
181 – #define MaxIdent(x)     ((x)->max_ident)
182 – #define MaxPerIp(x)     ((x)->max_perip)
183 – #define MaxSendq(x)     ((x)->max_sendq)
184 – #define CurrUserCount(x) ((x)->curr_user_count)
185 – #define CidrBitlenIPV4(x)       ((x)->cidr_bitlen_ipv4)
186 – #define CidrBitlenIPV6(x)       ((x)->cidr_bitlen_ipv6)
187 – #define NumberPerCidr(x) ((x)->number_per_cidr)
188 –
189 – #define ClassPtr(x)      ((x)->class_ptr)
190 –
175  
176   #define CONF_ILLEGAL            0x80000000
177   #define CONF_RESERVED           0x00000001
178   #define CONF_CLIENT             0x00000002
179   #define CONF_SERVER             0x00000004
180   #define CONF_OPERATOR           0x00000008
181 < #define CONF_KILL               0x00000010
198 < #define CONF_KLINE              CONF_KILL
181 > #define CONF_KLINE              0x00000010
182   #define CONF_CLASS              0x00000020
183 < #define CONF_LEAF               0x00000040
184 < #define CONF_LISTEN_PORT        0x00000080
185 < #define CONF_HUB                0x00000100
186 < #define CONF_EXEMPTKLINE        0x00000200
187 < #define CONF_NOLIMIT            0x00000400
188 < #define CONF_DLINE              0x00000800
206 < #define CONF_XLINE              0x00001000
207 < #define CONF_ULINE              0x00002000
208 < #define CONF_EXEMPTDLINE        0x00004000
209 < #define CONF_GLINE              0x00008000
183 > #define CONF_DLINE              0x00000040
184 > #define CONF_XLINE              0x00000080
185 > #define CONF_ULINE              0x00000100
186 > #define CONF_EXEMPTDLINE        0x00000200
187 > #define CONF_GLINE              0x00000400
188 > #define CONF_SERVICE            0x00000800
189  
190   #define CONF_SERVER_MASK       CONF_SERVER
191   #define CONF_CLIENT_MASK       (CONF_CLIENT | CONF_OPERATOR | CONF_SERVER_MASK)
# Line 220 | Line 199 | struct CidrItem
199   #define IsConfServer(x)         ((x)->status == CONF_SERVER)
200   #define SetConfServer(x)        ((x)->status = CONF_SERVER)
201   #define IsConfOperator(x)       ((x)->status & CONF_OPERATOR)
202 < #define IsConfHub(x)            ((x)->status == CONF_HUB)
224 < #define SetConfHub(x)           ((x)->status = CONF_HUB)
225 < #define IsConfLeaf(x)           ((x)->status == CONF_LEAF)
226 < #define SetConfLeaf(x)          ((x)->status = CONF_LEAF)
227 < #define IsConfHubOrLeaf(x)      ((x)->status & (CONF_HUB|CONF_LEAF))
228 < #define IsConfKill(x)           ((x)->status == CONF_KILL)
202 > #define IsConfKill(x)           ((x)->status == CONF_KLINE)
203   #define IsConfClient(x)         ((x)->status & CONF_CLIENT)
230 – #define IsConfTypeOfClient(x)   ((x)->status & CONF_CLIENT_MASK)
204   #define IsConfUline(x)          ((x)->status & CONF_ULINE)
205   #define IsConfXline(x)          ((x)->status & CONF_XLINE)
206   #define IsConfGline(x)          ((x)->status == CONF_GLINE)
# Line 240 | Line 213 | struct CidrItem
213   #define CONF_FLAGS_LIMIT_IP             0x00000002
214   #define CONF_FLAGS_NO_TILDE             0x00000004
215   #define CONF_FLAGS_NEED_IDENTD          0x00000008
216 < /*                                      0x00000010 */
217 < #define CONF_FLAGS_NOMATCH_IP           0x00000020
218 < #define CONF_FLAGS_EXEMPTKLINE          0x00000040
219 < #define CONF_FLAGS_NOLIMIT              0x00000080
220 < #define CONF_FLAGS_IDLE_LINED           0x00000100
221 < #define CONF_FLAGS_SPOOF_IP             0x00000200
222 < #define CONF_FLAGS_SPOOF_NOTICE         0x00000400
223 < #define CONF_FLAGS_REDIR                0x00000800
224 < #define CONF_FLAGS_EXEMPTGLINE          0x00001000
252 < #define CONF_FLAGS_RESTRICTED           0x00002000
253 < #define CONF_FLAGS_CAN_FLOOD            0x00100000
254 < #define CONF_FLAGS_NEED_PASSWORD        0x00200000
216 > #define CONF_FLAGS_NOMATCH_IP           0x00000010
217 > #define CONF_FLAGS_EXEMPTKLINE          0x00000020
218 > #define CONF_FLAGS_NOLIMIT              0x00000040
219 > #define CONF_FLAGS_SPOOF_IP             0x00000080
220 > #define CONF_FLAGS_SPOOF_NOTICE         0x00000100
221 > #define CONF_FLAGS_REDIR                0x00000200
222 > #define CONF_FLAGS_EXEMPTGLINE          0x00000400
223 > #define CONF_FLAGS_CAN_FLOOD            0x00000800
224 > #define CONF_FLAGS_NEED_PASSWORD        0x00001000
225   /* server flags */
226 < #define CONF_FLAGS_ALLOW_AUTO_CONN      0x00004000
227 < #define CONF_FLAGS_LAZY_LINK            0x00008000
228 < #define CONF_FLAGS_ENCRYPTED            0x00010000
229 < #define CONF_FLAGS_COMPRESSED           0x00020000
230 < #define CONF_FLAGS_TEMPORARY            0x00040000
231 < #define CONF_FLAGS_CRYPTLINK            0x00080000
232 < #define CONF_FLAGS_BURST_AWAY           0x00400000
263 < #define CONF_FLAGS_EXEMPTRESV           0x00800000
264 < #define CONF_FLAGS_TOPICBURST           0x01000000
226 > #define CONF_FLAGS_ALLOW_AUTO_CONN      0x00002000
227 > #define CONF_FLAGS_ENCRYPTED            0x00004000
228 > #define CONF_FLAGS_TEMPORARY            0x00008000
229 > #define CONF_FLAGS_BURST_AWAY           0x00010000
230 > #define CONF_FLAGS_EXEMPTRESV           0x00020000
231 > #define CONF_FLAGS_TOPICBURST           0x00040000
232 > #define CONF_FLAGS_SSL                  0x00080000
233  
234   /* Macros for struct AccessItem */
235   #define IsLimitIp(x)            ((x)->flags & CONF_FLAGS_LIMIT_IP)
# Line 274 | Line 242 | struct CidrItem
242   #define IsConfExemptLimits(x)   ((x)->flags & CONF_FLAGS_NOLIMIT)
243   #define IsConfExemptGline(x)    ((x)->flags & CONF_FLAGS_EXEMPTGLINE)
244   #define IsConfExemptResv(x)     ((x)->flags & CONF_FLAGS_EXEMPTRESV)
277 – #define IsConfIdlelined(x)      ((x)->flags & CONF_FLAGS_IDLE_LINED)
245   #define IsConfDoIdentd(x)       ((x)->flags & CONF_FLAGS_DO_IDENTD)
246   #define IsConfDoSpoofIp(x)      ((x)->flags & CONF_FLAGS_SPOOF_IP)
247   #define IsConfSpoofNotice(x)    ((x)->flags & CONF_FLAGS_SPOOF_NOTICE)
281 – #define IsConfRestricted(x)     ((x)->flags & CONF_FLAGS_RESTRICTED)
248   #define IsConfEncrypted(x)      ((x)->flags & CONF_FLAGS_ENCRYPTED)
249   #define SetConfEncrypted(x)     ((x)->flags |= CONF_FLAGS_ENCRYPTED)
250   #define ClearConfEncrypted(x)   ((x)->flags &= ~CONF_FLAGS_ENCRYPTED)
285 – #define IsConfCompressed(x)     ((x)->flags & CONF_FLAGS_COMPRESSED)
286 – #define SetConfCompressed(x)    ((x)->flags |= CONF_FLAGS_COMPRESSED)
287 – #define ClearConfCompressed(x)  ((x)->flags &= ~CONF_FLAGS_COMPRESSED)
288 – #define IsConfCryptLink(x)      ((x)->flags & CONF_FLAGS_CRYPTLINK)
289 – #define SetConfCryptLink(x)     ((x)->flags |= CONF_FLAGS_CRYPTLINK)
290 – #define ClearConfCryptLink(x)   ((x)->flags &= ~CONF_FLAGS_CRYPTLINK)
251   #define IsConfAllowAutoConn(x)  ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN)
252   #define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN)
253   #define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN)
# Line 300 | Line 260 | struct CidrItem
260   #define IsConfTopicBurst(x)     ((x)->flags & CONF_FLAGS_TOPICBURST)
261   #define SetConfTopicBurst(x)    ((x)->flags |= CONF_FLAGS_TOPICBURST)
262   #define ClearConfTopicBurst(x)  ((x)->flags &= ~CONF_FLAGS_TOPICBURST)
263 + #define IsConfSSL(x)      ((x)->flags & CONF_FLAGS_SSL)
264 + #define SetConfSSL(x)     ((x)->flags |= CONF_FLAGS_SSL)
265 + #define ClearConfSSL(x)   ((x)->flags &= ~CONF_FLAGS_SSL)
266  
267   /* shared/cluster server entry types
268   * These defines are used for both shared and cluster.
269   */
270   #define SHARED_KLINE            0x0001
271 < #define SHARED_TKLINE           0x0002
272 < #define SHARED_UNKLINE          0x0004
273 < #define SHARED_XLINE            0x0008
274 < #define SHARED_TXLINE           0x0010
275 < #define SHARED_UNXLINE          0x0020
276 < #define SHARED_RESV             0x0040
277 < #define SHARED_TRESV            0x0080
278 < #define SHARED_UNRESV           0x0100
279 < #define SHARED_LOCOPS           0x0200
280 < #define SHARED_ALL              (SHARED_KLINE | SHARED_TKLINE | SHARED_UNKLINE | \
281 <                                 SHARED_XLINE | SHARED_TXLINE | SHARED_UNXLINE | \
282 <                                 SHARED_RESV | SHARED_TRESV | SHARED_UNRESV |\
320 <                                 SHARED_LOCOPS)
321 <
322 < /* gline acl entry actions */
323 < #define GDENY_BLOCK             0x1
324 < #define GDENY_REJECT            0x2
271 > #define SHARED_UNKLINE          0x0002
272 > #define SHARED_XLINE            0x0004
273 > #define SHARED_UNXLINE          0x0008
274 > #define SHARED_RESV             0x0010
275 > #define SHARED_UNRESV           0x0020
276 > #define SHARED_LOCOPS           0x0040
277 > #define SHARED_DLINE            0x0080
278 > #define SHARED_UNDLINE          0x0100
279 > #define SHARED_ALL              (SHARED_KLINE | SHARED_UNKLINE |\
280 >                                 SHARED_XLINE | SHARED_UNXLINE |\
281 >                                 SHARED_RESV | SHARED_UNRESV |\
282 >                                 SHARED_LOCOPS | SHARED_DLINE | SHARED_UNDLINE)
283  
284   struct config_file_entry
285   {
# Line 336 | Line 294 | struct config_file_entry
294    const char *cresvfile;
295    const char *nresvfile;
296  
339 –  char *logpath;
340 –  char *operlog;
341 –
342 –  char *servlink_path;
297    char *egdpool_path;
298 +  char *service_name;
299  
300    MessageFile motd;
346 –  MessageFile opermotd;
301    MessageFile linksfile;
302  
349 –  unsigned char compression_level;
303    int gline_min_cidr;
304    int gline_min_cidr6;
352 –  int dot_in_ip6_addr;
305    int dots_in_ident;
306    int failed_oper_notice;
307    int anti_spam_exit_message_time;
# Line 383 | Line 335 | struct config_file_entry
335    int pace_wait;
336    int pace_wait_simple;
337    int gline_time;
338 <  int gline_logging;
387 <  int idletime;
338 >  int gline_request_time;
339    int oper_only_umodes;
340    int oper_umodes;
341    int max_targets;
# Line 400 | Line 351 | struct config_file_entry
351    int ping_cookie;
352    int disable_auth;
353    int disable_remote;
403 – #ifdef HAVE_LIBCRYPTO
404 –  struct EncCapability *default_cipher_preference;
405 – #endif
354   };
355  
356   struct config_channel_entry
357   {
358    int disable_fake_channels;
359    int restrict_channels;
412 –  int disable_local_channels;
413 –  int use_except;
414 –  int use_invex;
415 –  int use_knock;
360    int knock_delay;
361    int knock_delay_channel;
362    unsigned int max_bans;
363    unsigned int max_chans_per_user;
364 +  unsigned int max_chans_per_oper;
365    int no_create_on_split;
366    int no_join_on_split;
367    int quiet_on_ban;
423 –  int burst_topicwho;
368    int default_split_server_count;
369    int default_split_user_count;
370   };
371  
372   struct config_server_hide
373   {
374 +  char *hidden_name;
375    int flatten_links;
376    int hide_servers;
432 –  char *hidden_name;
377    int links_delay;
378    int links_disabled;
379    int hidden;
436 –  int disable_hidden;
380    int hide_server_ips;
381   };
382  
383   struct server_info
384   {
385 +  char *sid;
386    char *name;
387    char *description;
388    char *network_name;
# Line 448 | Line 392 | struct server_info
392    RSA *rsa_private_key;
393    SSL_CTX *server_ctx;
394    SSL_CTX *client_ctx;
451 –  unsigned int tls_version;
395   #endif
453 –  char *sid;
396    int hub;
397    struct irc_ssaddr ip;
398    struct irc_ssaddr ip6;
399 <  int max_clients;
399 >  unsigned int max_clients;
400    int specific_ipv4_vhost;
401    int specific_ipv6_vhost;
402    struct sockaddr_in dns_host;
# Line 471 | Line 413 | struct admin_info
413   struct logging_entry
414   {
415    unsigned int use_logging;
474 –  char operlog[PATH_MAX + 1];
475 –  char userlog[PATH_MAX + 1];
476 –  char glinelog[PATH_MAX + 1];
477 –  char ioerrlog[PATH_MAX + 1];
478 –  char klinelog[PATH_MAX + 1];
479 –  char killlog[PATH_MAX + 1];
480 –  char operspylog[PATH_MAX + 1];
481 –  char failed_operlog[PATH_MAX + 1];
416   };
417  
418   extern dlink_list class_items;
# Line 488 | Line 422 | extern dlink_list hub_items;
422   extern dlink_list rxconf_items;
423   extern dlink_list rkconf_items;
424   extern dlink_list leaf_items;
425 < extern dlink_list temporary_klines;
492 < extern dlink_list temporary_dlines;
493 < extern dlink_list temporary_glines;
425 > extern dlink_list service_items;
426   extern dlink_list temporary_xlines;
495 – extern dlink_list temporary_rxlines;
496 – extern dlink_list temporary_rklines;
427   extern struct logging_entry ConfigLoggingEntry;
428   extern struct config_file_entry ConfigFileEntry;/* defined in ircd.c*/
429   extern struct config_channel_entry ConfigChannel;/* defined in channel.c*/
# Line 529 | Line 459 | extern char *oper_privs_as_string(const
459   extern void split_nuh(struct split_nuh_item *);
460   extern struct ConfItem *find_matching_name_conf(ConfType, const char *,
461                                                  const char *, const char *, int);
462 < extern struct ConfItem *find_exact_name_conf(ConfType, const char *,
462 > extern struct ConfItem *find_exact_name_conf(ConfType, const struct Client *, const char *,
463                                               const char *, const char *);
464   extern void delete_conf_item(struct ConfItem *);
465 < extern void report_confitem_types(struct Client *, ConfType, int);
465 > extern void report_confitem_types(struct Client *, ConfType);
466   extern void yyerror(const char *);
537 – extern int conf_yy_fatal_error(const char *);
538 – extern int conf_fbgets(char *, unsigned int, FBFILE *);
467   extern void write_conf_line(struct Client *, struct ConfItem *,
468                              const char *, time_t);
469   extern int remove_conf_line(ConfType, struct Client *, const char *,
# Line 548 | Line 476 | extern int conf_add_server(struct ConfIt
476   extern void conf_add_class_to_conf(struct ConfItem *, const char *);
477  
478   /* XXX consider moving these into csvlib.h */
479 < extern void parse_csv_file(FBFILE *, ConfType);
480 <
481 < extern char *get_oper_name(const struct Client *);
479 > extern void parse_csv_file(FILE *, ConfType);
480 > extern int find_and_delete_temporary(const char *, const char *, int);
481 > extern const char *get_oper_name(const struct Client *);
482  
483   extern void *map_to_conf(struct ConfItem *);
484   extern struct ConfItem *unmap_conf_item(void *);
# Line 564 | Line 492 | extern int valid_comment(struct Client *
492  
493   #define TK_SECONDS 0
494   #define TK_MINUTES 1
495 < extern time_t valid_tkline(char *, int);
495 > extern time_t valid_tkline(const char *, int);
496   extern int match_conf_password(const char *, const struct AccessItem *);
497  
498   #define NOT_AUTHORIZED    (-1)
# Line 578 | Line 506 | extern int match_conf_password(const cha
506   extern void cluster_a_line(struct Client *,
507                             const char *, int, int, const char *,...);
508   extern void rebuild_cidr_class(struct ConfItem *, struct ClassItem *);
581 –
582 – /* XXX **/
583 – extern int yylex(void);
584 –
509   #endif /* INCLUDED_s_conf_h */

Diff Legend

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