send_password = "password";
accept_password = "anotherpassword";
port = 6666;
- hub_mask = "*";
class = "server";
flags = compressed, topicburst;
send_password = "password";
accept_password = "anotherpassword";
port = 9999;
- hub_mask = "*";
class = "server";
flags = ssl, topicburst;
};
use_propagated_bans = yes;
stats_e_disabled = no;
stats_c_oper_only = no;
- stats_h_oper_only = no;
stats_y_oper_only = no;
stats_o_oper_only = yes;
stats_P_oper_only = no;
/* port: the port to connect to this server on */
port = 6666;
- /* hub mask: the mask of servers that this server may hub. Multiple
- * entries are permitted
- */
- hub_mask = "*";
-
- /* leaf mask: the mask of servers this server may not hub. Multiple
- * entries are permitted. Useful for forbidding EU -> US -> EU routes.
- */
- #leaf_mask = "*.uk";
-
/* class: the class this server is in */
class = "server";
send_password = "password";
accept_password = "anotherpassword";
port = 9999;
- hub_mask = "*";
class = "server";
flags = ssl, topicburst;
};
/* stats c oper only: make stats c (connect {}) oper only */
stats_c_oper_only = no;
- /* stats h oper only: make stats h (hub_mask/leaf_mask) oper only */
- stats_h_oper_only = no;
-
/* stats y oper only: make stats y (class {}) oper only */
stats_y_oper_only = no;
X E - Shows Events
X f - Shows File Descriptors
* g - Shows global K lines
-^ h - Shows hub_mask/leaf_mask (Old H:/L: lines)
^ i - Shows auth blocks (Old I: lines)
^ K - Shows K lines (or matched klines)
^ k - Shows temporary K lines (or matched klines)
LETTER
------ (^ = Can be configured to be oper only.)
^ c - Shows connect blocks
-^ h - Shows hub_mask/leaf_mask (Old H:/L: lines)
^ i - Shows auth blocks (or matched auth block)
^ K - Shows K lines (or matched klines)
^ k - Shows temporary K lines (or matched klines)
int stats_e_disabled;
int stats_c_oper_only;
int stats_y_oper_only;
- int stats_h_oper_only;
int stats_o_oper_only;
int stats_k_oper_only;
enum stats_l_oper_only stats_l_oper_only;
char sid[4];
char *description;
char *network_name;
- int hub;
struct rb_sockaddr_storage bind4;
struct rb_sockaddr_storage bind6;
int default_max_clients;
extern rb_dlink_list cluster_conf_list;
extern rb_dlink_list oper_conf_list;
-extern rb_dlink_list hubleaf_conf_list;
extern rb_dlink_list server_conf_list;
extern rb_dlink_list xline_conf_list;
extern rb_dlink_list resv_conf_list;
void add_tgchange(const char *host);
tgchange *find_tgchange(const char *host);
-/* shared/cluster/hub/leaf confs */
+/* cluster confs */
struct remote_conf
{
char *username;
SHARED_TRESV | SHARED_PRESV | SHARED_UNRESV | SHARED_GRANT)
#define CLUSTER_ALL (SHARED_ALL | SHARED_LOCOPS)
-/* flags used in hub/leaf */
-#define CONF_HUB 0x0001
-#define CONF_LEAF 0x0002
-
struct oper_conf
{
char *name;
set_modes_from_table(&yy_server->flags, "flag", connect_table, args);
}
-static void
-conf_set_connect_hub_mask(void *data)
-{
- struct remote_conf *yy_hub;
-
- if(EmptyString(yy_server->name))
- return;
-
- yy_hub = make_remote_conf();
- yy_hub->flags = CONF_HUB;
-
- yy_hub->host = rb_strdup(data);
- yy_hub->server = rb_strdup(yy_server->name);
- rb_dlinkAdd(yy_hub, &yy_hub->node, &hubleaf_conf_list);
-}
-
-static void
-conf_set_connect_leaf_mask(void *data)
-{
- struct remote_conf *yy_leaf;
-
- if(EmptyString(yy_server->name))
- return;
-
- yy_leaf = make_remote_conf();
- yy_leaf->flags = CONF_LEAF;
-
- yy_leaf->host = rb_strdup(data);
- yy_leaf->server = rb_strdup(yy_server->name);
- rb_dlinkAdd(yy_leaf, &yy_leaf->node, &hubleaf_conf_list);
-}
-
static void
conf_set_connect_class(void *data)
{
{ "vhost", CF_QSTRING, conf_set_connect_vhost, 0, NULL },
{ "port", CF_INT, conf_set_connect_port, 0, NULL },
{ "aftype", CF_STRING, conf_set_connect_aftype, 0, NULL },
- { "hub_mask", CF_QSTRING, conf_set_connect_hub_mask, 0, NULL },
- { "leaf_mask", CF_QSTRING, conf_set_connect_leaf_mask, 0, NULL },
{ "class", CF_QSTRING, conf_set_connect_class, 0, NULL },
{ "\0", 0, NULL, 0, NULL }
};
{ "short_motd", CF_YESNO, NULL, 0, &ConfigFileEntry.short_motd },
{ "stats_c_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_c_oper_only },
{ "stats_e_disabled", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_e_disabled },
- { "stats_h_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_h_oper_only },
{ "stats_o_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_o_oper_only },
{ "stats_P_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_P_oper_only },
{ "stats_y_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_y_oper_only },
ConfigFileEntry.stats_P_oper_only = false;
ConfigFileEntry.stats_c_oper_only = false;
ConfigFileEntry.stats_y_oper_only = false;
- ConfigFileEntry.stats_h_oper_only = false;
ConfigFileEntry.map_oper_only = true;
ConfigFileEntry.operspy_admin_only = false;
ConfigFileEntry.pace_wait = 10;
rb_dlink_list cluster_conf_list;
rb_dlink_list oper_conf_list;
-rb_dlink_list hubleaf_conf_list;
rb_dlink_list server_conf_list;
rb_dlink_list xline_conf_list;
rb_dlink_list resv_conf_list; /* nicks only! */
free_remote_conf(ptr->data);
}
- RB_DLINK_FOREACH_SAFE(ptr, next_ptr, hubleaf_conf_list.head)
- {
- rb_dlinkDelete(ptr, &hubleaf_conf_list);
- free_remote_conf(ptr->data);
- }
-
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, oper_conf_list.head)
{
free_oper_conf(ptr->data);
/* same size as in s_misc.c */
const char *name;
struct Client *target_p;
- struct remote_conf *hub_p;
hook_data_client hdata;
int hop;
- int hlined = 0;
- int llined = 0;
- rb_dlink_node *ptr;
char squitreason[160];
name = parv[1];
* server links...
*/
- /*
- * See if the newly found server is behind a guaranteed
- * leaf. If so, close the link.
- *
- */
- RB_DLINK_FOREACH(ptr, hubleaf_conf_list.head)
- {
- hub_p = ptr->data;
-
- if(match(hub_p->server, client_p->name) && match(hub_p->host, name))
- {
- if(hub_p->flags & CONF_HUB)
- hlined++;
- else
- llined++;
- }
- }
-
- /* Ok, this way this works is
- *
- * A server can have a CONF_HUB allowing it to introduce servers
- * behind it.
- *
- * connect {
- * name = "irc.bighub.net";
- * hub_mask="*";
- * ...
- *
- * That would allow "irc.bighub.net" to introduce anything it wanted..
- *
- * However
- *
- * connect {
- * name = "irc.somehub.fi";
- * hub_mask="*";
- * leaf_mask="*.edu";
- *...
- * Would allow this server in finland to hub anything but
- * .edu's
- */
-
- /* Ok, check client_p can hub the new server */
- if(!hlined)
- {
- /* OOOPs nope can't HUB */
- sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Non-Hub link %s introduced %s.",
- client_p->name, name);
- ilog(L_SERVER, "Non-Hub link %s introduced %s.",
- client_p->name, name);
-
- snprintf(squitreason, sizeof squitreason,
- "No matching hub_mask for %s",
- name);
- exit_client(NULL, client_p, &me, squitreason);
- return;
- }
-
- /* Check for the new server being leafed behind this HUB */
- if(llined)
- {
- /* OOOPs nope can't HUB this leaf */
- sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
- "Link %s introduced leafed server %s.",
- client_p->name, name);
- ilog(L_SERVER, "Link %s introduced leafed server %s.",
- client_p->name, name);
-
- snprintf(squitreason, sizeof squitreason,
- "Matching leaf_mask for %s",
- name);
- exit_client(NULL, client_p, &me, squitreason);
- return;
- }
-
-
-
if(strlen(name) > HOSTLEN)
{
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
ms_sid(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p;
- struct remote_conf *hub_p;
hook_data_client hdata;
- rb_dlink_node *ptr;
- int hlined = 0;
- int llined = 0;
char squitreason[160];
/* collision on the name? */
return;
}
- /* for the directly connected server:
- * H: allows it to introduce a server matching that mask
- * L: disallows it introducing a server matching that mask
- */
- RB_DLINK_FOREACH(ptr, hubleaf_conf_list.head)
- {
- hub_p = ptr->data;
-
- if(match(hub_p->server, client_p->name) && match(hub_p->host, parv[1]))
- {
- if(hub_p->flags & CONF_HUB)
- hlined++;
- else
- llined++;
- }
- }
-
- /* no matching hub_mask */
- if(!hlined)
- {
- sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
- "Non-Hub link %s introduced %s.",
- client_p->name, parv[1]);
- ilog(L_SERVER, "Non-Hub link %s introduced %s.",
- client_p->name, parv[1]);
-
- snprintf(squitreason, sizeof squitreason,
- "No matching hub_mask for %s",
- parv[1]);
- exit_client(NULL, client_p, &me, squitreason);
- return;
- }
-
- /* matching leaf_mask */
- if(llined)
- {
- sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
- "Link %s introduced leafed server %s.",
- client_p->name, parv[1]);
- ilog(L_SERVER, "Link %s introduced leafed server %s.",
- client_p->name, parv[1]);
-
- snprintf(squitreason, sizeof squitreason,
- "Matching leaf_mask for %s",
- parv[1]);
- exit_client(NULL, client_p, &me, squitreason);
- return;
- }
-
/* ok, alls good */
target_p = make_client(client_p);
make_server(target_p);
"STATS C output is only shown to operators",
INFO_INTBOOL_YN(&ConfigFileEntry.stats_c_oper_only),
},
- {
- "stats_h_oper_only",
- "STATS H output is only shown to operators",
- INFO_INTBOOL_YN(&ConfigFileEntry.stats_h_oper_only),
- },
{
"stats_i_oper_only",
"STATS I output is only shown to operators",
static void stats_exempt(struct Client *);
static void stats_events(struct Client *);
static void stats_prop_klines(struct Client *);
-static void stats_hubleaf(struct Client *);
static void stats_auth(struct Client *);
static void stats_tklines(struct Client *);
static void stats_klines(struct Client *);
['f'] = HANDLER_NORM(stats_comm, true, NULL),
['F'] = HANDLER_NORM(stats_comm, true, NULL),
['g'] = HANDLER_NORM(stats_prop_klines, false, "oper:general"),
- ['h'] = HANDLER_NORM(stats_hubleaf, false, NULL),
- ['H'] = HANDLER_NORM(stats_hubleaf, false, NULL),
['i'] = HANDLER_NORM(stats_auth, false, NULL),
['I'] = HANDLER_NORM(stats_auth, false, NULL),
['k'] = HANDLER_NORM(stats_tklines, false, NULL),
}
}
-static void
-stats_hubleaf(struct Client *source_p)
-{
- struct remote_conf *hub_p;
- rb_dlink_node *ptr;
-
- if((ConfigFileEntry.stats_h_oper_only ||
- (ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
- !IsOperGeneral(source_p))
- {
- sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
- form_str (ERR_NOPRIVILEGES));
- return;
- }
-
- RB_DLINK_FOREACH(ptr, hubleaf_conf_list.head)
- {
- hub_p = ptr->data;
-
- if(hub_p->flags & CONF_HUB)
- sendto_one_numeric(source_p, RPL_STATSHLINE,
- form_str(RPL_STATSHLINE),
- hub_p->host, hub_p->server);
- else
- sendto_one_numeric(source_p, RPL_STATSLLINE,
- form_str(RPL_STATSLLINE),
- hub_p->host, hub_p->server);
- }
-}
-
-
static void
stats_auth (struct Client *source_p)
{
sid = "1TT";
description = "Testsuite";
network_name = "Testsuite";
- hub = yes;
vhost = "127.0.0.1";
};
port = 7602;
send_password = "testsuite";
accept_password = "testsuite";
- hub_mask = "*";
class = "server";
flags = topicburst;
};
port = 7603;
send_password = "testsuite";
accept_password = "testsuite";
- hub_mask = "*";
class = "server";
flags = topicburst;
};
sid = "2TT";
description = "Testsuite";
network_name = "Testsuite";
- hub = yes;
vhost = "127.0.0.1";
};
port = 7601;
send_password = "testsuite";
accept_password = "testsuite";
- hub_mask = "*";
class = "server";
flags = topicburst;
};
port = 7603;
send_password = "testsuite";
accept_password = "testsuite";
- hub_mask = "*";
class = "server";
flags = topicburst;
};
sid = "3TT";
description = "Testsuite";
network_name = "Testsuite";
- hub = yes;
vhost = "127.0.0.1";
};
port = 7601;
send_password = "testsuite";
accept_password = "testsuite";
- hub_mask = "*";
class = "server";
flags = topicburst;
};
port = 7602;
send_password = "testsuite";
accept_password = "testsuite";
- hub_mask = "*";
class = "server";
flags = topicburst;
};