static rb_dlink_list yy_aconf_list;
static rb_dlink_list yy_oper_list;
-static rb_dlink_list yy_shared_list;
static rb_dlink_list yy_cluster_list;
static struct oper_conf *yy_oper = NULL;
{ "all", CLUSTER_ALL },
{NULL, 0}
};
-
-static struct mode_table shared_table[] =
-{
- { "kline", SHARED_PKLINE|SHARED_TKLINE },
- { "xline", SHARED_PXLINE|SHARED_TXLINE },
- { "resv", SHARED_PRESV|SHARED_TRESV },
- { "dline", SHARED_PDLINE|SHARED_TDLINE },
- { "tdline", SHARED_TDLINE },
- { "pdline", SHARED_PDLINE },
- { "undline", SHARED_UNDLINE },
- { "tkline", SHARED_TKLINE },
- { "unkline", SHARED_UNKLINE },
- { "txline", SHARED_TXLINE },
- { "unxline", SHARED_UNXLINE },
- { "tresv", SHARED_TRESV },
- { "unresv", SHARED_UNRESV },
- { "locops", SHARED_LOCOPS },
- { "rehash", SHARED_REHASH },
- { "grant", SHARED_GRANT },
- { "die", SHARED_DIE },
- { "module", SHARED_MODULE },
- { "all", SHARED_ALL },
- { "none", 0 },
- {NULL, 0}
-};
/* *INDENT-ON* */
static int
yy_aconf->className = rb_strdup(data);
}
-/* ok, shared_oper handles the stacking, shared_flags handles adding
- * things.. so all we need to do when we start and end a shared block, is
- * clean up anything thats been left over.
- */
-static int
-conf_cleanup_shared(struct TopConf *tc)
-{
- rb_dlink_node *ptr, *next_ptr;
-
- RB_DLINK_FOREACH_SAFE(ptr, next_ptr, yy_shared_list.head)
- {
- free_remote_conf(ptr->data);
- rb_dlinkDestroy(ptr, &yy_shared_list);
- }
-
- if(yy_shared != NULL)
- {
- free_remote_conf(yy_shared);
- yy_shared = NULL;
- }
-
- return 0;
-}
-
-static void
-conf_set_shared_oper(void *data)
-{
- conf_parm_t *args = data;
- const char *username;
- char *p;
-
- if(yy_shared != NULL)
- free_remote_conf(yy_shared);
-
- yy_shared = make_remote_conf();
-
- if(args->next != NULL)
- {
- if(CF_TYPE(args->type) != CF_QSTRING)
- {
- conf_report_error("Ignoring shared::oper -- server is not a qstring");
- return;
- }
-
- yy_shared->server = rb_strdup(args->v.string);
- args = args->next;
- }
- else
- yy_shared->server = rb_strdup("*");
-
- if(CF_TYPE(args->type) != CF_QSTRING)
- {
- conf_report_error("Ignoring shared::oper -- oper is not a qstring");
- return;
- }
-
- if((p = strchr(args->v.string, '@')) == NULL)
- {
- conf_report_error("Ignoring shard::oper -- oper is not a user@host");
- return;
- }
-
- username = args->v.string;
- *p++ = '\0';
-
- if(EmptyString(p))
- yy_shared->host = rb_strdup("*");
- else
- yy_shared->host = rb_strdup(p);
-
- if(EmptyString(username))
- yy_shared->username = rb_strdup("*");
- else
- yy_shared->username = rb_strdup(username);
-
- rb_dlinkAddAlloc(yy_shared, &yy_shared_list);
- yy_shared = NULL;
-}
-
-static void
-conf_set_shared_flags(void *data)
-{
- conf_parm_t *args = data;
- int flags = 0;
- rb_dlink_node *ptr, *next_ptr;
-
- if(yy_shared != NULL)
- free_remote_conf(yy_shared);
-
- set_modes_from_table(&flags, "flag", shared_table, args);
-
- RB_DLINK_FOREACH_SAFE(ptr, next_ptr, yy_shared_list.head)
- {
- yy_shared = ptr->data;
-
- yy_shared->flags = flags;
- rb_dlinkDestroy(ptr, &yy_shared_list);
- rb_dlinkAddTail(yy_shared, &yy_shared->node, &shared_conf_list);
- }
-
- yy_shared = NULL;
-}
-
static int
conf_begin_connect(struct TopConf *tc)
{
add_conf_by_address(yy_tmp->host, CONF_EXEMPTDLINE, NULL, NULL, yy_tmp);
}
+static void
+conf_set_secure_ip(void *data)
+{
+ struct ConfItem *yy_tmp;
+ int masktype = parse_netmask_strict(data, NULL, NULL);
+
+ if(masktype != HM_IPV4 && masktype != HM_IPV6)
+ {
+ conf_report_error("Ignoring secure -- invalid secure::ip.");
+ return;
+ }
+
+ yy_tmp = make_conf();
+ yy_tmp->passwd = rb_strdup("*");
+ yy_tmp->host = rb_strdup(data);
+ yy_tmp->status = CONF_SECURE;
+ add_conf_by_address(yy_tmp->host, CONF_SECURE, NULL, NULL, yy_tmp);
+}
+
static int
conf_cleanup_cluster(struct TopConf *tc)
{
conf_report_error("Invalid setting '%s' for general::stats_i_oper_only.", val);
}
+static void
+conf_set_general_stats_l_oper_only(void *data)
+{
+ char *val = data;
+
+ if(rb_strcasecmp(val, "yes") == 0)
+ ConfigFileEntry.stats_l_oper_only = STATS_L_OPER_ONLY_YES;
+ else if(rb_strcasecmp(val, "self") == 0)
+ ConfigFileEntry.stats_l_oper_only = STATS_L_OPER_ONLY_SELF;
+ else if(rb_strcasecmp(val, "no") == 0)
+ ConfigFileEntry.stats_l_oper_only = STATS_L_OPER_ONLY_NO;
+ else
+ conf_report_error("Invalid setting '%s' for general::stats_l_oper_only.", val);
+}
+
static void
conf_set_general_compression_level(void *data)
{
}
}
+static void
+conf_set_general_hidden_caps(void *data)
+{
+ size_t n = 0;
+
+ for (conf_parm_t *arg = data; arg; arg = arg->next)
+ n += 1;
+
+ if (ConfigFileEntry.hidden_caps != NULL)
+ {
+ for (n = 0; ConfigFileEntry.hidden_caps[n] != NULL; n++)
+ rb_free(ConfigFileEntry.hidden_caps[n]);
+ rb_free(ConfigFileEntry.hidden_caps);
+ }
+ ConfigFileEntry.hidden_caps = rb_malloc(sizeof *ConfigFileEntry.hidden_caps * (n + 1));
+
+ n = 0;
+ for (conf_parm_t *arg = data; arg; arg = arg->next)
+ {
+ ConfigFileEntry.hidden_caps[n++] = rb_strdup(arg->v.string);
+ }
+ ConfigFileEntry.hidden_caps[n] = NULL;
+}
+
static void
conf_set_serverhide_links_delay(void *data)
{
}
ierror("\"%s\", line %d: %s", current_file, lineno + 1, msg);
- sendto_realops_snomask(SNO_GENERAL, L_ALL, "error: \"%s\", line %d: %s", current_file, lineno + 1, msg);
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "error: \"%s\", line %d: %s", current_file, lineno + 1, msg);
}
void
}
iwarn("\"%s\", line %d: %s", current_file, lineno + 1, msg);
- sendto_realops_snomask(SNO_GENERAL, L_ALL, "warning: \"%s\", line %d: %s", current_file, lineno + 1, msg);
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "warning: \"%s\", line %d: %s", current_file, lineno + 1, msg);
}
int
{ "compression_level", CF_INT, conf_set_general_compression_level, 0, NULL },
{ "havent_read_conf", CF_YESNO, conf_set_general_havent_read_conf, 0, NULL },
{ "hide_error_messages",CF_STRING, conf_set_general_hide_error_messages,0, NULL },
- { "stats_k_oper_only", CF_STRING, conf_set_general_stats_k_oper_only, 0, NULL },
{ "stats_i_oper_only", CF_STRING, conf_set_general_stats_i_oper_only, 0, NULL },
+ { "stats_k_oper_only", CF_STRING, conf_set_general_stats_k_oper_only, 0, NULL },
+ { "stats_l_oper_only", CF_STRING, conf_set_general_stats_l_oper_only, 0, NULL },
{ "default_umodes", CF_QSTRING, conf_set_general_default_umodes, 0, NULL },
{ "default_operstring", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.default_operstring },
{ "non_redundant_klines", CF_YESNO, NULL, 0, &ConfigFileEntry.non_redundant_klines },
{ "tkline_expire_notices", CF_YESNO, NULL, 0, &ConfigFileEntry.tkline_expire_notices },
+ { "hidden_caps", CF_QSTRING | CF_FLIST, conf_set_general_hidden_caps, 0, NULL },
+
{ "anti_nick_flood", CF_YESNO, NULL, 0, &ConfigFileEntry.anti_nick_flood },
{ "burst_away", CF_YESNO, NULL, 0, &ConfigFileEntry.burst_away },
{ "caller_id_wait", CF_TIME, NULL, 0, &ConfigFileEntry.caller_id_wait },
add_top_conf("auth", conf_begin_auth, conf_end_auth, conf_auth_table);
- add_top_conf("shared", conf_cleanup_shared, conf_cleanup_shared, NULL);
- add_conf_item("shared", "oper", CF_QSTRING | CF_FLIST, conf_set_shared_oper);
- add_conf_item("shared", "flags", CF_STRING | CF_FLIST, conf_set_shared_flags);
-
add_top_conf("connect", conf_begin_connect, conf_end_connect, conf_connect_table);
add_top_conf("exempt", NULL, NULL, NULL);
add_conf_item("exempt", "ip", CF_QSTRING, conf_set_exempt_ip);
+ add_top_conf("secure", NULL, NULL, NULL);
+ add_conf_item("secure", "ip", CF_QSTRING, conf_set_secure_ip);
+
add_top_conf("cluster", conf_cleanup_cluster, conf_cleanup_cluster, NULL);
add_conf_item("cluster", "name", CF_QSTRING, conf_set_cluster_name);
add_conf_item("cluster", "flags", CF_STRING | CF_FLIST, conf_set_cluster_flags);