diff -ru ircd-hybrid-6rc6/include/config.h ircd-hybrid-6rc6-CARNet/include/config.h --- ircd-hybrid-6rc6/include/config.h Sun Oct 29 21:55:21 2000 +++ ircd-hybrid-6rc6-CARNet/include/config.h Thu Dec 21 21:50:30 2000 @@ -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" @@ -131,7 +131,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 @@ -160,8 +160,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. @@ -315,7 +315,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 @@ -375,7 +375,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 @@ -426,7 +426,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: @@ -448,7 +448,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 @@ -682,7 +682,7 @@ * -Dianora */ -#undef NO_PRIORITY +#define NO_PRIORITY /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ @@ -883,7 +883,7 @@ * */ -#undef REJECT_HOLD +#define REJECT_HOLD #define REJECT_HOLD_TIME 30 /* maximum number of fd's that will be used for reject holding */ @@ -923,7 +923,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 @@ -932,13 +932,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-6rc6/include/config.h.dist ircd-hybrid-6rc6-CARNet/include/config.h.dist --- ircd-hybrid-6rc6/include/config.h.dist Sun Oct 29 21:55:21 2000 +++ ircd-hybrid-6rc6-CARNet/include/config.h.dist Thu Dec 21 22:41:09 2000 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: config.h.dist,v 1.77 2000/10/29 20:55:21 lusky Exp $ + * $Id: config.h,v 1.86 2000/10/29 20:55:21 lusky Exp $ */ #ifndef INCLUDED_config_h #define INCLUDED_config_h @@ -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" @@ -131,7 +131,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 @@ -160,8 +160,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. @@ -315,7 +315,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 @@ -375,7 +375,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 @@ -426,7 +426,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: @@ -448,7 +448,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 @@ -682,7 +682,7 @@ * -Dianora */ -#undef NO_PRIORITY +#define NO_PRIORITY /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ @@ -883,7 +883,7 @@ * */ -#undef REJECT_HOLD +#define REJECT_HOLD #define REJECT_HOLD_TIME 30 /* maximum number of fd's that will be used for reject holding */ @@ -923,7 +923,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 @@ -932,13 +932,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-6rc6/include/patchlevel.h ircd-hybrid-6rc6-CARNet/include/patchlevel.h --- ircd-hybrid-6rc6/include/patchlevel.h Sun Oct 29 21:55:22 2000 +++ ircd-hybrid-6rc6-CARNet/include/patchlevel.h Thu Dec 21 20:30:29 2000 @@ -17,5 +17,5 @@ */ #ifndef PATCHLEVEL -#define PATCHLEVEL "2.8/hybrid-6rc6" +#define PATCHLEVEL "2.8/hybrid-6rc6/CARNet" #endif diff -ru ircd-hybrid-6rc6/include/s_conf.h ircd-hybrid-6rc6-CARNet/include/s_conf.h --- ircd-hybrid-6rc6/include/s_conf.h Tue Aug 22 07:03:55 2000 +++ ircd-hybrid-6rc6-CARNet/include/s_conf.h Thu Dec 21 21:07:03 2000 @@ -284,6 +284,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 @@ -308,6 +309,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-6rc6/src/s_conf.c ircd-hybrid-6rc6-CARNet/src/s_conf.c --- ircd-hybrid-6rc6/src/s_conf.c Sat Oct 21 08:36:14 2000 +++ ircd-hybrid-6rc6-CARNet/src/s_conf.c Thu Dec 21 22:33:34 2000 @@ -463,6 +463,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)); @@ -1749,6 +1786,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;