24 |
|
|
25 |
|
#ifndef INCLUDED_s_conf_h |
26 |
|
#define INCLUDED_s_conf_h |
27 |
< |
#include "setup.h" |
27 |
> |
#include "config.h" |
28 |
|
#ifdef HAVE_LIBCRYPTO |
29 |
|
#include <openssl/rsa.h> |
30 |
|
#endif |
33 |
|
#include "motd.h" /* MessageFile */ |
34 |
|
#include "client.h" |
35 |
|
#include "hook.h" |
36 |
< |
#include "pcre.h" |
36 |
> |
|
37 |
> |
|
38 |
> |
#define CONF_SERVER_INFO_TLS_VERSION_SSLV3 0x1 |
39 |
> |
#define CONF_SERVER_INFO_TLS_VERSION_TLSV1 0x2 |
40 |
|
|
41 |
|
struct Client; |
39 |
– |
struct DNSReply; |
40 |
– |
struct hostent; |
42 |
|
|
42 |
– |
extern FBFILE *conf_fbfile_in; |
43 |
|
extern struct Callback *client_check_cb; |
44 |
|
|
45 |
< |
typedef enum { |
45 |
> |
struct conf_parser_context |
46 |
> |
{ |
47 |
> |
unsigned int boot; |
48 |
> |
unsigned int pass; |
49 |
> |
FBFILE *conf_file; |
50 |
> |
}; |
51 |
> |
|
52 |
> |
extern struct conf_parser_context conf_parser_ctx; |
53 |
> |
|
54 |
> |
typedef enum |
55 |
> |
{ |
56 |
|
CONF_TYPE, |
57 |
|
CLASS_TYPE, |
58 |
|
OPER_TYPE, |
74 |
|
GDENY_TYPE |
75 |
|
} ConfType; |
76 |
|
|
77 |
+ |
struct split_nuh_item |
78 |
+ |
{ |
79 |
+ |
dlink_node node; |
80 |
+ |
|
81 |
+ |
char *nuhmask; |
82 |
+ |
char *nickptr; |
83 |
+ |
char *userptr; |
84 |
+ |
char *hostptr; |
85 |
+ |
|
86 |
+ |
size_t nicksize; |
87 |
+ |
size_t usersize; |
88 |
+ |
size_t hostsize; |
89 |
+ |
}; |
90 |
+ |
|
91 |
|
struct ConfItem |
92 |
|
{ |
93 |
+ |
dlink_node node; /* link into known ConfItems of this type */ |
94 |
+ |
|
95 |
|
char *name; /* Primary key */ |
96 |
< |
pcre *regexpname; |
71 |
< |
dlink_node node; /* link into known ConfItems of this type */ |
96 |
> |
void *regexpname; |
97 |
|
unsigned int flags; |
98 |
|
ConfType type; |
99 |
|
}; |
117 |
|
struct AccessItem |
118 |
|
{ |
119 |
|
dlink_node node; |
120 |
+ |
unsigned int dns_failed; |
121 |
+ |
unsigned int dns_pending; |
122 |
|
unsigned int status; /* If CONF_ILLEGAL, delete when no clients */ |
123 |
|
unsigned int flags; |
124 |
+ |
unsigned int modes; |
125 |
+ |
unsigned int port; |
126 |
|
int clients; /* Number of *LOCAL* clients using this */ |
127 |
|
struct irc_ssaddr my_ipnum; /* ip to bind to for outgoing connect */ |
128 |
|
struct irc_ssaddr ipnum; /* ip to connect to */ |
132 |
|
char * reason; |
133 |
|
char * oper_reason; |
134 |
|
char * user; /* user part of user@host */ |
106 |
– |
int port; |
107 |
– |
char * fakename; /* Mask name */ |
135 |
|
time_t hold; /* Hold action until this time (calendar time) */ |
136 |
|
struct ConfItem *class_ptr; /* Class of connection */ |
110 |
– |
struct DNSQuery* dns_query; |
137 |
|
int aftype; |
138 |
|
#ifdef HAVE_LIBCRYPTO |
139 |
|
char * rsa_public_key_file; |
140 |
|
RSA * rsa_public_key; |
141 |
|
struct EncCapability *cipher_preference; |
142 |
|
#endif |
143 |
< |
pcre *regexuser; |
144 |
< |
pcre *regexhost; |
143 |
> |
void *regexuser; |
144 |
> |
void *regexhost; |
145 |
|
}; |
146 |
|
|
147 |
|
struct ClassItem |
148 |
|
{ |
149 |
< |
long max_sendq; |
149 |
> |
dlink_list list_ipv4; /* base of per cidr ipv4 client link list */ |
150 |
> |
dlink_list list_ipv6; /* base of per cidr ipv6 client link list */ |
151 |
> |
unsigned int max_sendq; |
152 |
|
int con_freq; |
153 |
|
int ping_freq; |
154 |
|
int ping_warning; |
161 |
|
int cidr_bitlen_ipv4; |
162 |
|
int cidr_bitlen_ipv6; |
163 |
|
int number_per_cidr; |
164 |
< |
dlink_list list_ipv4; /* base of per cidr ipv4 client link list */ |
137 |
< |
dlink_list list_ipv6; /* base of per cidr ipv6 client link list */ |
164 |
> |
int active; |
165 |
|
}; |
166 |
|
|
167 |
|
struct CidrItem |
168 |
|
{ |
169 |
+ |
dlink_node node; |
170 |
|
struct irc_ssaddr mask; |
171 |
|
int number_on_this_cidr; |
144 |
– |
dlink_node node; |
172 |
|
}; |
173 |
|
|
174 |
|
#define ConFreq(x) ((x)->con_freq) |
287 |
|
#define IsConfCryptLink(x) ((x)->flags & CONF_FLAGS_CRYPTLINK) |
288 |
|
#define SetConfCryptLink(x) ((x)->flags |= CONF_FLAGS_CRYPTLINK) |
289 |
|
#define ClearConfCryptLink(x) ((x)->flags &= ~CONF_FLAGS_CRYPTLINK) |
263 |
– |
#define IsConfLazyLink(x) ((x)->flags & CONF_FLAGS_LAZY_LINK) |
264 |
– |
#define SetConfLazyLink(x) ((x)->flags = CONF_FLAGS_LAZY_LINK) |
265 |
– |
#define ClearConfLazyLink(x) ((x)->flags &= ~CONF_FLAGS_LAZY_LINK) |
290 |
|
#define IsConfAllowAutoConn(x) ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN) |
291 |
|
#define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN) |
292 |
|
#define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN) |
348 |
|
unsigned char compression_level; |
349 |
|
int gline_min_cidr; |
350 |
|
int gline_min_cidr6; |
327 |
– |
int dot_in_ip6_addr; |
351 |
|
int dots_in_ident; |
352 |
|
int failed_oper_notice; |
353 |
|
int anti_spam_exit_message_time; |
354 |
< |
int max_accept; |
354 |
> |
unsigned int max_accept; |
355 |
> |
unsigned int max_watch; |
356 |
|
int max_nick_time; |
357 |
< |
int max_nick_changes; |
357 |
> |
unsigned int max_nick_changes; |
358 |
|
int ts_max_delta; |
359 |
|
int ts_warn_delta; |
360 |
|
int anti_nick_flood; |
361 |
|
int kline_with_reason; |
362 |
|
int warn_no_nline; |
363 |
|
int invisible_on_connect; |
364 |
+ |
int stats_e_disabled; |
365 |
|
int stats_o_oper_only; |
366 |
|
int stats_k_oper_only; |
367 |
|
int stats_i_oper_only; |
405 |
|
|
406 |
|
struct config_channel_entry |
407 |
|
{ |
408 |
+ |
int disable_fake_channels; |
409 |
|
int restrict_channels; |
410 |
|
int disable_local_channels; |
411 |
|
int use_except; |
413 |
|
int use_knock; |
414 |
|
int knock_delay; |
415 |
|
int knock_delay_channel; |
390 |
– |
int invite_ops_only; |
416 |
|
unsigned int max_bans; |
417 |
|
unsigned int max_chans_per_user; |
418 |
|
int no_create_on_split; |
425 |
|
|
426 |
|
struct config_server_hide |
427 |
|
{ |
428 |
+ |
char *hidden_name; |
429 |
|
int flatten_links; |
430 |
|
int hide_servers; |
405 |
– |
char *hidden_name; |
431 |
|
int links_delay; |
432 |
|
int links_disabled; |
433 |
|
int hidden; |
437 |
|
|
438 |
|
struct server_info |
439 |
|
{ |
440 |
+ |
char *sid; |
441 |
|
char *name; |
442 |
|
char *description; |
443 |
|
char *network_name; |
445 |
|
#ifdef HAVE_LIBCRYPTO |
446 |
|
char *rsa_private_key_file; |
447 |
|
RSA *rsa_private_key; |
448 |
< |
SSL_CTX *ctx; |
448 |
> |
SSL_CTX *server_ctx; |
449 |
> |
SSL_CTX *client_ctx; |
450 |
> |
unsigned int tls_version; |
451 |
|
#endif |
424 |
– |
char *sid; |
452 |
|
int hub; |
453 |
|
struct irc_ssaddr ip; |
454 |
|
struct irc_ssaddr ip6; |
455 |
< |
int max_clients; |
455 |
> |
unsigned int max_clients; |
456 |
|
int specific_ipv4_vhost; |
457 |
|
int specific_ipv6_vhost; |
458 |
|
struct sockaddr_in dns_host; |
479 |
|
char failed_operlog[PATH_MAX + 1]; |
480 |
|
}; |
481 |
|
|
482 |
< |
extern unsigned int scount; |
456 |
< |
extern int ypass; |
482 |
> |
extern dlink_list gdeny_items; |
483 |
|
extern dlink_list class_items; |
484 |
|
extern dlink_list server_items; |
485 |
|
extern dlink_list cluster_items; |
502 |
|
extern int valid_wild_card(struct Client *, int, int, ...); |
503 |
|
/* End GLOBAL section */ |
504 |
|
|
505 |
< |
extern unsigned long get_sendq(struct Client *); |
505 |
> |
extern unsigned int get_sendq(struct Client *); |
506 |
|
extern const char *get_client_class(struct Client *); |
507 |
|
extern int get_client_ping(struct Client *, int *); |
508 |
|
extern void check_class(void); |
509 |
|
extern void init_class(void); |
510 |
|
extern struct ConfItem *find_class(const char *); |
511 |
|
extern void init_ip_hash_table(void); |
512 |
< |
extern void count_ip_hash(int *, unsigned long *); |
512 |
> |
extern void count_ip_hash(unsigned int *, uint64_t *); |
513 |
|
extern void remove_one_ip(struct irc_ssaddr *); |
514 |
|
extern struct ConfItem *make_conf_item(ConfType type); |
515 |
|
extern void free_access_item(struct AccessItem *); |
525 |
|
extern struct AccessItem *find_gline(struct Client *); |
526 |
|
extern int conf_connect_allowed(struct irc_ssaddr *, int); |
527 |
|
extern char *oper_privs_as_string(const unsigned int); |
528 |
< |
extern void split_nuh(char *mask, char **nick, char **user, char **host); |
528 |
> |
extern void split_nuh(struct split_nuh_item *); |
529 |
|
extern struct ConfItem *find_matching_name_conf(ConfType, const char *, |
530 |
|
const char *, const char *, int); |
531 |
|
extern struct ConfItem *find_exact_name_conf(ConfType, const char *, |
543 |
|
extern void cleanup_tklines(void *); |
544 |
|
extern const char *get_conf_name(ConfType); |
545 |
|
extern int rehash(int); |
546 |
< |
extern int conf_add_server(struct ConfItem *, unsigned int, const char *); |
546 |
> |
extern int conf_add_server(struct ConfItem *, const char *); |
547 |
|
extern void conf_add_class_to_conf(struct ConfItem *, const char *); |
522 |
– |
extern void conf_add_d_conf(struct AccessItem *); |
548 |
|
|
549 |
|
/* XXX consider moving these into csvlib.h */ |
550 |
|
extern void parse_csv_file(FBFILE *, ConfType); |
560 |
|
int, char **, char **, time_t *, char **, char **); |
561 |
|
extern int valid_comment(struct Client *, char *, int); |
562 |
|
|
538 |
– |
/* XXX */ |
539 |
– |
extern int yylex(void); |
563 |
|
|
564 |
|
#define TK_SECONDS 0 |
565 |
|
#define TK_MINUTES 1 |
566 |
< |
extern time_t valid_tkline(char *, int); |
566 |
> |
extern time_t valid_tkline(const char *, int); |
567 |
|
extern int match_conf_password(const char *, const struct AccessItem *); |
568 |
|
|
569 |
|
#define NOT_AUTHORIZED (-1) |
570 |
< |
#define IRCD_SOCKET_ERROR (-2) |
571 |
< |
#define I_LINE_FULL (-3) |
572 |
< |
#define TOO_MANY (-4) |
573 |
< |
#define BANNED_CLIENT (-5) |
551 |
< |
#define TOO_FAST (-6) |
570 |
> |
#define I_LINE_FULL (-2) |
571 |
> |
#define TOO_MANY (-3) |
572 |
> |
#define BANNED_CLIENT (-4) |
573 |
> |
#define TOO_FAST (-5) |
574 |
|
|
575 |
|
#define CLEANUP_TKLINES_TIME 60 |
576 |
|
|
578 |
|
const char *, int, int, const char *,...); |
579 |
|
extern void rebuild_cidr_class(struct ConfItem *, struct ClassItem *); |
580 |
|
|
581 |
+ |
/* XXX **/ |
582 |
+ |
extern int yylex(void); |
583 |
+ |
|
584 |
|
#endif /* INCLUDED_s_conf_h */ |