diff -rdu ircd-hybrid-6-cvs/include/config.h ircd-hybrid-6-CARNet/include/config.h --- ircd-hybrid-6-cvs/include/config.h Mon Jun 11 01:11:45 2001 +++ ircd-hybrid-6-CARNet/include/config.h Mon Jun 11 10:45:29 2001 @@ -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,v 1.106 2001/06/10 20:00:07 db Exp $ + * $Id: config.h.dist,v 1.93 2001/06/10 20:00:08 db Exp $ */ #ifndef INCLUDED_config_h #define INCLUDED_config_h @@ -333,9 +333,9 @@ #define B_LINES_OPER_ONLY #define E_LINES_OPER_ONLY #define F_LINES_OPER_ONLY -#define I_LINES_OPER_ONLY -#define K_LINES_OPER_ONLY -#define O_LINES_OPER_ONLY +#undef I_LINES_OPER_ONLY +#undef K_LINES_OPER_ONLY +#undef O_LINES_OPER_ONLY #define P_LINES_OPER_ONLY /* SPOOF_NOTICE - See a notice when a user connects with a @@ -351,7 +351,7 @@ * seeing STATS p requests, look below for the answer to that * argument. */ -#define STATS_NOTICE +#undef STATS_NOTICE /* STATS_P_NOTICE - See STATS p requests only, when STATS_NOTICE * is undefined. This allows opers to see requests by users for @@ -398,7 +398,7 @@ /* NO_OPER_FLOOD - disable flood control for opers * define this to remove flood control for opers */ -#define NO_OPER_FLOOD +#undef NO_OPER_FLOOD /* TRUE_NO_OPER_FLOOD - absolutely remove all flood * control for opered clients. for this to work, the above define @@ -481,7 +481,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: @@ -905,7 +905,7 @@ * */ -#undef REJECT_HOLD +#define REJECT_HOLD #define REJECT_HOLD_TIME 30 /* maximum number of fd's that will be used for reject holding */ @@ -960,7 +960,7 @@ /* 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) /* Ignore bogus timestamps from other servers. Yes this will desync * the network, but it will allow chanops to resync with a valid non TS 0 @@ -997,6 +997,24 @@ * can be chanopped, but cannot chanop anyone else. */ #undef LITTLE_I_LINES + +/* ----------------- 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 + /* ------------------------- END CONFIGURATION SECTION -------------------- */ #define MAX_CLIENTS INIT_MAXCLIENTS Only in ircd-hybrid-6-cvs/include: config.h-CARNet diff -rdu ircd-hybrid-6-cvs/include/config.h.dist ircd-hybrid-6-CARNet/include/config.h.dist --- ircd-hybrid-6-cvs/include/config.h.dist Sun Jun 10 23:59:57 2001 +++ ircd-hybrid-6-CARNet/include/config.h.dist Mon Jun 11 10:33:38 2001 @@ -109,8 +109,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" @@ -144,12 +144,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 @@ -165,7 +165,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 @@ -365,7 +365,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 @@ -449,7 +449,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 @@ -481,7 +481,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: @@ -707,7 +707,7 @@ * -Dianora */ -#undef NO_PRIORITY +#define NO_PRIORITY /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ @@ -905,7 +905,7 @@ * */ -#undef REJECT_HOLD +#define REJECT_HOLD #define REJECT_HOLD_TIME 30 /* maximum number of fd's that will be used for reject holding */ @@ -945,7 +945,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 @@ -954,13 +954,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 /* Ignore bogus timestamps from other servers. Yes this will desync * the network, but it will allow chanops to resync with a valid non TS 0 Only in ircd-hybrid-6-CARNet/include: config.h.dist.orig Only in ircd-hybrid-6-CARNet/include: config.h.orig diff -rdu ircd-hybrid-6-cvs/include/s_conf.h ircd-hybrid-6-CARNet/include/s_conf.h --- ircd-hybrid-6-cvs/include/s_conf.h Fri Dec 1 07:28:47 2000 +++ ircd-hybrid-6-CARNet/include/s_conf.h Mon Jun 11 10:33:38 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 -rdu ircd-hybrid-6-cvs/src/s_conf.c ircd-hybrid-6-CARNet/src/s_conf.c --- ircd-hybrid-6-cvs/src/s_conf.c Wed Jun 6 10:30:42 2001 +++ ircd-hybrid-6-CARNet/src/s_conf.c Mon Jun 11 10:49:41 2001 @@ -465,6 +465,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)); @@ -1751,6 +1788,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; @@ -1775,9 +1815,12 @@ case '>': /* can exceed max connects */ aconf->flags |= CONF_FLAGS_F_LINED; break; - case '_': /* exempt from glines */ +#if 0 +/* quickfix to make things working -kre */ + case '_': /* exempt from glines */ aconf->flags |= CONF_FLAGS_EXEMPTGLINE; break; +#endif #ifdef IDLE_CHECK case '<': /* can idle */ aconf->flags |= CONF_FLAGS_IDLE_LINED;