+2000-12-19 Kevin L. Mitchell <klmitch@mit.edu>
+
+ * ircd/m_ison.c (m_ison): Dianora says that ISON has to end with a
+ space (*sigh* stupid clients...)
+
+ * ircd/s_user.c: make WALLOPS_OPER_ONLY a feature managed through
+ ircd_features.[ch]
+
+ * ircd/s_err.c: get rid of GODMODE conditionals
+
+ * ircd/s_debug.c (debug_serveropts): switch to using appropriate
+ calls into the features subsystem for various serveropts
+ characters
+
+ * ircd/s_conf.c (find_conf_entry): get rid of USEONE conditional
+
+ * ircd/s_bsd.c: remove GODMODE conditional; use features subsystem
+ to get value of VIRTUAL_HOST and CLIENT_FLOOD; remove
+ NOFLOWCONTROL conditional
+
+ * ircd/s_auth.c: use features subsystem to determine value of
+ KILL_IPMISMATCH
+
+ * ircd/parse.c: get rid of NOOPER and GODMODE conditionals; use
+ features subsystem to determine the setting of IDLE_FROM_MSG
+
+ * ircd/numnicks.c: get rid of EXTENDED_NUMERICS conditionals
+
+ * ircd/motd.c: get value of NODEFAULTMOTD from features subsystem;
+ use features subsystem to get motd file names
+
+ * ircd/m_settime.c: get value of RELIABLE_CLOCK from features
+ subsystem
+
+ * ircd/m_server.c: get rid of CRYPT_LINK_PASSWORD, since it does
+ us no good; use features subsystem to figure out if we need to do
+ HUB-type stuff; make TESTNET debugging sendto_opmask_butone's use
+ the Debug(()) macro instead; get value of RELIABLE_CLOCK from
+ features subsystem
+
+ * ircd/m_privmsg.c: get IDLE_FROM_MSG from the features subsystem
+
+ * ircd/m_oper.c: get CRYPT_OPER_PASSWORD from the features
+ subsystem
+
+ * ircd/m_connect.c: get SERVER_PORT from the features subsystem
+
+ * ircd/ircd_log.c (log_set_file): fix a bug that kept log files
+ from getting marked if they were already set to something...
+
+ * ircd/ircd_features.c: add a flag to indicates read-only access;
+ add several new features that used to be compile-time selected
+
+ * ircd/ircd.c: grab pidfile out of feature subsystem; don't check
+ access to motd files (what the heck?); make sure to initialize the
+ feature subsystem before trying to write the config file
+
+ * ircd/dbuf.c: use feature_int() to retrieve BUFFERPOOL settings;
+ use feature_bool() to figure out if we're using the FERGUSON
+ flusher
+
+ * ircd/Makefile.in: MPATH and RPATH are now done differently, so
+ remove the clause that creates empty files of that name; also ran
+ make depend
+
+ * include/sys.h: CLIENT_FLOOD is now a feature; unfortunately,
+ there is no easy way to bounds-check it at present
+
+ * include/querycmds.h: make sure ircd_features.h is included; use
+ feature_str(FEAT_DOMAINNAME) in calls to match()
+
+ * include/ircd_features.h: many new features that used to be
+ compile-time selected
+
+ * config/config-sh.in: add * to DOMAINNAME; try also using first
+ argument to search in /etc/resolv.conf; removed many compile-time
+ options that now can be configured through the features system
+
2000-12-18 Kevin L. Mitchell <klmitch@mit.edu>
* doc/api/log.txt: how to use the logging API
mainmenu_option next_comment
comment 'Host specific defines'
if [ -f /etc/resolv.conf ]; then
- DOMAINNAME_DEFAULT="`awk '/^domain/ { print $2; exit }' /etc/resolv.conf`"
+ DOMAINNAME_DEFAULT="`awk '/^domain/ { print "*" $2; exit }' /etc/resolv.conf`"
fi
- string 'What is the domain name of your network' DOMAINNAME $DOMAINNAME_DEFAULT
- if [ -z "$DOMAINNAME" ]; then
- DOMAINNAME=none
+ if [ -z "$DOMAINNAME_DEFAULT" ]; then
+ DOMAINNAME_DEFAULT="`awk '/^search/ { print "*" $2; exit }' /etc/resolv.conf`"
fi
+ if [ -z "$DOMAINNAME_DEFAULT" ]; then
+ DOMAINNAME_DEFAULT=none
+ fi
+ define_string DOMAINNAME $DOMAINNAME_DEFAULT
+
string 'Please give a random seed of eight characters' RANDOM_SEED 12345678
- bool 'Does your host have a reliable clock' RELIABLE_CLOCK
endmenu
mainmenu_option next_comment
echo " SECURITY: Then don't install the daemon SUID or SGID !"
fi
fi
- bool 'Do you need virtual hosting' VIRTUAL_HOST
- PREV_HUB=$HUB
- bool 'Will you connect to more then one server at a time' HUB
- if [ "$PREV_HUB" != "$HUB" ]; then
- BUFFERPOOL=
- fi
endmenu
fi
echo "The following filenames are either full paths or files within DPATH"
string 'Server configuration file' CPATH 'ircd.conf'
- string 'Server MOTD file' MPATH 'ircd.motd'
- string 'Server remote MOTD file (3 lines max)' RPATH 'remote.motd'
if [ "$DEBUGMODE" = "y" ]; then
string 'Debug file if DEBUGMODE' LPATH '/tmp/ircd.log'
else
define_string LPATH "$LPATH"
fi
- string 'File for server pid' PPATH 'ircd.pid'
endmenu
mainmenu_option next_comment
comment 'Configuration'
- bool 'Use crypted passwords for operators' CRYPT_OPER_PASSWORD y
- DUMMY=`echo "$BUFFERPOOL" | sed -e 's/[0-9]//g'`
- if [ "$DUMMY" != "" ]; then
- BUFFERPOOL=
- fi
- if [ "$HUB" = "y" ]; then
- int 'Max size of the total of of all sendqs (bytes)' BUFFERPOOL 27000000
- else
- int 'Max size of the total of of all sendqs (bytes)' BUFFERPOOL 9000000
- fi
- bool 'Aggressively empty the sendqpool (Read Help!)' HAS_FERGUSON_FLUSHER n
- int 'Max receive queue for clients (bytes)' CLIENT_FLOOD 1024
int 'Maximum number of network connections (23 - (FD_SETSIZE-4))' MAXCONNECTIONS 252
- int 'Default port for connections to other servers' SERVER_PORT 4400
int 'Nickname history length' NICKNAMEHISTORYLENGTH 800
- bool 'Do you want to use R: lines in your configuration file' R_LINES
- if [ "$R_LINES" = "y" ]; then
- bool 'Process R: lines every rehash' R_LINES_REHASH y
- bool 'Process R: lines always' R_LINES_OFTEN
- else
- define_bool R_LINES_REHASH $R_LINES_REHASH
- define_bool R_LINES_OFTEN $R_LINES_OFTEN
- fi
- bool 'Send a short message instead of the MOTD to connecting clients' NODEFAULTMOTD y
- bool 'Kill connecting clients when forward and reverse DNS mismatch' KILL_IPMISMATCH n
endmenu
mainmenu_option next_comment
define_string DEFAULT_LIST "$DEFAULT_LIST"
define_bool DEFAULT_LIST_PARAM n
fi
- bool 'K: line comments treated as a file by default' COMMENT_IS_FILE y
- bool 'Only nullify idle-time on PRIVMSG' IDLE_FROM_MSG y
endmenu
mainmenu_option next_comment
struct Client;
enum Feature {
+ /* Misc. features */
FEAT_LOG,
+ FEAT_DOMAINNAME,
+ FEAT_RELIABLE_CLOCK,
+ FEAT_BUFFERPOOL,
+ FEAT_HAS_FERGUSON_FLUSHER,
+ FEAT_CLIENT_FLOOD,
+ FEAT_SERVER_PORT,
+ FEAT_NODEFAULTMOTD,
+ FEAT_KILL_IPMISMATCH,
+ FEAT_IDLE_FROM_MSG,
+ FEAT_HUB,
+ FEAT_WALLOPS_OPER_ONLY,
+
+ /* Some misc. default paths */
+ FEAT_MPATH,
+ FEAT_RPATH,
+ FEAT_PPATH,
/* Networking features */
+ FEAT_VIRTUAL_HOST,
FEAT_TOS_SERVER,
FEAT_TOS_CLIENT,
/* features that affect all operators */
+ FEAT_CRYPT_OPER_PASSWORD,
FEAT_OPER_NO_CHAN_LIMIT,
FEAT_OPER_MODE_LCHAN,
FEAT_OPER_WALK_THROUGH_LMODES,
#ifndef INCLUDED_querycmds_h
#define INCLUDED_querycmds_h
+#ifndef INCLUDED_ircd_features_h
+#include "ircd_features.h" /* feature_str() */
+#endif
+
struct Client;
/*
#define Count_unknownbecomesclient(cptr, UserStats) \
do { \
--UserStats.unknowns; ++UserStats.local_clients; ++UserStats.clients; \
- if (match("*" DOMAINNAME, cli_sockhost(cptr)) == 0) \
+ if (match(feature_str(FEAT_DOMAINNAME), cli_sockhost(cptr)) == 0) \
++current_load.local_count; \
if (UserStats.local_clients > max_client_count) \
max_client_count = UserStats.local_clients; \
do \
{ \
--UserStats.local_clients; --UserStats.clients; \
- if (match("*" DOMAINNAME, cli_sockhost(cptr)) == 0) \
+ if (match(feature_str(FEAT_DOMAINNAME), cli_sockhost(cptr)) == 0) \
--current_load.local_count; \
} while(0)
#define Count_serverdisconnects(UserStats) do { --UserStats.local_servers; --UserStats.servers; } while(0)
#undef DOTERMCAP
#endif
-#if defined(CLIENT_FLOOD)
-#if (CLIENT_FLOOD > 8000) || (CLIENT_FLOOD < 512)
-#error CLIENT_FLOOD needs redefining.
-#endif
-#else
-#error CLIENT_FLOOD undefined
-#endif
-
#ifndef CONFIG_SETUGID
#undef IRC_UID
#undef IRC_GID
@${RM} /tmp/ircd.tag
${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR}
${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ../doc/example.conf ${DPATH}
- ( cd ${DPATH}; \
- ${TOUCH} ${MPATH}; \
- ${TOUCH} ${RPATH}; \
- ${CHOWN} ${IRCDOWN} ${MPATH} ${RPATH}; \
- ${CHGRP} ${IRCDGRP} ${MPATH} ${RPATH}; )
+# ( cd ${DPATH}; \
+# ${TOUCH} ${MPATH}; \
+# ${TOUCH} ${RPATH}; \
+# ${CHOWN} ${IRCDOWN} ${MPATH} ${RPATH}; \
+# ${CHGRP} ${IRCDGRP} ${MPATH} ${RPATH}; )
uninstall:
@if [ "${BINDIR}" != "${DPATH}" ]; then \
../include/ircd_log.h ../include/ircd_reply.h \
../include/ircd_snprintf.h ../include/ircd_string.h ../include/list.h \
../include/match.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \
- ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
- ../include/s_user.h ../include/send.h ../include/sprintf_irc.h \
- ../include/support.h ../include/sys.h ../include/whowas.h
+ ../include/numnicks.h ../include/querycmds.h \
+ ../include/ircd_features.h ../include/s_bsd.h ../include/s_conf.h \
+ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
+ ../include/send.h ../include/sprintf_irc.h ../include/support.h \
+ ../include/sys.h ../include/whowas.h
class.o: class.c ../include/class.h ../include/client.h \
../include/ircd_defs.h ../config/config.h ../config/setup.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../include/fda.h ../include/ircd_chattr.h ../include/ircd_string.h \
../include/match.h ../include/s_bsd.h ../include/s_debug.h
dbuf.o: dbuf.c ../include/dbuf.h ../include/ircd_alloc.h \
- ../include/fda.h ../include/ircd_chattr.h ../include/send.h \
- ../include/sys.h ../config/config.h ../config/setup.h
+ ../include/fda.h ../include/ircd_chattr.h ../include/ircd_features.h \
+ ../include/send.h ../include/sys.h ../config/config.h \
+ ../config/setup.h
fda.o: fda.c
fileio.o: fileio.c ../include/fileio.h ../include/ircd_alloc.h \
../include/fda.h
../include/class.h ../include/client.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/crule.h \
../include/hash.h ../include/ircd_alloc.h ../include/fda.h \
- ../include/ircd_log.h ../include/ircd_reply.h \
- ../include/ircd_signal.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/jupe.h ../include/list.h \
- ../include/match.h ../include/motd.h ../include/msg.h \
- ../include/numeric.h ../include/numnicks.h ../include/parse.h \
- ../include/res.h ../include/s_auth.h ../include/s_bsd.h \
- ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
- ../include/send.h ../include/sys.h ../include/uping.h \
- ../include/userload.h ../include/version.h ../include/whowas.h
+ ../include/ircd_features.h ../include/ircd_log.h \
+ ../include/ircd_reply.h ../include/ircd_signal.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \
+ ../include/list.h ../include/match.h ../include/motd.h \
+ ../include/msg.h ../include/numeric.h ../include/numnicks.h \
+ ../include/parse.h ../include/res.h ../include/s_auth.h \
+ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \
+ ../include/s_misc.h ../include/send.h ../include/sys.h \
+ ../include/uping.h ../include/userload.h ../include/version.h \
+ ../include/whowas.h
ircd_alloc.o: ircd_alloc.c ../include/ircd_alloc.h ../include/fda.h \
../include/ircd_string.h ../config/config.h ../config/setup.h \
../include/ircd_chattr.h ../include/s_debug.h ../include/ircd_defs.h
-ircd_features.o: ircd_features.c ../include/ircd_features.h \
- ../include/client.h ../include/ircd_defs.h ../config/config.h \
- ../config/setup.h ../include/dbuf.h ../include/msgq.h \
- ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \
- ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
- ../include/ircd_log.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
- ../include/msg.h ../include/numeric.h ../include/numnicks.h \
- ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \
- ../include/send.h ../include/support.h ../include/sys.h
+ircd_features.o: ircd_features.c ../config/config.h ../config/setup.h \
+ ../include/ircd_features.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
+ ../include/hash.h ../include/ircd.h ../include/struct.h \
+ ../include/ircd_alloc.h ../include/fda.h ../include/ircd_log.h \
+ ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \
+ ../include/s_debug.h ../include/s_misc.h ../include/send.h \
+ ../include/support.h ../include/sys.h
ircd_log.o: ircd_log.c ../include/ircd_log.h ../include/client.h \
../include/ircd_defs.h ../config/config.h ../config/setup.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../include/client.h ../config/config.h ../config/setup.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
- ../include/fda.h ../include/ircd_osdep.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h \
- ../include/numeric.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_misc.h ../include/send.h ../include/sprintf_irc.h \
- ../include/sys.h
+ ../include/fda.h ../include/ircd_features.h ../include/ircd_osdep.h \
+ ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/numeric.h ../include/s_bsd.h \
+ ../include/s_conf.h ../include/s_misc.h ../include/send.h \
+ ../include/sprintf_irc.h ../include/sys.h
m_admin.o: m_admin.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/ircd_reply.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/crule.h \
../include/hash.h ../include/ircd.h ../include/struct.h \
- ../include/ircd_log.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \
- ../include/match.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_user.h ../include/send.h
+ ../include/ircd_features.h ../include/ircd_log.h \
+ ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/jupe.h ../include/match.h \
+ ../include/msg.h ../include/numeric.h ../include/numnicks.h \
+ ../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \
+ ../include/send.h
m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/ircd_reply.h \
../include/msgq.h ../include/ircd_handler.h ../include/ircd.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/querycmds.h ../include/s_user.h \
- ../include/s_serv.h ../include/send.h
+ ../include/numnicks.h ../include/querycmds.h \
+ ../include/ircd_features.h ../include/s_user.h ../include/s_serv.h \
+ ../include/send.h
m_map.o: m_map.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/ircd.h \
../include/ircd_snprintf.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/list.h ../include/match.h \
../include/numeric.h ../include/s_user.h ../include/s_serv.h \
- ../include/send.h ../include/querycmds.h
+ ../include/send.h ../include/querycmds.h ../include/ircd_features.h
m_mode.o: m_mode.c ../include/handlers.h ../include/channel.h \
../config/config.h ../config/setup.h ../include/ircd_defs.h \
../include/client.h ../include/dbuf.h ../include/msgq.h \
m_oper.o: m_oper.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/hash.h \
- ../include/ircd.h ../include/struct.h ../include/ircd_log.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/ircd_xopen.h ../include/msg.h \
- ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \
- ../include/s_conf.h ../include/s_debug.h ../include/s_user.h \
- ../include/s_misc.h ../include/send.h ../include/support.h
+ ../include/ircd.h ../include/struct.h ../include/ircd_features.h \
+ ../include/ircd_log.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h \
+ ../include/ircd_xopen.h ../include/msg.h ../include/numeric.h \
+ ../include/numnicks.h ../include/querycmds.h ../include/s_conf.h \
+ ../include/s_debug.h ../include/s_user.h ../include/s_misc.h \
+ ../include/send.h ../include/support.h
m_opmode.o: m_opmode.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/channel.h \
m_privmsg.o: m_privmsg.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/ircd.h \
- ../include/struct.h ../include/ircd_chattr.h ../include/ircd_relay.h \
+ ../include/struct.h ../include/ircd_chattr.h \
+ ../include/ircd_features.h ../include/ircd_relay.h \
../include/ircd_reply.h ../include/ircd_string.h ../include/match.h \
../include/msg.h ../include/numeric.h ../include/send.h
m_privs.o: m_privs.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../include/struct.h ../include/ircd_log.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/jupe.h ../include/list.h \
- ../include/match.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \
- ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
- ../include/s_serv.h ../include/send.h ../include/userload.h
+ ../include/ircd_features.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \
+ ../include/list.h ../include/match.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \
+ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \
+ ../include/s_misc.h ../include/s_serv.h ../include/send.h \
+ ../include/userload.h
m_set.o: m_set.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/hash.h \
m_settime.o: m_settime.c ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/msgq.h ../include/ircd_handler.h ../include/hash.h \
- ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
- ../include/msg.h ../include/numeric.h ../include/numnicks.h \
- ../include/s_user.h ../include/send.h
+ ../include/ircd.h ../include/struct.h ../include/ircd_features.h \
+ ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/list.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/s_user.h \
+ ../include/send.h
m_silence.o: m_silence.c ../include/channel.h ../config/config.h \
../config/setup.h ../include/ircd_defs.h ../include/client.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../config/setup.h ../include/dbuf.h ../include/msgq.h \
../include/ircd_handler.h ../include/fileio.h ../include/ircd.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/match.h ../include/msg.h \
- ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_user.h ../include/send.h
+ ../include/ircd_features.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
+ ../include/msg.h ../include/numeric.h ../include/numnicks.h \
+ ../include/s_conf.h ../include/s_debug.h ../include/s_user.h \
+ ../include/send.h
msgq.o: msgq.c ../include/msgq.h ../include/ircd_defs.h \
../include/ircd_alloc.h ../include/fda.h ../include/ircd_snprintf.h \
../config/config.h ../config/setup.h ../include/s_debug.h
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../include/channel.h ../include/handlers.h ../include/hash.h \
../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
- ../include/fda.h ../include/ircd_chattr.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/opercmds.h ../include/querycmds.h \
- ../include/res.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_misc.h ../include/s_numeric.h \
- ../include/s_user.h ../include/send.h ../include/sys.h \
- ../include/whocmds.h ../include/whowas.h
-querycmds.o: querycmds.c ../include/querycmds.h
+ ../include/fda.h ../include/ircd_chattr.h ../include/ircd_features.h \
+ ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/opercmds.h \
+ ../include/querycmds.h ../include/res.h ../include/s_bsd.h \
+ ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
+ ../include/s_numeric.h ../include/s_user.h ../include/send.h \
+ ../include/sys.h ../include/whocmds.h ../include/whowas.h
+querycmds.o: querycmds.c ../include/querycmds.h \
+ ../include/ircd_features.h
random.o: random.c ../include/random.h ../config/config.h \
../config/setup.h
res.o: res.c ../include/res.h ../include/client.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../include/IPcheck.h ../include/ircd.h ../include/struct.h \
../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \
- ../include/ircd_log.h ../include/ircd_osdep.h \
- ../include/ircd_string.h ../include/list.h ../include/numeric.h \
- ../include/querycmds.h ../include/res.h ../include/s_bsd.h \
- ../include/s_debug.h ../include/s_misc.h ../include/send.h \
- ../include/sprintf_irc.h ../include/sys.h
+ ../include/ircd_features.h ../include/ircd_log.h \
+ ../include/ircd_osdep.h ../include/ircd_string.h ../include/list.h \
+ ../include/numeric.h ../include/querycmds.h ../include/res.h \
+ ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \
+ ../include/send.h ../include/sprintf_irc.h ../include/sys.h
s_bsd.o: s_bsd.c ../include/s_bsd.h ../config/config.h \
../config/setup.h ../include/client.h ../include/ircd_defs.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../include/IPcheck.h ../include/channel.h ../include/class.h \
- ../include/hash.h ../include/ircd_log.h ../include/ircd_osdep.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/ircd.h ../include/struct.h \
- ../include/list.h ../include/listener.h ../include/msg.h \
- ../include/numeric.h ../include/numnicks.h ../include/packet.h \
- ../include/parse.h ../include/querycmds.h ../include/res.h \
- ../include/s_auth.h ../include/s_conf.h ../include/s_debug.h \
- ../include/s_misc.h ../include/s_user.h ../include/send.h \
- ../include/sprintf_irc.h ../include/support.h ../include/sys.h \
- ../include/uping.h ../include/version.h
+ ../include/hash.h ../include/ircd_log.h ../include/ircd_features.h \
+ ../include/ircd_osdep.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd.h \
+ ../include/struct.h ../include/list.h ../include/listener.h \
+ ../include/msg.h ../include/numeric.h ../include/numnicks.h \
+ ../include/packet.h ../include/parse.h ../include/querycmds.h \
+ ../include/res.h ../include/s_auth.h ../include/s_conf.h \
+ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
+ ../include/send.h ../include/sprintf_irc.h ../include/support.h \
+ ../include/sys.h ../include/uping.h ../include/version.h
s_conf.o: s_conf.c ../include/s_conf.h ../include/IPcheck.h \
../include/class.h ../include/client.h ../include/ircd_defs.h \
../config/config.h ../config/setup.h ../include/dbuf.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
../include/match.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/parse.h ../include/querycmds.h \
- ../include/res.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_user.h ../include/send.h \
- ../include/sprintf_irc.h ../include/support.h ../include/sys.h \
- ../include/uping.h ../include/userload.h
+ ../include/ircd_features.h ../include/res.h ../include/s_bsd.h \
+ ../include/s_conf.h ../include/s_debug.h ../include/s_user.h \
+ ../include/send.h ../include/sprintf_irc.h ../include/support.h \
+ ../include/sys.h ../include/uping.h ../include/userload.h
s_numeric.o: s_numeric.c ../include/s_numeric.h ../include/channel.h \
../config/config.h ../config/setup.h ../include/ircd_defs.h \
../include/client.h ../include/dbuf.h ../include/msgq.h \
../include/ircd_snprintf.h ../include/ircd_xopen.h ../include/jupe.h \
../include/list.h ../include/match.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/parse.h \
- ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
- ../include/send.h ../include/sprintf_irc.h ../include/sys.h \
- ../include/userload.h
+ ../include/querycmds.h ../include/ircd_features.h ../include/s_bsd.h \
+ ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
+ ../include/s_user.h ../include/send.h ../include/sprintf_irc.h \
+ ../include/sys.h ../include/userload.h
s_stats.o: s_stats.c ../include/s_stats.h ../include/class.h \
../include/client.h ../include/ircd_defs.h ../config/config.h \
../config/setup.h ../include/dbuf.h ../include/msgq.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../include/gline.h ../include/hash.h ../include/ircd.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
- ../include/ircd_chattr.h ../include/ircd_log.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../include/list.h \
- ../include/match.h ../include/motd.h ../include/msg.h \
- ../include/numeric.h ../include/numnicks.h ../include/parse.h \
- ../include/querycmds.h ../include/random.h ../include/s_bsd.h \
- ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
- ../include/s_serv.h ../include/send.h ../include/sprintf_irc.h \
- ../include/support.h ../include/supported.h ../include/sys.h \
- ../include/userload.h ../include/version.h ../include/whowas.h \
- ../include/handlers.h
+ ../include/ircd_chattr.h ../include/ircd_features.h \
+ ../include/ircd_log.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/list.h ../include/match.h \
+ ../include/motd.h ../include/msg.h ../include/numeric.h \
+ ../include/numnicks.h ../include/parse.h ../include/querycmds.h \
+ ../include/random.h ../include/s_bsd.h ../include/s_conf.h \
+ ../include/s_debug.h ../include/s_misc.h ../include/s_serv.h \
+ ../include/send.h ../include/sprintf_irc.h ../include/support.h \
+ ../include/supported.h ../include/sys.h ../include/userload.h \
+ ../include/version.h ../include/whowas.h ../include/handlers.h
send.o: send.c ../include/send.h ../include/channel.h \
../config/config.h ../config/setup.h ../include/ircd_defs.h \
../include/class.h ../include/client.h ../include/dbuf.h \
../include/ircd_defs.h ../config/config.h ../config/setup.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
../include/ircd.h ../include/struct.h ../include/msg.h \
- ../include/numnicks.h ../include/querycmds.h ../include/s_misc.h \
- ../include/send.h ../include/sys.h
+ ../include/numnicks.h ../include/querycmds.h \
+ ../include/ircd_features.h ../include/s_misc.h ../include/send.h \
+ ../include/sys.h
whocmds.o: whocmds.c ../include/whocmds.h ../config/config.h \
../config/setup.h ../include/channel.h ../include/ircd_defs.h \
../include/client.h ../include/dbuf.h ../include/msgq.h \
../include/struct.h ../include/ircd_chattr.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/list.h ../include/match.h \
../include/numeric.h ../include/numnicks.h ../include/querycmds.h \
- ../include/random.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_misc.h ../include/s_user.h ../include/send.h \
- ../include/sprintf_irc.h ../include/support.h ../include/sys.h \
- ../include/userload.h ../include/version.h ../include/whowas.h \
- ../include/msg.h
+ ../include/ircd_features.h ../include/random.h ../include/s_bsd.h \
+ ../include/s_conf.h ../include/s_misc.h ../include/s_user.h \
+ ../include/send.h ../include/sprintf_irc.h ../include/support.h \
+ ../include/sys.h ../include/userload.h ../include/version.h \
+ ../include/whowas.h ../include/msg.h
whowas.o: whowas.c ../include/whowas.h ../include/client.h \
../include/ircd_defs.h ../config/config.h ../config/setup.h \
../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
#include "dbuf.h"
#include "ircd_alloc.h"
#include "ircd_chattr.h"
+#include "ircd_features.h"
#include "send.h"
#include "sys.h" /* MIN */
dbufFreeList = db->next;
++DBufUsedCount;
}
- else if (DBufAllocCount * DBUF_SIZE < BUFFERPOOL) {
+ else if (DBufAllocCount * DBUF_SIZE < feature_int(FEAT_BUFFERPOOL)) {
db = (struct DBufBuffer*) MyMalloc(sizeof(struct DBufBuffer));
assert(0 != db);
++DBufAllocCount;
for (; length > 0; h = &(db->next)) {
if (0 == (db = *h)) {
if (0 == (db = dbuf_alloc())) {
-#if defined(HAS_FERGUSON_FLUSHER)
- /*
- * from "Married With Children" episode were Al bought a REAL toilet
- * on the black market because he was tired of the wimpy water
- * conserving toilets they make these days --Bleep
- */
- /*
- * Apparently this doesn't work, the server _has_ to
- * dump a few clients to handle the load. A fully loaded
- * server cannot handle a net break without dumping some
- * clients. If we flush the connections here under a full
- * load we may end up starving the kernel for mbufs and
- * crash the machine
- */
- /*
- * attempt to recover from buffer starvation before
- * bailing this may help servers running out of memory
- */
- flush_connections(0);
- if (0 == (db = dbuf_alloc()))
-#endif
+ if (feature_bool(FEAT_HAS_FERGUSON_FLUSHER)) {
+ /*
+ * from "Married With Children" episode were Al bought a REAL toilet
+ * on the black market because he was tired of the wimpy water
+ * conserving toilets they make these days --Bleep
+ */
+ /*
+ * Apparently this doesn't work, the server _has_ to
+ * dump a few clients to handle the load. A fully loaded
+ * server cannot handle a net break without dumping some
+ * clients. If we flush the connections here under a full
+ * load we may end up starving the kernel for mbufs and
+ * crash the machine
+ */
+ /*
+ * attempt to recover from buffer starvation before
+ * bailing this may help servers running out of memory
+ */
+ flush_connections(0);
+ db = dbuf_alloc();
+ }
+
+ if (0 == db)
return dbuf_malloc_error(dyn);
}
dyn->tail = db;
#include "crule.h"
#include "hash.h"
#include "ircd_alloc.h"
+#include "ircd_features.h"
#include "ircd_log.h"
#include "ircd_reply.h"
#include "ircd_signal.h"
static void write_pidfile(void) {
FILE *pidf;
- if (!(pidf = fopen(PPATH, "w+"))) {
+ if (!(pidf = fopen(feature_str(FEAT_PPATH), "w+"))) {
Debug((DEBUG_NOTICE,
- "Error opening pid file \"%s\": %s", PPATH, strerror(errno)));
+ "Error opening pid file \"%s\": %s", feature_str(FEAT_PPATH),
+ strerror(errno)));
return;
}
if (fprintf(pidf, "%5d\n", getpid()) < 5)
- Debug((DEBUG_NOTICE, "Error writing to pid file %s", PPATH));
+ Debug((DEBUG_NOTICE, "Error writing to pid file %s",
+ feature_str(FEAT_PPATH)));
fclose(pidf);
}
/* Check paths for accessibility */
if (!check_file_access(SPATH, 'S', X_OK) ||
- !check_file_access(configfile, 'C', R_OK) ||
- !check_file_access(MPATH, 'M', R_OK) ||
- !check_file_access(RPATH, 'R', R_OK))
+ !check_file_access(configfile, 'C', R_OK))
return 4;
#ifdef DEBUG
daemon_init(thisServer.bootopt & BOOT_TTY);
setup_signals();
+ feature_mark(); /* initialize features... */
log_init(*argv);
set_nomem_handler(outofmemory);
*
* $Id$
*/
+#include "config.h"
#include "ircd_features.h"
#include "client.h"
#include "hash.h"
#define FEAT_OPER 0x0100 /* set to display only to opers */
#define FEAT_MYOPER 0x0200 /* set to display only to local opers */
+#define FEAT_READ 0x1000 /* feature is read-only (for now, perhaps?) */
+
static struct FeatureDesc {
enum Feature feat; /* feature identifier */
char* type; /* string describing type */
{ FEAT_ ## type, #type, FEAT_STR | (flags), 0, 0, 0, (v_str), \
0, 0, 0, 0, 0, 0 }
+ /* Misc. features */
F_N(LOG, FEAT_MYOPER, feature_log_set, feature_log_reset, feature_log_get,
log_feature_unmark, log_feature_mark, log_feature_report),
+ F_S(DOMAINNAME, 0, DOMAINNAME),
+ F_B(RELIABLE_CLOCK, 0, 0),
+ F_I(BUFFERPOOL, 0, 27000000),
+ F_B(HAS_FERGUSON_FLUSHER, 0, 0),
+ F_I(CLIENT_FLOOD, 0, 1024),
+ F_I(SERVER_PORT, FEAT_OPER, 4400),
+ F_B(NODEFAULTMOTD, 0, 1),
+ F_B(KILL_IPMISMATCH, FEAT_OPER, 0),
+ F_B(IDLE_FROM_MSG, 0, 1),
+ F_B(HUB, 0, 0),
+ F_B(WALLOPS_OPER_ONLY, 0, 0),
+
+ /* Some misc. default paths */
+ F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd"),
+ F_S(RPATH, FEAT_CASE | FEAT_MYOPER, "remote.motd"),
+ F_S(PPATH, FEAT_CASE | FEAT_MYOPER | FEAT_READ, "ircd.pid"),
/* Networking features */
+ F_B(VIRTUAL_HOST, 0, 0),
F_I(TOS_SERVER, 0, 0x08),
F_I(TOS_CLIENT, 0, 0x08),
/* features that affect all operators */
+ F_B(CRYPT_OPER_PASSWORD, FEAT_MYOPER | FEAT_READ, 1),
F_B(OPER_NO_CHAN_LIMIT, 0, 1),
F_B(OPER_MODE_LCHAN, 0, 1),
F_B(OPER_WALK_THROUGH_LMODES, 0, 0),
else
log_write(LS_CONFIG, L_ERROR, 0, "Not enough fields in F line");
} else if ((feat = feature_desc(from, fields[0]))) { /* find feature */
+ if (from && feat->flags & FEAT_READ)
+ return send_reply(from, ERR_NOFEATURE, fields[0]);
+
switch (feat->flags & FEAT_MASK) {
case FEAT_NONE:
if (feat->set && (i = (*feat->set)(from, fields + 1, count - 1))) {
if (count < 1) /* check arguments */
need_more_params(from, "RESET");
else if ((feat = feature_desc(from, fields[0]))) { /* get descriptor */
+ if (from && feat->flags & FEAT_READ)
+ return send_reply(from, ERR_NOFEATURE, fields[0]);
+
switch (feat->flags & FEAT_MASK) {
case FEAT_NONE: /* None... */
if (feat->reset && (i = (*feat->reset)(from, fields + 1, count - 1))) {
if (!(desc = log_find(subsys)))
return 2;
- /* no change, don't go to the trouble of destroying and recreating */
- if (desc->file && filename && !strcmp(desc->file->file, filename))
- return 0;
-
if (filename)
desc->mark |= LOG_MARK_FILE; /* mark that file has been changed */
else
desc->mark &= ~LOG_MARK_FILE; /* file has been reset to defaults */
+ /* no change, don't go to the trouble of destroying and recreating */
+ if (desc->file && filename && !strcmp(desc->file->file, filename))
+ return 0;
+
/* debug log is special, since it has to be opened on fd 2 */
if (desc->subsys == LS_DEBUG)
return log_debug_file(filename);
#include "crule.h"
#include "hash.h"
#include "ircd.h"
+#include "ircd_features.h"
#include "ircd_log.h"
#include "ircd_reply.h"
#include "ircd_string.h"
return 0;
}
}
- if (0 == port && 0 == (port = SERVER_PORT)) {
+ if (0 == port && 0 == (port = feature_int(FEAT_SERVER_PORT))) {
sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: missing port number",
sptr);
return 0;
char* name;
char* p = 0;
struct MsgBuf* mb;
- int found1 = 0;
int i;
if (parc < 2)
msgq_clean(mb); /* then do another round */
mb = msgq_make(sptr, rpl_str(RPL_ISON), cli_name(&me),
cli_name(sptr));
- found1 = 0;
}
- msgq_append(0, mb, "%s%s", found1 ? " " : "", cli_name(acptr));
- found1++;
+ msgq_append(0, mb, "%s ", cli_name(acptr));
}
}
}
#include "client.h"
#include "hash.h"
#include "ircd.h"
+#include "ircd_features.h"
#include "ircd_log.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include <stdlib.h>
#include <string.h>
-#ifdef CRYPT_OPER_PASSWORD
int oper_password_match(const char* to_match, const char* passwd)
{
/*
*
* passwd may be NULL. Head it off at the pass...
*/
- if (to_match && passwd) {
- const char *encr = ircd_crypt(to_match, passwd);
- return (0 == strcmp(encr, passwd));
- }
- return 0;
-}
-#else
-int oper_password_match(const char* to_match, const char* passwd)
-{
- return (to_match && passwd) ? (0 == strcmp(to_match, passwd)) : 0;
+ if (!to_match || !passwd)
+ return 0;
+
+ if (feature_bool(FEAT_CRYPT_OPER_PASSWORD))
+ to_match = ircd_crypt(to_match, passwd);
+
+ return (0 == strcmp(to_match, passwd));
}
-#endif
/*
* m_oper - generic message handler
#include "client.h"
#include "ircd.h"
#include "ircd_chattr.h"
+#include "ircd_features.h"
#include "ircd_relay.h"
#include "ircd_reply.h"
#include "ircd_string.h"
cli_flags(sptr) &= ~FLAGS_TS8;
-#ifdef IDLE_FROM_MSG
- cli_user(sptr)->last = CurrentTime;
-#endif
+ if (feature_bool(FEAT_IDLE_FROM_MSG))
+ cli_user(sptr)->last = CurrentTime;
if (parc < 2 || EmptyString(parv[1]))
return send_reply(sptr, ERR_NORECIPIENT, MSG_PRIVATE);
cli_flags(sptr) &= ~FLAGS_TS8;
-#ifdef IDLE_FROM_MSG
- cli_user(sptr)->last = CurrentTime;
-#endif
+ if (feature_bool(FEAT_IDLE_FROM_MSG))
+ cli_user(sptr)->last = CurrentTime;
if (parc < 2 || EmptyString(parv[1]))
return send_reply(sptr, ERR_NORECIPIENT, MSG_PRIVATE);
#include "hash.h"
#include "ircd.h"
#include "ircd_log.h"
+#include "ircd_features.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "jupe.h"
return exit_client_msg(cptr, cptr, &me,
"Access denied. No conf line for server %s", cli_name(cptr));
}
-#ifdef CRYPT_LINK_PASSWORD
- /* passwd may be NULL. Head it off at the pass... */
- if (*(cli_passwd(cptr))) {
- encr = ircd_crypt(cli_passwd(cptr), aconf->passed);
- }
- else
- encr = "";
-#else
encr = cli_passwd(cptr);
-#endif /* CRYPT_LINK_PASSWORD */
if (*aconf->passwd && !!strcmp(aconf->passwd, encr)) {
++ServerStats->is_ref;
memset(cli_passwd(cptr), 0, sizeof(cli_passwd(cptr)));
-#ifndef HUB
- for (i = 0; i <= HighestFd; i++)
- if (LocalClientArray[i] && IsServer(LocalClientArray[i])) {
- active_lh_line = 3;
- LHcptr = 0;
- break;
- }
-#endif
+ if (!feature_bool(FEAT_HUB)) {
+ for (i = 0; i <= HighestFd; i++)
+ if (LocalClientArray[i] && IsServer(LocalClientArray[i])) {
+ active_lh_line = 3;
+ LHcptr = 0;
+ break;
+ }
+ }
}
/*
SetServerYXX(cptr, cptr, parv[6]);
if (start_timestamp > OLDEST_TS)
{
-#ifndef RELIABLE_CLOCK
-#ifdef TESTNET
- sendto_opmask_butone(0, SNO_OLDSNO, "Debug: my start time: %Tu ; "
- "others start time: %Tu", cli_serv(&me)->timestamp,
- start_timestamp);
- sendto_opmask_butone(0, SNO_OLDSNO, "Debug: receive time: %Tu ; "
- "received timestamp: %Tu ; difference %ld",
- recv_time, timestamp, timestamp - recv_time);
-#endif
- if (start_timestamp < cli_serv(&me)->timestamp)
- {
- sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
- "%Tu < %Tu", start_timestamp, cli_serv(&me)->timestamp);
- cli_serv(&me)->timestamp = start_timestamp;
- TSoffset += timestamp - recv_time;
- sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
- (int)(timestamp - recv_time));
- }
- else if ((start_timestamp > cli_serv(&me)->timestamp) && IsUnknown(cptr))
- cli_serv(cptr)->timestamp = TStime();
-
- else if (timestamp != recv_time)
- {
- /*
- * Equal start times, we have a collision. Let the connected-to server
- * decide. This assumes leafs issue more than half of the connection
- * attempts.
- */
- if (IsUnknown(cptr))
- cli_serv(cptr)->timestamp = TStime();
- else if (IsHandshake(cptr))
- {
- sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
+ Debug((DEBUG_DEBUG, "My start time: %Tu; other's start time: %Tu",
+ cli_serv(&me)->timestamp, start_timestamp));
+ Debug((DEBUG_DEBUG, "Receive time: %Tu; received timestamp: %Tu; "
+ "difference %ld", recv_time, timestamp, timestamp - recv_time));
+ if (feature_bool(FEAT_RELIABLE_CLOCK)) {
+ if (start_timestamp < cli_serv(&me)->timestamp)
+ cli_serv(&me)->timestamp = start_timestamp;
+ if (IsUnknown(cptr))
+ cli_serv(cptr)->timestamp = TStime();
+ } else {
+ if (start_timestamp < cli_serv(&me)->timestamp) {
+ sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
+ "%Tu < %Tu", start_timestamp,
+ cli_serv(&me)->timestamp);
+ cli_serv(&me)->timestamp = start_timestamp;
+ TSoffset += timestamp - recv_time;
+ sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
(int)(timestamp - recv_time));
- TSoffset += timestamp - recv_time;
- }
+ } else if ((start_timestamp > cli_serv(&me)->timestamp) &&
+ IsUnknown(cptr))
+ cli_serv(cptr)->timestamp = TStime();
+
+ else if (timestamp != recv_time) {
+ /*
+ * Equal start times, we have a collision. Let the connected-to
+ * server decide. This assumes leafs issue more than half of the
+ * connection attempts.
+ */
+ if (IsUnknown(cptr))
+ cli_serv(cptr)->timestamp = TStime();
+ else if (IsHandshake(cptr)) {
+ sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
+ (int)(timestamp - recv_time));
+ TSoffset += timestamp - recv_time;
+ }
+ }
}
-#else /* RELIABLE CLOCK IS TRUE, we _always_ use our own clock */
- if (start_timestamp < cli_serv(&me)->timestamp)
- cli_serv(&me)->timestamp = start_timestamp;
- if (IsUnknown(cptr))
- cli_serv(cptr)->timestamp = TStime();
-#endif
}
ret = server_estab(cptr, aconf, ajupe);
}
else
ret = 0;
-#ifdef RELIABLE_CLOCK
- if (abs(cli_serv(cptr)->timestamp - recv_time) > 30)
- {
+
+ if (feature_bool(FEAT_RELIABLE_CLOCK) &&
+ abs(cli_serv(cptr)->timestamp - recv_time) > 30) {
sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
"timestamp-clock difference of %Td seconds! "
"Used SETTIME to correct this.",
timestamp - recv_time);
sendcmdto_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(), cli_name(&me));
}
-#endif
return ret;
}
return exit_client_msg(cptr, cptr, &me,
"Access denied. No conf line for server %s", cli_name(cptr));
}
-#ifdef CRYPT_LINK_PASSWORD
- /* passwd may be NULL. Head it off at the pass... */
- if (*(cli_passwd(cptr)))
- {
- encr = ircd_crypt(cli_passwd(cptr), cli_passwd(aconf));
- }
- else
- encr = "";
-#else
encr = cli_passwd(cptr);
-#endif /* CRYPT_LINK_PASSWORD */
if (*(aconf->passwd) && !!strcmp(aconf->passwd, encr)) {
++ServerStats->is_ref;
}
memset(cli_passwd(cptr), 0, sizeof(cli_passwd(cptr)));
-#ifndef HUB
- for (i = 0; i <= HighestFd; i++)
- if (LocalClientArray[i] && IsServer(LocalClientArray[i])) {
- active_lh_line = 3;
- LHcptr = 0;
- break;
- }
-#endif
+ if (!feature_bool(FEAT_HUB)) {
+ for (i = 0; i <= HighestFd; i++)
+ if (LocalClientArray[i] && IsServer(LocalClientArray[i])) {
+ active_lh_line = 3;
+ LHcptr = 0;
+ break;
+ }
+ }
}
/*
SetServerYXX(cptr, cptr, parv[6]);
if (start_timestamp > OLDEST_TS)
{
-#ifndef RELIABLE_CLOCK
-#ifdef TESTNET
- sendto_opmask_butone(0, SNO_OLDSNO, "Debug: my start time: %Tu ; "
- "others start time: %Tu", cli_serv(&me)->timestamp,
- start_timestamp);
- sendto_opmask_butone(0, SNO_OLDSNO, "Debug: receive time: %Tu ; "
- "received timestamp: %Tu ; difference %ld",
- recv_time, timestamp, timestamp - recv_time);
-#endif
- if (start_timestamp < cli_serv(&me)->timestamp)
- {
- sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
- "%Tu < %Tu", start_timestamp, cli_serv(&me)->timestamp);
- cli_serv(&me)->timestamp = start_timestamp;
- TSoffset += timestamp - recv_time;
- sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
- (int)(timestamp - recv_time));
- }
- else if ((start_timestamp > cli_serv(&me)->timestamp) && IsUnknown(cptr))
- cli_serv(cptr)->timestamp = TStime();
-
- else if (timestamp != recv_time)
- {
- /*
- * Equal start times, we have a collision. Let the connected-to server
- * decide. This assumes leafs issue more than half of the connection
- * attempts.
- */
- if (IsUnknown(cptr))
- cli_serv(cptr)->timestamp = TStime();
- else if (IsHandshake(cptr))
- {
- sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
+ Debug((DEBUG_DEBUG, "My start time: %Tu; other's start time: %Tu",
+ cli_serv(&me)->timestamp, start_timestamp));
+ Debug((DEBUG_DEBUG, "Receive time: %Tu; received timestamp: %Tu; "
+ "difference %ld", recv_time, timestamp, timestamp - recv_time));
+ if (feature_bool(FEAT_RELIABLE_CLOCK)) {
+ if (start_timestamp < cli_serv(&me)->timestamp)
+ cli_serv(&me)->timestamp = start_timestamp;
+ if (IsUnknown(cptr))
+ cli_serv(cptr)->timestamp = TStime();
+ } else {
+ if (start_timestamp < cli_serv(&me)->timestamp) {
+ sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
+ "%Tu < %Tu", start_timestamp,
+ cli_serv(&me)->timestamp);
+ cli_serv(&me)->timestamp = start_timestamp;
+ TSoffset += timestamp - recv_time;
+ sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
(int)(timestamp - recv_time));
- TSoffset += timestamp - recv_time;
- }
+ } else if ((start_timestamp > cli_serv(&me)->timestamp) &&
+ IsUnknown(cptr))
+ cli_serv(cptr)->timestamp = TStime();
+
+ else if (timestamp != recv_time) {
+ /*
+ * Equal start times, we have a collision. Let the connected-to
+ * server decide. This assumes leafs issue more than half of the
+ * connection attempts.
+ */
+ if (IsUnknown(cptr))
+ cli_serv(cptr)->timestamp = TStime();
+ else if (IsHandshake(cptr)) {
+ sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
+ (int)(timestamp - recv_time));
+ TSoffset += timestamp - recv_time;
+ }
+ }
}
-#else /* RELIABLE CLOCK IS TRUE, we _always_ use our own clock */
- if (start_timestamp < cli_serv(&me)->timestamp)
- cli_serv(&me)->timestamp = start_timestamp;
- if (IsUnknown(cptr))
- cli_serv(cptr)->timestamp = TStime();
-#endif
}
ret = server_estab(cptr, aconf, ajupe);
}
else
ret = 0;
-#ifdef RELIABLE_CLOCK
- if (abs(cli_serv(cptr)->timestamp - recv_time) > 30)
- {
+
+ if (feature_bool(FEAT_RELIABLE_CLOCK) &&
+ abs(cli_serv(cptr)->timestamp - recv_time) > 30) {
sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
"timestamp-clock difference of %Td seconds! Used "
"SETTIME to correct this.", timestamp - recv_time);
sendcmdto_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(), cli_name(&me));
}
-#endif
return ret;
}
#include "client.h"
#include "hash.h"
#include "ircd.h"
+#include "ircd_features.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "list.h"
if (IsServer(sptr)) /* send to unlagged servers */
{
-#ifdef RELIABLE_CLOCK
- sprintf_irc(tbuf, TIME_T_FMT, TStime());
- parv[1] = tbuf;
-#endif
+ if (feature_bool(FEAT_RELIABLE_CLOCK)) {
+ sprintf_irc(tbuf, TIME_T_FMT, TStime());
+ parv[1] = tbuf;
+ }
+
for (lp = cli_serv(&me)->down; lp; lp = lp->next)
if (cptr != lp->value.cptr && MsgQLength(&(cli_sendQ(lp->value.cptr))) < 8000)
sendcmdto_one(sptr, CMD_NOTICE, lp->value.cptr, "%s", parv[1]);
return 0;
}
-#ifdef RELIABLE_CLOCK
- if ((dt > 600) || (dt < -600))
- sendcmdto_serv_butone(&me, CMD_WALLOPS, 0, ":Bad SETTIME from %s: %Tu",
- cli_name(sptr), t);
- if (IsUser(sptr))
- {
- sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is not set %ld seconds %s "
- ": RELIABLE_CLOCK is defined", sptr, (dt < 0) ? -dt : dt,
- (dt < 0) ? "forwards" : "backwards");
- }
-#else
- sendto_opmask_butone(0, SNO_OLDSNO, "SETTIME from %s, clock is set %ld "
- "seconds %s", cli_name(sptr), (dt < 0) ? -dt : dt,
- (dt < 0) ? "forwards" : "backwards");
- TSoffset -= dt;
- if (IsUser(sptr))
- {
- sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is set %ld seconds %s",
- sptr, (dt < 0) ? -dt : dt,
- (dt < 0) ? "forwards" : "backwards");
+ if (feature_bool(FEAT_RELIABLE_CLOCK)) {
+ if ((dt > 600) || (dt < -600))
+ sendcmdto_serv_butone(&me, CMD_WALLOPS, 0, ":Bad SETTIME from %s: %Tu",
+ cli_name(sptr), t);
+ if (IsUser(sptr)) {
+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is not set %ld "
+ "seconds %s : RELIABLE_CLOCK is defined", sptr,
+ (dt < 0) ? -dt : dt, (dt < 0) ? "forwards" : "backwards");
+ }
+ } else {
+ sendto_opmask_butone(0, SNO_OLDSNO, "SETTIME from %s, clock is set %ld "
+ "seconds %s", cli_name(sptr), (dt < 0) ? -dt : dt,
+ (dt < 0) ? "forwards" : "backwards");
+ TSoffset -= dt;
+ if (IsUser(sptr)) {
+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is set %ld seconds %s",
+ sptr, (dt < 0) ? -dt : dt,
+ (dt < 0) ? "forwards" : "backwards");
+ }
}
-#endif
+
return 0;
}
if (IsServer(sptr)) /* send to unlagged servers */
{
-#ifdef RELIABLE_CLOCK
- sprintf_irc(tbuf, TIME_T_FMT, TStime());
- parv[1] = tbuf;
-#endif
+ if (feature_bool(FEAT_RELIABLE_CLOCK)) {
+ sprintf_irc(tbuf, TIME_T_FMT, TStime());
+ parv[1] = tbuf;
+ }
+
for (lp = cli_serv(&me)->down; lp; lp = lp->next)
if (cptr != lp->value.cptr && MsgQLength(&(cli_sendQ(lp->value.cptr))) < 8000)
sendcmdto_one(sptr, CMD_SETTIME, lp->value.cptr, "%s", parv[1]);
return 0;
}
-#ifdef RELIABLE_CLOCK
- if ((dt > 600) || (dt < -600))
- sendcmdto_serv_butone(&me, CMD_WALLOPS, 0, ":Bad SETTIME from %s: %Tu",
- cli_name(sptr), t);
- if (IsUser(sptr))
- {
- sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is not set %ld seconds %s "
- ": RELIABLE_CLOCK is defined", sptr, (dt < 0) ? -dt : dt,
- (dt < 0) ? "forwards" : "backwards");
- }
-#else
- sendto_opmask_butone(0, SNO_OLDSNO, "SETTIME from %s, clock is set %ld "
- "seconds %s", cli_name(sptr), (dt < 0) ? -dt : dt,
- (dt < 0) ? "forwards" : "backwards");
- TSoffset -= dt;
- if (IsUser(sptr))
- {
- sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is set %ld seconds %s",
- sptr, (dt < 0) ? -dt : dt,
- (dt < 0) ? "forwards" : "backwards");
+ if (feature_bool(FEAT_RELIABLE_CLOCK)) {
+ if ((dt > 600) || (dt < -600))
+ sendcmdto_serv_butone(&me, CMD_WALLOPS, 0, ":Bad SETTIME from %s: %Tu",
+ cli_name(sptr), t);
+ if (IsUser(sptr)) {
+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is not set %ld "
+ "seconds %s : RELIABLE_CLOCK is defined", sptr,
+ (dt < 0) ? -dt : dt, (dt < 0) ? "forwards" : "backwards");
+ }
+ } else {
+ sendto_opmask_butone(0, SNO_OLDSNO, "SETTIME from %s, clock is set %ld "
+ "seconds %s", cli_name(sptr), (dt < 0) ? -dt : dt,
+ (dt < 0) ? "forwards" : "backwards");
+ TSoffset -= dt;
+ if (IsUser(sptr)) {
+ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is set %ld seconds %s",
+ sptr, (dt < 0) ? -dt : dt,
+ (dt < 0) ? "forwards" : "backwards");
+ }
}
-#endif
+
return 0;
}
#include "fileio.h"
#include "ircd.h"
#include "ircd_alloc.h"
+#include "ircd_features.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "match.h"
cache = motd_cache(motd_lookup(cptr));
-#ifdef NODEFAULTMOTD
- send_reply(cptr, RPL_MOTDSTART, cli_name(&me));
- send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":\002Type /MOTD to read the AUP "
- "before continuing using this service.\002");
- send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":The message of the day was last "
- "changed: %d-%d-%d %d:%d", cache->modtime.tm_year + 1900,
- cache->modtime.tm_mon + 1, cache->modtime.tm_mday,
- cache->modtime.tm_hour, cache->modtime.tm_min);
- send_reply(cptr, RPL_ENDOFMOTD);
-#else
- motd_forward(cptr, cache);
-#endif
+ if (!feature_bool(FEAT_NODEFAULTMOTD))
+ motd_forward(cptr, cache);
+ else {
+ send_reply(cptr, RPL_MOTDSTART, cli_name(&me));
+ send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":\002Type /MOTD to read the "
+ "AUP before continuing using this service.\002");
+ send_reply(cptr, SND_EXPLICIT | RPL_MOTD, ":The message of the day was "
+ "last changed: %d-%d-%d %d:%d", cache->modtime.tm_year + 1900,
+ cache->modtime.tm_mon + 1, cache->modtime.tm_mday,
+ cache->modtime.tm_hour, cache->modtime.tm_min);
+ send_reply(cptr, RPL_ENDOFMOTD);
+ }
}
/* motd_recache causes all the MOTD caches to be cleared */
void
motd_init(void)
{
- MotdList.local = motd_create(0, MPATH, MOTD_MAXLINES); /* init local */
- motd_cache(MotdList.local); /* and cache it */
+ MotdList.local = motd_create(0, feature_str(FEAT_MPATH), MOTD_MAXLINES);
+ motd_cache(MotdList.local); /* init local and cache it */
- MotdList.remote = motd_create(0, RPATH, MOTD_MAXREMOTE); /* init remote */
- motd_cache(MotdList.remote); /* and cache it */
+ MotdList.remote = motd_create(0, feature_str(FEAT_RPATH), MOTD_MAXREMOTE);
+ motd_cache(MotdList.remote); /* init remote and cache it */
MotdList.other = 0; /* no T-lines processed yet */
}
* just-disconnected-client aren't confused with just-connected ones.
*/
-/*
- * Lets have *LOTS* of connections...
- */
-#define EXTENDED_NUMERICS
/* These must be the same on ALL servers ! Do not change ! */
#define NUMNICKBASE 64 /* (2 << NUMNICKLOG) */
#define NUMNICKMASK 63 /* (NUMNICKBASE-1) */
#define NN_MAX_SERVER 4096 /* (NUMNICKBASE * NUMNICKBASE) */
-#if defined(EXTENDED_NUMERICS)
#define NN_MAX_CLIENT 262144 /* NUMNICKBASE ^ 3 */
-#else
-#define NN_MAX_CLIENT 4096 /* (NUMNICKBASE * NUMNICKBASE) */
-#endif
/*
* The internal counter for the 'XX' of local clients
exit(-1);
}
--max_clients;
-#if defined(EXTENDED_NUMERICS)
inttobase64(cli_serv(c)->nn_capacity, max_clients, 3);
-#else
- inttobase64(cli_serv(c)->nn_capacity, max_clients, 2);
-#endif
cli_serv(c)->nn_mask = max_clients; /* Our Numeric Nick mask */
cli_serv(c)->client_list = (struct Client**) MyCalloc(max_clients + 1,
sizeof(struct Client*));
assert(0 != c);
assert(numeric < NN_MAX_SERVER);
-#if defined(EXTENDED_NUMERICS)
inttobase64(cli_yxx(c), numeric, 2);
-#else
- assert(numeric < NUMNICKBASE);
- (cli_yxx(c))[0] = convert2y[numeric];
-#endif
if (numeric >= lastNNServer)
lastNNServer = numeric + 1;
server_list[numeric] = c;
}
client_list[last_nn & mask] = cptr; /* Reserve the numeric ! */
-#if defined(EXTENDED_NUMERICS)
inttobase64(cli_yxx(cptr), last_nn, 3);
-#else
- inttobase64(cli_yxx(cptr), last_nn, 2);
-#endif
if (++last_nn == NN_MAX_CLIENT)
last_nn = 0;
return 1;
#include "ircd.h"
#include "ircd_alloc.h"
#include "ircd_chattr.h"
+#include "ircd_features.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "msg.h"
TOK_OPER,
0, MAXPARA, MFLG_SLOW, 0,
/* UNREG, CLIENT, SERVER, OPER, SERVICE */
-#ifndef NOOPER
{ m_unregistered, m_oper, ms_oper, mo_oper, m_ignore }
-#else
- { m_unregistered, m_oper, m_ignore, m_ignore, m_ignore }
-#endif
},
{
MSG_CONNECT,
};
-#ifdef GODMODE
-extern int sdbflag;
-#endif /* GODMODE */
-
static char *para[MAXPARA + 2]; /* leave room for prefix and null */
/*
handler = mptr->handlers[cli_handler(cptr)];
assert(0 != handler);
-#ifndef IDLE_FROM_MSG
- if (IsUser(cptr) && handler != m_ping && handler != m_ignore)
+ if (!feature_bool(FEAT_IDLE_FROM_MSG) && IsUser(cptr) &&
+ handler != m_ping && handler != m_ignore)
cli_user(from)->last = CurrentTime;
-#endif
return (*handler) (cptr, from, i, para);
}
#include "ircd.h"
#include "ircd_alloc.h"
#include "ircd_chattr.h"
+#include "ircd_features.h"
#include "ircd_log.h"
#include "ircd_osdep.h"
#include "ircd_string.h"
sendto_opmask_butone(0, SNO_IPMISMATCH, "IP# Mismatch: %s != %s[%s]",
cli_sock_ip(auth->client), hp->h_name,
ircd_ntoa(hp->h_addr_list[0]));
-#if defined(KILL_IPMISMATCH)
- auth_kill_client(auth);
- return;
-#endif
+ if (feature_bool(FEAT_KILL_IPMISMATCH)) {
+ auth_kill_client(auth);
+ return;
+ }
}
else {
++reply->ref_count;
#include "class.h"
#include "hash.h"
#include "ircd_log.h"
+#include "ircd_features.h"
#include "ircd_osdep.h"
#include "ircd_reply.h"
#include "ircd_string.h"
const char* const TOS_ERROR_MSG = "error setting TOS for %s: %s";
-#ifdef GODMODE
-#ifndef NODNS
-#define NODNS
-#endif
-#ifndef NOFLOODCONTROL
-#define NOFLOODCONTROL
-#endif
-#endif
-
#if !defined(USE_POLL)
#if FD_SETSIZE < (MAXCONNECTIONS + 4)
/*
* leading to a freezing select() on this side for some time.
* I had this on my Linux 1.1.88 --Run
*/
-#ifdef VIRTUAL_HOST
+
/*
* No, we do bind it if we have virtual host support. If we don't
* explicitly bind it, it will default to IN_ADDR_ANY and we lose
* due to the other server not allowing our base IP --smg
*/
- if (bind(cli_fd(cptr), (struct sockaddr*) &VirtualHost, sizeof(VirtualHost))) {
+ if (feature_bool(FEAT_VIRTUAL_HOST) &&
+ bind(cli_fd(cptr), (struct sockaddr*) &VirtualHost,
+ sizeof(VirtualHost))) {
report_error(BIND_ERROR_MSG, cli_name(cptr), errno);
return 0;
}
-#endif
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
unsigned int dolen = 0;
unsigned int length = 0;
- if (socket_ready && !(IsUser(cptr) && DBufLength(&(cli_recvQ(cptr))) > CLIENT_FLOOD)) {
+ if (socket_ready &&
+ !(IsUser(cptr) &&
+ DBufLength(&(cli_recvQ(cptr))) > feature_int(FEAT_CLIENT_FLOOD))) {
switch (os_recv_nonb(cli_fd(cptr), readbuf, sizeof(readbuf), &length)) {
case IO_SUCCESS:
if (length) {
if (length > 0 && 0 == dbuf_put(&(cli_recvQ(cptr)), readbuf, length)) {
return exit_client(cptr, cptr, &me, "dbuf_put fail");
}
-#ifndef NOFLOODCONTROL
+
/*
* XXX - cptr will always be a user or unregistered
*/
- if (IsUser(cptr) && DBufLength(&(cli_recvQ(cptr))) > CLIENT_FLOOD)
+ if (IsUser(cptr) &&
+ DBufLength(&(cli_recvQ(cptr))) > feature_int(FEAT_CLIENT_FLOOD))
return exit_client(cptr, cptr, &me, "Excess Flood");
while (DBufLength(&(cli_recvQ(cptr))) && !NoNewLine(cptr) &&
(IsTrusted(cptr) || cli_since(cptr) - CurrentTime < 10))
-#else
- while (DBufLength(&(cli_recvQ(cptr))) && !NoNewLine(cptr))
-#endif
{
/*
* If it has become registered as a Server
(EmptyString(aconf->passwd) && !EmptyString(bconf->passwd)))
continue;
if (!EmptyString(bconf->passwd) && (!IsDigit(*bconf->passwd) || bconf->passwd[1])
-#ifdef USEONE
- && 0 != ircd_strcmp(bconf->passwd, "ONE")
-#endif
&& 0 != ircd_strcmp(bconf->passwd, aconf->passwd))
continue;
const char* debug_serveropts(void)
{
+ int bp;
int i = 0;
#define AddC(c) serveropts[i++] = (c)
-#if BUFFERPOOL < 1000000
- AddC('b');
-#if BUFFERPOOL > 99999
- AddC((char)('0' + (BUFFERPOOL/100000)));
-#endif
-#if BUFFERPOOL > 9999
- AddC((char)('0' + (BUFFERPOOL/10000) % 10));
-#endif
- AddC((char)('0' + (BUFFERPOOL/1000) % 10));
-#else
- AddC('B');
-#if BUFFERPOOL > 99999999
- AddC((char)('0' + (BUFFERPOOL/100000000)));
-#endif
-#if BUFFERPOOL > 9999999
- AddC((char)('0' + (BUFFERPOOL/10000000) % 10));
-#endif
- AddC((char)('0' + (BUFFERPOOL/1000000) % 10));
-#endif
+ bp = feature_int(FEAT_BUFFERPOOL);
+ if (bp < 1000000) {
+ AddC('b');
+ if (bp > 99999)
+ AddC((char)('0' + (bp / 100000)));
+ if (bp > 9999)
+ AddC((char)('0' + (bp / 10000) % 10));
+ AddC((char)('0' + (bp / 1000) % 10));
+ } else {
+ AddC('B');
+ if (bp > 99999999)
+ AddC((char)('0' + (bp / 100000000)));
+ if (bp > 9999999)
+ AddC((char)('0' + (bp / 10000000) % 10));
+ AddC((char)('0' + (bp / 1000000) % 10));
+ }
+
#ifdef CHROOTDIR
AddC('c');
#endif
if (feature_bool(FEAT_OPER_MODE_LCHAN))
AddC('f');
-#ifdef HUB
- AddC('H');
-#endif
+ if (feature_bool(FEAT_HUB))
+ AddC('H');
if (feature_bool(FEAT_SHOW_ALL_INVISIBLE_USERS))
AddC('I');
if (feature_bool(FEAT_OPER_WALK_THROUGH_LMODES))
AddC('l');
-#ifdef IDLE_FROM_MSG
- AddC('M');
-#endif
-#ifdef USEONE
- AddC('O');
-#endif
+ if (feature_bool(FEAT_IDLE_FROM_MSG))
+ AddC('M');
if (feature_bool(FEAT_NO_OPER_DEOP_LCHAN))
AddC('o');
-#ifdef CRYPT_OPER_PASSWORD
- AddC('p');
-#endif
-#ifdef CRYPT_LINK_PASSWORD
- AddC('P');
-#endif
-#ifdef RELIABLE_CLOCK
- AddC('R');
-#endif
+ if (feature_bool(FEAT_CRYPT_OPER_PASSWORD))
+ AddC('p');
+
+ if (feature_bool(FEAT_RELIABLE_CLOCK))
+ AddC('R');
if (feature_bool(FEAT_LOCOP_RESTART))
AddC('s');
#if defined(USE_POLL) && defined(HAVE_POLL_H)
AddC('U');
#endif
-#ifdef VIRTUAL_HOST
- AddC('v');
-#endif
+
+ if (feature_bool(FEAT_VIRTUAL_HOST))
+ AddC('v');
serveropts[i] = '\0';
/* 199 */
{ 0 },
/* 200 */
-#ifndef GODMODE
{ RPL_TRACELINK, "Link %s%s %s %s", "200" },
-#else /* GODMODE */
- { RPL_TRACELINK, "Link %s%s %s %s " TIME_T_FMT, "200" },
-#endif /* GODMODE */
/* 201 */
{ RPL_TRACECONNECTING, "Try. %d %s", "201" },
/* 202 */
/* 363 */
{ RPL_CLOSEEND, "%d :Connections Closed", "363" },
/* 364 */
-#ifndef GODMODE
{ RPL_LINKS, "%s %s :%d P%u %s", "364" },
-#else /* GODMODE */
- { RPL_LINKS, "%s %s :%d P%u " TIME_T_FMT " (%s) %s", "364" },
-#endif /* GODMODE */
/* 365 */
{ RPL_ENDOFLINKS, "%s :End of /LINKS list.", "365" },
/* 366 */
#include "ircd.h"
#include "ircd_alloc.h"
#include "ircd_chattr.h"
+#include "ircd_features.h"
#include "ircd_log.h"
#include "ircd_reply.h"
#include "ircd_string.h"
*/
if (!(setflags & FLAGS_CHSERV))
ClearChannelService(sptr);
-#ifdef WALLOPS_OPER_ONLY
/*
* only send wallops to opers
*/
- if (!IsAnOper(sptr) && !(setflags & FLAGS_WALLOP))
+ if (feature_bool(FEAT_WALLOPS_OPER_ONLY) && !IsAnOper(sptr) &&
+ !(setflags & FLAGS_WALLOP))
ClearWallops(sptr);
-#endif
}
if (MyConnect(sptr)) {
if ((setflags & (FLAGS_OPER | FLAGS_LOCOP)) && !IsAnOper(sptr))