1 /* This code is in the public domain.
2 * $Id: newconf.c 3550 2007-08-09 06:47:26Z nenolod $
8 #include <openssl/pem.h>
9 #include <openssl/rsa.h>
13 #include "ircd_defs.h"
18 #include "s_newconf.h"
29 #include "blacklist.h"
31 #include "privilege.h"
33 #define CF_TYPE(x) ((x) & CF_MTYPE)
35 struct TopConf
*conf_cur_block
;
36 static char *conf_cur_block_name
;
38 static rb_dlink_list conf_items
;
40 static struct ConfItem
*yy_aconf
= NULL
;
42 static struct Class
*yy_class
= NULL
;
44 static struct remote_conf
*yy_shared
= NULL
;
45 static struct server_conf
*yy_server
= NULL
;
47 static rb_dlink_list yy_aconf_list
;
48 static rb_dlink_list yy_oper_list
;
49 static rb_dlink_list yy_shared_list
;
50 static rb_dlink_list yy_cluster_list
;
51 static struct oper_conf
*yy_oper
= NULL
;
53 static struct alias_entry
*yy_alias
= NULL
;
55 static char *yy_blacklist_host
= NULL
;
56 static char *yy_blacklist_reason
= NULL
;
57 static char *yy_privset_extends
= NULL
;
60 conf_strtype(int type
)
62 switch (type
& CF_MTYPE
)
65 return "integer value";
67 return "unquoted string";
69 return "yes/no value";
71 return "quoted string";
73 return "time/size value";
75 return "unknown type";
80 add_top_conf(const char *name
, int (*sfunc
) (struct TopConf
*),
81 int (*efunc
) (struct TopConf
*), struct ConfEntry
*items
)
85 tc
= rb_malloc(sizeof(struct TopConf
));
90 tc
->tc_entries
= items
;
92 rb_dlinkAddAlloc(tc
, &conf_items
);
97 find_top_conf(const char *name
)
102 RB_DLINK_FOREACH(d
, conf_items
.head
)
105 if(strcasecmp(tc
->tc_name
, name
) == 0)
114 find_conf_item(const struct TopConf
*top
, const char *name
)
116 struct ConfEntry
*cf
;
123 for(i
= 0; top
->tc_entries
[i
].cf_type
; i
++)
125 cf
= &top
->tc_entries
[i
];
127 if(!strcasecmp(cf
->cf_name
, name
))
132 RB_DLINK_FOREACH(d
, top
->tc_items
.head
)
135 if(strcasecmp(cf
->cf_name
, name
) == 0)
143 remove_top_conf(char *name
)
148 if((tc
= find_top_conf(name
)) == NULL
)
151 if((ptr
= rb_dlinkFind(tc
, &conf_items
)) == NULL
)
154 rb_dlinkDestroy(ptr
, &conf_items
);
161 conf_set_serverinfo_name(void *data
)
163 if(ServerInfo
.name
== NULL
)
168 for(s
= data
; *s
!= '\0'; s
++)
172 conf_report_error("Ignoring serverinfo::name "
173 "-- bogus servername.");
182 conf_report_error("Ignoring serverinfo::name -- must contain '.'");
190 conf_report_error("Ignoring serverinfo::name -- cannot begin with digit.");
194 /* the ircd will exit() in main() if we dont set one */
195 if(strlen(s
) <= HOSTLEN
)
196 ServerInfo
.name
= rb_strdup((char *) data
);
201 conf_set_serverinfo_sid(void *data
)
205 if(ServerInfo
.sid
[0] == '\0')
207 if(!IsDigit(sid
[0]) || !IsIdChar(sid
[1]) ||
208 !IsIdChar(sid
[2]) || sid
[3] != '\0')
210 conf_report_error("Ignoring serverinfo::sid "
215 strcpy(ServerInfo
.sid
, sid
);
220 conf_set_serverinfo_network_name(void *data
)
224 if((p
= strchr((char *) data
, ' ')))
227 rb_free(ServerInfo
.network_name
);
228 ServerInfo
.network_name
= rb_strdup((char *) data
);
232 conf_set_serverinfo_vhost(void *data
)
234 if(rb_inet_pton(AF_INET
, (char *) data
, &ServerInfo
.ip
.sin_addr
) <= 0)
236 conf_report_error("Invalid netmask for server IPv4 vhost (%s)", (char *) data
);
239 ServerInfo
.ip
.sin_family
= AF_INET
;
240 ServerInfo
.specific_ipv4_vhost
= 1;
244 conf_set_serverinfo_vhost6(void *data
)
247 if(rb_inet_pton(AF_INET6
, (char *) data
, &ServerInfo
.ip6
.sin6_addr
) <= 0)
249 conf_report_error("Invalid netmask for server IPv6 vhost (%s)", (char *) data
);
253 ServerInfo
.specific_ipv6_vhost
= 1;
254 ServerInfo
.ip6
.sin6_family
= AF_INET6
;
256 conf_report_error("Warning -- ignoring serverinfo::vhost6 -- IPv6 support not available.");
261 conf_set_modules_module(void *data
)
263 #ifndef STATIC_MODULES
266 m_bn
= rb_basename((char *) data
);
268 if(findmodule_byname(m_bn
) != -1)
271 load_one_module((char *) data
, 0);
275 conf_report_error("Ignoring modules::module -- loadable module support not present.");
280 conf_set_modules_path(void *data
)
282 #ifndef STATIC_MODULES
283 mod_add_path((char *) data
);
285 conf_report_error("Ignoring modules::path -- loadable module support not present.");
296 static struct mode_table umode_table
[] = {
297 {"callerid", UMODE_CALLERID
},
298 {"softcallerid", UMODE_SCALLERID
},
299 {"deaf", UMODE_DEAF
},
300 {"invisible", UMODE_INVISIBLE
},
301 {"locops", UMODE_LOCOPS
},
302 {"noforward", UMODE_NOFORWARD
},
303 {"regonlymsg", UMODE_REGONLYMSG
},
304 {"servnotice", UMODE_SERVNOTICE
},
305 {"wallop", UMODE_WALLOP
},
306 {"operwall", UMODE_OPERWALL
},
307 {"noctcp", UMODE_NOCTCP
},
308 {"noinvite", UMODE_NOINVITE
},
310 {"override", UMODE_OVERRIDE
},
314 static struct mode_table oper_table
[] = {
315 {"encrypted", OPER_ENCRYPTED
},
316 {"need_ssl", OPER_NEEDSSL
},
320 static struct mode_table auth_table
[] = {
321 {"encrypted", CONF_FLAGS_ENCRYPTED
},
322 {"spoof_notice", CONF_FLAGS_SPOOF_NOTICE
},
323 {"exceed_limit", CONF_FLAGS_NOLIMIT
},
324 {"dnsbl_exempt", CONF_FLAGS_EXEMPTDNSBL
},
325 {"kline_exempt", CONF_FLAGS_EXEMPTKLINE
},
326 {"flood_exempt", CONF_FLAGS_EXEMPTFLOOD
},
327 {"spambot_exempt", CONF_FLAGS_EXEMPTSPAMBOT
},
328 {"shide_exempt", CONF_FLAGS_EXEMPTSHIDE
},
329 {"jupe_exempt", CONF_FLAGS_EXEMPTJUPE
},
330 {"resv_exempt", CONF_FLAGS_EXEMPTRESV
},
331 {"no_tilde", CONF_FLAGS_NO_TILDE
},
332 {"need_ident", CONF_FLAGS_NEED_IDENTD
},
333 {"have_ident", CONF_FLAGS_NEED_IDENTD
},
334 {"need_ssl", CONF_FLAGS_NEED_SSL
},
335 {"need_sasl", CONF_FLAGS_NEED_SASL
},
339 static struct mode_table connect_table
[] = {
340 { "autoconn", SERVER_AUTOCONN
},
341 { "compressed", SERVER_COMPRESSED
},
342 { "encrypted", SERVER_ENCRYPTED
},
343 { "topicburst", SERVER_TB
},
344 { "ssl", SERVER_SSL
},
348 static struct mode_table cluster_table
[] = {
349 { "kline", SHARED_PKLINE
},
350 { "tkline", SHARED_TKLINE
},
351 { "unkline", SHARED_UNKLINE
},
352 { "locops", SHARED_LOCOPS
},
353 { "xline", SHARED_PXLINE
},
354 { "txline", SHARED_TXLINE
},
355 { "unxline", SHARED_UNXLINE
},
356 { "resv", SHARED_PRESV
},
357 { "tresv", SHARED_TRESV
},
358 { "unresv", SHARED_UNRESV
},
359 { "all", CLUSTER_ALL
},
363 static struct mode_table shared_table
[] =
365 { "kline", SHARED_PKLINE
|SHARED_TKLINE
},
366 { "xline", SHARED_PXLINE
|SHARED_TXLINE
},
367 { "resv", SHARED_PRESV
|SHARED_TRESV
},
368 { "dline", SHARED_PDLINE
|SHARED_TDLINE
},
369 { "tdline", SHARED_TDLINE
},
370 { "pdline", SHARED_PDLINE
},
371 { "undline", SHARED_UNDLINE
},
372 { "tkline", SHARED_TKLINE
},
373 { "unkline", SHARED_UNKLINE
},
374 { "txline", SHARED_TXLINE
},
375 { "unxline", SHARED_UNXLINE
},
376 { "tresv", SHARED_TRESV
},
377 { "unresv", SHARED_UNRESV
},
378 { "locops", SHARED_LOCOPS
},
379 { "rehash", SHARED_REHASH
},
380 { "die", SHARED_DIE
},
381 { "all", SHARED_ALL
},
388 find_umode(struct mode_table
*tab
, const char *name
)
392 for (i
= 0; tab
[i
].name
; i
++)
394 if(strcmp(tab
[i
].name
, name
) == 0)
402 set_modes_from_table(int *modes
, const char *whatis
, struct mode_table
*tab
, conf_parm_t
* args
)
404 for (; args
; args
= args
->next
)
410 if((args
->type
& CF_MTYPE
) != CF_STRING
)
412 conf_report_error("Warning -- %s is not a string; ignoring.", whatis
);
416 umode
= args
->v
.string
;
424 mode
= find_umode(tab
, umode
);
428 conf_report_error("Warning -- unknown %s %s.", whatis
, args
->v
.string
);
445 conf_set_privset_extends(void *data
)
447 yy_privset_extends
= rb_strdup((char *) data
);
451 conf_set_privset_privs(void *data
)
454 conf_parm_t
*args
= data
;
456 for (; args
; args
= args
->next
)
459 privs
= rb_strdup(args
->v
.string
);
462 char *privs_old
= privs
;
464 privs
= rb_malloc(strlen(privs_old
) + 1 + strlen(args
->v
.string
) + 1);
465 strcpy(privs
, privs_old
);
467 strcat(privs
, args
->v
.string
);
475 if (yy_privset_extends
)
477 struct PrivilegeSet
*set
= privilegeset_get(yy_privset_extends
);
481 conf_report_error("Warning -- unknown parent privilege set %s for %s; assuming defaults", yy_privset_extends
, conf_cur_block_name
);
483 set
= privilegeset_get("default");
486 privilegeset_extend(set
, conf_cur_block_name
!= NULL
? conf_cur_block_name
: "<unknown>", privs
, 0);
488 rb_free(yy_privset_extends
);
489 yy_privset_extends
= NULL
;
492 privilegeset_set_new(conf_cur_block_name
!= NULL
? conf_cur_block_name
: "<unknown>", privs
, 0);
499 conf_begin_oper(struct TopConf
*tc
)
502 rb_dlink_node
*next_ptr
;
506 free_oper_conf(yy_oper
);
510 RB_DLINK_FOREACH_SAFE(ptr
, next_ptr
, yy_oper_list
.head
)
512 free_oper_conf(ptr
->data
);
513 rb_dlinkDestroy(ptr
, &yy_oper_list
);
516 yy_oper
= make_oper_conf();
517 yy_oper
->flags
|= OPER_ENCRYPTED
;
523 conf_end_oper(struct TopConf
*tc
)
525 struct oper_conf
*yy_tmpoper
;
527 rb_dlink_node
*next_ptr
;
529 if(conf_cur_block_name
!= NULL
)
531 if(strlen(conf_cur_block_name
) > OPERNICKLEN
)
532 conf_cur_block_name
[OPERNICKLEN
] = '\0';
534 yy_oper
->name
= rb_strdup(conf_cur_block_name
);
537 if(EmptyString(yy_oper
->name
))
539 conf_report_error("Ignoring operator block -- missing name.");
543 #ifdef HAVE_LIBCRYPTO
544 if(EmptyString(yy_oper
->passwd
) && EmptyString(yy_oper
->rsa_pubkey_file
))
546 if(EmptyString(yy_oper
->passwd
))
549 conf_report_error("Ignoring operator block for %s -- missing password",
555 if (!yy_oper
->privset
)
556 yy_oper
->privset
= privilegeset_get("default");
558 /* now, yy_oper_list contains a stack of oper_conf's with just user
559 * and host in, yy_oper contains the rest of the information which
560 * we need to copy into each element in yy_oper_list
562 RB_DLINK_FOREACH_SAFE(ptr
, next_ptr
, yy_oper_list
.head
)
564 yy_tmpoper
= ptr
->data
;
566 yy_tmpoper
->name
= rb_strdup(yy_oper
->name
);
568 /* could be an rsa key instead.. */
569 if(!EmptyString(yy_oper
->passwd
))
570 yy_tmpoper
->passwd
= rb_strdup(yy_oper
->passwd
);
572 yy_tmpoper
->flags
= yy_oper
->flags
;
573 yy_tmpoper
->umodes
= yy_oper
->umodes
;
574 yy_tmpoper
->snomask
= yy_oper
->snomask
;
576 if(!EmptyString(yy_oper
->vhost
))
578 if(valid_hostname(yy_oper
->vhost
))
579 yy_tmpoper
->vhost
= rb_strdup(yy_oper
->vhost
);
580 else if(!EmptyString(yy_oper
->vhost
))
581 conf_report_error("Ignoring vhost setting for oper %s -- invalid hostmask.", yy_oper
->name
);
584 if(!EmptyString(yy_oper
->swhois
))
586 if(strlen(yy_oper
->swhois
) < 400)
587 yy_tmpoper
->swhois
= rb_strdup(yy_oper
->swhois
);
589 conf_report_error("Ignoring swhois setting for oper %s -- swhois too long.", yy_oper
->name
);
592 if(!EmptyString(yy_oper
->operstring
))
594 if(strlen(yy_oper
->operstring
) < 400)
595 yy_tmpoper
->operstring
= rb_strdup(yy_oper
->operstring
);
597 conf_report_error("Ignoring operstring setting for oper %s -- operstring too long.", yy_oper
->name
);
600 yy_tmpoper
->privset
= yy_oper
->privset
;
602 #ifdef HAVE_LIBCRYPTO
603 if(yy_oper
->rsa_pubkey_file
)
607 if((file
= BIO_new_file(yy_oper
->rsa_pubkey_file
, "r")) == NULL
)
609 conf_report_error("Ignoring operator block for %s -- "
610 "rsa_public_key_file cant be opened",
615 yy_tmpoper
->rsa_pubkey
=
616 (RSA
*) PEM_read_bio_RSA_PUBKEY(file
, NULL
, 0, NULL
);
618 (void)BIO_set_close(file
, BIO_CLOSE
);
621 if(yy_tmpoper
->rsa_pubkey
== NULL
)
623 conf_report_error("Ignoring operator block for %s -- "
624 "rsa_public_key_file key invalid; check syntax",
631 /* all is ok, put it on oper_conf_list */
632 rb_dlinkMoveNode(ptr
, &yy_oper_list
, &oper_conf_list
);
635 free_oper_conf(yy_oper
);
642 conf_set_oper_flags(void *data
)
644 conf_parm_t
*args
= data
;
646 set_modes_from_table(&yy_oper
->flags
, "flag", oper_table
, args
);
650 conf_set_oper_fingerprint(void *data
)
652 yy_oper
->certfp
= rb_strdup((char *) data
);
656 conf_set_oper_privset(void *data
)
658 yy_oper
->privset
= privilegeset_get((char *) data
);
662 conf_set_oper_user(void *data
)
664 struct oper_conf
*yy_tmpoper
;
666 char *host
= (char *) data
;
668 yy_tmpoper
= make_oper_conf();
670 if((p
= strchr(host
, '@')))
674 yy_tmpoper
->username
= rb_strdup(host
);
675 yy_tmpoper
->host
= rb_strdup(p
);
680 yy_tmpoper
->username
= rb_strdup("*");
681 yy_tmpoper
->host
= rb_strdup(host
);
684 if(EmptyString(yy_tmpoper
->username
) || EmptyString(yy_tmpoper
->host
))
686 conf_report_error("Ignoring user -- missing username/host");
687 free_oper_conf(yy_tmpoper
);
691 rb_dlinkAddAlloc(yy_tmpoper
, &yy_oper_list
);
695 conf_set_oper_password(void *data
)
699 memset(yy_oper
->passwd
, 0, strlen(yy_oper
->passwd
));
700 rb_free(yy_oper
->passwd
);
703 yy_oper
->passwd
= rb_strdup((char *) data
);
707 conf_set_oper_rsa_public_key_file(void *data
)
709 #ifdef HAVE_LIBCRYPTO
710 rb_free(yy_oper
->rsa_pubkey_file
);
711 yy_oper
->rsa_pubkey_file
= rb_strdup((char *) data
);
713 conf_report_error("Warning -- ignoring rsa_public_key_file (OpenSSL support not available");
718 conf_set_oper_umodes(void *data
)
720 set_modes_from_table(&yy_oper
->umodes
, "umode", umode_table
, data
);
724 conf_set_oper_snomask(void *data
)
726 yy_oper
->snomask
= parse_snobuf_to_mask(0, (const char *) data
);
730 conf_set_oper_vhost(void *data
)
732 yy_oper
->vhost
= rb_strdup((char *) data
);
736 conf_set_oper_swhois(void *data
)
738 yy_oper
->swhois
= rb_strdup((char *) data
);
742 conf_set_oper_operstring(void *data
)
744 yy_oper
->operstring
= rb_strdup((char *) data
);
748 conf_begin_class(struct TopConf
*tc
)
751 free_class(yy_class
);
753 yy_class
= make_class();
758 conf_end_class(struct TopConf
*tc
)
760 if(conf_cur_block_name
!= NULL
)
761 yy_class
->class_name
= rb_strdup(conf_cur_block_name
);
763 if(EmptyString(yy_class
->class_name
))
765 conf_report_error("Ignoring connect block -- missing name.");
775 conf_set_class_ping_time(void *data
)
777 yy_class
->ping_freq
= *(unsigned int *) data
;
781 conf_set_class_cidr_ipv4_bitlen(void *data
)
783 unsigned int maxsize
= 32;
784 if(*(unsigned int *) data
> maxsize
)
786 ("class::cidr_ipv4_bitlen argument exceeds maxsize (%d > %d) - ignoring.",
787 *(unsigned int *) data
, maxsize
);
789 yy_class
->cidr_ipv4_bitlen
= *(unsigned int *) data
;
795 conf_set_class_cidr_ipv6_bitlen(void *data
)
797 unsigned int maxsize
= 128;
798 if(*(unsigned int *) data
> maxsize
)
800 ("class::cidr_ipv6_bitlen argument exceeds maxsize (%d > %d) - ignoring.",
801 *(unsigned int *) data
, maxsize
);
803 yy_class
->cidr_ipv6_bitlen
= *(unsigned int *) data
;
809 conf_set_class_number_per_cidr(void *data
)
811 yy_class
->cidr_amount
= *(unsigned int *) data
;
815 conf_set_class_number_per_ip(void *data
)
817 yy_class
->max_local
= *(unsigned int *) data
;
822 conf_set_class_number_per_ip_global(void *data
)
824 yy_class
->max_global
= *(unsigned int *) data
;
828 conf_set_class_number_per_ident(void *data
)
830 yy_class
->max_ident
= *(unsigned int *) data
;
834 conf_set_class_connectfreq(void *data
)
836 yy_class
->con_freq
= *(unsigned int *) data
;
840 conf_set_class_max_number(void *data
)
842 yy_class
->max_total
= *(unsigned int *) data
;
846 conf_set_class_sendq(void *data
)
848 yy_class
->max_sendq
= *(unsigned int *) data
;
851 static char *listener_address
;
854 conf_begin_listen(struct TopConf
*tc
)
856 rb_free(listener_address
);
857 listener_address
= NULL
;
862 conf_end_listen(struct TopConf
*tc
)
864 rb_free(listener_address
);
865 listener_address
= NULL
;
872 conf_set_listen_port_both(void *data
, int ssl
)
874 conf_parm_t
*args
= data
;
875 for (; args
; args
= args
->next
)
877 if((args
->type
& CF_MTYPE
) != CF_INT
)
880 ("listener::port argument is not an integer " "-- ignoring.");
883 if(listener_address
== NULL
)
885 add_listener(args
->v
.number
, listener_address
, AF_INET
, ssl
);
887 add_listener(args
->v
.number
, listener_address
, AF_INET6
, ssl
);
894 if(strchr(listener_address
, ':') != NULL
)
900 add_listener(args
->v
.number
, listener_address
, family
, ssl
);
908 conf_set_listen_port(void *data
)
910 conf_set_listen_port_both(data
, 0);
914 conf_set_listen_sslport(void *data
)
916 conf_set_listen_port_both(data
, 1);
920 conf_set_listen_address(void *data
)
922 rb_free(listener_address
);
923 listener_address
= rb_strdup(data
);
927 conf_begin_auth(struct TopConf
*tc
)
930 rb_dlink_node
*next_ptr
;
935 RB_DLINK_FOREACH_SAFE(ptr
, next_ptr
, yy_aconf_list
.head
)
937 free_conf(ptr
->data
);
938 rb_dlinkDestroy(ptr
, &yy_aconf_list
);
941 yy_aconf
= make_conf();
942 yy_aconf
->status
= CONF_CLIENT
;
948 conf_end_auth(struct TopConf
*tc
)
950 struct ConfItem
*yy_tmp
, *found_conf
;
952 rb_dlink_node
*next_ptr
;
954 if(EmptyString(yy_aconf
->name
))
955 yy_aconf
->name
= rb_strdup("NOMATCH");
957 /* didnt even get one ->host? */
958 if(EmptyString(yy_aconf
->host
))
960 conf_report_error("Ignoring auth block -- missing user@host");
964 /* so the stacking works in order.. */
965 collapse(yy_aconf
->user
);
966 collapse(yy_aconf
->host
);
967 conf_add_class_to_conf(yy_aconf
);
968 if ((found_conf
= find_exact_conf_by_address("*", CONF_CLIENT
, "*")) && found_conf
->spasswd
== NULL
)
969 conf_report_error("Ignoring redundant auth block (after *@*)");
970 else if ((found_conf
= find_exact_conf_by_address(yy_aconf
->host
, CONF_CLIENT
, yy_aconf
->user
)) &&
971 (!found_conf
->spasswd
|| (yy_aconf
->spasswd
&&
972 0 == irccmp(found_conf
->spasswd
, yy_aconf
->spasswd
))))
973 conf_report_error("Ignoring duplicate auth block for %s@%s",
974 yy_aconf
->user
, yy_aconf
->host
);
976 add_conf_by_address(yy_aconf
->host
, CONF_CLIENT
, yy_aconf
->user
, yy_aconf
->spasswd
, yy_aconf
);
978 RB_DLINK_FOREACH_SAFE(ptr
, next_ptr
, yy_aconf_list
.head
)
983 yy_tmp
->passwd
= rb_strdup(yy_aconf
->passwd
);
985 if(yy_aconf
->spasswd
)
986 yy_tmp
->spasswd
= rb_strdup(yy_aconf
->spasswd
);
988 /* this will always exist.. */
989 yy_tmp
->name
= rb_strdup(yy_aconf
->name
);
991 if(yy_aconf
->className
)
992 yy_tmp
->className
= rb_strdup(yy_aconf
->className
);
994 yy_tmp
->flags
= yy_aconf
->flags
;
995 yy_tmp
->port
= yy_aconf
->port
;
997 collapse(yy_tmp
->user
);
998 collapse(yy_tmp
->host
);
1000 conf_add_class_to_conf(yy_tmp
);
1002 if (find_exact_conf_by_address("*", CONF_CLIENT
, "*"))
1003 conf_report_error("Ignoring redundant auth block (after *@*)");
1004 else if (find_exact_conf_by_address(yy_tmp
->host
, CONF_CLIENT
, yy_tmp
->user
))
1005 conf_report_error("Ignoring duplicate auth block for %s@%s",
1006 yy_tmp
->user
, yy_tmp
->host
);
1008 add_conf_by_address(yy_tmp
->host
, CONF_CLIENT
, yy_tmp
->user
, yy_tmp
->spasswd
, yy_tmp
);
1009 rb_dlinkDestroy(ptr
, &yy_aconf_list
);
1017 conf_set_auth_user(void *data
)
1019 struct ConfItem
*yy_tmp
;
1022 /* The first user= line doesn't allocate a new conf */
1023 if(!EmptyString(yy_aconf
->host
))
1025 yy_tmp
= make_conf();
1026 yy_tmp
->status
= CONF_CLIENT
;
1031 if((p
= strchr(data
, '@')))
1035 yy_tmp
->user
= rb_strdup(data
);
1036 yy_tmp
->host
= rb_strdup(p
);
1040 yy_tmp
->user
= rb_strdup("*");
1041 yy_tmp
->host
= rb_strdup(data
);
1044 if(yy_aconf
!= yy_tmp
)
1045 rb_dlinkAddAlloc(yy_tmp
, &yy_aconf_list
);
1049 conf_set_auth_auth_user(void *data
)
1051 if(yy_aconf
->spasswd
)
1052 memset(yy_aconf
->spasswd
, 0, strlen(yy_aconf
->spasswd
));
1053 rb_free(yy_aconf
->spasswd
);
1054 yy_aconf
->spasswd
= rb_strdup(data
);
1058 conf_set_auth_passwd(void *data
)
1060 if(yy_aconf
->passwd
)
1061 memset(yy_aconf
->passwd
, 0, strlen(yy_aconf
->passwd
));
1062 rb_free(yy_aconf
->passwd
);
1063 yy_aconf
->passwd
= rb_strdup(data
);
1067 conf_set_auth_autojoin(void *data
)
1069 if(yy_aconf
->autojoin
)
1070 memset(yy_aconf
->autojoin
, 0, strlen(yy_aconf
->autojoin
));
1071 rb_free(yy_aconf
->autojoin
);
1072 yy_aconf
->autojoin
= rb_strdup(data
);
1076 conf_set_auth_autojoin_opers(void *data
)
1078 if(yy_aconf
->autojoin_opers
)
1079 memset(yy_aconf
->autojoin_opers
, 0, strlen(yy_aconf
->autojoin
));
1080 rb_free(yy_aconf
->autojoin_opers
);
1081 yy_aconf
->autojoin_opers
= rb_strdup(data
);
1085 conf_set_auth_spoof(void *data
)
1093 /* user@host spoof */
1094 if((p
= strchr(host
, '@')) != NULL
)
1100 if(EmptyString(user
))
1102 conf_report_error("Warning -- spoof ident empty.");
1106 if(strlen(user
) > USERLEN
)
1108 conf_report_error("Warning -- spoof ident length invalid.");
1112 if(!valid_username(user
))
1114 conf_report_error("Warning -- invalid spoof (ident).");
1118 /* this must be restored! */
1122 if(EmptyString(host
))
1124 conf_report_error("Warning -- spoof host empty.");
1128 if(strlen(host
) > HOSTLEN
)
1130 conf_report_error("Warning -- spoof host length invalid.");
1134 if(!valid_hostname(host
))
1136 conf_report_error("Warning -- invalid spoof (host).");
1140 rb_free(yy_aconf
->name
);
1141 yy_aconf
->name
= rb_strdup(data
);
1142 yy_aconf
->flags
|= CONF_FLAGS_SPOOF_IP
;
1146 conf_set_auth_flags(void *data
)
1148 conf_parm_t
*args
= data
;
1150 set_modes_from_table((int *) &yy_aconf
->flags
, "flag", auth_table
, args
);
1154 conf_set_auth_redir_serv(void *data
)
1156 yy_aconf
->flags
|= CONF_FLAGS_REDIR
;
1157 rb_free(yy_aconf
->name
);
1158 yy_aconf
->name
= rb_strdup(data
);
1162 conf_set_auth_redir_port(void *data
)
1164 int port
= *(unsigned int *) data
;
1166 yy_aconf
->flags
|= CONF_FLAGS_REDIR
;
1167 yy_aconf
->port
= port
;
1171 conf_set_auth_class(void *data
)
1173 rb_free(yy_aconf
->className
);
1174 yy_aconf
->className
= rb_strdup(data
);
1177 /* ok, shared_oper handles the stacking, shared_flags handles adding
1178 * things.. so all we need to do when we start and end a shared block, is
1179 * clean up anything thats been left over.
1182 conf_cleanup_shared(struct TopConf
*tc
)
1184 rb_dlink_node
*ptr
, *next_ptr
;
1186 RB_DLINK_FOREACH_SAFE(ptr
, next_ptr
, yy_shared_list
.head
)
1188 free_remote_conf(ptr
->data
);
1189 rb_dlinkDestroy(ptr
, &yy_shared_list
);
1192 if(yy_shared
!= NULL
)
1194 free_remote_conf(yy_shared
);
1202 conf_set_shared_oper(void *data
)
1204 conf_parm_t
*args
= data
;
1205 const char *username
;
1208 if(yy_shared
!= NULL
)
1209 free_remote_conf(yy_shared
);
1211 yy_shared
= make_remote_conf();
1213 if(args
->next
!= NULL
)
1215 if((args
->type
& CF_MTYPE
) != CF_QSTRING
)
1217 conf_report_error("Ignoring shared::oper -- server is not a qstring");
1221 yy_shared
->server
= rb_strdup(args
->v
.string
);
1225 yy_shared
->server
= rb_strdup("*");
1227 if((args
->type
& CF_MTYPE
) != CF_QSTRING
)
1229 conf_report_error("Ignoring shared::oper -- oper is not a qstring");
1233 if((p
= strchr(args
->v
.string
, '@')) == NULL
)
1235 conf_report_error("Ignoring shared::oper -- oper is not a user@host");
1239 username
= args
->v
.string
;
1243 yy_shared
->host
= rb_strdup("*");
1245 yy_shared
->host
= rb_strdup(p
);
1247 if(EmptyString(username
))
1248 yy_shared
->username
= rb_strdup("*");
1250 yy_shared
->username
= rb_strdup(username
);
1252 rb_dlinkAddAlloc(yy_shared
, &yy_shared_list
);
1257 conf_set_shared_flags(void *data
)
1259 conf_parm_t
*args
= data
;
1261 rb_dlink_node
*ptr
, *next_ptr
;
1263 if(yy_shared
!= NULL
)
1264 free_remote_conf(yy_shared
);
1266 set_modes_from_table(&flags
, "flag", shared_table
, args
);
1268 RB_DLINK_FOREACH_SAFE(ptr
, next_ptr
, yy_shared_list
.head
)
1270 yy_shared
= ptr
->data
;
1272 yy_shared
->flags
= flags
;
1273 rb_dlinkDestroy(ptr
, &yy_shared_list
);
1274 rb_dlinkAddTail(yy_shared
, &yy_shared
->node
, &shared_conf_list
);
1281 conf_begin_connect(struct TopConf
*tc
)
1284 free_server_conf(yy_server
);
1286 yy_server
= make_server_conf();
1287 yy_server
->port
= PORTNUM
;
1288 yy_server
->flags
|= SERVER_TB
;
1290 if(conf_cur_block_name
!= NULL
)
1291 yy_server
->name
= rb_strdup(conf_cur_block_name
);
1297 conf_end_connect(struct TopConf
*tc
)
1299 if(EmptyString(yy_server
->name
))
1301 conf_report_error("Ignoring connect block -- missing name.");
1305 if(ServerInfo
.name
!= NULL
&& !irccmp(ServerInfo
.name
, yy_server
->name
))
1307 conf_report_error("Ignoring connect block for %s -- name is equal to my own name.",
1312 if(EmptyString(yy_server
->passwd
) || EmptyString(yy_server
->spasswd
))
1314 conf_report_error("Ignoring connect block for %s -- missing password.",
1319 if(EmptyString(yy_server
->host
))
1321 conf_report_error("Ignoring connect block for %s -- missing host.",
1327 if(ServerConfCompressed(yy_server
))
1329 conf_report_error("Ignoring connect::flags::compressed -- zlib not available.");
1330 yy_server
->flags
&= ~SERVER_COMPRESSED
;
1334 add_server_conf(yy_server
);
1335 rb_dlinkAdd(yy_server
, &yy_server
->node
, &server_conf_list
);
1342 conf_set_connect_host(void *data
)
1344 rb_free(yy_server
->host
);
1345 yy_server
->host
= rb_strdup(data
);
1346 if (strchr(yy_server
->host
, ':'))
1347 yy_server
->aftype
= AF_INET6
;
1351 conf_set_connect_vhost(void *data
)
1353 if(rb_inet_pton_sock(data
, (struct sockaddr
*)&yy_server
->my_ipnum
) <= 0)
1355 conf_report_error("Invalid netmask for server vhost (%s)",
1360 yy_server
->flags
|= SERVER_VHOSTED
;
1364 conf_set_connect_send_password(void *data
)
1366 if(yy_server
->spasswd
)
1368 memset(yy_server
->spasswd
, 0, strlen(yy_server
->spasswd
));
1369 rb_free(yy_server
->spasswd
);
1372 yy_server
->spasswd
= rb_strdup(data
);
1376 conf_set_connect_accept_password(void *data
)
1378 if(yy_server
->passwd
)
1380 memset(yy_server
->passwd
, 0, strlen(yy_server
->passwd
));
1381 rb_free(yy_server
->passwd
);
1383 yy_server
->passwd
= rb_strdup(data
);
1387 conf_set_connect_port(void *data
)
1389 int port
= *(unsigned int *) data
;
1394 yy_server
->port
= port
;
1398 conf_set_connect_aftype(void *data
)
1402 if(strcasecmp(aft
, "ipv4") == 0)
1403 yy_server
->aftype
= AF_INET
;
1405 else if(strcasecmp(aft
, "ipv6") == 0)
1406 yy_server
->aftype
= AF_INET6
;
1409 conf_report_error("connect::aftype '%s' is unknown.", aft
);
1413 conf_set_connect_flags(void *data
)
1415 conf_parm_t
*args
= data
;
1417 /* note, we allow them to set compressed, then remove it later if
1418 * they do and LIBZ isnt available
1420 set_modes_from_table(&yy_server
->flags
, "flag", connect_table
, args
);
1424 conf_set_connect_hub_mask(void *data
)
1426 struct remote_conf
*yy_hub
;
1428 if(EmptyString(yy_server
->name
))
1431 yy_hub
= make_remote_conf();
1432 yy_hub
->flags
= CONF_HUB
;
1434 yy_hub
->host
= rb_strdup(data
);
1435 yy_hub
->server
= rb_strdup(yy_server
->name
);
1436 rb_dlinkAdd(yy_hub
, &yy_hub
->node
, &hubleaf_conf_list
);
1440 conf_set_connect_leaf_mask(void *data
)
1442 struct remote_conf
*yy_leaf
;
1444 if(EmptyString(yy_server
->name
))
1447 yy_leaf
= make_remote_conf();
1448 yy_leaf
->flags
= CONF_LEAF
;
1450 yy_leaf
->host
= rb_strdup(data
);
1451 yy_leaf
->server
= rb_strdup(yy_server
->name
);
1452 rb_dlinkAdd(yy_leaf
, &yy_leaf
->node
, &hubleaf_conf_list
);
1456 conf_set_connect_class(void *data
)
1458 rb_free(yy_server
->class_name
);
1459 yy_server
->class_name
= rb_strdup(data
);
1463 conf_set_exempt_ip(void *data
)
1465 struct ConfItem
*yy_tmp
;
1467 if(parse_netmask(data
, NULL
, NULL
) == HM_HOST
)
1469 conf_report_error("Ignoring exempt -- invalid exempt::ip.");
1473 yy_tmp
= make_conf();
1474 yy_tmp
->passwd
= rb_strdup("*");
1475 yy_tmp
->host
= rb_strdup(data
);
1476 yy_tmp
->status
= CONF_EXEMPTDLINE
;
1477 add_conf_by_address(yy_tmp
->host
, CONF_EXEMPTDLINE
, NULL
, NULL
, yy_tmp
);
1481 conf_cleanup_cluster(struct TopConf
*tc
)
1483 rb_dlink_node
*ptr
, *next_ptr
;
1485 RB_DLINK_FOREACH_SAFE(ptr
, next_ptr
, yy_cluster_list
.head
)
1487 free_remote_conf(ptr
->data
);
1488 rb_dlinkDestroy(ptr
, &yy_cluster_list
);
1491 if(yy_shared
!= NULL
)
1493 free_remote_conf(yy_shared
);
1501 conf_set_cluster_name(void *data
)
1503 if(yy_shared
!= NULL
)
1504 free_remote_conf(yy_shared
);
1506 yy_shared
= make_remote_conf();
1507 yy_shared
->server
= rb_strdup(data
);
1508 rb_dlinkAddAlloc(yy_shared
, &yy_cluster_list
);
1514 conf_set_cluster_flags(void *data
)
1516 conf_parm_t
*args
= data
;
1518 rb_dlink_node
*ptr
, *next_ptr
;
1520 if(yy_shared
!= NULL
)
1521 free_remote_conf(yy_shared
);
1523 set_modes_from_table(&flags
, "flag", cluster_table
, args
);
1525 RB_DLINK_FOREACH_SAFE(ptr
, next_ptr
, yy_cluster_list
.head
)
1527 yy_shared
= ptr
->data
;
1528 yy_shared
->flags
= flags
;
1529 rb_dlinkAddTail(yy_shared
, &yy_shared
->node
, &cluster_conf_list
);
1530 rb_dlinkDestroy(ptr
, &yy_cluster_list
);
1537 conf_set_general_havent_read_conf(void *data
)
1539 if(*(unsigned int *) data
)
1541 conf_report_error("You haven't read your config file properly.");
1543 ("There is a line in the example conf that will kill your server if not removed.");
1545 ("Consider actually reading/editing the conf file, and removing this line.");
1552 conf_set_general_hide_error_messages(void *data
)
1556 if(strcasecmp(val
, "yes") == 0)
1557 ConfigFileEntry
.hide_error_messages
= 2;
1558 else if(strcasecmp(val
, "opers") == 0)
1559 ConfigFileEntry
.hide_error_messages
= 1;
1560 else if(strcasecmp(val
, "no") == 0)
1561 ConfigFileEntry
.hide_error_messages
= 0;
1563 conf_report_error("Invalid setting '%s' for general::hide_error_messages.", val
);
1567 conf_set_general_kline_delay(void *data
)
1569 ConfigFileEntry
.kline_delay
= *(unsigned int *) data
;
1571 /* THIS MUST BE HERE to stop us being unable to check klines */
1576 conf_set_general_stats_k_oper_only(void *data
)
1580 if(strcasecmp(val
, "yes") == 0)
1581 ConfigFileEntry
.stats_k_oper_only
= 2;
1582 else if(strcasecmp(val
, "masked") == 0)
1583 ConfigFileEntry
.stats_k_oper_only
= 1;
1584 else if(strcasecmp(val
, "no") == 0)
1585 ConfigFileEntry
.stats_k_oper_only
= 0;
1587 conf_report_error("Invalid setting '%s' for general::stats_k_oper_only.", val
);
1591 conf_set_general_stats_i_oper_only(void *data
)
1595 if(strcasecmp(val
, "yes") == 0)
1596 ConfigFileEntry
.stats_i_oper_only
= 2;
1597 else if(strcasecmp(val
, "masked") == 0)
1598 ConfigFileEntry
.stats_i_oper_only
= 1;
1599 else if(strcasecmp(val
, "no") == 0)
1600 ConfigFileEntry
.stats_i_oper_only
= 0;
1602 conf_report_error("Invalid setting '%s' for general::stats_i_oper_only.", val
);
1606 conf_set_general_compression_level(void *data
)
1609 ConfigFileEntry
.compression_level
= *(unsigned int *) data
;
1611 if((ConfigFileEntry
.compression_level
< 1) || (ConfigFileEntry
.compression_level
> 9))
1614 ("Invalid general::compression_level %d -- using default.",
1615 ConfigFileEntry
.compression_level
);
1616 ConfigFileEntry
.compression_level
= 0;
1619 conf_report_error("Ignoring general::compression_level -- zlib not available.");
1624 conf_set_general_default_umodes(void *data
)
1627 int what
= MODE_ADD
, flag
;
1629 ConfigFileEntry
.default_umodes
= 0;
1630 for (pm
= (char *) data
; *pm
; pm
++)
1641 /* don't allow +o */
1648 if ((flag
= user_modes
[(unsigned char) *pm
]))
1650 /* Proper value has probably not yet been set
1651 * so don't check oper_only_umodes -- jilles */
1652 if (what
== MODE_ADD
)
1653 ConfigFileEntry
.default_umodes
|= flag
;
1655 ConfigFileEntry
.default_umodes
&= ~flag
;
1663 conf_set_general_oper_umodes(void *data
)
1665 set_modes_from_table(&ConfigFileEntry
.oper_umodes
, "umode", umode_table
, data
);
1669 conf_set_general_oper_only_umodes(void *data
)
1671 set_modes_from_table(&ConfigFileEntry
.oper_only_umodes
, "umode", umode_table
, data
);
1675 conf_set_general_oper_snomask(void *data
)
1678 int what
= MODE_ADD
, flag
;
1680 ConfigFileEntry
.oper_snomask
= 0;
1681 for (pm
= (char *) data
; *pm
; pm
++)
1693 if ((flag
= snomask_modes
[(unsigned char) *pm
]))
1695 if (what
== MODE_ADD
)
1696 ConfigFileEntry
.oper_snomask
|= flag
;
1698 ConfigFileEntry
.oper_snomask
&= ~flag
;
1706 conf_set_serverhide_links_delay(void *data
)
1708 int val
= *(unsigned int *) data
;
1710 ConfigServerHide
.links_delay
= val
;
1714 conf_begin_service(struct TopConf
*tc
)
1716 struct Client
*target_p
;
1719 RB_DLINK_FOREACH(ptr
, global_serv_list
.head
)
1721 target_p
= ptr
->data
;
1723 target_p
->flags
&= ~FLAGS_SERVICE
;
1730 conf_set_service_name(void *data
)
1732 struct Client
*target_p
;
1737 for(s
= data
; *s
!= '\0'; s
++)
1741 conf_report_error("Ignoring service::name "
1742 "-- bogus servername.");
1751 conf_report_error("Ignoring service::name -- must contain '.'");
1755 tmp
= rb_strdup(data
);
1756 rb_dlinkAddAlloc(tmp
, &service_list
);
1758 if((target_p
= find_server(NULL
, tmp
)))
1759 target_p
->flags
|= FLAGS_SERVICE
;
1763 conf_begin_alias(struct TopConf
*tc
)
1765 yy_alias
= rb_malloc(sizeof(struct alias_entry
));
1767 if (conf_cur_block_name
!= NULL
)
1768 yy_alias
->name
= rb_strdup(conf_cur_block_name
);
1770 yy_alias
->flags
= 0;
1777 conf_end_alias(struct TopConf
*tc
)
1779 if (yy_alias
== NULL
)
1782 if (yy_alias
->name
== NULL
)
1784 conf_report_error("Ignoring alias -- must have a name.");
1791 if (yy_alias
->target
== NULL
)
1793 conf_report_error("Ignoring alias -- must have a target.");
1800 irc_dictionary_add(alias_dict
, yy_alias
->name
, yy_alias
);
1806 conf_set_alias_name(void *data
)
1808 if (data
== NULL
|| yy_alias
== NULL
) /* this shouldn't ever happen */
1811 yy_alias
->name
= rb_strdup(data
);
1815 conf_set_alias_target(void *data
)
1817 if (data
== NULL
|| yy_alias
== NULL
) /* this shouldn't ever happen */
1820 yy_alias
->target
= rb_strdup(data
);
1824 conf_set_blacklist_host(void *data
)
1826 yy_blacklist_host
= rb_strdup(data
);
1830 conf_set_blacklist_reason(void *data
)
1832 yy_blacklist_reason
= rb_strdup(data
);
1834 if (yy_blacklist_host
&& yy_blacklist_reason
)
1836 new_blacklist(yy_blacklist_host
, yy_blacklist_reason
);
1837 rb_free(yy_blacklist_host
);
1838 rb_free(yy_blacklist_reason
);
1839 yy_blacklist_host
= NULL
;
1840 yy_blacklist_reason
= NULL
;
1844 /* public functions */
1848 conf_report_error(const char *fmt
, ...)
1851 char msg
[IRCD_BUFSIZE
+ 1] = { 0 };
1854 rb_vsnprintf(msg
, IRCD_BUFSIZE
, fmt
, ap
);
1859 fprintf(stderr
, "\"%s\", line %d: %s\n", current_file
, lineno
+ 1, msg
);
1863 ierror("\"%s\", line %d: %s", current_file
, lineno
+ 1, msg
);
1864 sendto_realops_snomask(SNO_GENERAL
, L_ALL
, "\"%s\", line %d: %s", current_file
, lineno
+ 1, msg
);
1868 conf_start_block(char *block
, char *name
)
1870 if((conf_cur_block
= find_top_conf(block
)) == NULL
)
1872 conf_report_error("Configuration block '%s' is not defined.", block
);
1877 conf_cur_block_name
= rb_strdup(name
);
1879 conf_cur_block_name
= NULL
;
1881 if(conf_cur_block
->tc_sfunc
)
1882 if(conf_cur_block
->tc_sfunc(conf_cur_block
) < 0)
1889 conf_end_block(struct TopConf
*tc
)
1892 return tc
->tc_efunc(tc
);
1894 rb_free(conf_cur_block_name
);
1899 conf_set_generic_int(void *data
, void *location
)
1901 *((int *) location
) = *((unsigned int *) data
);
1905 conf_set_generic_string(void *data
, int len
, void *location
)
1907 char **loc
= location
;
1910 if(len
&& strlen(input
) > (unsigned int)len
)
1914 *loc
= rb_strdup(input
);
1918 conf_call_set(struct TopConf
*tc
, char *item
, conf_parm_t
* value
, int type
)
1920 struct ConfEntry
*cf
;
1926 if((cf
= find_conf_item(tc
, item
)) == NULL
)
1929 ("Non-existant configuration setting %s::%s.", tc
->tc_name
, (char *) item
);
1933 /* if it takes one thing, make sure they only passed one thing,
1934 and handle as needed. */
1935 if(value
->type
& CF_FLIST
&& !cf
->cf_type
& CF_FLIST
)
1938 ("Option %s::%s does not take a list of values.", tc
->tc_name
, item
);
1945 if(CF_TYPE(value
->v
.list
->type
) != CF_TYPE(cf
->cf_type
))
1947 /* if it expects a string value, but we got a yesno,
1950 if((CF_TYPE(value
->v
.list
->type
) == CF_YESNO
) &&
1951 (CF_TYPE(cf
->cf_type
) == CF_STRING
))
1953 value
->v
.list
->type
= CF_STRING
;
1955 if(cp
->v
.number
== 1)
1956 cp
->v
.string
= rb_strdup("yes");
1958 cp
->v
.string
= rb_strdup("no");
1961 /* maybe it's a CF_TIME and they passed CF_INT --
1962 should still be valid */
1963 else if(!((CF_TYPE(value
->v
.list
->type
) == CF_INT
) &&
1964 (CF_TYPE(cf
->cf_type
) == CF_TIME
)))
1967 ("Wrong type for %s::%s (expected %s, got %s)",
1968 tc
->tc_name
, (char *) item
,
1969 conf_strtype(cf
->cf_type
), conf_strtype(value
->v
.list
->type
));
1974 if(cf
->cf_type
& CF_FLIST
)
1978 conf_set_generic_list(value
->v
.list
, cf
->cf_arg
);
1981 /* just pass it the extended argument list */
1982 cf
->cf_func(value
->v
.list
);
1986 /* it's old-style, needs only one arg */
1987 switch (cf
->cf_type
)
1993 conf_set_generic_int(&cp
->v
.number
, cf
->cf_arg
);
1995 cf
->cf_func(&cp
->v
.number
);
1999 if(EmptyString(cp
->v
.string
))
2000 conf_report_error("Ignoring %s::%s -- empty field",
2003 conf_set_generic_string(cp
->v
.string
, cf
->cf_len
, cf
->cf_arg
);
2005 cf
->cf_func(cp
->v
.string
);
2015 add_conf_item(const char *topconf
, const char *name
, int type
, void (*func
) (void *))
2018 struct ConfEntry
*cf
;
2020 if((tc
= find_top_conf(topconf
)) == NULL
)
2023 if((cf
= find_conf_item(tc
, name
)) != NULL
)
2026 cf
= rb_malloc(sizeof(struct ConfEntry
));
2033 rb_dlinkAddAlloc(cf
, &tc
->tc_items
);
2039 remove_conf_item(const char *topconf
, const char *name
)
2042 struct ConfEntry
*cf
;
2045 if((tc
= find_top_conf(topconf
)) == NULL
)
2048 if((cf
= find_conf_item(tc
, name
)) == NULL
)
2051 if((ptr
= rb_dlinkFind(cf
, &tc
->tc_items
)) == NULL
)
2054 rb_dlinkDestroy(ptr
, &tc
->tc_items
);
2061 static struct ConfEntry conf_serverinfo_table
[] =
2063 { "description", CF_QSTRING
, NULL
, 0, &ServerInfo
.description
},
2064 { "network_desc", CF_QSTRING
, NULL
, 0, &ServerInfo
.network_desc
},
2065 { "hub", CF_YESNO
, NULL
, 0, &ServerInfo
.hub
},
2067 { "network_name", CF_QSTRING
, conf_set_serverinfo_network_name
, 0, NULL
},
2068 { "name", CF_QSTRING
, conf_set_serverinfo_name
, 0, NULL
},
2069 { "sid", CF_QSTRING
, conf_set_serverinfo_sid
, 0, NULL
},
2070 { "vhost", CF_QSTRING
, conf_set_serverinfo_vhost
, 0, NULL
},
2071 { "vhost6", CF_QSTRING
, conf_set_serverinfo_vhost6
, 0, NULL
},
2073 { "ssl_private_key", CF_QSTRING
, NULL
, 0, &ServerInfo
.ssl_private_key
},
2074 { "ssl_ca_cert", CF_QSTRING
, NULL
, 0, &ServerInfo
.ssl_ca_cert
},
2075 { "ssl_cert", CF_QSTRING
, NULL
, 0, &ServerInfo
.ssl_cert
},
2076 { "ssl_dh_params", CF_QSTRING
, NULL
, 0, &ServerInfo
.ssl_dh_params
},
2077 { "ssld_count", CF_INT
, NULL
, 0, &ServerInfo
.ssld_count
},
2079 { "default_max_clients",CF_INT
, NULL
, 0, &ServerInfo
.default_max_clients
},
2081 { "\0", 0, NULL
, 0, NULL
}
2084 static struct ConfEntry conf_admin_table
[] =
2086 { "name", CF_QSTRING
, NULL
, 200, &AdminInfo
.name
},
2087 { "description",CF_QSTRING
, NULL
, 200, &AdminInfo
.description
},
2088 { "email", CF_QSTRING
, NULL
, 200, &AdminInfo
.email
},
2089 { "\0", 0, NULL
, 0, NULL
}
2092 static struct ConfEntry conf_log_table
[] =
2094 { "fname_userlog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_userlog
},
2095 { "fname_fuserlog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_fuserlog
},
2096 { "fname_operlog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_operlog
},
2097 { "fname_foperlog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_foperlog
},
2098 { "fname_serverlog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_serverlog
},
2099 { "fname_killlog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_killlog
},
2100 { "fname_klinelog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_klinelog
},
2101 { "fname_operspylog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_operspylog
},
2102 { "fname_ioerrorlog", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.fname_ioerrorlog
},
2103 { "\0", 0, NULL
, 0, NULL
}
2106 static struct ConfEntry conf_operator_table
[] =
2108 { "rsa_public_key_file", CF_QSTRING
, conf_set_oper_rsa_public_key_file
, 0, NULL
},
2109 { "flags", CF_STRING
| CF_FLIST
, conf_set_oper_flags
, 0, NULL
},
2110 { "umodes", CF_STRING
| CF_FLIST
, conf_set_oper_umodes
, 0, NULL
},
2111 { "privset", CF_QSTRING
, conf_set_oper_privset
, 0, NULL
},
2112 { "snomask", CF_QSTRING
, conf_set_oper_snomask
, 0, NULL
},
2113 { "vhost", CF_QSTRING
, conf_set_oper_vhost
, 0, NULL
},
2114 { "swhois", CF_QSTRING
, conf_set_oper_swhois
, 0, NULL
},
2115 { "operstring", CF_QSTRING
, conf_set_oper_operstring
, 0, NULL
},
2116 { "user", CF_QSTRING
, conf_set_oper_user
, 0, NULL
},
2117 { "password", CF_QSTRING
, conf_set_oper_password
, 0, NULL
},
2118 { "fingerprint", CF_QSTRING
, conf_set_oper_fingerprint
, 0, NULL
},
2119 { "\0", 0, NULL
, 0, NULL
}
2122 static struct ConfEntry conf_privset_table
[] =
2124 { "extends", CF_QSTRING
, conf_set_privset_extends
, 0, NULL
},
2125 { "privs", CF_STRING
| CF_FLIST
, conf_set_privset_privs
, 0, NULL
},
2126 { "\0", 0, NULL
, 0, NULL
}
2129 static struct ConfEntry conf_class_table
[] =
2131 { "ping_time", CF_TIME
, conf_set_class_ping_time
, 0, NULL
},
2132 { "cidr_ipv4_bitlen", CF_INT
, conf_set_class_cidr_ipv4_bitlen
, 0, NULL
},
2134 { "cidr_ipv6_bitlen", CF_INT
, conf_set_class_cidr_ipv6_bitlen
, 0, NULL
},
2136 { "number_per_cidr", CF_INT
, conf_set_class_number_per_cidr
, 0, NULL
},
2137 { "number_per_ip", CF_INT
, conf_set_class_number_per_ip
, 0, NULL
},
2138 { "number_per_ip_global", CF_INT
,conf_set_class_number_per_ip_global
, 0, NULL
},
2139 { "number_per_ident", CF_INT
, conf_set_class_number_per_ident
, 0, NULL
},
2140 { "connectfreq", CF_TIME
, conf_set_class_connectfreq
, 0, NULL
},
2141 { "max_number", CF_INT
, conf_set_class_max_number
, 0, NULL
},
2142 { "sendq", CF_TIME
, conf_set_class_sendq
, 0, NULL
},
2143 { "\0", 0, NULL
, 0, NULL
}
2146 static struct ConfEntry conf_auth_table
[] =
2148 { "user", CF_QSTRING
, conf_set_auth_user
, 0, NULL
},
2149 { "auth_user", CF_QSTRING
, conf_set_auth_auth_user
, 0, NULL
},
2150 { "password", CF_QSTRING
, conf_set_auth_passwd
, 0, NULL
},
2151 { "class", CF_QSTRING
, conf_set_auth_class
, 0, NULL
},
2152 { "spoof", CF_QSTRING
, conf_set_auth_spoof
, 0, NULL
},
2153 { "autojoin", CF_QSTRING
, conf_set_auth_autojoin
, 0, NULL
},
2154 { "autojoin_opers", CF_QSTRING
, conf_set_auth_autojoin_opers
, 0, NULL
},
2155 { "redirserv", CF_QSTRING
, conf_set_auth_redir_serv
, 0, NULL
},
2156 { "redirport", CF_INT
, conf_set_auth_redir_port
, 0, NULL
},
2157 { "flags", CF_STRING
| CF_FLIST
, conf_set_auth_flags
, 0, NULL
},
2158 { "\0", 0, NULL
, 0, NULL
}
2161 static struct ConfEntry conf_connect_table
[] =
2163 { "send_password", CF_QSTRING
, conf_set_connect_send_password
, 0, NULL
},
2164 { "accept_password", CF_QSTRING
, conf_set_connect_accept_password
, 0, NULL
},
2165 { "flags", CF_STRING
| CF_FLIST
, conf_set_connect_flags
, 0, NULL
},
2166 { "host", CF_QSTRING
, conf_set_connect_host
, 0, NULL
},
2167 { "vhost", CF_QSTRING
, conf_set_connect_vhost
, 0, NULL
},
2168 { "port", CF_INT
, conf_set_connect_port
, 0, NULL
},
2169 { "aftype", CF_STRING
, conf_set_connect_aftype
, 0, NULL
},
2170 { "hub_mask", CF_QSTRING
, conf_set_connect_hub_mask
, 0, NULL
},
2171 { "leaf_mask", CF_QSTRING
, conf_set_connect_leaf_mask
, 0, NULL
},
2172 { "class", CF_QSTRING
, conf_set_connect_class
, 0, NULL
},
2173 { "\0", 0, NULL
, 0, NULL
}
2176 static struct ConfEntry conf_general_table
[] =
2178 { "oper_only_umodes", CF_STRING
| CF_FLIST
, conf_set_general_oper_only_umodes
, 0, NULL
},
2179 { "oper_umodes", CF_STRING
| CF_FLIST
, conf_set_general_oper_umodes
, 0, NULL
},
2180 { "oper_snomask", CF_QSTRING
, conf_set_general_oper_snomask
, 0, NULL
},
2181 { "compression_level", CF_INT
, conf_set_general_compression_level
, 0, NULL
},
2182 { "havent_read_conf", CF_YESNO
, conf_set_general_havent_read_conf
, 0, NULL
},
2183 { "hide_error_messages",CF_STRING
, conf_set_general_hide_error_messages
,0, NULL
},
2184 { "kline_delay", CF_TIME
, conf_set_general_kline_delay
, 0, NULL
},
2185 { "stats_k_oper_only", CF_STRING
, conf_set_general_stats_k_oper_only
, 0, NULL
},
2186 { "stats_i_oper_only", CF_STRING
, conf_set_general_stats_i_oper_only
, 0, NULL
},
2187 { "default_umodes", CF_QSTRING
, conf_set_general_default_umodes
, 0, NULL
},
2189 { "default_operstring", CF_QSTRING
, NULL
, REALLEN
, &ConfigFileEntry
.default_operstring
},
2190 { "default_adminstring",CF_QSTRING
, NULL
, REALLEN
, &ConfigFileEntry
.default_adminstring
},
2191 { "default_operhost", CF_QSTRING
, NULL
, REALLEN
, &ConfigFileEntry
.default_operhost
},
2192 { "static_quit", CF_QSTRING
, NULL
, REALLEN
, &ConfigFileEntry
.static_quit
},
2193 { "servicestring", CF_QSTRING
, NULL
, REALLEN
, &ConfigFileEntry
.servicestring
},
2194 { "egdpool_path", CF_QSTRING
, NULL
, MAXPATHLEN
, &ConfigFileEntry
.egdpool_path
},
2195 { "kline_reason", CF_QSTRING
, NULL
, REALLEN
, &ConfigFileEntry
.kline_reason
},
2196 { "identify_service", CF_QSTRING
, NULL
, REALLEN
, &ConfigFileEntry
.identifyservice
},
2197 { "identify_command", CF_QSTRING
, NULL
, REALLEN
, &ConfigFileEntry
.identifycommand
},
2199 { "anti_spam_exit_message_time", CF_TIME
, NULL
, 0, &ConfigFileEntry
.anti_spam_exit_message_time
},
2200 { "use_part_messages", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.use_part_messages
},
2201 { "disable_fake_channels", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.disable_fake_channels
},
2202 { "min_nonwildcard_simple", CF_INT
, NULL
, 0, &ConfigFileEntry
.min_nonwildcard_simple
},
2203 { "non_redundant_klines", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.non_redundant_klines
},
2204 { "tkline_expire_notices", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.tkline_expire_notices
},
2206 { "anti_nick_flood", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.anti_nick_flood
},
2207 { "burst_away", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.burst_away
},
2208 { "caller_id_wait", CF_TIME
, NULL
, 0, &ConfigFileEntry
.caller_id_wait
},
2209 { "client_exit", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.client_exit
},
2210 { "client_flood", CF_INT
, NULL
, 0, &ConfigFileEntry
.client_flood
},
2211 { "collision_fnc", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.collision_fnc
},
2212 { "connect_timeout", CF_TIME
, NULL
, 0, &ConfigFileEntry
.connect_timeout
},
2213 { "default_floodcount", CF_INT
, NULL
, 0, &ConfigFileEntry
.default_floodcount
},
2214 { "disable_auth", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.disable_auth
},
2215 { "dots_in_ident", CF_INT
, NULL
, 0, &ConfigFileEntry
.dots_in_ident
},
2216 { "failed_oper_notice", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.failed_oper_notice
},
2217 { "global_snotices", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.global_snotices
},
2218 { "hide_spoof_ips", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.hide_spoof_ips
},
2219 { "dline_with_reason", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.dline_with_reason
},
2220 { "kline_with_reason", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.kline_with_reason
},
2221 { "map_oper_only", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.map_oper_only
},
2222 { "max_accept", CF_INT
, NULL
, 0, &ConfigFileEntry
.max_accept
},
2223 { "max_monitor", CF_INT
, NULL
, 0, &ConfigFileEntry
.max_monitor
},
2224 { "max_nick_time", CF_TIME
, NULL
, 0, &ConfigFileEntry
.max_nick_time
},
2225 { "max_nick_changes", CF_INT
, NULL
, 0, &ConfigFileEntry
.max_nick_changes
},
2226 { "max_targets", CF_INT
, NULL
, 0, &ConfigFileEntry
.max_targets
},
2227 { "min_nonwildcard", CF_INT
, NULL
, 0, &ConfigFileEntry
.min_nonwildcard
},
2228 { "nick_delay", CF_TIME
, NULL
, 0, &ConfigFileEntry
.nick_delay
},
2229 { "no_oper_flood", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.no_oper_flood
},
2230 { "true_no_oper_flood", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.true_no_oper_flood
},
2231 { "operspy_admin_only", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.operspy_admin_only
},
2232 { "operspy_dont_care_user_info", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.operspy_dont_care_user_info
},
2233 { "secret_channels_in_whois", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.secret_channels_in_whois
},
2234 { "pace_wait", CF_TIME
, NULL
, 0, &ConfigFileEntry
.pace_wait
},
2235 { "pace_wait_simple", CF_TIME
, NULL
, 0, &ConfigFileEntry
.pace_wait_simple
},
2236 { "ping_cookie", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.ping_cookie
},
2237 { "reject_after_count", CF_INT
, NULL
, 0, &ConfigFileEntry
.reject_after_count
},
2238 { "reject_ban_time", CF_TIME
, NULL
, 0, &ConfigFileEntry
.reject_ban_time
},
2239 { "reject_duration", CF_TIME
, NULL
, 0, &ConfigFileEntry
.reject_duration
},
2240 { "throttle_count", CF_INT
, NULL
, 0, &ConfigFileEntry
.throttle_count
},
2241 { "throttle_duration", CF_TIME
, NULL
, 0, &ConfigFileEntry
.throttle_duration
},
2242 { "short_motd", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.short_motd
},
2243 { "stats_c_oper_only", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.stats_c_oper_only
},
2244 { "stats_e_disabled", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.stats_e_disabled
},
2245 { "stats_h_oper_only", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.stats_h_oper_only
},
2246 { "stats_o_oper_only", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.stats_o_oper_only
},
2247 { "stats_P_oper_only", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.stats_P_oper_only
},
2248 { "stats_y_oper_only", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.stats_y_oper_only
},
2249 { "target_change", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.target_change
},
2250 { "ts_max_delta", CF_TIME
, NULL
, 0, &ConfigFileEntry
.ts_max_delta
},
2251 { "use_egd", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.use_egd
},
2252 { "ts_warn_delta", CF_TIME
, NULL
, 0, &ConfigFileEntry
.ts_warn_delta
},
2253 { "use_whois_actually", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.use_whois_actually
},
2254 { "warn_no_nline", CF_YESNO
, NULL
, 0, &ConfigFileEntry
.warn_no_nline
},
2255 { "expire_override_time", CF_TIME
, NULL
, 0, &ConfigFileEntry
.expire_override_time
},
2256 { "\0", 0, NULL
, 0, NULL
}
2259 static struct ConfEntry conf_channel_table
[] =
2261 { "autochanmodes", CF_QSTRING
, NULL
, 0, &ConfigChannel
.autochanmodes
},
2262 { "exemptchanops", CF_QSTRING
, NULL
, 0, &ConfigChannel
.exemptchanops
},
2263 { "default_split_user_count", CF_INT
, NULL
, 0, &ConfigChannel
.default_split_user_count
},
2264 { "default_split_server_count", CF_INT
, NULL
, 0, &ConfigChannel
.default_split_server_count
},
2265 { "burst_topicwho", CF_YESNO
, NULL
, 0, &ConfigChannel
.burst_topicwho
},
2266 { "kick_on_split_riding", CF_YESNO
, NULL
, 0, &ConfigChannel
.kick_on_split_riding
},
2267 { "knock_delay", CF_TIME
, NULL
, 0, &ConfigChannel
.knock_delay
},
2268 { "knock_delay_channel",CF_TIME
, NULL
, 0, &ConfigChannel
.knock_delay_channel
},
2269 { "max_bans", CF_INT
, NULL
, 0, &ConfigChannel
.max_bans
},
2270 { "max_bans_large", CF_INT
, NULL
, 0, &ConfigChannel
.max_bans_large
},
2271 { "max_chans_per_user", CF_INT
, NULL
, 0, &ConfigChannel
.max_chans_per_user
},
2272 { "no_create_on_split", CF_YESNO
, NULL
, 0, &ConfigChannel
.no_create_on_split
},
2273 { "no_join_on_split", CF_YESNO
, NULL
, 0, &ConfigChannel
.no_join_on_split
},
2274 { "only_ascii_channels", CF_YESNO
, NULL
, 0, &ConfigChannel
.only_ascii_channels
},
2275 { "cycle_host_change", CF_YESNO
, NULL
, 0, &ConfigChannel
.cycle_host_change
},
2276 { "host_in_topic", CF_YESNO
, NULL
, 0, &ConfigChannel
.host_in_topic
},
2277 { "use_halfop", CF_YESNO
, NULL
, 0, &ConfigChannel
.use_halfop
},
2278 { "use_admin", CF_YESNO
, NULL
, 0, &ConfigChannel
.use_admin
},
2279 { "use_except", CF_YESNO
, NULL
, 0, &ConfigChannel
.use_except
},
2280 { "use_invex", CF_YESNO
, NULL
, 0, &ConfigChannel
.use_invex
},
2281 { "use_knock", CF_YESNO
, NULL
, 0, &ConfigChannel
.use_knock
},
2282 { "use_forward", CF_YESNO
, NULL
, 0, &ConfigChannel
.use_forward
},
2283 { "use_local_channels", CF_YESNO
, NULL
, 0, &ConfigChannel
.use_local_channels
},
2284 { "resv_forcepart", CF_YESNO
, NULL
, 0, &ConfigChannel
.resv_forcepart
},
2285 { "kick_no_rejoin_time", CF_TIME
, NULL
, 0, &ConfigChannel
.kick_no_rejoin_time
},
2286 { "exempt_cmode_c", CF_YESNO
, NULL
, 0, &ConfigChannel
.exempt_cmode_c
},
2287 { "exempt_cmode_C", CF_YESNO
, NULL
, 0, &ConfigChannel
.exempt_cmode_C
},
2288 { "exempt_cmode_D", CF_YESNO
, NULL
, 0, &ConfigChannel
.exempt_cmode_D
},
2289 { "exempt_cmode_T", CF_YESNO
, NULL
, 0, &ConfigChannel
.exempt_cmode_T
},
2290 { "exempt_cmode_N", CF_YESNO
, NULL
, 0, &ConfigChannel
.exempt_cmode_N
},
2291 { "exempt_cmode_G", CF_YESNO
, NULL
, 0, &ConfigChannel
.exempt_cmode_G
},
2292 { "exempt_cmode_K", CF_YESNO
, NULL
, 0, &ConfigChannel
.exempt_cmode_K
},
2293 { "\0", 0, NULL
, 0, NULL
}
2296 static struct ConfEntry conf_serverhide_table
[] =
2298 { "disable_hidden", CF_YESNO
, NULL
, 0, &ConfigServerHide
.disable_hidden
},
2299 { "flatten_links", CF_YESNO
, NULL
, 0, &ConfigServerHide
.flatten_links
},
2300 { "hidden", CF_YESNO
, NULL
, 0, &ConfigServerHide
.hidden
},
2301 { "links_delay", CF_TIME
, conf_set_serverhide_links_delay
, 0, NULL
},
2302 { "\0", 0, NULL
, 0, NULL
}
2309 add_top_conf("modules", NULL
, NULL
, NULL
);
2310 add_conf_item("modules", "path", CF_QSTRING
, conf_set_modules_path
);
2311 add_conf_item("modules", "module", CF_QSTRING
, conf_set_modules_module
);
2313 add_top_conf("serverinfo", NULL
, NULL
, conf_serverinfo_table
);
2314 add_top_conf("admin", NULL
, NULL
, conf_admin_table
);
2315 add_top_conf("log", NULL
, NULL
, conf_log_table
);
2316 add_top_conf("operator", conf_begin_oper
, conf_end_oper
, conf_operator_table
);
2317 add_top_conf("class", conf_begin_class
, conf_end_class
, conf_class_table
);
2318 add_top_conf("privset", NULL
, NULL
, conf_privset_table
);
2320 add_top_conf("listen", conf_begin_listen
, conf_end_listen
, NULL
);
2321 add_conf_item("listen", "port", CF_INT
| CF_FLIST
, conf_set_listen_port
);
2322 add_conf_item("listen", "sslport", CF_INT
| CF_FLIST
, conf_set_listen_sslport
);
2323 add_conf_item("listen", "ip", CF_QSTRING
, conf_set_listen_address
);
2324 add_conf_item("listen", "host", CF_QSTRING
, conf_set_listen_address
);
2326 add_top_conf("auth", conf_begin_auth
, conf_end_auth
, conf_auth_table
);
2328 add_top_conf("shared", conf_cleanup_shared
, conf_cleanup_shared
, NULL
);
2329 add_conf_item("shared", "oper", CF_QSTRING
|CF_FLIST
, conf_set_shared_oper
);
2330 add_conf_item("shared", "flags", CF_STRING
| CF_FLIST
, conf_set_shared_flags
);
2332 add_top_conf("connect", conf_begin_connect
, conf_end_connect
, conf_connect_table
);
2334 add_top_conf("exempt", NULL
, NULL
, NULL
);
2335 add_conf_item("exempt", "ip", CF_QSTRING
, conf_set_exempt_ip
);
2337 add_top_conf("cluster", conf_cleanup_cluster
, conf_cleanup_cluster
, NULL
);
2338 add_conf_item("cluster", "name", CF_QSTRING
, conf_set_cluster_name
);
2339 add_conf_item("cluster", "flags", CF_STRING
| CF_FLIST
, conf_set_cluster_flags
);
2341 add_top_conf("general", NULL
, NULL
, conf_general_table
);
2342 add_top_conf("channel", NULL
, NULL
, conf_channel_table
);
2343 add_top_conf("serverhide", NULL
, NULL
, conf_serverhide_table
);
2345 add_top_conf("service", conf_begin_service
, NULL
, NULL
);
2346 add_conf_item("service", "name", CF_QSTRING
, conf_set_service_name
);
2348 add_top_conf("alias", conf_begin_alias
, conf_end_alias
, NULL
);
2349 add_conf_item("alias", "name", CF_QSTRING
, conf_set_alias_name
);
2350 add_conf_item("alias", "target", CF_QSTRING
, conf_set_alias_target
);
2352 add_top_conf("blacklist", NULL
, NULL
, NULL
);
2353 add_conf_item("blacklist", "host", CF_QSTRING
, conf_set_blacklist_host
);
2354 add_conf_item("blacklist", "reject_reason", CF_QSTRING
, conf_set_blacklist_reason
);