#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"
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");
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);
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
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(!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;
}
*port = (int) aconf->port;
}
-void\r
-get_printable_kline(struct Client *source_p, struct ConfItem *aconf, \r
- const char **host, const char **reason,\r
- const char **user, const char **oper_reason)\r
-{\r
- static const char *null = "<NULL>";\r
-\r
- *host = EmptyString(aconf->host) ? null : aconf->host;\r
- *reason = EmptyString(aconf->passwd) ? null : aconf->passwd;\r
- *user = EmptyString(aconf->user) ? null : aconf->user;\r
-\r
- if(EmptyString(aconf->spasswd) || !IsOper(source_p))\r
- *oper_reason = NULL;\r
- else\r
- *oper_reason = aconf->spasswd;\r
+void
+get_printable_kline(struct Client *source_p, struct ConfItem *aconf,
+ char **host, char **reason,
+ char **user, char **oper_reason)
+{
+ static char null[] = "<NULL>";
+
+ *host = EmptyString(aconf->host) ? null : aconf->host;
+ *reason = EmptyString(aconf->passwd) ? null : aconf->passwd;
+ *user = EmptyString(aconf->user) ? null : aconf->user;
+
+ if(EmptyString(aconf->spasswd) || !IsOper(source_p))
+ *oper_reason = NULL;
+ else
+ *oper_reason = aconf->spasswd;
}
/*