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 950 by michael, Tue Jul 21 23:07:52 2009 UTC vs.
ircd-hybrid-8/include/conf.h (file contents), Revision 1383 by michael, Tue May 1 11:18:22 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"
35 < #include "pcre.h"
35 >
36  
37   struct Client;
39 – struct DNSReply;
40 – struct hostent;
38  
42 – extern FBFILE *conf_fbfile_in;
39   extern struct Callback *client_check_cb;
40  
41 + struct conf_parser_context
42 + {
43 +  unsigned int boot;
44 +  unsigned int pass;
45 +  FILE *conf_file;
46 + };
47 +
48 + extern struct conf_parser_context conf_parser_ctx;
49 +
50   typedef enum
51   {  
52    CONF_TYPE,
# Line 62 | Line 67 | typedef enum
67    GLINE_TYPE,
68    CRESV_TYPE,    
69    NRESV_TYPE,
70 <  GDENY_TYPE
70 >  GDENY_TYPE,
71 >  SERVICE_TYPE
72   } ConfType;
73  
74   struct split_nuh_item
# Line 81 | Line 87 | struct split_nuh_item
87  
88   struct ConfItem
89   {
90 +  dlink_node node;      /* link into known ConfItems of this type */
91 +
92    char *name;           /* Primary key */
93 <  pcre *regexpname;
86 <  dlink_node node;      /* link into known ConfItems of this type */
93 >  void *regexpname;
94    unsigned int flags;
95    ConfType type;
96   };
# Line 107 | Line 114 | struct MatchItem
114   struct AccessItem
115   {
116    dlink_node node;
117 +  unsigned int     dns_failed;
118 +  unsigned int     dns_pending;
119    unsigned int     status;   /* If CONF_ILLEGAL, delete when no clients */
120    unsigned int     flags;
121    unsigned int     modes;
122 +  unsigned int     port;
123    int              clients;  /* Number of *LOCAL* clients using this */
124 +  int              bits;
125 +  int              type;
126    struct irc_ssaddr my_ipnum; /* ip to bind to for outgoing connect */
127    struct irc_ssaddr ipnum;      /* ip to connect to */
128    char *           host;     /* host part of user@host */
# Line 119 | Line 131 | struct AccessItem
131    char *           reason;
132    char *           oper_reason;
133    char *           user;     /* user part of user@host */
122 –  int              port;
123 –  char *           fakename;   /* Mask name */
134    time_t           hold;     /* Hold action until this time (calendar time) */
135    struct ConfItem *class_ptr;  /* Class of connection */
126 –  struct DNSQuery* dns_query;
136    int              aftype;
137   #ifdef HAVE_LIBCRYPTO
138 +  /* certs */
139 +  char *cipher_list;
140    char *           rsa_public_key_file;
141    RSA *            rsa_public_key;
131 –  struct EncCapability *cipher_preference;
142   #endif
143 <  pcre *regexuser;
144 <  pcre *regexhost;
143 >  void *regexuser;
144 >  void *regexhost;
145 >  dlink_list leaf_list;
146 >  dlink_list hub_list;
147   };
148  
149   struct ClassItem
150   {
151 +  dlink_list list_ipv4;         /* base of per cidr ipv4 client link list */
152 +  dlink_list list_ipv6;         /* base of per cidr ipv6 client link list */
153    unsigned int max_sendq;
154    int con_freq;
155    int ping_freq;
# Line 149 | Line 163 | struct ClassItem
163    int cidr_bitlen_ipv4;
164    int cidr_bitlen_ipv6;
165    int number_per_cidr;
152 –  dlink_list list_ipv4;         /* base of per cidr ipv4 client link list */
153 –  dlink_list list_ipv6;         /* base of per cidr ipv6 client link list */
166    int active;
167   };
168  
169   struct CidrItem
170   {
171 +  dlink_node node;
172    struct irc_ssaddr mask;
173    int number_on_this_cidr;
161 –  dlink_node node;
174   };
175  
164 – #define ConFreq(x)      ((x)->con_freq)
165 – #define PingFreq(x)     ((x)->ping_freq)
166 – #define PingWarning(x)  ((x)->ping_warning)
167 – #define MaxTotal(x)     ((x)->max_total)
168 – #define MaxGlobal(x)    ((x)->max_global)
169 – #define MaxLocal(x)     ((x)->max_local)
170 – #define MaxIdent(x)     ((x)->max_ident)
171 – #define MaxPerIp(x)     ((x)->max_perip)
172 – #define MaxSendq(x)     ((x)->max_sendq)
173 – #define CurrUserCount(x) ((x)->curr_user_count)
174 – #define CidrBitlenIPV4(x)       ((x)->cidr_bitlen_ipv4)
175 – #define CidrBitlenIPV6(x)       ((x)->cidr_bitlen_ipv6)
176 – #define NumberPerCidr(x) ((x)->number_per_cidr)
177 –
178 – #define ClassPtr(x)      ((x)->class_ptr)
179 –
176  
177   #define CONF_ILLEGAL            0x80000000
178   #define CONF_RESERVED           0x00000001
179   #define CONF_CLIENT             0x00000002
180   #define CONF_SERVER             0x00000004
181   #define CONF_OPERATOR           0x00000008
182 < #define CONF_KILL               0x00000010
187 < #define CONF_KLINE              CONF_KILL
182 > #define CONF_KLINE              0x00000010
183   #define CONF_CLASS              0x00000020
184 < #define CONF_LEAF               0x00000040
185 < #define CONF_LISTEN_PORT        0x00000080
186 < #define CONF_HUB                0x00000100
187 < #define CONF_EXEMPTKLINE        0x00000200
188 < #define CONF_NOLIMIT            0x00000400
189 < #define CONF_DLINE              0x00000800
190 < #define CONF_XLINE              0x00001000
191 < #define CONF_ULINE              0x00002000
197 < #define CONF_EXEMPTDLINE        0x00004000
198 < #define CONF_GLINE              0x00008000
184 > #define CONF_LISTEN_PORT        0x00000040
185 > #define CONF_EXEMPTKLINE        0x00000080
186 > #define CONF_DLINE              0x00000100
187 > #define CONF_XLINE              0x00000200
188 > #define CONF_ULINE              0x00000400
189 > #define CONF_EXEMPTDLINE        0x00000800
190 > #define CONF_GLINE              0x00001000
191 > #define CONF_SERVICE            0x00002000
192  
193   #define CONF_SERVER_MASK       CONF_SERVER
194   #define CONF_CLIENT_MASK       (CONF_CLIENT | CONF_OPERATOR | CONF_SERVER_MASK)
# Line 209 | Line 202 | struct CidrItem
202   #define IsConfServer(x)         ((x)->status == CONF_SERVER)
203   #define SetConfServer(x)        ((x)->status = CONF_SERVER)
204   #define IsConfOperator(x)       ((x)->status & CONF_OPERATOR)
205 < #define IsConfHub(x)            ((x)->status == CONF_HUB)
213 < #define SetConfHub(x)           ((x)->status = CONF_HUB)
214 < #define IsConfLeaf(x)           ((x)->status == CONF_LEAF)
215 < #define SetConfLeaf(x)          ((x)->status = CONF_LEAF)
216 < #define IsConfHubOrLeaf(x)      ((x)->status & (CONF_HUB|CONF_LEAF))
217 < #define IsConfKill(x)           ((x)->status == CONF_KILL)
205 > #define IsConfKill(x)           ((x)->status == CONF_KLINE)
206   #define IsConfClient(x)         ((x)->status & CONF_CLIENT)
207   #define IsConfTypeOfClient(x)   ((x)->status & CONF_CLIENT_MASK)
208   #define IsConfUline(x)          ((x)->status & CONF_ULINE)
# Line 229 | Line 217 | struct CidrItem
217   #define CONF_FLAGS_LIMIT_IP             0x00000002
218   #define CONF_FLAGS_NO_TILDE             0x00000004
219   #define CONF_FLAGS_NEED_IDENTD          0x00000008
220 < /*                                      0x00000010 */
221 < #define CONF_FLAGS_NOMATCH_IP           0x00000020
222 < #define CONF_FLAGS_EXEMPTKLINE          0x00000040
223 < #define CONF_FLAGS_NOLIMIT              0x00000080
224 < #define CONF_FLAGS_IDLE_LINED           0x00000100
225 < #define CONF_FLAGS_SPOOF_IP             0x00000200
226 < #define CONF_FLAGS_SPOOF_NOTICE         0x00000400
227 < #define CONF_FLAGS_REDIR                0x00000800
228 < #define CONF_FLAGS_EXEMPTGLINE          0x00001000
241 < #define CONF_FLAGS_RESTRICTED           0x00002000
242 < #define CONF_FLAGS_CAN_FLOOD            0x00100000
243 < #define CONF_FLAGS_NEED_PASSWORD        0x00200000
220 > #define CONF_FLAGS_NOMATCH_IP           0x00000010
221 > #define CONF_FLAGS_EXEMPTKLINE          0x00000020
222 > #define CONF_FLAGS_NOLIMIT              0x00000040
223 > #define CONF_FLAGS_SPOOF_IP             0x00000080
224 > #define CONF_FLAGS_SPOOF_NOTICE         0x00000100
225 > #define CONF_FLAGS_REDIR                0x00000200
226 > #define CONF_FLAGS_EXEMPTGLINE          0x00000400
227 > #define CONF_FLAGS_CAN_FLOOD            0x00000800
228 > #define CONF_FLAGS_NEED_PASSWORD        0x00001000
229   /* server flags */
230 < #define CONF_FLAGS_ALLOW_AUTO_CONN      0x00004000
231 < #define CONF_FLAGS_LAZY_LINK            0x00008000
232 < #define CONF_FLAGS_ENCRYPTED            0x00010000
233 < #define CONF_FLAGS_COMPRESSED           0x00020000
234 < #define CONF_FLAGS_TEMPORARY            0x00040000
235 < #define CONF_FLAGS_CRYPTLINK            0x00080000
236 < #define CONF_FLAGS_BURST_AWAY           0x00400000
252 < #define CONF_FLAGS_EXEMPTRESV           0x00800000
253 < #define CONF_FLAGS_TOPICBURST           0x01000000
230 > #define CONF_FLAGS_ALLOW_AUTO_CONN      0x00002000
231 > #define CONF_FLAGS_ENCRYPTED            0x00004000
232 > #define CONF_FLAGS_TEMPORARY            0x00008000
233 > #define CONF_FLAGS_BURST_AWAY           0x00010000
234 > #define CONF_FLAGS_EXEMPTRESV           0x00020000
235 > #define CONF_FLAGS_TOPICBURST           0x00040000
236 > #define CONF_FLAGS_SSL                  0x00080000
237  
238   /* Macros for struct AccessItem */
239   #define IsLimitIp(x)            ((x)->flags & CONF_FLAGS_LIMIT_IP)
# Line 263 | Line 246 | struct CidrItem
246   #define IsConfExemptLimits(x)   ((x)->flags & CONF_FLAGS_NOLIMIT)
247   #define IsConfExemptGline(x)    ((x)->flags & CONF_FLAGS_EXEMPTGLINE)
248   #define IsConfExemptResv(x)     ((x)->flags & CONF_FLAGS_EXEMPTRESV)
266 – #define IsConfIdlelined(x)      ((x)->flags & CONF_FLAGS_IDLE_LINED)
249   #define IsConfDoIdentd(x)       ((x)->flags & CONF_FLAGS_DO_IDENTD)
250   #define IsConfDoSpoofIp(x)      ((x)->flags & CONF_FLAGS_SPOOF_IP)
251   #define IsConfSpoofNotice(x)    ((x)->flags & CONF_FLAGS_SPOOF_NOTICE)
270 – #define IsConfRestricted(x)     ((x)->flags & CONF_FLAGS_RESTRICTED)
252   #define IsConfEncrypted(x)      ((x)->flags & CONF_FLAGS_ENCRYPTED)
253   #define SetConfEncrypted(x)     ((x)->flags |= CONF_FLAGS_ENCRYPTED)
254   #define ClearConfEncrypted(x)   ((x)->flags &= ~CONF_FLAGS_ENCRYPTED)
274 – #define IsConfCompressed(x)     ((x)->flags & CONF_FLAGS_COMPRESSED)
275 – #define SetConfCompressed(x)    ((x)->flags |= CONF_FLAGS_COMPRESSED)
276 – #define ClearConfCompressed(x)  ((x)->flags &= ~CONF_FLAGS_COMPRESSED)
277 – #define IsConfCryptLink(x)      ((x)->flags & CONF_FLAGS_CRYPTLINK)
278 – #define SetConfCryptLink(x)     ((x)->flags |= CONF_FLAGS_CRYPTLINK)
279 – #define ClearConfCryptLink(x)   ((x)->flags &= ~CONF_FLAGS_CRYPTLINK)
255   #define IsConfAllowAutoConn(x)  ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN)
256   #define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN)
257   #define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN)
# Line 289 | Line 264 | struct CidrItem
264   #define IsConfTopicBurst(x)     ((x)->flags & CONF_FLAGS_TOPICBURST)
265   #define SetConfTopicBurst(x)    ((x)->flags |= CONF_FLAGS_TOPICBURST)
266   #define ClearConfTopicBurst(x)  ((x)->flags &= ~CONF_FLAGS_TOPICBURST)
267 + #define IsConfSSL(x)      ((x)->flags & CONF_FLAGS_SSL)
268 + #define SetConfSSL(x)     ((x)->flags |= CONF_FLAGS_SSL)
269 + #define ClearConfSSL(x)   ((x)->flags &= ~CONF_FLAGS_SSL)
270  
271   /* shared/cluster server entry types
272   * These defines are used for both shared and cluster.
273   */
274   #define SHARED_KLINE            0x0001
275 < #define SHARED_TKLINE           0x0002
276 < #define SHARED_UNKLINE          0x0004
277 < #define SHARED_XLINE            0x0008
278 < #define SHARED_TXLINE           0x0010
279 < #define SHARED_UNXLINE          0x0020
280 < #define SHARED_RESV             0x0040
281 < #define SHARED_TRESV            0x0080
282 < #define SHARED_UNRESV           0x0100
283 < #define SHARED_LOCOPS           0x0200
284 < #define SHARED_ALL              (SHARED_KLINE | SHARED_TKLINE | SHARED_UNKLINE | \
285 <                                 SHARED_XLINE | SHARED_TXLINE | SHARED_UNXLINE | \
286 <                                 SHARED_RESV | SHARED_TRESV | SHARED_UNRESV |\
309 <                                 SHARED_LOCOPS)
275 > #define SHARED_UNKLINE          0x0002
276 > #define SHARED_XLINE            0x0004
277 > #define SHARED_UNXLINE          0x0008
278 > #define SHARED_RESV             0x0010
279 > #define SHARED_UNRESV           0x0020
280 > #define SHARED_LOCOPS           0x0040
281 > #define SHARED_DLINE            0x0080
282 > #define SHARED_UNDLINE          0x0100
283 > #define SHARED_ALL              (SHARED_KLINE | SHARED_UNKLINE |\
284 >                                 SHARED_XLINE | SHARED_UNXLINE |\
285 >                                 SHARED_RESV | SHARED_UNRESV |\
286 >                                 SHARED_LOCOPS | SHARED_DLINE | SHARED_UNDLINE)
287  
288   /* gline acl entry actions */
289   #define GDENY_BLOCK             0x1
# Line 325 | Line 302 | struct config_file_entry
302    const char *cresvfile;
303    const char *nresvfile;
304  
328 –  char *logpath;
329 –  char *operlog;
330 –
331 –  char *servlink_path;
305    char *egdpool_path;
306 +  char *service_name;
307  
308    MessageFile motd;
309    MessageFile opermotd;
310    MessageFile linksfile;
311  
338 –  unsigned char compression_level;
312    int gline_min_cidr;
313    int gline_min_cidr6;
341 –  int dot_in_ip6_addr;
314    int dots_in_ident;
315    int failed_oper_notice;
316    int anti_spam_exit_message_time;
# Line 373 | Line 345 | struct config_file_entry
345    int pace_wait_simple;
346    int gline_time;
347    int gline_logging;
376 –  int idletime;
348    int oper_only_umodes;
349    int oper_umodes;
350    int max_targets;
# Line 389 | Line 360 | struct config_file_entry
360    int ping_cookie;
361    int disable_auth;
362    int disable_remote;
392 – #ifdef HAVE_LIBCRYPTO
393 –  struct EncCapability *default_cipher_preference;
394 – #endif
363   };
364  
365   struct config_channel_entry
# Line 416 | Line 384 | struct config_channel_entry
384  
385   struct config_server_hide
386   {
387 +  char *hidden_name;
388    int flatten_links;
389    int hide_servers;
421 –  char *hidden_name;
390    int links_delay;
391    int links_disabled;
392    int hidden;
# Line 428 | Line 396 | struct config_server_hide
396  
397   struct server_info
398   {
399 +  char *sid;
400    char *name;
401    char *description;
402    char *network_name;
# Line 435 | Line 404 | struct server_info
404   #ifdef HAVE_LIBCRYPTO
405    char *rsa_private_key_file;
406    RSA *rsa_private_key;
407 <  SSL_CTX *ctx;
407 >  SSL_CTX *server_ctx;
408 >  SSL_CTX *client_ctx;
409   #endif
440 –  char *sid;
410    int hub;
411    struct irc_ssaddr ip;
412    struct irc_ssaddr ip6;
413 <  int max_clients;
413 >  unsigned int max_clients;
414    int specific_ipv4_vhost;
415    int specific_ipv6_vhost;
416    struct sockaddr_in dns_host;
# Line 458 | Line 427 | struct admin_info
427   struct logging_entry
428   {
429    unsigned int use_logging;
461 –  char operlog[PATH_MAX + 1];
462 –  char userlog[PATH_MAX + 1];
463 –  char glinelog[PATH_MAX + 1];
464 –  char ioerrlog[PATH_MAX + 1];
465 –  char klinelog[PATH_MAX + 1];
466 –  char killlog[PATH_MAX + 1];
467 –  char operspylog[PATH_MAX + 1];
468 –  char failed_operlog[PATH_MAX + 1];
430   };
431  
432 < extern int ypass;
432 > extern dlink_list gdeny_items;
433   extern dlink_list class_items;
434   extern dlink_list server_items;
435   extern dlink_list cluster_items;
# Line 476 | Line 437 | extern dlink_list hub_items;
437   extern dlink_list rxconf_items;
438   extern dlink_list rkconf_items;
439   extern dlink_list leaf_items;
440 < extern dlink_list temporary_klines;
480 < extern dlink_list temporary_dlines;
481 < extern dlink_list temporary_glines;
440 > extern dlink_list service_items;
441   extern dlink_list temporary_xlines;
483 – extern dlink_list temporary_rxlines;
484 – extern dlink_list temporary_rklines;
442   extern struct logging_entry ConfigLoggingEntry;
443   extern struct config_file_entry ConfigFileEntry;/* defined in ircd.c*/
444   extern struct config_channel_entry ConfigChannel;/* defined in channel.c*/
# Line 517 | Line 474 | extern char *oper_privs_as_string(const
474   extern void split_nuh(struct split_nuh_item *);
475   extern struct ConfItem *find_matching_name_conf(ConfType, const char *,
476                                                  const char *, const char *, int);
477 < extern struct ConfItem *find_exact_name_conf(ConfType, const char *,
477 > extern struct ConfItem *find_exact_name_conf(ConfType, const struct Client *, const char *,
478                                               const char *, const char *);
479   extern void delete_conf_item(struct ConfItem *);
480 < extern void report_confitem_types(struct Client *, ConfType, int);
480 > extern void report_confitem_types(struct Client *, ConfType);
481   extern void yyerror(const char *);
525 – extern int conf_yy_fatal_error(const char *);
526 – extern int conf_fbgets(char *, unsigned int, FBFILE *);
482   extern void write_conf_line(struct Client *, struct ConfItem *,
483                              const char *, time_t);
484   extern int remove_conf_line(ConfType, struct Client *, const char *,
# Line 534 | Line 489 | extern const char *get_conf_name(ConfTyp
489   extern int rehash(int);
490   extern int conf_add_server(struct ConfItem *, const char *);
491   extern void conf_add_class_to_conf(struct ConfItem *, const char *);
537 – extern void conf_add_d_conf(struct AccessItem *);
492  
493   /* XXX consider moving these into csvlib.h */
494 < extern void parse_csv_file(FBFILE *, ConfType);
495 <
496 < extern char *get_oper_name(const struct Client *);
494 > extern void parse_csv_file(FILE *, ConfType);
495 > extern int find_and_delete_temporary(const char *, const char *, int);
496 > extern const char *get_oper_name(const struct Client *);
497  
498   extern void *map_to_conf(struct ConfItem *);
499   extern struct ConfItem *unmap_conf_item(void *);
# Line 553 | Line 507 | extern int valid_comment(struct Client *
507  
508   #define TK_SECONDS 0
509   #define TK_MINUTES 1
510 < extern time_t valid_tkline(char *, int);
510 > extern time_t valid_tkline(const char *, int);
511   extern int match_conf_password(const char *, const struct AccessItem *);
512  
513   #define NOT_AUTHORIZED    (-1)
# Line 567 | Line 521 | extern int match_conf_password(const cha
521   extern void cluster_a_line(struct Client *,
522                             const char *, int, int, const char *,...);
523   extern void rebuild_cidr_class(struct ConfItem *, struct ClassItem *);
570 –
571 – /* XXX **/
572 – extern int yylex(void);
573 –
524   #endif /* INCLUDED_s_conf_h */

Diff Legend

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