#include "channel.h"
#include "class.h"
#include "client.h"
-#include "common.h"
#include "hash.h"
#include "match.h"
#include "ircd.h"
#include "send.h"
#include "reject.h"
#include "cache.h"
-#include "blacklist.h"
#include "privilege.h"
#include "sslproc.h"
+#include "wsproc.h"
#include "bandbi.h"
#include "operhash.h"
#include "chmode.h"
#include "hook.h"
#include "s_assert.h"
-#include "authd.h"
+#include "authproc.h"
struct config_server_hide ConfigServerHide;
* inputs - pointer to client
* output - 0 = Success
* NOT_AUTHORISED (-1) = Access denied (no I line match)
- * SOCKET_ERROR (-2) = Bad socket.
+ * I_SOCKET_ERROR (-2) = Bad socket.
* I_LINE_FULL (-3) = I-line is full
* TOO_MANY (-4) = Too many connections from hostname
* BANNED_CLIENT (-5) = K-lined
switch (i)
{
- case SOCKET_ERROR:
+ case I_SOCKET_ERROR:
exit_client(client_p, source_p, &me, "Socket Error");
break;
case NOT_AUTHORISED:
{
int port = -1;
-#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);
+ port = ntohs(GET_SS_PORT(&source_p->localClient->listener->addr));
ServerStats.is_ref++;
/* jdc - lists server name & port connections are on */
aconf = find_address_conf(client_p->host, client_p->sockhost,
client_p->username, client_p->username,
(struct sockaddr *) &client_p->localClient->ip,
- client_p->localClient->ip.ss_family,
+ GET_SS_FAMILY(&client_p->localClient->ip),
client_p->localClient->auth_user);
}
else
aconf = find_address_conf(client_p->host, client_p->sockhost,
non_ident, client_p->username,
(struct sockaddr *) &client_p->localClient->ip,
- client_p->localClient->ip.ss_family,
+ GET_SS_FAMILY(&client_p->localClient->ip),
client_p->localClient->auth_user);
}
return aconf;
* as a result of an operator issuing this command, else assume it has been
* called as a result of the server receiving a HUP signal.
*/
-int
-rehash(int sig)
+bool
+rehash(bool sig)
{
- if(sig != 0)
+ if(sig)
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Got signal SIGHUP, reloading ircd conf. file");
rehash_authd();
/* don't close listeners until we know we can go ahead with the rehash */
- read_conf_files(NO);
+ read_conf_files(false);
if(ServerInfo.description != NULL)
rb_strlcpy(me.info, ServerInfo.description, sizeof(me.info));
rb_strlcpy(me.info, "unknown", sizeof(me.info));
open_logfiles();
- return (0);
+ return false;
}
void
-rehash_bans(int sig)
+rehash_bans(void)
{
bandb_rehash_bans();
}
ServerInfo.specific_ipv6_vhost = 0;
#endif
- /* Don't reset hub, as that will break lazylinks */
- /* ServerInfo.hub = false; */
AdminInfo.name = NULL;
AdminInfo.email = NULL;
AdminInfo.description = NULL;
if(ServerInfo.ssld_count < 1)
ServerInfo.ssld_count = 1;
+ /* XXX: configurable? */
+ ServerInfo.wsockd_count = 1;
+
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
{
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
start_ssldaemon(start, ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list);
}
+ if(ServerInfo.wsockd_count > get_wsockd_count())
+ {
+ int start = ServerInfo.wsockd_count - get_wsockd_count();
+ start_wsockd(start);
+ }
+
/* General conf */
if (ConfigFileEntry.default_operstring == NULL)
ConfigFileEntry.default_operstring = rb_strdup("is an IRC operator");
* free an alias{} entry.
*/
static void
-free_alias_cb(struct DictionaryElement *ptr, void *unused)
+free_alias_cb(rb_dictionary_element *ptr, void *unused)
{
struct alias_entry *aptr = ptr->data;
alias_dict = NULL;
}
- destroy_blacklists();
+ del_blacklist_all();
privilegeset_mark_all_illegal();