#include "hostmask.h"
#include "modules.h"
#include "numeric.h"
-#include "s_log.h"
+#include "logger.h"
#include "send.h"
#include "s_gline.h"
-#include "patricia.h"
#include "reject.h"
#include "cache.h"
#include "blacklist.h"
+#include "sslproc.h"
struct config_server_hide ConfigServerHide;
void
init_s_conf(void)
{
- confitem_heap = rb_bh_create(sizeof(struct ConfItem), CONFITEM_HEAP_SIZE);
+ confitem_heap = rb_bh_create(sizeof(struct ConfItem), CONFITEM_HEAP_SIZE, "confitem_heap");
- eventAddIsh("expire_temp_klines", expire_temp_kd, &temp_klines[TEMP_MIN], 60);
- eventAddIsh("expire_temp_dlines", expire_temp_kd, &temp_dlines[TEMP_MIN], 60);
+ rb_event_addish("expire_temp_klines", expire_temp_kd, &temp_klines[TEMP_MIN], 60);
+ rb_event_addish("expire_temp_dlines", expire_temp_kd, &temp_dlines[TEMP_MIN], 60);
- eventAddIsh("expire_temp_klines_hour", reorganise_temp_kd,
+ rb_event_addish("expire_temp_klines_hour", reorganise_temp_kd,
&temp_klines[TEMP_HOUR], 3600);
- eventAddIsh("expire_temp_dlines_hour", reorganise_temp_kd,
+ rb_event_addish("expire_temp_dlines_hour", reorganise_temp_kd,
&temp_dlines[TEMP_HOUR], 3600);
- eventAddIsh("expire_temp_klines_day", reorganise_temp_kd,
+ rb_event_addish("expire_temp_klines_day", reorganise_temp_kd,
&temp_klines[TEMP_DAY], 86400);
- eventAddIsh("expire_temp_dlines_day", reorganise_temp_kd,
+ rb_event_addish("expire_temp_dlines_day", reorganise_temp_kd,
&temp_dlines[TEMP_DAY], 86400);
- eventAddIsh("expire_temp_klines_week", reorganise_temp_kd,
+ rb_event_addish("expire_temp_klines_week", reorganise_temp_kd,
&temp_klines[TEMP_WEEK], 604800);
- eventAddIsh("expire_temp_dlines_week", reorganise_temp_kd,
+ rb_event_addish("expire_temp_dlines_week", reorganise_temp_kd,
&temp_dlines[TEMP_WEEK], 604800);
}
source_p->name, IsGotId(source_p) ? "" : "~",
source_p->username, source_p->sockhost);
- ServerStats->is_ref++;
+ ServerStats.is_ref++;
exit_client(client_p, source_p, &me, "Too many host connections (local)");
break;
source_p->name, IsGotId(source_p) ? "" : "~",
source_p->username, source_p->sockhost);
- ServerStats->is_ref++;
+ ServerStats.is_ref++;
exit_client(client_p, source_p, &me, "Too many host connections (global)");
break;
source_p->name, IsGotId(source_p) ? "" : "~",
source_p->username, source_p->sockhost);
- ServerStats->is_ref++;
+ ServerStats.is_ref++;
exit_client(client_p, source_p, &me, "Too many user connections (global)");
break;
source_p->name, IsGotId(source_p) ? "" : "~",
source_p->username, source_p->sockhost);
- ServerStats->is_ref++;
+ ServerStats.is_ref++;
exit_client(client_p, source_p, &me,
"No more connections allowed in your connection class");
break;
case NOT_AUTHORISED:
{
int port = -1;
-#ifdef IPV6
+#ifdef RB_IPV6
if(source_p->localClient->ip.ss_family == AF_INET6)
port = ntohs(((struct sockaddr_in6 *)&source_p->localClient->listener->addr)->sin6_port);
else
#endif
port = ntohs(((struct sockaddr_in *)&source_p->localClient->listener->addr)->sin_port);
- ServerStats->is_ref++;
+ ServerStats.is_ref++;
/* jdc - lists server name & port connections are on */
/* a purely cosmetical change */
/* why ipaddr, and not just source_p->sockhost? --fl */
}
case BANNED_CLIENT:
exit_client(client_p, client_p, &me, "*** Banned ");
- ServerStats->is_ref++;
+ ServerStats.is_ref++;
break;
case 0:
static int
add_ip_limit(struct Client *client_p, struct ConfItem *aconf)
{
- patricia_node_t *pnode;
+ rb_patricia_node_t *pnode;
/* If the limits are 0 don't do anything.. */
if(ConfCidrAmount(aconf) == 0 || ConfCidrBitlen(aconf) == 0)
return -1;
- pnode = match_ip(ConfIpLimits(aconf), (struct sockaddr *)&client_p->localClient->ip);
+ pnode = rb_match_ip(ConfIpLimits(aconf), (struct sockaddr *)&client_p->localClient->ip);
if(pnode == NULL)
pnode = make_and_lookup_ip(ConfIpLimits(aconf), (struct sockaddr *)&client_p->localClient->ip, ConfCidrBitlen(aconf));
/* This should only happen if the limits are set to 0 */
if((unsigned long) pnode->data == 0)
{
- patricia_remove(ConfIpLimits(aconf), pnode);
+ rb_patricia_remove(ConfIpLimits(aconf), pnode);
}
return (0);
}
static void
remove_ip_limit(struct Client *client_p, struct ConfItem *aconf)
{
- patricia_node_t *pnode;
+ rb_patricia_node_t *pnode;
/* If the limits are 0 don't do anything.. */
if(ConfCidrAmount(aconf) == 0 || ConfCidrBitlen(aconf) == 0)
return;
- pnode = match_ip(ConfIpLimits(aconf), (struct sockaddr *)&client_p->localClient->ip);
+ pnode = rb_match_ip(ConfIpLimits(aconf), (struct sockaddr *)&client_p->localClient->ip);
if(pnode == NULL)
return;
pnode->data--;
if(((unsigned long) pnode->data) == 0)
{
- patricia_remove(ConfIpLimits(aconf), pnode);
+ rb_patricia_remove(ConfIpLimits(aconf), pnode);
}
}
memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip));
ServerInfo.specific_ipv4_vhost = 0;
-#ifdef IPV6
+#ifdef RB_IPV6
memset(&ServerInfo.ip6, 0, sizeof(ServerInfo.ip6));
ServerInfo.specific_ipv6_vhost = 0;
#endif
ConfigFileEntry.reject_duration = 120;
ConfigFileEntry.max_unknown_ip = 2;
- ServerInfo.max_clients = rb_get_maxconnections() - MAX_BUFFER;
+ ServerInfo.default_max_clients = MAXCONNECTIONS;
}
#undef YES
if(ServerInfo.network_desc == NULL)
ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT);
+ if(ServerInfo.ssld_count < 1)\r
+ ServerInfo.ssld_count = 1;
+
+ if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params))\r
+ {\r
+ ilog(L_MAIN, "WARNING: Unable to setup SSL.");\r
+ ssl_ok = 0;\r
+ } else {\r
+ ssl_ok = 1;\r
+ send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);\r
+ }\r
+\r
+ if(ServerInfo.ssld_count > get_ssld_count())\r
+ {\r
+ int start = ServerInfo.ssld_count - get_ssld_count();\r
+ /* start up additional ssld if needed */\r
+ start_ssldaemon(start, ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);\r
+ \r
+ }
+
if((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) ||
(ConfigFileEntry.client_flood > CLIENT_FLOOD_MAX))
ConfigFileEntry.client_flood = CLIENT_FLOOD_MAX;
if(!split_users || !split_servers ||
(!ConfigChannel.no_create_on_split && !ConfigChannel.no_join_on_split))
{
- eventDelete(check_splitmode, NULL);
+ rb_event_delete(check_splitmode_ev);
+ check_splitmode_ev = NULL;
splitmode = 0;
splitchecking = 0;
}
rb_free(ServerInfo.network_desc);
ServerInfo.network_desc = NULL;
+ ServerInfo.ssld_count = 1;
+
/* clean out AdminInfo */
rb_free(AdminInfo.name);
AdminInfo.name = NULL;