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-8/include/conf.h (file contents), Revision 1389 by michael, Tue May 1 13:08:29 2012 UTC vs.
ircd-hybrid/trunk/include/conf.h (file contents), Revision 1632 by michael, Sun Nov 4 15:37:10 2012 UTC

# Line 32 | Line 32
32   #include "motd.h"               /* MessageFile */
33   #include "client.h"
34   #include "hook.h"
35 + #include "conf_class.h"
36  
37  
37 – struct Client;
38  
39   extern struct Callback *client_check_cb;
40  
# Line 47 | Line 47 | struct conf_parser_context
47  
48   extern struct conf_parser_context conf_parser_ctx;
49  
50 < typedef enum
51 < {  
52 <  CONF_TYPE,
53 <  CLASS_TYPE,
54 <  OPER_TYPE,
55 <  CLIENT_TYPE,
56 <  SERVER_TYPE,
57 <  HUB_TYPE,
58 <  LEAF_TYPE,
59 <  KLINE_TYPE,
60 <  DLINE_TYPE,
61 <  EXEMPTDLINE_TYPE,
62 <  CLUSTER_TYPE,
63 <  RKLINE_TYPE,
64 <  RXLINE_TYPE,
65 <  XLINE_TYPE,    
66 <  ULINE_TYPE,
67 <  GLINE_TYPE,
68 <  CRESV_TYPE,    
69 <  NRESV_TYPE,
70 <  GDENY_TYPE,
71 <  SERVICE_TYPE
72 < } ConfType;
50 > enum maskitem_type
51 > {
52 >  CONF_RESERVED = 1 <<  0, /* XXX */
53 >  CONF_CLIENT   = 1 <<  1,
54 >  CONF_SERVER   = 1 <<  2,
55 >  CONF_KLINE    = 1 <<  3,
56 >  CONF_DLINE    = 1 <<  4,
57 >  CONF_EXEMPT   = 1 <<  5,
58 >  CONF_CLUSTER  = 1 <<  6,
59 >  CONF_RKLINE   = 1 <<  7,
60 >  CONF_RXLINE   = 1 <<  8,
61 >  CONF_XLINE    = 1 <<  9,
62 >  CONF_ULINE    = 1 << 10,
63 >  CONF_GLINE    = 1 << 11,
64 >  CONF_CRESV    = 1 << 12,
65 >  CONF_NRESV    = 1 << 13,
66 >  CONF_SERVICE  = 1 << 14,
67 >  CONF_OPER     = 1 << 15,
68 >  CONF_HUB      = 1 << 16, /* XXX There are no separate hub/leaf configs anymore. This is just for /stats h */
69 >  CONF_CLASS    = 1 << 17
70 > };
71  
72   struct split_nuh_item
73   {
# Line 85 | Line 83 | struct split_nuh_item
83    size_t hostsize;
84   };
85  
86 < struct ConfItem
89 < {
90 <  dlink_node node;      /* link into known ConfItems of this type */
91 <
92 <  char *name;           /* Primary key */
93 <  void *regexpname;
94 <  unsigned int flags;
95 <  ConfType type;
96 < };
97 <
98 < /*
99 < * MatchItem - used for XLINE and ULINE types
100 < */
101 < struct MatchItem
102 < {
103 <  char *user;           /* Used for ULINE only */
104 <  char *host;           /* Used for ULINE only */
105 <  char *reason;
106 <  char *oper_reason;
107 <  int action;           /* used for uline */
108 <  int count;            /* How many times this matchitem has been matched */
109 <  int ref_count;        /* How many times is this matchitem in use */
110 <  int illegal;          /* Should it be deleted when possible? */
111 <  time_t           hold;     /* Hold action until this time (calendar time) */
112 < };
113 <
114 < struct AccessItem
86 > struct MaskItem
87   {
88 +  struct MaskItem *hnext;
89    dlink_node node;
90 +  enum maskitem_type type;
91    unsigned int     dns_failed;
92    unsigned int     dns_pending;
93    unsigned int     status;   /* If CONF_ILLEGAL, delete when no clients */
94    unsigned int     flags;
95    unsigned int     modes;
96    unsigned int     port;
97 +  unsigned int     count;
98 +  unsigned int     action;
99    int              clients;  /* Number of *LOCAL* clients using this */
100    int              bits;
101 <  int              type;
101 >  unsigned int     aftype;
102 >  unsigned int     htype;
103 >  unsigned int     active;
104    struct irc_ssaddr bind;  /* ip to bind to for outgoing connect */
105    struct irc_ssaddr addr;  /* ip to connect to */
106 +  char *           name;
107    char *           host;     /* host part of user@host */
108    char *           passwd;
109    char *           spasswd;  /* Password to send. */
110    char *           reason;
132 –  char *           oper_reason;
111    char *           user;     /* user part of user@host */
112    time_t           hold;     /* Hold action until this time (calendar time) */
113 <  struct ConfItem *class_ptr;  /* Class of connection */
114 <  int              aftype;
113 >  time_t           setat;
114 >  struct ClassItem *class;  /* Class of connection */
115   #ifdef HAVE_LIBCRYPTO
116    /* certs */
117    char *cipher_list;
# Line 146 | Line 124 | struct AccessItem
124    dlink_list hub_list;
125   };
126  
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;
156 –  int ping_warning;
157 –  int max_total;
158 –  int max_local;
159 –  int max_global;
160 –  int max_ident;
161 –  int max_perip;
162 –  int curr_user_count;
163 –  int cidr_bitlen_ipv4;
164 –  int cidr_bitlen_ipv6;
165 –  int number_per_cidr;
166 –  int active;
167 – };
168 –
127   struct CidrItem
128   {
129    dlink_node node;
# Line 174 | Line 132 | struct CidrItem
132   };
133  
134  
135 < #define CONF_ILLEGAL            0x80000000
136 < #define CONF_RESERVED           0x00000001
137 < #define CONF_CLIENT             0x00000002
138 < #define CONF_SERVER             0x00000004
181 < #define CONF_OPERATOR           0x00000008
182 < #define CONF_KLINE              0x00000010
183 < #define CONF_CLASS              0x00000020
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)
195 <
196 < /* XXX temporary hack */
197 < #define CONF_CRESV              0x80000001
198 < #define CONF_NRESV              0x80000002
199 <
200 < #define IsConfIllegal(x)        ((x)->status & CONF_ILLEGAL)
201 < #define SetConfIllegal(x)       ((x)->status |= CONF_ILLEGAL)
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 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)
209 < #define IsConfXline(x)          ((x)->status & CONF_XLINE)
210 < #define IsConfGline(x)          ((x)->status == CONF_GLINE)
135 > #define IsConfOperator(x)       ((x)->type & CONF_OPER)
136 > #define IsConfKill(x)           ((x)->type == CONF_KLINE)
137 > #define IsConfClient(x)         ((x)->type & CONF_CLIENT)
138 > #define IsConfGline(x)          ((x)->type == CONF_GLINE)
139  
140 < /* AccessItem->flags */
140 > /* MaskItem->flags */
141  
142   /* Generic flags... */
143   /* access flags... */
# Line 229 | Line 157 | struct CidrItem
157   /* server flags */
158   #define CONF_FLAGS_ALLOW_AUTO_CONN      0x00002000
159   #define CONF_FLAGS_ENCRYPTED            0x00004000
160 < #define CONF_FLAGS_TEMPORARY            0x00008000
161 < #define CONF_FLAGS_BURST_AWAY           0x00010000
162 < #define CONF_FLAGS_EXEMPTRESV           0x00020000
163 < #define CONF_FLAGS_TOPICBURST           0x00040000
236 < #define CONF_FLAGS_SSL                  0x00080000
160 > #define CONF_FLAGS_IN_DATABASE          0x00008000
161 > #define CONF_FLAGS_EXEMPTRESV           0x00010000
162 > #define CONF_FLAGS_SSL                  0x00020000
163 > #define CONF_FLAGS_MAINCONF             0x00040000
164  
165 < /* Macros for struct AccessItem */
165 > /* Macros for struct MaskItem */
166   #define IsLimitIp(x)            ((x)->flags & CONF_FLAGS_LIMIT_IP)
167   #define IsNoTilde(x)            ((x)->flags & CONF_FLAGS_NO_TILDE)
168   #define IsConfCanFlood(x)       ((x)->flags & CONF_FLAGS_CAN_FLOOD)
# Line 255 | Line 182 | struct CidrItem
182   #define IsConfAllowAutoConn(x)  ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN)
183   #define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN)
184   #define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN)
258 – #define IsConfTemporary(x)      ((x)->flags & CONF_FLAGS_TEMPORARY)
259 – #define SetConfTemporary(x)     ((x)->flags |= CONF_FLAGS_TEMPORARY)
185   #define IsConfRedir(x)          ((x)->flags & CONF_FLAGS_REDIR)
261 – #define IsConfAwayBurst(x)      ((x)->flags & CONF_FLAGS_BURST_AWAY)
262 – #define SetConfAwayBurst(x)     ((x)->flags |= CONF_FLAGS_BURST_AWAY)
263 – #define ClearConfAwayBurst(x)   ((x)->flags &= ~CONF_FLAGS_BURST_AWAY)
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)
186   #define IsConfSSL(x)      ((x)->flags & CONF_FLAGS_SSL)
187   #define SetConfSSL(x)     ((x)->flags |= CONF_FLAGS_SSL)
188   #define ClearConfSSL(x)   ((x)->flags &= ~CONF_FLAGS_SSL)
189 + #define IsConfDatabase(x)      ((x)->flags & CONF_FLAGS_IN_DATABASE)
190 + #define SetConfDatabase(x)     ((x)->flags |= CONF_FLAGS_IN_DATABASE)
191 +
192  
193   /* shared/cluster server entry types
194   * These defines are used for both shared and cluster.
# Line 285 | Line 207 | struct CidrItem
207                                   SHARED_RESV | SHARED_UNRESV |\
208                                   SHARED_LOCOPS | SHARED_DLINE | SHARED_UNDLINE)
209  
288 – /* gline acl entry actions */
289 – #define GDENY_BLOCK             0x1
290 – #define GDENY_REJECT            0x2
291 –
210   struct config_file_entry
211   {
212    const char *dpath;          /* DPATH if set from command line */
213    const char *configfile;
214    const char *klinefile;
215    const char *xlinefile;
298 –  const char *rxlinefile;
299 –  const char *rklinefile;
216    const char *dlinefile;
301 –  const char *glinefile;
217    const char *cresvfile;
218    const char *nresvfile;
219  
# Line 306 | Line 221 | struct config_file_entry
221    char *service_name;
222  
223    MessageFile motd;
309 –  MessageFile opermotd;
224    MessageFile linksfile;
225  
226    int gline_min_cidr;
# Line 321 | Line 235 | struct config_file_entry
235    int ts_max_delta;
236    int ts_warn_delta;
237    int anti_nick_flood;
324 –  int kline_with_reason;
238    int warn_no_nline;
239    int invisible_on_connect;
240    int stats_e_disabled;
# Line 335 | Line 248 | struct config_file_entry
248    int oper_pass_resv;
249    int glines;
250    int hide_spoof_ips;
338 –  int burst_away;
339 –  int use_whois_actually;
251    int tkline_expire_notices;
252    int opers_bypass_callerid;
253    int ignore_bogus_ts;
343 –  char *kline_reason;
254    int pace_wait;
255    int pace_wait_simple;
256    int gline_time;
257 <  int gline_logging;
257 >  int gline_request_time;
258    int oper_only_umodes;
259    int oper_umodes;
260    int max_targets;
# Line 353 | Line 263 | struct config_file_entry
263    int min_nonwildcard_simple;
264    int kill_chase_time_limit;
265    int default_floodcount;
356 –  int client_flood;
266    /* 0 == don't use throttle... */
267    int throttle_time;
268    int use_egd;
# Line 366 | Line 275 | struct config_channel_entry
275   {
276    int disable_fake_channels;
277    int restrict_channels;
369 –  int disable_local_channels;
370 –  int use_except;
371 –  int use_invex;
372 –  int use_knock;
278    int knock_delay;
279    int knock_delay_channel;
280    unsigned int max_bans;
281    unsigned int max_chans_per_user;
282 +  unsigned int max_chans_per_oper;
283    int no_create_on_split;
284    int no_join_on_split;
285    int quiet_on_ban;
380 –  int burst_topicwho;
286    int default_split_server_count;
287    int default_split_user_count;
288   };
# Line 390 | Line 295 | struct config_server_hide
295    int links_delay;
296    int links_disabled;
297    int hidden;
393 –  int disable_hidden;
298    int hide_server_ips;
299   };
300  
# Line 429 | Line 333 | struct logging_entry
333    unsigned int use_logging;
334   };
335  
432 – extern dlink_list gdeny_items;
336   extern dlink_list class_items;
337   extern dlink_list server_items;
338   extern dlink_list cluster_items;
339 < extern dlink_list hub_items;
339 > extern dlink_list xconf_items;
340   extern dlink_list rxconf_items;
341   extern dlink_list rkconf_items;
439 – extern dlink_list leaf_items;
342   extern dlink_list service_items;
441 – extern dlink_list temporary_xlines;
343   extern struct logging_entry ConfigLoggingEntry;
344   extern struct config_file_entry ConfigFileEntry;/* defined in ircd.c*/
345   extern struct config_channel_entry ConfigChannel;/* defined in channel.c*/
# Line 448 | Line 349 | extern struct admin_info AdminInfo;
349   extern int valid_wild_card(struct Client *, int, int, ...);
350   /* End GLOBAL section */
351  
352 < extern unsigned int get_sendq(struct Client *);
353 < extern const char *get_client_class(struct Client *);
354 < extern int get_client_ping(struct Client *, int *);
454 < extern void check_class(void);
455 < extern void init_class(void);
456 < extern struct ConfItem *find_class(const char *);
352 >
353 >
354 >
355   extern void init_ip_hash_table(void);
356   extern void count_ip_hash(unsigned int *, uint64_t *);
357   extern void remove_one_ip(struct irc_ssaddr *);
358 < extern struct ConfItem *make_conf_item(ConfType type);
461 < extern void free_access_item(struct AccessItem *);
358 > extern struct MaskItem *conf_make(enum maskitem_type);
359   extern void read_conf_files(int);
360 < extern int attach_conf(struct Client *, struct ConfItem *);
360 > extern int attach_conf(struct Client *, struct MaskItem *);
361   extern int attach_connect_block(struct Client *, const char *, const char *);
362 + extern int get_conf_ping(const struct MaskItem *, int *);
363  
364 < extern int detach_conf(struct Client *, ConfType);
365 <
366 < extern struct ConfItem *find_conf_name(dlink_list *, const char *, ConfType);
367 < extern struct ConfItem *find_conf_exact(ConfType, const char *, const char *, const char *);
368 < extern struct AccessItem *find_kill(struct Client *);
471 < extern struct AccessItem *find_gline(struct Client *);
364 > extern void detach_conf(struct Client *, enum maskitem_type);
365 > extern struct MaskItem *find_conf_name(dlink_list *, const char *, enum maskitem_type);
366 > extern struct MaskItem *find_conf_exact(enum maskitem_type, const char *, const char *, const char *);
367 > extern struct MaskItem *find_kill(struct Client *);
368 > extern struct MaskItem *find_gline(struct Client *);
369   extern int conf_connect_allowed(struct irc_ssaddr *, int);
370   extern char *oper_privs_as_string(const unsigned int);
371   extern void split_nuh(struct split_nuh_item *);
372 < extern struct ConfItem *find_matching_name_conf(ConfType, const char *,
373 <                                                const char *, const char *, int);
374 < extern struct ConfItem *find_exact_name_conf(ConfType, const struct Client *, const char *,
372 > extern struct MaskItem *find_matching_name_conf(enum maskitem_type, const char *,
373 >                                                const char *, const char *, unsigned int);
374 > extern struct MaskItem *find_exact_name_conf(enum maskitem_type, const struct Client *, const char *,
375                                               const char *, const char *);
376 < extern void delete_conf_item(struct ConfItem *);
377 < extern void report_confitem_types(struct Client *, ConfType);
376 > extern void conf_free(struct MaskItem *);
377 > extern void report_confitem_types(struct Client *, enum maskitem_type);
378   extern void yyerror(const char *);
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 *,
485 –                            const char *);
486 – extern void add_temp_line(struct ConfItem *);
379   extern void cleanup_tklines(void *);
488 – extern const char *get_conf_name(ConfType);
380   extern int rehash(int);
381 < extern int conf_add_server(struct ConfItem *, const char *);
382 < extern void conf_add_class_to_conf(struct ConfItem *, const char *);
381 > extern int conf_add_server(struct MaskItem *, const char *);
382 > extern void conf_add_class_to_conf(struct MaskItem *, const char *);
383  
493 – /* XXX consider moving these into csvlib.h */
494 – extern void parse_csv_file(FILE *, ConfType);
495 – extern int find_and_delete_temporary(const char *, const char *, int);
384   extern const char *get_oper_name(const struct Client *);
385  
498 – extern void *map_to_conf(struct ConfItem *);
499 – extern struct ConfItem *unmap_conf_item(void *);
386   /* XXX should the parse_aline stuff go into another file ?? */
387   #define AWILD 0x1               /* check wild cards */
502 – #define NOUSERLOOKUP 0x2 /* Don't lookup the user@host on /rkline nick */
388   extern int parse_aline(const char *, struct Client *, int, char **,
389                         int, char **, char **, time_t *, char **, char **);
390   extern int valid_comment(struct Client *, char *, int);
# Line 508 | Line 393 | extern int valid_comment(struct Client *
393   #define TK_SECONDS 0
394   #define TK_MINUTES 1
395   extern time_t valid_tkline(const char *, int);
396 < extern int match_conf_password(const char *, const struct AccessItem *);
396 > extern int match_conf_password(const char *, const struct MaskItem *);
397  
398   #define NOT_AUTHORIZED    (-1)
399   #define I_LINE_FULL       (-2)
# Line 520 | Line 405 | extern int match_conf_password(const cha
405  
406   extern void cluster_a_line(struct Client *,
407                             const char *, int, int, const char *,...);
523 – extern void rebuild_cidr_class(struct ConfItem *, struct ClassItem *);
408   #endif /* INCLUDED_s_conf_h */

Diff Legend

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