diff -ru ircd-hybrid-6.0/include/config.h ircd-hybrid-6.0-CARNet/include/config.h --- ircd-hybrid-6.0/include/config.h Mon Nov 27 05:11:47 2000 +++ ircd-hybrid-6.0-CARNet/include/config.h Wed Jan 10 17:48:18 2001 @@ -51,8 +51,8 @@ * system limits. If you know what you are doing, increase them now */ -#define HARD_FDLIMIT_ 256 -#define INIT_MAXCLIENTS 200 +#define HARD_FDLIMIT_ 1024 +#define INIT_MAXCLIENTS 500 #if defined(__CYGWIN__) #undef HARD_FDLIMIT_ @@ -107,8 +107,8 @@ * */ -#define DPATH "/usr/local/ircd/" -#define SPATH "/usr/local/ircd/ircd" +#define DPATH "/opt/irc/hybrid/" +#define SPATH "/opt/irc/hybrid/ircd" #define CPATH "ircd.conf" #define KPATH "kline.conf" #define DLPATH "kline.conf" @@ -135,12 +135,12 @@ /* NETWORK_NAME * Displayed in place of the servername when SERVERHIDE is enabled */ -#define NETWORK_NAME "EFnet" +#define NETWORK_NAME "CARNet IRC" /* NETWORK_DESC * Displayed in place of the server info when SERVERHIDE is enabled */ -#define NETWORK_DESC "Eris Free Network" +#define NETWORK_DESC "CARNet IRC Network" /* TS_MAX_DELTA and TS_WARN_DELTA - allowed delta for TS when another @@ -156,7 +156,7 @@ * implementation. Once pre-hybrid5.2 servers are eradicated, we can drop this * down to 90 seconds or so. --Rodder */ -#define TS_MAX_DELTA 300 /* seconds */ +#define TS_MAX_DELTA 900 /* seconds */ #define TS_WARN_DELTA 30 /* seconds */ /* SLAVE_SERVERS - Use this to send LOCOPS and KLINES to servers you define @@ -185,8 +185,8 @@ * * These need to be defined if you want to use SYSLOG logging, too. */ -#define FNAME_USERLOG "/usr/local/ircd/users" /* */ -#define FNAME_OPERLOG "/usr/local/ircd/opers" /* */ +#define FNAME_USERLOG "/opt/irc/hybrid/users" /* */ +#define FNAME_OPERLOG "/opt/irc/hybrid/opers" /* */ /* RFC1035_ANAL * Defining this causes ircd to reject hostnames with non-compliant chars. @@ -340,7 +340,7 @@ * Why do opers need this at all? Its an invasion of privacy. bah. * you don't need this. -Dianora */ -#undef WHOIS_NOTICE +#define WHOIS_NOTICE /* WHOIS_WAIT - minimum seconds between remote use of WHOIS before * max use count is reset @@ -400,7 +400,7 @@ * Above 4 will only give a rather marginal increase in compression for a * large increase in CPU usage. */ -#define ZIP_LEVEL 2 +#define ZIP_LEVEL 5 /* * OPER_UMODES LOCOP_UMODES - set these to be the initial umodes when OPER'ing @@ -444,14 +444,14 @@ * to a leaf which just has 1 server (typically the uplink). Define this * correctly for performance reasons. */ -#undef HUB +#define HUB /* CMDLINE_CONFIG - allow conf-file to be specified on command line * NOTE: defining CMDLINE_CONFIG and installing ircd SUID or SGID is a MAJOR * security problem - they can use the "-f" option to read any files * that the 'new' access lets them. */ -#define CMDLINE_CONFIG +#undef CMDLINE_CONFIG /* INIT_LOG_LEVEL - what level of information is logged to ircd.log * options are: @@ -473,7 +473,7 @@ * this option is used unless you tell the system administrator beforehand * and obtain their permission to send messages to the system log files. */ -#define USE_SYSLOG +#undef USE_SYSLOG #ifdef USE_SYSLOG /* SYSLOG_KILL SYSLOG_SQUIT SYSLOG_CONNECT SYSLOG_USERS SYSLOG_OPER @@ -708,7 +708,7 @@ * -Dianora */ -#undef NO_PRIORITY +#define NO_PRIORITY /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ @@ -909,7 +909,7 @@ * */ -#undef REJECT_HOLD +#define REJECT_HOLD #define REJECT_HOLD_TIME 30 /* maximum number of fd's that will be used for reject holding */ @@ -949,7 +949,7 @@ * viconf option, if USE_RCS is defined, viconf will use rcs "ci" * to keep the conf file under RCS control. */ -#define USE_RCS +#undef USE_RCS /* ----------------- not approved on EFnet section -------------------- */ /* GLINES - global Kline-like bans @@ -958,13 +958,30 @@ * three different servers must do the identical GLINE in order * for the G line to take effect. */ -#undef GLINES +#define GLINES #define GLINEFILE "gline.log" /* GLINE_TIME - local expire time for GLINES * As configured here, a GLINE will last 12 hours */ -#define GLINE_TIME (12*3600) +#define GLINE_TIME (24*3600) + +/* ----------------- CARNet extra patches section --------------------- */ +/* Define this if you want addresses starting with `_' in ircd.conf to + be SMART_SPOOFed to new address that is CRC16 encoded. -kre + */ +#define SMART_SPOOF + +/* Prefix that indicates whether SMART_SPOOFed addresses should be + prefixed or not. It should usually be `asy-' since most addresses + you want to be spoofed are async ttys. If not defined, it will + be ignored. -kre */ +#define SMART_SPOOF_PREFIX "asy-" + +/* Define to polinomial value for proper CRC16 encoding. Should be + either 0xa001, 0x8408, 0x1021. This *has* to be defined if + SMART_SPOOF is defined. -kre */ +#define SMART_SPOOF_POLY 0xa001 /* ----------------- archaic and/or broken section -------------------- */ #undef DNS_DEBUG diff -ru ircd-hybrid-6.0/include/config.h.dist ircd-hybrid-6.0-CARNet/include/config.h.dist --- ircd-hybrid-6.0/include/config.h.dist Mon Nov 27 05:11:48 2000 +++ ircd-hybrid-6.0-CARNet/include/config.h.dist Wed Jan 10 18:04:30 2001 @@ -51,8 +51,8 @@ * system limits. If you know what you are doing, increase them now */ -#define HARD_FDLIMIT_ 256 -#define INIT_MAXCLIENTS 200 +#define HARD_FDLIMIT_ 1024 +#define INIT_MAXCLIENTS 500 #if defined(__CYGWIN__) #undef HARD_FDLIMIT_ @@ -107,8 +107,8 @@ * */ -#define DPATH "/usr/local/ircd/" -#define SPATH "/usr/local/ircd/ircd" +#define DPATH "/opt/irc/hybrid/" +#define SPATH "/opt/irc/hybrid/ircd" #define CPATH "ircd.conf" #define KPATH "kline.conf" #define DLPATH "kline.conf" @@ -135,12 +135,12 @@ /* NETWORK_NAME * Displayed in place of the servername when SERVERHIDE is enabled */ -#define NETWORK_NAME "EFnet" +#define NETWORK_NAME "CARNet IRC" /* NETWORK_DESC * Displayed in place of the server info when SERVERHIDE is enabled */ -#define NETWORK_DESC "Eris Free Network" +#define NETWORK_DESC "CARNet IRC Network" /* TS_MAX_DELTA and TS_WARN_DELTA - allowed delta for TS when another @@ -156,7 +156,7 @@ * implementation. Once pre-hybrid5.2 servers are eradicated, we can drop this * down to 90 seconds or so. --Rodder */ -#define TS_MAX_DELTA 300 /* seconds */ +#define TS_MAX_DELTA 900 /* seconds */ #define TS_WARN_DELTA 30 /* seconds */ /* SLAVE_SERVERS - Use this to send LOCOPS and KLINES to servers you define @@ -185,8 +185,8 @@ * * These need to be defined if you want to use SYSLOG logging, too. */ -#define FNAME_USERLOG "/usr/local/ircd/users" /* */ -#define FNAME_OPERLOG "/usr/local/ircd/opers" /* */ +#define FNAME_USERLOG "/opt/irc/hybrid/users" /* */ +#define FNAME_OPERLOG "/opt/irc/hybrid/opers" /* */ /* RFC1035_ANAL * Defining this causes ircd to reject hostnames with non-compliant chars. @@ -340,7 +340,7 @@ * Why do opers need this at all? Its an invasion of privacy. bah. * you don't need this. -Dianora */ -#undef WHOIS_NOTICE +#define WHOIS_NOTICE /* WHOIS_WAIT - minimum seconds between remote use of WHOIS before * max use count is reset @@ -400,7 +400,7 @@ * Above 4 will only give a rather marginal increase in compression for a * large increase in CPU usage. */ -#define ZIP_LEVEL 2 +#define ZIP_LEVEL 4 /* * OPER_UMODES LOCOP_UMODES - set these to be the initial umodes when OPER'ing @@ -451,7 +451,7 @@ * security problem - they can use the "-f" option to read any files * that the 'new' access lets them. */ -#define CMDLINE_CONFIG +#undef CMDLINE_CONFIG /* INIT_LOG_LEVEL - what level of information is logged to ircd.log * options are: @@ -473,7 +473,7 @@ * this option is used unless you tell the system administrator beforehand * and obtain their permission to send messages to the system log files. */ -#define USE_SYSLOG +#undef USE_SYSLOG #ifdef USE_SYSLOG /* SYSLOG_KILL SYSLOG_SQUIT SYSLOG_CONNECT SYSLOG_USERS SYSLOG_OPER @@ -708,7 +708,7 @@ * -Dianora */ -#undef NO_PRIORITY +#define NO_PRIORITY /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ @@ -909,7 +909,7 @@ * */ -#undef REJECT_HOLD +#define REJECT_HOLD #define REJECT_HOLD_TIME 30 /* maximum number of fd's that will be used for reject holding */ @@ -949,7 +949,7 @@ * viconf option, if USE_RCS is defined, viconf will use rcs "ci" * to keep the conf file under RCS control. */ -#define USE_RCS +#undef USE_RCS /* ----------------- not approved on EFnet section -------------------- */ /* GLINES - global Kline-like bans @@ -958,13 +958,30 @@ * three different servers must do the identical GLINE in order * for the G line to take effect. */ -#undef GLINES +#define GLINES #define GLINEFILE "gline.log" /* GLINE_TIME - local expire time for GLINES * As configured here, a GLINE will last 12 hours */ -#define GLINE_TIME (12*3600) +#define GLINE_TIME (24*3600) + +/* ----------------- CARNet extra patches section --------------------- */ +/* Define this if you want addresses starting with `_' in ircd.conf to + be SMART_SPOOFed to new address that is CRC16 encoded. -kre + */ +#define SMART_SPOOF + +/* Prefix that indicates whether SMART_SPOOFed addresses should be + prefixed or not. It should usually be `asy-' since most addresses + you want to be spoofed are async ttys. If not defined, it will + be ignored. -kre */ +#define SMART_SPOOF_PREFIX "asy-" + +/* Define to polinomial value for proper CRC16 encoding. Should be + either 0xa001, 0x8408, 0x1021. This *has* to be defined if + SMART_SPOOF is defined. -kre */ +#define SMART_SPOOF_POLY 0xa001 /* ----------------- archaic and/or broken section -------------------- */ #undef DNS_DEBUG diff -ru ircd-hybrid-6.0/include/patchlevel.h ircd-hybrid-6.0-CARNet/include/patchlevel.h --- ircd-hybrid-6.0/include/patchlevel.h Thu Jan 4 04:14:27 2001 +++ ircd-hybrid-6.0-CARNet/include/patchlevel.h Wed Jan 10 17:39:20 2001 @@ -17,5 +17,5 @@ */ #ifndef PATCHLEVEL -#define PATCHLEVEL "2.8/hybrid-6.0" +#define PATCHLEVEL "2.8/hybrid-6.0/CARNet" #endif diff -ru ircd-hybrid-6.0/include/s_conf.h ircd-hybrid-6.0-CARNet/include/s_conf.h --- ircd-hybrid-6.0/include/s_conf.h Fri Dec 1 07:28:47 2000 +++ ircd-hybrid-6.0-CARNet/include/s_conf.h Wed Jan 10 17:39:20 2001 @@ -288,6 +288,7 @@ #define CONF_FLAGS_ALLOW_AUTO_CONN 0x0400 #define CONF_FLAGS_ZIP_LINK 0x0800 #define CONF_FLAGS_SPOOF_IP 0x1000 +#define CONF_FLAGS_SMART_SPOOF_IP 0x2000 #ifdef LITTLE_I_LINES #define CONF_FLAGS_LITTLE_I_LINE 0x8000 @@ -313,6 +314,7 @@ #define IsConfDoIdentd(x) ((x)->flags & CONF_FLAGS_DO_IDENTD) #define IsConfDoSpoofIp(x) ((x)->flags & CONF_FLAGS_SPOOF_IP) +#define IsConfDoSmartSpoofIp(x) ((x)->flags & CONF_FLAGS_SMART_SPOOF_IP) #ifdef LITTLE_I_LINES #define IsConfLittleI(x) ((x)->flags & CONF_FLAGS_LITTLE_I_LINE) #endif diff -ru ircd-hybrid-6.0/src/s_conf.c ircd-hybrid-6.0-CARNet/src/s_conf.c --- ircd-hybrid-6.0/src/s_conf.c Fri Dec 1 07:28:50 2000 +++ ircd-hybrid-6.0-CARNet/src/s_conf.c Wed Jan 10 18:05:14 2001 @@ -474,6 +474,43 @@ SetIPSpoof(cptr); SetIPHidden(cptr); } + +#ifdef SMART_SPOOF + /* Encode IP to real spoofed CRC16 encoded string -kre */ + if (IsConfDoSmartSpoofIp(aconf)) + { + /* Re-implementation using CCITT CRC 16 -kre */ + unsigned register crc=0, data, i; + char *strptr=cptr->host; + + do + for (data=*strptr, i=0; i<8; ++i) + { + if ((crc & 0x0001) ^ (data & 0x0001)) + crc = (crc>>1) ^ SMART_SPOOF_POLY; + else + crc>>=1; + data>>=1; + } + while (*(++strptr)); + + /* Notice that SMART_SPOOF_PREFIX should be smaller than + HOSTLEN - I decided to leave it that way, since there is no + checking for IsConfDoSpoofIp, either.. -kre */ +#ifdef SMART_SPOOF_PREFIX + strcpy(cptr->host, SMART_SPOOF_PREFIX); + for (i=strlen(SMART_SPOOF_PREFIX); crc; ++i, crc/=26) +#else + for (i=0; crc; ++i, crc/=26) +#endif + /* Perhaps this should be something faster than otherwise + slow `%' operation. -kre */ + cptr->host[i]='A'+(crc%26); + strncpy_irc(cptr->host+i, aconf->name, HOSTLEN-i); + SetIPSpoof(cptr); + SetIPHidden(cptr); + } +#endif #ifdef LIMIT_UH return(attach_iline(cptr, aconf, username)); @@ -1760,6 +1797,9 @@ case '=': aconf->flags |= CONF_FLAGS_SPOOF_IP; break; + case '_': + aconf->flags |= CONF_FLAGS_SMART_SPOOF_IP; + break; case '!': aconf->flags |= CONF_FLAGS_LIMIT_IP; break; @@ -1784,9 +1824,10 @@ case '>': /* can exceed max connects */ aconf->flags |= CONF_FLAGS_F_LINED; break; - case '_': /* exempt from glines */ - aconf->flags |= CONF_FLAGS_EXEMPTGLINE; - break; +/* quickfix to make things working -kre + * case '_': /* exempt from glines */ +/* aconf->flags |= CONF_FLAGS_EXEMPTGLINE; + break; */ #ifdef IDLE_CHECK case '<': /* can idle */ aconf->flags |= CONF_FLAGS_IDLE_LINED;