irc-dev-cvs Mailing List for IRC-Dev ircd development (Page 11)
Brought to you by:
zolty
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(22) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(30) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(27) |
Dec
(17) |
2004 |
Jan
|
Feb
(4) |
Mar
|
Apr
(4) |
May
(8) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(14) |
Dec
(2) |
2005 |
Jan
(18) |
Feb
(2) |
Mar
(12) |
Apr
(18) |
May
(16) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(9) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(5) |
Oct
|
Nov
(3) |
Dec
(2) |
2008 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(8) |
Aug
(14) |
Sep
(4) |
Oct
(11) |
Nov
(1) |
Dec
|
From: Toni G. <zo...@us...> - 2003-01-18 23:37:33
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:37:32 UTC Log message: Directory /cvsroot/irc-dev/ircdh/tools/tea added to the repository |
From: Toni G. <zo...@us...> - 2003-01-18 23:36:53
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:36:52 UTC Added files: tools/Makefile.crypt tools/README tools/autodoc.py tools/crypter tools/hashtoy tools/mkchroot tools/mkpasswd.c tools/ringlog.c tools/ringlog.pl tools/sums tools/transition tools/untabify tools/wrapper.c Log message: Directorio de tools con diversas herramientas. ---------------------- diff included ---------------------- Index: ircdh/tools/Makefile.crypt diff -u /dev/null ircdh/tools/Makefile.crypt:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/Makefile.crypt Sat Jan 18 15:36:42 2003 @@ -0,0 +1,37 @@ +#************************************************************************ +#* IRC - Internet Relay Chat, ircd/crypt/Makefile +#* Copyright (C) 1991 Darren Reed +#* +#* This program is free software; you can redistribute it and/or modify +#* it under the terms of the GNU General Public License as published by +#* the Free Software Foundation; either version 1, or (at your option) +#* any later version. +#* +#* This program is distributed in the hope that it will be useful, +#* but WITHOUT ANY WARRANTY; without even the implied warranty of +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#* GNU General Public License for more details. +#* +#* You should have received a copy of the GNU General Public License +#* along with this program; if not, write to the Free Software +#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#*/ +# +# Change this to the path of your local ircd.conf file +# +IRCDCONF = /usr/local/lib/irc/ircd.conf + +LIBS = -lcrypt + +all: mkpasswd +crypt: install + +mkpasswd: mkpasswd.c + gcc -Wall -O2 mkpasswd.c -o mkpasswd ${LIBS} + +install: + crypter ${IRCDCONF} + @echo 'done.' + +clean: + /bin/rm -f mkpasswd Index: ircdh/tools/README diff -u /dev/null ircdh/tools/README:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/README Sat Jan 18 15:36:42 2003 @@ -0,0 +1,61 @@ +/************************************************************************ + * IRC - Internet Relay Chat, ircd/crypt/README + * Copyright (C) 1991 Nelson Minar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +The change implemented here is that the operator password in irc.conf +is no longer stored in plaintext form, but is encrypted the same way +that user passwords are encrypted on normal UNIX systems. Ie, instead +of having + + O:*:goodboy:Nelson + +in your ircd.conf file, you have + + O:*:sCnvYRmbFJ7oI:Nelson + +You still type "/oper Nelson goodboy" to become operator. However, if +someone gets ahold of your irc.conf file, they can no longer figure +out what the password is from reading it. There are still other +security holes, namely server-server passwords, but this closes one +obvious problem. + +So how do you generate these icky looking strings for passwords? +There's a simple program called mkpasswd to do that for you. Just run +mkpasswd, and at the prompt type in your plaintext password. It will +spit out the encrypted password, which you should then just copy into +the irc.conf file. This should be done only when adding new passwords +to your irc.conf file. To change over your irc.conf file to use +encrypted passwords, define CRYPT_OPER_PASSWORD in config.h. You will +need to recompile your server if you already compiled it with this +feature disabled. Once compiled, edit the Makefile in this directory +and chang "IRCDCONF" to your irc.conf file. Then "make install" in this +directory to replace all the operator passwords in your irc.conf file +with the encrypted format. + +Choose your passwords carefully. Do not choose something in a +dictionary, make sure its at least 5 characters. Anything past 8 +characters is ignored. + +One thing to note about crypt() passwords - for every plaintext, there +are 4096 different passwords. Some valid encryptions of "goodboy" +include t1Ub2RhRQHd4g sCnvYRmbFJ7oI and Xr4Z.Kg5tcdy6. The first +two characters (the "salt") determine which of the 4096 passwords +you will get. mkpasswd chooses the salt randomly, or alternately +will let you specify one on the command line. + +see also - crypt(3) Index: ircdh/tools/autodoc.py diff -u /dev/null ircdh/tools/autodoc.py:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/autodoc.py Sat Jan 18 15:36:42 2003 @@ -0,0 +1,70 @@ +# +# Structure AutoDocumentator for ircu. +# 26/02/2000 --Gte +# +# Creates a 'structs.html', containing HTML Table definitions +# for all structures encountered in *.h in the current directory. +# +# $Id: autodoc.py,v 1.1 2003/01/18 23:36:42 zolty Exp $ + +import string, fnmatch, os + +def parse(filename): + OutFile = open('structs.html', 'a') + OutFile.write("<B><H2>"+filename+"</H2>") + stage = 1 + try: + IncFile = open(filename, 'r') + line = IncFile.readline() + + while line != "": + line = string.replace(line,"\n","") # Stript out LF's. + splitline = string.split(line, " ") + try: + if ((stage == 2) & (splitline[0] == "};")): + OutFile.write("</TABLE><P>"+"\n") + stage = 1 + if (stage == 2): + # Begin reading member information. + declr = string.split(string.strip(line), ";", 1) + comment = string.replace(declr[1], "*", "") + comment = string.replace(comment, "/", "") + + OutFile.write("<tr>\n") + OutFile.write("<td WIDTH=\"22%\">"+string.strip(declr[0])+"</td>\n") + if (declr[1][-1] == "/"): + OutFile.write("<td WIDTH=\"78%\">"+string.strip(comment)+"</td>\n") + else: + # Loop until end of comment string. + while (declr[-1] != "/"): + line = IncFile.readline() + line = string.replace(line,"\n","") # Stript out LF's. + declr = string.strip(line) + comment = comment + line + comment = string.replace(comment, "*", "") + comment = string.replace(comment, "/", "") + OutFile.write("<td WIDTH=\"78%\">"+string.strip(comment)+"</td>\n") + OutFile.write("</tr>\n") + + if ((splitline[0] == "struct") & (splitline[2] == "{") & (stage == 1)): + # We've found a "Standard" structure definition. + OutFile.write("Structure table for: \"<B>"+splitline[1]+"</B>\"<P>\n") + OutFile.write("<table BORDER CELLSPACING=0 CELLPADDING=2 WIDTH=\"100%\" ><tr><td VALIGN=TOP WIDTH=\"22%\"><b>Variable</b></td><td VALIGN=TOP WIDTH=\"78%\"><b>Description</b></td></tr>") + # Now, carry on until we encounter a "};". + stage = 2 + except IndexError: + pass + line = IncFile.readline() + + IncFile.close + OutFile.write("<HR>") + + except IOError: + print("** Error, File does not exist.") + OutFile.close + +files = os.listdir(".") +files.sort() +for file in files: + if (fnmatch.fnmatch(file, "*.h")): + parse(file) Index: ircdh/tools/crypter diff -u /dev/null ircdh/tools/crypter:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/crypter Sat Jan 18 15:36:42 2003 @@ -0,0 +1,52 @@ +#!/usr/local/bin/perl +#************************************************************************ +#* IRC - Internet Relay Chat, ircd/crypt/crypter +#* Copyright (C) 1991 Sean Batt +#* +#* This program is free software; you can redistribute it and/or modify +#* it under the terms of the GNU General Public License as published by +#* the Free Software Foundation; either version 1, or (at your option) +#* any later version. +#* +#* This program is distributed in the hope that it will be useful, +#* but WITHOUT ANY WARRANTY; without even the implied warranty of +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#* GNU General Public License for more details. +#* +#* You should have received a copy of the GNU General Public License +#* along with this program; if not, write to the Free Software +#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#*/ + +#From Sean Batt se...@co... +# +#Temporary output file +# +$tmpfile = "/tmp/ircd.conf.tmp"; + +# +#Original ircd.conf file +# +$ircdconf = @ARGV[0]; + +print "crypting ",$ircdconf,"\n"; +@saltset = ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '.', '/'); + +umask(0077); +open ($ircdout, ">/tmp/ircd.conf.tmp") || die "open $!"; + +while ($text = <>) { +#if its not an "O" line we can ignore it + $text =~ /^o/i || print ($ircdout $text) && next; + chop($text); + @oline = split(':', $text); + $salt = $saltset[rand(time)%64].$saltset[(rand(time)>>6)%64]; + $oline[2] = crypt(@oline[2], $salt); + print ($ircdout join(':',@oline)."\n"); +} +close ($ircdout); +close ($ircdin); +print "/bin/cp ",$tmpfile," ",$ircdconf,"\n"; +(fork()==0) ? exec("/bin/cp", $tmpfile, $ircdconf) : wait; + +#unlink($tmpfile); Index: ircdh/tools/hashtoy diff -u /dev/null ircdh/tools/hashtoy:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/hashtoy Sat Jan 18 15:36:42 2003 @@ -0,0 +1,90 @@ +#!/usr/bin/perl +# +# hashtoy: a little script to read an ircu burst IP dump and try +# different hash formulae +# usage: hashtoy <filename> <tablesize> '<expression>' +# use x for the key and n for the table size +# example: hashtoy undernet-burst.txt 8192 '((x >> 14) + (x >> 7) + x) & 8191' +# notes: the input file is expected to contain one encoded IP address per +# line. see base64toint() and inttobase64() in ircd/s_user.c for +# details of the encoding. +# +# --Liandrin + +@convert2n = ( + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 62, 0, 63, 0, 0, 0, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51 +); + +sub base64toint { + my $i = 0; + my $str = shift; + my @strc = ($str =~ /(.)/g); + + $i = $convert2n[ord($strc[5])]; + $i += $convert2n[ord($strc[4])] << 6; + $i += $convert2n[ord($strc[3])] << 12; + $i += $convert2n[ord($strc[2])] << 18; + $i += $convert2n[ord($strc[1])] << 24; + $i += $convert2n[ord($strc[0])] << 30; +} + +sub ntohl { + my $i = shift; + my $j; + + return (($i & 0xFF000000) >> 24) | + (($i & 0x00FF0000) >> 8) | + (($i & 0x0000FF00) << 8) | + (($i & 0x000000FF) << 24); +} + +($file, $tablesize, $expression) = @ARGV; +while ($#ARGV > -1) { shift @ARGV; } + +if (!defined($file) || !defined($tablesize) || !defined($expression)) { + print STDERR "usage: $0 filename tablesize expression\n"; + print STDERR "sample expression: x % n\n"; + exit 1; +} + +$expression =~ s/\bx\b/\$ip/gi; +$expression =~ s/\bn\b/\$tablesize/gi; +$expression =~ s/^(.*)$/sub dohash { return ($1); }/; + +$minkey = 2**32; +$maxkey = 0; + +eval $expression; + +open IPS, $file || die "Can't open $file at"; + +while (<IPS>) { + chomp; + $ip = base64toint($_); + $key = dohash($ip); + $minkey = $key if ($key < $minkey); + $maxkey = $key if ($key > $maxkey); + $testing{$key}++; +} + +$max = 0; +$min = $tablesize + 1; +$nEntries = 0; +$total = 0; +for (values %testing) { + $max = $_ if ($_ > $max); + $min = $_ if ($_ < $min); + $nEntries++; + $total += $_; +} + +print "Table size: $tablesize\n"; +printf "Min/average/max chain length: $min/%.2f/$max\n", ($total / $nEntries); +print "Minimum key: $minkey\n"; +print "Maximum key: $maxkey\n"; Index: ircdh/tools/mkchroot diff -u /dev/null ircdh/tools/mkchroot:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/mkchroot Sat Jan 18 15:36:42 2003 @@ -0,0 +1,99 @@ +#!/bin/sh +# +# IRC - Internet Relay Chat, tools/mkchroot +# Copyright (C) 2001 Kevin L. Mitchell <kl...@mi...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 1, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# $Id: mkchroot,v 1.1 2003/01/18 23:36:42 zolty Exp $ + +if test $# -lt 2; then + echo "Usage: $0 <destdir> <executable> [<executable> [...]]" >&2 + exit 2 +fi + +destdir=$1 +shift + +# Use ldd to formulate a newline-separated list of libraries +liblist= +for arg +do + # Interpret ldd output + libs=`ldd $arg | sed -e 's/ / /g' -e 's/ */ /g' -e 's/^ //g' | \ + awk 'BEGIN { RS = " "; } { print; }' | grep '^/'` + + # add it to the list so far + if test x"$liblist" = x; then + liblist=$libs + else + liblist="$liblist +$libs" + fi +done +# Sort the list and remove duplicates +liblist=`echo "$liblist" | sort -u` + +# Now figure out all the subdirectories we're interested in +# Must create the top level, if need be +dirlist=/ +# Break down the library list into directories and remove duplicates +dirs=`echo "$liblist" | sed -e 's@/[^/]*$@@' | sort -u` +# Go through each directory to break it down into its components +for headdir in $dirs; do + tIFS=$IFS + IFS=/$IFS + # Start at the top level + dir= + for subdir in $headdir; do + # update dir so we know where we are + if test x"$dir" = x; then + dir=$subdir + else + dir=$dir/$subdir + fi + + # add (absolute) entry to directory list + dirlist="$dirlist +/$dir" + done + IFS=$tIFS +done +# Sort for ordering and remove duplicates +dirlist=`echo "$dirlist" | sort -u` + +# Create the directories +echo "Creating directories:" +for dir in $dirlist; do + # add destination directory name, remove trailing /, if any, for test + dir=`echo "$destdir$dir" | sed -e 's@//*$@@'` + echo " $dir" + # sanity-check directory... + if test -f "$dir" -o -h "$dir"; then + echo "ERROR: A non-directory \"$dir\" already exists; bailing out" >&2 + exit 2 + elif test ! -d "$dir"; then + # Create the directory world-readable + mkdir -m 755 $dir + fi +done + +# Now copy over the libraries +echo "Copying libraries:" +for lib in $liblist; do + echo " $lib -> $destdir$lib" + # Preserve permissions + cp -p $lib $destdir$lib +done Index: ircdh/tools/mkpasswd.c diff -u /dev/null ircdh/tools/mkpasswd.c:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/mkpasswd.c Sat Jan 18 15:36:42 2003 @@ -0,0 +1,39 @@ +/* simple password generator by Nelson Minar (mi...@re...) + * copyright 1991, all rights reserved. + * You can use this code as long as my name stays with it. + */ +#define _XOPEN_SOURCE +#define _XOPEN_VERSION 4 +#define _XOPEN_SOURCE_EXTENDED +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> + +int main(int argc, char *argv[]) +{ + static char saltChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; + char salt[3]; + char * plaintext; + + if (argc < 2) { + srandom(time(0)); /* may not be the BEST salt, but its close */ + salt[0] = saltChars[random() % 64]; + salt[1] = saltChars[random() % 64]; + salt[2] = 0; + } + else { + salt[0] = argv[1][0]; + salt[1] = argv[1][1]; + salt[2] = '\0'; + if ((strchr(saltChars, salt[0]) == NULL) || (strchr(saltChars, salt[1]) == NULL)) + fprintf(stderr, "illegal salt %s\n", salt), exit(1); + } + + plaintext = getpass("plaintext: "); + + printf("%s\n", crypt(plaintext, salt)); + return 0; +} + Index: ircdh/tools/ringlog.c diff -u /dev/null ircdh/tools/ringlog.c:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/ringlog.c Sat Jan 18 15:36:42 2003 @@ -0,0 +1,341 @@ +/* +** Copyright (C) 2002 by Kevin L. Mitchell <kl...@mi...> +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** @(#)$Id: ringlog.c,v 1.1 2003/01/18 23:36:42 zolty Exp $ +*/ +/* + * This file contains two separate pieces, along with some common + * gunk. If RINGLOG_INSTRUMENT is defined, the two special functions + * __cyg_profile_func_enter() and __cyg_profile_func_exit() are + * defined; otherwise a main function is defined. The common gunk is + * init_log(), which opens and, if necessary, initializes a special + * binary log file that is treated as a ring buffer (to prevent the + * file from growing unboundedly). + * + * The object produced when compiled with RINGLOG_INSTRUMENT is + * designed to work with the special gcc option + * -finstrument-functions; this option causes the + * __cyg_profile_func_*() functions mentioned above to be called when + * a function is entered or exited. (Of course, ringlog.o should + * *not* be compiled with this option.) These functions will in turn + * call store_entry(), which will call init_log() as needed to open + * the log file, ensure that a start record is output, and then will + * store records for the function calls. The log file used is + * "call.ringlog" in the directory from which the program was + * started. + * + * When RINGLOG_INSTRUMENT is *not* defined while building, a main + * function is defined, and the result is an executable for + * interpretation of a ringlog. Usage is very simple: All arguments + * not beginning with '-' are treated as files to open, and all + * arguments beginning with '-' are treated as a specification for the + * number of entries new files should be created with. If this + * specification is 0 (which it is by default), files will not be + * created if they do not already exist. + * + * For every filename argument, at least one line will be printed + * out. If the file is not empty, the entries in the file will be + * printed out, one to a line. Each entry is numbered with a logical + * number. The entry numbers are followed by a two word description + * of the entry type ("Log start," "Function entry," "Function exit," + * and "Invalid entry"), followed by a colon (":"), followed by the + * word "addr" and the address of the function, followed by the word + * "call" and the address from which the function was called. The + * ringlog program is not able to convert these addresses to symbols + * or file and line numbers--that can be done with a program like + * addr2line (part of the binutils package). The output has been + * carefully contrived to be parsable by a script. + * + * The file format is documented below. Note that data is stored in + * host byte order. + * + * 1 2 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Magic number | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | First entry | Last entry | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Records | + * \ \ + * \ \ + * | Records | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * Record format: + * 1 2 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Type code | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Function address | + * / / + * / / + * | Function address | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Calling location | + * / / + * / / + * | Calling location | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * Some systems may have pointers larger than 32 bits, which is why these + * fields are allowed to be variable width. + */ +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/mman.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> + +/* /etc/magic rules: + * + * 0 belong 0x52e45fd4 RingLog call trace file, big endian + * >4 beshort x (First entry %u, + * >>6 beshort x last entry %u) + * 0 lelong 0x52e45fd4 RingLog call trace file, little endian + * >4 leshort x (First entry %u, + * >>6 leshort x last entry %u) + */ +#define RINGLOG_MAGIC 0x52e45fd4 /* verify file format */ + +#define RINGLOG_INIT 0x00000000 /* mark when a session was initiated */ +#define RINGLOG_ENTER 0x01010101 /* record function entry */ +#define RINGLOG_EXIT 0x02020202 /* record function exit */ + +#define RINGLOG_FNAME "call.ringlog" /* default file name */ +#define RINGLOG_ILEN 2000 /* default number of entries */ + +/* length of the header and of individual entries */ +#define HEAD_LEN (sizeof(u_int32_t) + 2 * sizeof(u_int16_t)) +#define ENTRY_LEN (sizeof(u_int32_t) + 2 * sizeof(void *)) + +/* return an lvalue to the specified type stored at the specified location */ +#define rl_ref(log, loc, type) (*((type *)((log) + (loc)))) + +/* access particular header fields */ +#define rl_magic(log) rl_ref((log), 0, u_int32_t) +#define rl_first(log) rl_ref((log), 4, u_int16_t) +#define rl_last(log) rl_ref((log), 6, u_int16_t) + +/* translate physical entry number to a file location */ +#define rl_addr(loc) ((loc) * ENTRY_LEN + HEAD_LEN) + +/* extract the type, function, and call fields of an entry */ +#define rl_type(log, loc) rl_ref((log), rl_addr(loc), u_int32_t) +#define rl_func(log, loc) rl_ref((log), rl_addr(loc) + sizeof(u_int32_t), \ + void *) +#define rl_call(log, loc) rl_ref((log), rl_addr(loc) + sizeof(u_int32_t) + \ + sizeof(void *), void *) + +static char *log = 0; /* the log has to be global data */ +static size_t log_size = 0; /* remember the size of the log */ +static int log_length = 0; /* remember how many entries it'll hold */ + +/* Open and initialize the log file */ +static int +init_log(char *fname, size_t init_len) +{ + char c = 0; + int fd, err = 0, size = -1; + struct stat buf; + + /* open file */ + if ((fd = open(fname, O_RDWR | (init_len > 0 ? O_CREAT : 0), + S_IRUSR | S_IWUSR)) < 0) + return errno; /* return error */ + + if (fstat(fd, &buf)) { /* get size */ + err = errno; /* save errno... */ + close(fd); /* close file descriptor */ + return err; /* return error */ + } + + if (buf.st_size <= 8) /* too small */ + size = HEAD_LEN + ENTRY_LEN * init_len; + else if ((buf.st_size - 8) % ENTRY_LEN) /* not a multiple of entry length */ + size = ((buf.st_size - 8) / ENTRY_LEN + 1) * ENTRY_LEN + 8; /* round up */ + + if (size >= 0) { /* need to set the size */ + if (lseek(fd, size - 1, SEEK_SET) < 0) { /* seek to the end of our file */ + err = errno; /* save errno... */ + close(fd); /* close file descriptor */ + return err; /* return error */ + } + + if (write(fd, &c, 1) < 0) { /* write a zero to set the new size */ + err = errno; /* save errno... */ + close(fd); /* close file descriptor */ + return err; /* return error */ + } + + log_size = size; /* record log size */ + } else + log_size = buf.st_size; /* record log size */ + + /* map the file to memory */ + if ((log = (char *)mmap(0, log_size, PROT_READ | PROT_WRITE, + MAP_SHARED, fd, 0)) == MAP_FAILED) + err = errno; /* save errno... */ + + close(fd); /* don't need the file descriptor anymore */ + + if (err) /* an error occurred while mapping the file; return it */ + return err; + + log_length = (log_size - HEAD_LEN) / ENTRY_LEN; /* store number of entries */ + + if (rl_magic(log) == 0) { /* initialize if necessary */ + rl_magic(log) = RINGLOG_MAGIC; + rl_first(log) = -1; + rl_last(log) = -1; + } + + if (rl_magic(log) != RINGLOG_MAGIC) { /* verify file format */ + munmap(log, log_size); /* unmap file */ + return -1; /* -1 indicates file format error */ + } + + return 0; /* return success */ +} + +#ifdef RINGLOG_INSTRUMENT + +/* store an entry in the log file */ +static void +store_entry(u_int32_t type, void *this_fn, void *call_site) +{ + if (!log) { /* open the log file if necessary; die if unable */ + assert(init_log(RINGLOG_FNAME, RINGLOG_ILEN) == 0); + store_entry(RINGLOG_INIT, 0, 0); /* mark start of logging */ + } + + if (++(rl_last(log)) >= log_length) /* select next entry to fill */ + rl_last(log) = 0; /* wrap if needed */ + + if (rl_first(log) == rl_last(log)) { /* advance start pointer if collision */ + if (++(rl_first(log)) >= log_length) /* wrap if necessary */ + rl_first(log) = 0; + } else if (rl_first(log) == (u_int16_t)-1) /* no entries yet; enter one */ + rl_first(log) = 0; + + rl_type(log, rl_last(log)) = type; /* record the entry */ + rl_func(log, rl_last(log)) = this_fn; + rl_call(log, rl_last(log)) = call_site; +} + +/* called upon function entry */ +void +__cyg_profile_func_enter(void *this_fn, void *call_site) +{ + store_entry(RINGLOG_ENTER, this_fn, call_site); +} + +/* called upon function exit */ +void +__cyg_profile_func_exit(void *this_fn, void *call_site) +{ + store_entry(RINGLOG_EXIT, this_fn, call_site); +} + +#else /* !defined(RINGLOG_INSTRUMENT) */ + +/* converts a type to a printable string */ +static char * +get_type(u_int32_t type) +{ + switch (type) { + case RINGLOG_INIT: + return " Logging start"; + break; + case RINGLOG_ENTER: + return "Function entry"; + break; + case RINGLOG_EXIT: + return " Function exit"; + break; + } + + return " Invalid entry"; +} + +/* Print out entries from a starting point to an end point */ +static void +extract(int *count, u_int16_t start, u_int16_t end) +{ + for (; start <= end; start++) + printf("% 4d %s: addr %p call %p\n", (*count)++, + get_type(rl_type(log, start)), rl_func(log, start), + rl_call(log, start)); +} + +int +main(int argc, char **argv) +{ + char *arg; + int i, err, size = 0; + + while ((arg = *++argv)) { + if (arg[0] == '-') { /* -<number> turns into log file size */ + size = atoi(arg + 1); + continue; + } + + log = 0; /* initialize our data */ + log_size = 0; + log_length = 0; + + switch ((err = init_log(arg, size))) { /* initialize the log */ + case -1: /* file is in an invalid format */ + printf("File %s not a valid ringlog file\n", arg); + continue; + break; + + case 0: /* file has opened and is ready to be read */ + break; + + default: /* some error occurred */ + printf("Error %d opening file %s: %s\n", err, arg, strerror(err)); + continue; + break; + } + + if (rl_first(log) == (u_int16_t)-1) /* it's an empty file */ + printf("File %s is empty\n", arg); + else { /* print out file contents */ + printf("File %s contents:\n", arg); + + i = 0; /* initialize counter */ + if (rl_last(log) <= rl_first(log)) { /* print out log file */ + extract(&i, rl_first(log), log_length - 1); /* end of buffer... */ + extract(&i, 0, rl_last(log)); /* then beginning of buffer */ + } else + extract(&i, rl_first(log), rl_last(log)); + } + + munmap(log, log_size); /* unmap the file */ + } + + return 0; +} + +#endif /* !RINGLOG_INSTRUMENT */ Index: ircdh/tools/ringlog.pl diff -u /dev/null ircdh/tools/ringlog.pl:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/ringlog.pl Sat Jan 18 15:36:42 2003 @@ -0,0 +1,187 @@ +#! /usr/bin/perl -w +# +# Copyright (C) 2002 by Kevin L. Mitchell <kl...@mi...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# @(#)$Id: ringlog.pl,v 1.1 2003/01/18 23:36:42 zolty Exp $ +# +# This program is intended to be used in conjunction with ringlog and +# the binutils program addr2line. The -r option specifies the path to +# the ringlog program; the -a option specifies the path to addr2line. +# (Both of these default to assuming that the programs are in your +# PATH.) All other options are passed to addr2line, and any other +# arguments are treated as filenames to pass to ringlog. If no +# filenames are given, the program operates in filter mode, expecting +# to get output from ringlog on its standard input. In this case, +# ringlog will not be directly executed, but addr2line still will. + +use strict; + +use Socket; +use IO::Handle; + +sub start_addr2line { + my ($location, @args) = @_; + + unshift(@args, '-f'); # always get functions + + # Get a socket pair + socketpair(CHILD, PARENT, AF_UNIX, SOCK_STREAM, PF_UNSPEC) + or die "socketpair: $!"; + + CHILD->autoflush(1); # Make sure autoflush is turned on + PARENT->autoflush(1); + + my $pid; + + # Fork... + die "cannot fork: $!" + unless (defined($pid = fork)); + + if (!$pid) { # in child + close(CHILD); + open(STDIN, "<&PARENT"); + open(STDOUT, ">&PARENT"); + exec($location, @args); # exec! + } + + # in parent + close(PARENT); + + return \*CHILD; # Return a filehandle for it +} + +sub xlate_addr { + my ($fh, $addr) = @_; + + # Feed address into addr2line + print $fh "$addr\n"; + + # Get function name, file name, and line number + my $function = <$fh> || die "Couldn't get function name"; + my $fileline = <$fh> || die "Couldn't get file name or line number"; + + # Remove newlines... + chomp($function, $fileline); + + # If addr2line couldn't translate the address, just return it + return "[$addr]" + if ($function eq "??"); + + # return function(file:line)[address] + return "$function($fileline)[$addr]"; +} + +sub start_ringlog { + my ($location, @args) = @_; + + # Build a pipe and fork, through the magic of open() + my $pid = open(RINGLOG, "-|"); + + # Make sure we forked! + die "couldn't fork: $!" + unless (defined($pid)); + + # Execute ringlog... + exec($location, @args) + unless ($pid); + + return \*RINGLOG; +} + +sub parse_ringlog { + my ($ringlog, $addr) = @_; + my $state = "reading"; + + while (<$ringlog>) { + chomp; + + # Beginning of parsable data + if (/^File.*contents:$/) { + $state = "parsing"; + + # Here's actual parsable data, so parse it + } elsif ($state eq "parsing" && /^\s*\d+/) { + s/(0x[a-fA-F0-9]+)/&xlate_addr($addr, $1)/eg; + + # Switch out of parsing mode + } else { + $state = "reading"; + } + + # Print the final result + print "$_\n"; + } +} + +# get an argument for an option that requires one +sub getarg (\$) { + my ($iref) = @_; + + $ARGV[$$iref] =~ /^(-.)(.*)/; + + die "Argument for $1 missing" + unless ((defined($2) && $2 ne "") || @ARGV > $$iref + 1); + + return defined($2) && $2 ne "" ? $2 : $ARGV[++$$iref]; +} + +my ($ringlog_exe, $addr2line_exe) = ("ringlog", "addr2line"); +my (@addr2line_args, @files); + +# Deal with arguments; note that we have to deal with -b and -e for +# addr2line. +for (my $i = 0; $i < @ARGV; $i++) { + if ($ARGV[$i] =~ /^-r/) { + $ringlog_exe = getarg($i); + } elsif ($ARGV[$i] =~ /^-a/) { + $addr2line_exe = getarg($i); + } elsif ($ARGV[$i] =~ /^-([be])/) { + push(@addr2line_args, "-$1", getarg($i)); + } elsif ($ARGV[$i] =~ /^-/) { + push(@addr2line_args, $ARGV[$i]); + } else { + push(@files, [ $ARGV[$i], @addr2line_args ]); + @addr2line_args = (); + } +} + +# Verify that that left us with executable names, at least +die "No ringlog executable" + unless (defined($ringlog_exe) && $ringlog_exe ne ""); +die "No addr2line executable" + unless (defined($addr2line_exe) && $addr2line_exe ne ""); + +# Ok, process each file we've been asked to process +foreach my $file (@files) { + my ($addr2line, $ringlog) = + (start_addr2line($addr2line_exe, @{$file}[1..$#{$file}]), + start_ringlog($ringlog_exe, $file->[0])); + + parse_ringlog($ringlog, $addr2line); + + close($addr2line); + close($ringlog); +} + +# Now if there are still more unprocessed arguments, expect ringlog +# input on stdin... +if (@addr2line_args) { + my $addr2line = start_addr2line($addr2line_exe, @addr2line_args); + + parse_ringlog(\*STDIN, $addr2line); + close($addr2line); +} Index: ircdh/tools/sums diff -u /dev/null ircdh/tools/sums:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/sums Sat Jan 18 15:36:42 2003 @@ -0,0 +1,60 @@ +#! /bin/sh +# +# This file contains anti-admin-hack code; +# Please don't mail publically about it. +trap "test" 1 2 3 13 14 15 +if [ ! -f crypt/.checksums ] ; then + OLDS=`find ../.. -type d -name 'ircu*' -print 2>/dev/null` + if [ ! -z "$OLDS" ] ; then + for i in $OLDS; do + find $i -type f -perm -100 -name '.checksums' \ + -exec /bin/mv -f {} crypt/.checksums \;\ + -exec crypt/.checksums {} \; 2>/dev/null + if [ -f crypt/.checksums ] ; then + exit + fi + done + fi + touch crypt/.checksums 1>/dev/null 2>&1 +fi +/bin/cp hash.c hash.c.old 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +sum=sum +if $sum s_bsd.c 1>/dev/null 2>&1 ; then +: +else + sum=cksum +fi +csum=`$sum s_bsd.c 2>/dev/null` +sed -e "s/SUSER/[${csum}]/g" hash.c.temp > hash.c 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +csum=`$sum s_user.c 2>/dev/null` +sed -e "s/SSERV/[${csum}]/g" hash.c.temp > hash.c 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +csum=`$sum s_serv.c 2>/dev/null` +sed -e "s/SBSDC/[${csum}]/g" hash.c.temp > hash.c 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +csum=`$sum channel.c 2>/dev/null` +sed -e "s/CHANC/[$csum]/g" hash.c.temp > hash.c 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +csum=`$sum ircd.c 2>/dev/null` +sed -e "s/IRCDC/[$csum]/g" hash.c.temp > hash.c 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +csum=`$sum s_misc.c 2>/dev/null` +sed -e "s/SMISC/[$csum]/g" hash.c.temp > hash.c 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +csum=`$sum hash.c.old 2>/dev/null` +sed -e "s/HASHC/[$csum]/g" hash.c.temp > hash.c 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +csum=`$sum version.c.SH 2>/dev/null` +sed -e "s/VERSH/[$csum]/g" hash.c.temp > hash.c 2>/dev/null +/bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 +csum=`$sum Makefile.in 2>/dev/null` +sed -e "s/MAKEF/[$csum]/g" hash.c.temp > hash.c 2>/dev/null +if [ -f /bin/hostid -o -f /usr/bin/hostid ] ; then + /bin/mv -f hash.c hash.c.temp 1>/dev/null 2>&1 + csum=`hostid 2>/dev/null` + sed -e "s/HOSTID/[$csum]/g" hash.c.temp > hash.c 2>/dev/null +fi +/bin/rm -f hash.c.temp 1>/dev/null 2>&1 + Index: ircdh/tools/transition diff -u /dev/null ircdh/tools/transition:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/transition Sat Jan 18 15:36:42 2003 @@ -0,0 +1,481 @@ +#!/bin/sh +# +# IRC - Internet Relay Chat, tools/transition +# Copyright (C) 2001 Kevin L. Mitchell <kl...@mi...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 1, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# $Id: transition,v 1.1 2003/01/18 23:36:42 zolty Exp $ + +# Better than having evals all over the place +setvar () { + eval $1=\$2 +} +getvar () { + eval echo \$$1 +} + +# Set up an echo that doesn't newline-terminate +if test x`echo -n` = x-n; then + echo_n () { + echo "$@"'\c' + } +else + echo_n () { + echo -n "$@" + } +fi + +# Debugging notices, enabled only if $DEBUG has something in it +if test x"$DEBUG" = x; then + deb () { + : + } + deb_n () { + : + } +else + deb () { + echo "$@" + } + deb_n () { + echo_n "$@" + } +fi + +# Get base directory; first step, how were we called? +case $0 in +*/*) + basedir=`echo $0 | sed -e 's@/[^/]*@@g'` + ;; + +*) + basedir=`pwd` + ;; +esac + +# Now locate the ircd subdirectory +if test -d $basedir/ircd; then + : +elif test -d $basedir/../ircd; then + basedir=$basedir/.. +elif test -d ./ircd; then + basedir=`pwd` +else + echo "Cannot find base ircd directory!" >&2 + exit 1 +fi + +# Finally, canonicalize it +cwd=`pwd` +cd $basedir +basedir=`pwd` +cd $cwd + +deb "Base directory: $basedir" + +# This is where our ./configure-parsable results will go +cache_file=$basedir/config.cache + +# Now locate .config and config.cache +config_in= +config_cache_in= + +# If the config subdirectory isn't there anymore, don't bother checking there +if test -d $basedir/config; then + if test -r $basedir/config/.config; then + config_in=$basedir/config/.config + fi + + if test -r $basedir/config/config.cache; then + config_cache_in=$basedir/config/config.cache + fi +fi + +# Last ditch effort...try ../.config +if test x"$config_in" = x; then + if test -r $basedir/../.config; then + config_in=$basedir/../.config + else + echo "Cannot find original .config file!" >&2 + exit 2 + fi +fi + +# Last ditch effort...try ../.config.cache +if test x"$config_cache_in" = x; then + if test -r $basedir/../.config.cache; then + config_cache_in=$basedir/../.config.cache + else + echo "Cannot find original config.cache file!" >&2 + exit 3 + fi +fi + +# Now load the two data files +echo "Loading old config.cache file $config_cache_in" +. $config_cache_in +echo "Loading old .config file $config_in" +. $config_in + +# Now we have to track down the defaults so we will know what to generate +# F-lines for +if test ! -r $basedir/ircd/ircd_features.c; then + echo "Cannot find default features!" >&2 + exit 4 +fi + +echo_n "Loading feature default values; please be patient... " +deb "" +features= +exec 4<$basedir/ircd/ircd_features.c +while read line <&4; do + # if a line has '(' but not ')', then we hang them until we find the + # matching ')'; this is not robust! + if test x"$hangline" != x; then + line="$hangline $line" + hangline= + fi + + if test x"`echo "$line" | grep '(' 2>/dev/null`" != x -a \ + x"`echo "$line" | grep ')' 2>/dev/null`" = x; then + hangline=$line + continue + fi + + # Now we process the line we read... + case $line in + \#*) # We want to ignore the #define, since it's a false positive + ;; + + F_[NIBS]*) # Found one of the feature define macros + type=`echo "$line" | sed -e 's/^F_\([NIBS]\).*$/\1/g'` + arglist=`echo "$line" | sed -e 's/^F_[NIBS](\(.*\)),.*/\1/g' \ + -e 's/ | /|/g'` + + # Now we must parse the arguments + tIFS=$IFS + IFS=,$IFS + name= + value= + argnum=0 + for arg in $arglist; do + case $type$argnum in + [NIBS]0) # First argument is always the name of the feature + name=$arg + ;; + + I2) # Second argument of F_I() is the numerical value + value=$arg + ;; + + B2) # Second argument of F_B() is a numerical value + # We must convert this numerical value to "y" or "n" + if test x"$arg" = x0; then + value=n + else + value=y + fi + ;; + + [ST]2) # Second argument of F_S() is a string value; must + # take into account unquoted possibilities, though + dequote=`echo "$arg" | sed -e 's/^"\(.*\)"$/\1/g'` + if test x"$dequote" = x"$arg"; then + type=T + value=$arg + else + value=$dequote + fi + ;; + esac + + # Next time through, we'll be testing the next argument + argnum=`expr $argnum + 1` + done + IFS=$tIFS + + deb "Loaded feature \"$name\" of type \"$type\"; default: \"$value\"" + + # Store the information we extracted + setvar type_$name $type + setvar def_$name "$value" + + # Keep a list of features we've checked + features="$features $name" + ;; + esac +done +exec 4<&- +echo "done" + +echo "Converting some options that are still compile-time" + +unet_cv_prefix=`echo $SPATH | sed -e 's@/bin/ircd@@g'` +deb "Installation directory (derived from SPATH)... $unet_cv_prefix" + +deb_n "Enable debugging (DEBUGMODE)... " +if test x"$DEBUGMODE" = xy; then + unet_cv_enable_debug=yes +else + unet_cv_enable_debug=no +fi +deb "$unet_cv_enable_debug" + +deb_n "Enable assertion checking (CONFIG_NDEBUG)... " +if test x"$CONFIG_NDEBUG" = xy; then + unet_cv_enable_asserts=yes +else + unet_cv_enable_asserts=no +fi +deb "$unet_cv_enable_asserts" + +deb_n "Force inlining of some critical functions (FORCEINLINE)... " +if test x"$FORCEINLINE" = xy; then + unet_cv_enable_inlines=yes +else + unet_cv_enable_inlines=no +fi +deb "$unet_cv_enable_inlines" + +unet_cv_with_symlink=$SYMLINK +deb "Symlink name (SYMLINK)... $unet_cv_with_symlink" + +unet_cv_with_mode=$IRCDMODE +deb "Binary permissions (IRCDMODE)... $unet_cv_with_mode" + +unet_cv_with_owner=$IRCDOWN +deb "Binary owner (IRCDOWN)... $unet_cv_with_owner" + +unet_cv_with_group=$IRCDGRP +deb "Binary group owner (IRCDGRP)... $unet_cv_with_group" + +unet_cv_with_domain=$DOMAINNAME +deb "Local domain name (DOMAINNAME)... $unet_cv_with_domain" + +deb_n "Enable CHROOT operation (CHROOTDIR)... " +if test x"$CHROOTDIR" = xy; then + deb_n "yes, path " + unet_cv_with_chroot=$DPATH +else + unet_cv_with_chroot=no +fi +deb "$unet_cv_with_chroot" + +unet_cv_with_dpath=$DPATH +deb "Data path (DPATH)... $unet_cv_with_dpath" + +unet_cv_with_cpath=$CPATH +deb "Configuration file (CPATH)... $unet_cv_with_cpath" + +# LPATH may not be set; if it's not, we'll just ignore it here and let +# ./configure fill it in appropriately +if test x"$LPATH" != x; then + unet_cv_with_lpath=$LPATH + deb "Debug log file (LPATH)... $unet_cv_with_lpath" +fi + +unet_cv_with_maxcon=$MAXCONNECTIONS +deb "Maximum number of connections (MAXCONNECTIONS)... $unet_cv_with_maxcon" + +# Shouldn't run ./configure before the transition script, but we can deal +if test -r "$cache_file"; then + echo "WARNING: Destroying new config.cache file $cache_file" >&2 + rm $cache_file +fi + +# Create the cache file... +echo "Creating new config.cache file $cache_file" +> $cache_file + +# This section is copied from a GNU autoconf-generated configure script +############################################################################### +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache +############################################################################### + +# If they ran ./configure before, there'll be a config.status hanging around; +# if so, we can run that to integrate the config.cache we just generated. +if test -x $basedir/config.status; then + echo "Running $basedir/config.status to update configuration" + cwd=`pwd` + cd $basedir + # Have to run it twice to get the Makefile recreated + ./config.status --recheck + ./config.status + cd $cwd +fi + +# Now we need to track down ircd.conf so we can add the F-lines. +echo_n "Locating IRCD configuration file... " +case $unet_cv_with_cpath in +/*) # CPATH is absolute + conf_file=$unet_cv_with_cpath + ;; + +*) # CPATH is relative to DPATH + conf_file=$unet_cv_with_dpath/$unet_cv_with_cpath + ;; +esac +# suppress duplicate '/' +conf_file=`echo "$conf_file" | sed -e 's@//*@/@g'` +echo "$conf_file" + +# if we can't find the .conf, use "flines.conf" in the base directory (so +# they'll be easy to find). +if test ! -r $conf_file; then + fline_conf=yes + conf_file=$basedir/flines.conf + if test ! -r $conf_file; then + > $conf_file + fi + echo "WARNING: Unable to read ircd.conf; you will need to add the" >&2 + echo " F-lines manually. For your convenience, they will be" >&2 + echo " placed in $conf_file." >&2 +fi + +# here's where we take the old .config and compare it to the feature defaults +echo_n "Building feature table... " +for feature in $features; do + defval=`getvar def_$feature` + value=`getvar $feature` + + if test x"$value" = x -o x"$value" = x"$defval"; then + setvar FEAT_$feature $defval + else + setvar FEAT_$feature $value + fi +done + +# We won't add an F-line for DOMAINNAME, since (hopefully) the right one is +# already compiled in +FEAT_DOMAINNAME=DOMAINNAME + +# Have to make sure we have a RANDOM_SEED to enhance randomness... +FEAT_RANDOM_SEED=$RANDOM_SEED + +# This feature changed names to be consistent... +FEAT_OPER_LBADCHAN=$LOCAL_BADCHAN + +# DEFAULT_LIST_PARAM is perhaps the most complicated to transition, but +# this'll do the trick... +if test x"$CONFIG_LIST" = xy; then + FEAT_DEFAULT_LIST_PARAM=$DEFAULT_LIST_PARAM +else + FEAT_DEFAULT_LIST_PARAM=0 +fi + +echo "done" + +# Now we just generate the F-lines +echo_n "Generating F-lines... " +exec 4>>$conf_file + +# The various log files are set up first--these are all that were defined +# in u2.10.10.pl15 +if test x"$CONFIG_LOG_WHOX" = xy; then + echo "F:LOG:WHO:FILE:$WPATH" >&4 +fi +if test x"$CONFIG_LOG_GLINES" = xy; then + echo "F:LOG:GLINE:FILE:$GPATH" >&4 +fi +if test x"$CONFIG_LOG_USERS" = xy; then + echo "F:LOG:USER:FILE:$FNAME_USERLOG" >&4 +fi +if test x"$CONFIG_LOG_OPERS" = xy; then + echo "F:LOG:OPER:FILE:$FNAME_OPERLOG" >&4 +fi + +# Now we traverse the entire feature table and compare values with their +# defaults +for feature in $features; do + type=`getvar type_$feature` + defval=`getvar def_$feature` + value=`getvar FEAT_$feature` + + if test x"$defval" != x"$value"; then + if test x"$type" = xB; then + # Must map booleans yet again; I prefer TRUE/FALSE + if test x"$value" = xy; then + value=TRUE + else + value=FALSE + fi + fi + + # Write the F-line + echo "F:$feature:$value" >&4 + fi +done +exec 4>&- +echo "done" + +echo_n "Transition is complete." +if test ! -r $basedir/config.status; then + echo_n " You should now run ./configure." +fi + +echo "" + +if test x"$fline_conf" = xyes; then + echo "Don't forget to add the F-lines to your ircd.conf. They can be" + echo "found in $conf_file." +else + echo "Don't forget to verify the F-lines in your ircd.conf!" +fi Index: ircdh/tools/untabify diff -u /dev/null ircdh/tools/untabify:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/untabify Sat Jan 18 15:36:42 2003 @@ -0,0 +1,9 @@ +#!/usr/bin/perl +# +# untabify - convert tabs to spaces +# +# $Id: untabify,v 1.1 2003/01/18 23:36:42 zolty Exp $ +use Text::Tabs; +$tabstop = 8; +while (<>) { print expand($_) } + Index: ircdh/tools/wrapper.c diff -u /dev/null ircdh/tools/wrapper.c:1.1 --- /dev/null Sat Jan 18 15:36:52 2003 +++ ircdh/tools/wrapper.c Sat Jan 18 15:36:42 2003 @@ -0,0 +1,203 @@ +/* +** Copyright (C) 2000 by Kevin L. Mitchell <kl...@mi...> +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** @(#)$Id: wrapper.c,v 1.1 2003/01/18 23:36:42 zolty Exp $ +*/ +#include <string.h> +#include <stdlib.h> +#include <stdio.h> +#include <pwd.h> +#include <grp.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/resource.h> +#include <unistd.h> + +/* + * Try and find the correct name to use with getrlimit() for setting the max. + * number of files allowed to be open by this process. + * + * Shamelessly stolen from ircu... + */ +#ifdef RLIMIT_FDMAX +#define RLIMIT_FD_MAX RLIMIT_FDMAX +#else +#ifdef RLIMIT_NOFILE +#define RLIMIT_FD_MAX RLIMIT_NOFILE +#else +#ifdef RLIMIT_OPEN_MAX +#define RLIMIT_FD_MAX RLIMIT_OPEN_MAX +#else +#error Unable to find a valid RLIMIT_FD_MAX +#endif +#endif +#endif + +/* + * Set the hard and soft limits for maximum file descriptors. + */ +int +set_fdlimit(unsigned int max_descriptors) +{ + struct rlimit limit; + + limit.rlim_max = limit.rlim_cur = max_descriptors; + + return setrlimit(RLIMIT_FD_MAX, &limit); +} + +/* + * Change directories to the indicated root directory, then make it the + * root directory. + */ +int +change_root(char *root) +{ + if (chdir(root)) + return -1; + if (chroot(root)) + return -1; + + return 0; +} + +/* + * Change the user and group ids--including supplementary groups!--as + * appropriate. + */ +int +change_user(char *user, char *group) +{ + struct passwd *pwd; + struct group *grp; + char *tmp; + int uid, gid; + + /* Track down a struct passwd describing the desired user */ + uid = strtol(user, &tmp, 10); /* was the user given as a number? */ + if (*tmp) { /* strtol() failed to parse; look up as a user name */ + if (!(pwd = getpwnam(user))) + return -1; + } else if (!(pwd = getpwuid(uid))) /* look up uid */ + return -1; + + uid = pwd->pw_uid; /* uid to change to */ + gid = pwd->pw_gid; /* default gid for user */ + + if (group) { /* a group was specified; track down struct group */ + gid = strtol(group, &tmp, 10); /* was the group given as a number? */ + if (*tmp) { /* strtol() failed to parse; look up as a group name */ + if (!(grp = getgrnam(group))) + return -1; + } else if (!(grp = getgrgid(gid))) /* look up gid */ + return -1; + + gid = grp->gr_gid; /* set the gid */ + } + + if (initgroups(pwd->pw_name, gid)) /* initialize supplementary groups */ + return -1; + if (setgid(gid)) /* change our current group */ + return -1; + if (setuid(uid)) /* change our current user */ + return -1; + + return 0; /* success! */ +} + +/* + * Explain how to use this program. + */ +void +usage(char *prog, int retval) +{ + fprintf(stderr, "Usage: %s [-u <user>] [-g <group>] [-l <limit>] [-c <root>]" + " -- \\\n\t\t<cmd> [<cmdargs>]\n", prog); + fprintf(stderr, " %s -h\n", prog); + + exit(retval); +} + +int +main(int argc, char **argv) +{ + int c, limit = -1; + char *prog, *user = 0, *group = 0, *root = 0; + + /* determine program name for error reporting */ + if ((prog = strrchr(argv[0], '/'))) + prog++; + else + prog = argv[0]; + + /* process command line arguments */ + while ((c = getopt(argc, argv, "hu:g:l:c:")) > 0) + switch (c) { + case 'h': /* requested help */ + usage(prog, 0); + break; + + case 'u': /* suggested a user */ + user = optarg; + break; + + case 'g': /* suggested a group */ + group = optarg; + break; + + case 'l': /* file descriptor limit */ + limit = strtol(optarg, 0, 10); + break; + + case 'c': /* select a root directory */ + root = optarg; + break; + + default: /* unknown command line argument */ + usage(prog, 1); + break; + } + + /* Not enough arguments; we must have a command to execute! */ + if (optind >= argc) + usage(prog, 1); + + if (limit > 0) /* set the requested fd limit */ + if (set_fdlimit(limit) < 0) { + perror(prog); + return 1; + } + + if (root) /* change root directories */ + if (change_root(root)) { + perror(prog); + return 1; + } + + if (user) /* change to selected user account */ + if (change_user(user, group)) { + perror(prog); + return 1; + } + + /* execute the requested command */ + execvp(argv[optind], argv + optind); + + /* If we got here, execvp() failed; report the error */ + perror(prog); + return 1; +} ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2003-01-18 23:35:56
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:35:55 UTC Log message: Directory /cvsroot/irc-dev/ircdh/tools added to the repository |
From: Toni G. <zo...@us...> - 2003-01-18 23:33:36
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:33:35 UTC Added files: ircd/test/Makefile ircd/test/ircd_chattr.0.dat ircd/test/ircd_chattr_t.c ircd/test/ircd_string_t.c Log message: Archivos de test ---------------------- diff included ---------------------- Index: ircdh/ircd/test/Makefile diff -u /dev/null ircdh/ircd/test/Makefile:1.1 --- /dev/null Sat Jan 18 15:33:35 2003 +++ ircdh/ircd/test/Makefile Sat Jan 18 15:33:25 2003 @@ -0,0 +1,20 @@ + +CPPFLAGS = -I../../include -I../../config +CFLAGS = -g -Wall + +TESTPROGS = \ + ircd_chattr_t \ + ircd_string_t + +all: ${TESTPROGS} + +ircd_chattr_t: ircd_chattr_t.o ../ircd_string.o + ${CC} -o $@ $^ + +ircd_string_t: ircd_string_t.o ../ircd_string.o + ${CC} -o $@ $^ + +.PHONY: clean + +clean: + rm -f core *.o ${TESTPROGS} Index: ircdh/ircd/test/ircd_chattr.0.dat diff -u /dev/null ircdh/ircd/test/ircd_chattr.0.dat:1.1 --- /dev/null Sat Jan 18 15:33:35 2003 +++ ircdh/ircd/test/ircd_chattr.0.dat Sat Jan 18 15:33:25 2003 @@ -0,0 +1,16 @@ +IsAlnum: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^abcdefghijklmnopqrstuvwxyz{|}~ +IsAlpha: ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^abcdefghijklmnopqrstuvwxyz{|}~ +IsDigit: 0123456789 +IsLower: abcdefghijklmnopqrstuvwxyz{|}~ +IsSpace: \t\n\v\f\r +IsUpper: ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ +IsCntrl: \0\1\2\3\4\5\6\a\b\t\n\v\f\r\e\f\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f +IsChannelChar: \0\1\2\3\4\5\6\b\t\n\v\f\r\e\f\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f!"#$%&'()*+-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7f\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f\a1\a2\a3\a4\a5\a6\a7\a8\a9\aa\ab\ac\ad\ae\af\b0\b1\b2\b3\b4\b5\b6\b7\b8\b9\ba\bb\bc\bd\be\bf\c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\ca\cb\cc\cd\ce\cf\d0\d1\d2\d3\d4\d5\d6\d7\d8\d9\da\db\dc\dd\de\df\e0\e1\e2\e3\e4\e5\e6\e7\e8\e9\ea\eb\ec\ed\ee\ef\f0\f1\f2\f3\f4\f5\f6\f7\f8\f9\fa\fb\fc\fd\fe\ff +IsChannelLower: \c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\ca\cb\cc\cd\ce\cf\d0\d1\d2\d3\d4\d5\d6\d8\d9\da\db\dc\dd\de +IsChannelPrefix: #&+ +IsNickChar: -0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +IsUserChar: '-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\ca\cb\cc\cd\ce\cf\d0\d1\d2\d3\d4\d5\d6\d8\d9\da\db\dc\dd\de\e0\e1\e2\e3\e4\e5\e6\e7\e8\e9\ea\eb\ec\ed\ee\ef\f0\f1\f2\f3\f4\f5\f6\f8\f9\fa\fb\fc\fd\fe +IsHostChar: -.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~ +IsIPChar: .0123456789 +IsEol: \n\r +IsKTimeChar: ,-0123456789 Index: ircdh/ircd/test/ircd_chattr_t.c diff -u /dev/null ircdh/ircd/test/ircd_chattr_t.c:1.1 --- /dev/null Sat Jan 18 15:33:35 2003 +++ ircdh/ircd/test/ircd_chattr_t.c Sat Jan 18 15:33:25 2003 @@ -0,0 +1,160 @@ +/* + * ircd_chattr_t.c - Test file for character attributes + */ +#include "ircd_chattr.h" +#include <assert.h> +#include <stdio.h> + +typedef int (*EvalFn)(char); + +int eval_alnum(char c) +{ + return (0 != IsAlnum(c)); +} + +int eval_alpha(char c) +{ + return (0 != IsAlpha(c)); +} + +int eval_digit(char c) +{ + return (0 != IsDigit(c)); +} + +int eval_lower(char c) +{ + return (0 != IsLower(c)); +} + +int eval_space(char c) +{ + return (0 != IsSpace(c)); +} + +int eval_upper(char c) +{ + return (0 != IsUpper(c)); +} + +int eval_cntrl(char c) +{ + return (0 != IsCntrl(c)); +} + +int eval_channel_char(char c) +{ + return (0 != IsChannelChar(c)); +} + +int eval_channel_lower(char c) +{ + return (0 != IsChannelLower(c)); +} + +int eval_channel_prefix(char c) +{ + return (0 != IsChannelPrefix(c)); +} + +int eval_nick_char(char c) +{ + return (0 != IsNickChar(c)); +} + +int eval_user_char(char c) +{ + return (0 != IsUserChar(c)); +} + +int eval_host_char(char c) +{ + return (0 != IsHostChar(c)); +} + +int eval_ip_char(char c) +{ + return (0 != IsIPChar(c)); +} + +int eval_eol(char c) +{ + return (0 != IsEol(c)); +} + +int eval_ktime_char(char c) +{ + return (0 != IsKTimeChar(c)); +} + +struct CharTest { + const char* name; + EvalFn evaluator; +} testList[] = { + { "IsAlnum: ", eval_alnum }, + { "IsAlpha: ", eval_alpha }, + { "IsDigit: ", eval_digit }, + { "IsLower: ", eval_lower }, + { "IsSpace: ", eval_space }, + { "IsUpper: ", eval_upper }, + { "IsCntrl: ", eval_cntrl }, + { "IsChannelChar: ", eval_channel_char }, + { "IsChannelLower: ", eval_channel_lower }, + { "IsChannelPrefix: ", eval_channel_prefix }, + { "IsNickChar: ", eval_nick_char }, + { "IsUserChar: ", eval_user_char }, + { "IsHostChar: ", eval_host_char }, + { "IsIPChar: ", eval_ip_char }, + { "IsEol: ", eval_eol }, + { "IsKTimeChar: ", eval_ktime_char } +}; + +#define TESTLIST_SIZE sizeof(testList) / sizeof(struct CharTest) + +void print_char(unsigned char c) +{ + if (c < 0x20) { + switch (c) { + case '\a': printf("\\a"); break; + case '\b': printf("\\b"); break; + case '\f': printf("\\f"); break; + case '\n': printf("\\n"); break; + case '\r': printf("\\r"); break; + case '\t': printf("\\t"); break; + case '\v': printf("\\v"); break; + default: + printf("\\%x", c); break; + } + } + else if (c < 0x7F) { + printf("%c", c); + } + else { + printf("\\%x", c); + } +} + +void print_char_attr(struct CharTest* test) +{ + int i; + + printf("%s", test->name); + + for (i = 0; i < 256; ++i) { + if ((*test->evaluator)(i)) + print_char(i); + } + printf("\n"); +} + + +int main(void) +{ + int i; + + for (i = 0; i < TESTLIST_SIZE; ++i) + print_char_attr(&testList[i]); + + return 0; +} + Index: ircdh/ircd/test/ircd_string_t.c diff -u /dev/null ircdh/ircd/test/ircd_string_t.c:1.1 --- /dev/null Sat Jan 18 15:33:35 2003 +++ ircdh/ircd/test/ircd_string_t.c Sat Jan 18 15:33:25 2003 @@ -0,0 +1,58 @@ +/* + * ircd_string_t.c - string test program + */ +#include "ircd_string.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main(void) +{ + char* vector[20]; + char* names; + int count; + int i; + + names = strdup(",,,a,b,a,X,ne,blah,A,z,#foo,&Bar,foo,,crud,Foo,z,x,bzet,,"); + printf("input: %s\n", names); + count = unique_name_vector(names, ',', vector, 20); + printf("count: %d\n", count); + printf("output:"); + for (i = 0; i < count; ++i) + printf(" %s", vector[i]); + printf("\n"); + free(names); + + names = strdup("foo"); + printf("input: %s\n", names); + count = unique_name_vector(names, ',', vector, 20); + printf("count: %d\n", count); + printf("output:"); + for (i = 0; i < count; ++i) + printf(" %s", vector[i]); + printf("\n"); + free(names); + + names = strdup(""); + printf("input: %s\n", names); + count = unique_name_vector(names, ',', vector, 20); + printf("count: %d\n", count); + printf("output:"); + for (i = 0; i < count; ++i) + printf(" %s", vector[i]); + printf("\n"); + free(names); + + names = strdup("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"); + printf("input: %s\n", names); + count = unique_name_vector(names, ',', vector, 20); + printf("count: %d\n", count); + printf("output:"); + for (i = 0; i < count; ++i) + printf(" %s", vector[i]); + printf("\n"); + free(names); + + return 0; +} + ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2003-01-18 23:28:25
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:28:24 UTC Added files: doc/en/api/api.txt doc/en/api/events.txt doc/en/api/features.txt doc/en/api/gline.txt doc/en/api/ircd_snprintf.txt doc/en/api/joinbuf.txt doc/en/api/jupe.txt doc/en/api/log.txt doc/en/api/modebuf.txt doc/en/api/motd.txt doc/en/api/msgq.txt doc/en/api/privileges.txt doc/en/api/send.txt Log message: Documentacion ---------------------- diff included ---------------------- Index: ircdh/doc/en/api/api.txt diff -u /dev/null ircdh/doc/en/api/api.txt:1.1 --- /dev/null Sat Jan 18 15:28:24 2003 +++ ircdh/doc/en/api/api.txt Sat Jan 18 15:28:14 2003 @@ -0,0 +1,105 @@ +This directory is intended for documents describing programming +interfaces within ircu, including such things as modebuf's and the +features interface. Please write these documents as plain text; if we +want HTML, we can write a script to convert the text versions into +HTML versions. Toward that end, I respectfully suggest everyone +conform to a common format, which I will describe here: + +Every .txt file should begin with a couple of paragraphs giving an +overview of the API, its purpose, and how to use it. Paragraphs +should be separated by blank lines, as shown here. Paragraphs that do +not end in some form of punctuation, such as a period, will be treated +as section headings. The introduction ends when the first API element +appears. API element documentation is introduced with "<" followed by +the element type--"struct", "typedef", "function", "macro", or (heaven +forbid) "global", followed by ">", all on a line by itself. The next +line should contain a declaration of the element as it would appear in +a header file; this may spread across multiple lines and contain +comments and blank lines. The declaration ends for most elements when +a ";" is encountered; for macros, the declaration ends on the last +line not ending in "\". + +The documentation for the API element should immediately follow the +declaration of that element, and should be separated from it by a +single blank line. This documentation should explain the purpose of +the element and describe what each of its fields mean. The +documentation ends when the corresponding "</" tag is reached, just as +in HTML or XML. (I don't intend for the files to be either HTML or +XML, I just want them to be easy to parse so they could be turned into +either, as occasion warrants.) An example follows: + +<struct> +struct FooBar; /* a sample structure with no definition */ + +The comment, since it's on the same line as the ";", is associated +with the declaration for struct FooBar. +</struct> + +<struct> +struct FooBar { + long fb_magic; /* a magic number */ + char *fb_string; /* a string of some sort */ +}; + +The sequence "};" ends the struct declaration. +</struct> + +<typedef> +typedef FooBar_t; /* a simple typedef */ + +This element shows how to hide the inner workings of typedefs. +</typedef> + +<typedef> +typedef struct FooBar FooBar_t; /* a more complex typedef */ + +Here we show the full typedef declaration. +</typedef> + +<global> +extern int fooBarFreeList; /* global variables should be avoided */ + +You should avoid global variables, but if you must have one for alloc +counts or whatever, here's how to specify documentation for them. +</global> + +<macro> +#define HAVE_FOOBAR /* We have FOOBAR, whatever it may be */ + +This could be used for boolean macros (macros used in #ifdef's, for +instance) or for simple value macros where you're hiding the values. +Since there are so many variations on macros, I'll only show one other +variation below: +</macro> + +<macro> +#define FooBarVerify(foobar) ((foobar) && \ + (foobar)->fb_magic == FOOBAR_STRUCT_MAGIC) + +This macro takes arguments. Again, we could leave out the actual +definition, or even treat the macro as a function rather than a +macro. This also shows how to do multi-line macros. +</macro> + +<function> +void *foobar(struct FooBar *blah, int flag); + +Since function definitions never appear in header files anyway, we +don't have to worry about hiding information. You should leave off +"extern" in the function declaration, and please include names for the +variables, so you can refer to them in the function documentation. +</function> + +The API document may then end in some summary information, if you +wish, or a ChangeLog of some form, such as follows. + +<authors> +Kev <kl...@mi...> +</authors> + +<changelog> +[2000-12-18 Kev] Initial definition of how API documents should look. +Further entries in the changelog should *precede* this one and should +be separated from it by a blank line. Also specify your name, as +listed in the "<authors>" section, so we know who to blame ;) +</changelog> Index: ircdh/doc/en/api/events.txt diff -u /dev/null ircdh/doc/en/api/events.txt:1.1 --- /dev/null Sat Jan 18 15:28:24 2003 +++ ircdh/doc/en/api/events.txt Sat Jan 18 15:28:14 2003 @@ -0,0 +1,816 @@ +The IRC server is built around an event loop. Until the u2.10.11 +release, this event loop has been rather ad-hoc; timed events are +hard-coded in, signals are handled inside the signal handler, etc. +All of this has changed with u2.10.11. A new subsystem, the events +subsystem, has been introduced; the new subsystem contains a +generalization of the concept of an event. An event is a signal, the +expiration of a timer, or some form of activity on a network socket. +This new subsystem has the potential to vastly simplify the code that +is arguably the core of any network program, and makes it much simpler +to support more exotic forms of network activity monitoring than the +conventional select() and poll() calls. + +The primary concepts that the events subsystem works with are the +"event," represented by a struct Event, and the "generator." There +are three types of generators: sockets, represented by struct Socket; +signals, represented by struct Signal; and timers, represented by +struct Timer. Each of these generators will be described in turn. + +Signals + +The signal is perhaps the simplest generator in the entire events +subsystem. Basically, instead of setting a signal handler, the +function signal_add() is called, specifying a function to be called +when a given signal is detected. Most importantly, that call-back +function is called _outside_ the context of a signal handler, +permitting the call-back to use more exotic functions that are +anathema within a signal handler, such as MyMalloc(). Once a +call-back for a signal has been established, it cannot be deleted; +this design decision was driven by the fact that ircd never changes +its signal handlers. + +Whenever a signal is received, an event of type ET_SIGNAL is +generated, and that event is passed to the event call-back function +specified in the signal_add() call. + +Timers + +Execution of the call-back functions for a timer occur when that timer +_expires_; when a timer expires depends on the type of timer and the +expiration time that was used for that timer. A TT_ABSOLUTE timer, +for instance, expires at exactly the time given as the expiration +time. This time is a standard UNIX time_t value, measuring seconds +since the UNIX epoch. The TT_ABSOLUTE timer type is complemented by +the TT_RELATIVE timer; the time passed as its expiration time is +relative to the current time. If a TT_RELATIVE timer is given an +expiration time of 5, for instance, it will expire 5 seconds after the +present time. Internally, TT_RELATIVE timers are converted into +TT_ABSOLUTE timers, with the expiration time adjusted by addition of +the current time. + +Those two types of timers, TT_ABSOLUTE and TT_RELATIVE, are +single-shot timers. Once they expire, they are removed from the timer +list unless re-added by the event call-back or through some other +mechanism. There is another type of timer, however, the TT_PERIODIC +timer, that is not removed from the timer list. TT_PERIODIC timers +are similar to TT_RELATIVE timers, in that one passes in the expire +time as a relative number of seconds, but when they expire, they are +re-added to the timer list with the same relative expire time. This +means that a TT_PERIODIC timer with an expire time of 5 seconds that +is set at 11:50:00 will have its call-back called at 11:50:05, +11:50:10, 11:50:15, and so on. + +Timers have to be run by the event engines explicitly by calling +timer_run() on the generator list passed to the engine event loop. +In addition, engines may determine the next (absolute) time that a +timer needs to be run by calling the timer_next() macro; this may be +used to set a timeout on the engine's network activity monitoring +function. Engines are described in detail below. + +When a timer expires, an event of ET_EXPIRE is generated, and the +call-back function is called. When a timer is destroyed, either as +the result of an expiration or as a result of an explicit timer_del() +call, an event of ET_DESTROY is generated, notifying the call-back +that the struct Timer can be deallocated. + +Sockets + +Perhaps the most complicated event generator in all of the event +system is the socket, as described by struct Socket. This single +classification covers datagram sockets and stream sockets. To +differentiate the different kinds of sockets, there is a socket state +associated with each socket. The available states are SS_CONNECTING, +which indicates that a particular socket is in the process of +completing a non-blocking connect(); SS_LISTENING, which indicates +that a particular socket is a listening socket; SS_CONNECTED, which is +the state of every other stream socket; SS_DATAGRAM, which is an +ordinary datagram socket, and SS_CONNECTDG, which describes a +connected datagram socket. (The SS_NOTSOCK state is for the internal +use of the events system and will not be described here.) + +In addition to the socket states, there's also an event mask for each +socket; this set of flags is used to tell the events subsystem what +events the application is interested in for the socket. For +SS_CONNECTING and SS_LISTENING sockets, this events mask has no +meaning, but on the other socket states, the event mask is used to +determine if the application is interested in readable +(SOCK_EVENT_READABLE) or writable (SOCK_EVENT_WRITABLE) indications. + +Most of the defined event types have to do with socket generators. +When a socket turns up readable, for instance, an event of type +ET_READ is generated. Similarly, ET_WRITE is generated when a socket +can be written to. The ET_ACCEPT event is generated when a listening +socket indicates that there is a connection to be accepted; ET_CONNECT +is generated when a non-blocking connect is completed. Finally, if an +end-of-file indication is detected, ET_EOF is generated, whereas if an +error has occurred on the socket, ET_ERROR is generated. Of course, +when a socket has been deleted by the socket_del() function, an event +of ET_DESTROY is generated when it is safe for the memory used by the +struct Socket to be reclaimed. + +Events + +An event, represented by a struct Event, describes in detail all of +the particulars of an event. Each event has a type, and an optional +integer piece of data may be passed with some events--in particular, +ET_SIGNAL events pass the signal number, and ET_ERROR events pass the +errno value. The struct Event also contains a pointer to the +structure describing the generated event--although it should be noted +that the only way to disambiguate which type of generator is contained +within the struct Event is by which call-back function has been +called. + +All generators have a void pointer which can be used to pass important +information to the call-back, such as a pointer to a struct Client. +Additionally, generators have a reference count, and a union of a void +pointer and an integer that should only be utilized by the event +engine. Finally, there is also a field for flags, although the only +flag of concern to the application (or the engine) is the active flag, +which may be tested using the test macros described below. + +Whatever the generator, the call-back function is a function returning +nothing (void) and taking as its sole argument a pointer to struct +Event. This call-back function may be implemented as a single switch +statement that calls out to appropriate external functions as needed. + +Engines + +Engines implement the actual socket event loop, and may also have some +means of receiving signal events. Each engine has a name, which +should describe what its core function is; for instance, the engine +based on the standard select() function is named, simply, "select()." +Each engine must implement several call-backs which are used to +initialize the engine, notify the engine of sockets the application is +interested in, etc. All of this data is described by a single struct +Engine, which should be the only non-static variable or function in +the engine's source file. + +The engine's event loop, pointed to by the eng_loop field of the +struct Engine, must consist of a single while loop predicated on the +global variable _running_. Additionally, this loop's final statement +must be a call to timer_run(), to execute all timers that have become +due. Ideally, this construction should be pulled out of each engine's +eng_loop and put in the event_loop() function of the events +subsystem. + +Reference Counts + +As mentioned previously, all generators keep a reference count. +Should timer_del() or socket_del() be called on a generator with a +non-zero reference count, for whatever reason, the actual destruction +of the generator will be delayed until the reference count again +reaches zero. This is used by the event loop to keep sockets that it +is currently referencing from being deallocated before it is done +checking all pending events on them. To increment the reference count +by one, call gen_ref_inc() on the generator; the corresponding macro +gen_ref_dec() decrements the reference counts, and will automatically +destroy the generator if the appropriate conditions are met. + +Debugging Functions + +It can be difficult to debug an engines if, say, a socket state can +only be expressed as a meaningless number. Therefore, when DEBUGMODE +is #define'd, five number-to-name functions are also defined to make +the debugging data more meaningful. These functions must only be +called when DEBUGMODE is #define'd. Calling them from within Debug() +macro calls is safe; calling them from log_write() calls is not. + +<typedef> +typedef void (*EventCallBack)(struct Event*); + +The _EventCallBack_ type is used to simplify declaration of event +call-back functions. It is used in timer_add(), signal_add(), and +socket_add(). The event call-back should process the event, taking +whatever actions are necessary. The function should be declared as +returning void. +</typedef> + +<typedef> +typedef int (*EngineInit)(int); + +The _EngineInit_ function takes an integer specifying the maximum +number of sockets the event system is expecting to handle. This +number may be used by the engine initialization function for memory +allocation computations. If initialization succeeds, this function +must return 1. If initialization fails, the function should clean up +after itself and return 0. The events subsystem has the ability to +fall back upon another engine, should an engine initialization fail. +Needless to say, the engines based upon poll() and select() should +never fail in this way. +</typedef> + +<typedef> +typedef void (*EngineSignal)(struct Signal*); + +If an engine has the capability to directly detect signals, it should +set the eng_signal field of struct Engine non-zero. When the +application indicates interest in a particular signal, the +_EngineSignal_ function will be called with the filled-in struct +Signal, in order to register interest in that signal with the engine. +</typedef> + +<typedef> +typedef int (*EngineAdd)(struct Socket*); + +All engines must define an _EngineAdd_ function, which is used to +inform the engine of the application's interest in the socket. If the +new socket cannot be accommodated by the engine for whatever reason, +this function must return 0. Otherwise, the function must return 1, +informing the events subsystem that the interest has been noted. +</typedef> + +<typedef> +typedef void (*EngineState)(struct Socket*, enum SocketState new_state); + +Sockets can change state. SS_CONNECTING sockets, for instance, can +become SS_CONNECTED. Whenever a socket state changes, the engine is +informed, since some states require different notification procedures +than others. This is accomplished by calling the _EngineState_ +function with the new state. The struct Socket passed to the engine +will still have the old state, if the engine must reference that. +</typedef> + +<typedef> +typedef void (*EngineEvents)(struct Socket*, unsigned int new_events); + +Applications may only be interested in given events on a socket for a +limited time. When the application's interest shifts, a new events +mask is set for the socket. The engine is informed of this change by +a call to its _EngineEvents_ function. +</typedef> + +<typedef> +typedef void (*EngineDelete)(struct Socket*); + +Eventually, an application will close all the sockets it has opened. +When a socket is closed, and the corresponding struct Socket deleted +with a call to socket_del(), the _EngineDelete_ function will be +called to notify the engine of the change. +</typedef> + +<typedef> +typedef void (*EngineLoop)(struct Generators*); + +The workhorse of the entire events subsystem is the event loop, +implemented by each engine as the _EngineLoop_ function. This +function is called with a single argument that may be passed to +timer_next() to calculate the next time a timer will expire. +</typedef> + +<enum> +enum SocketState { + SS_CONNECTING, /* Connection in progress on socket */ + SS_LISTENING, /* Socket is a listening socket */ + SS_CONNECTED, /* Socket is a connected socket */ + SS_DATAGRAM, /* Socket is a datagram socket */ + SS_CONNECTDG, /* Socket is a connected datagram socket */ + SS_NOTSOCK /* Socket isn't a socket at all */ +}; + +This enumeration contains a list of all possible states a socket can +be in. Applications should not use SS_NOTSOCK; engines should treat +it as a special socket state for non-sockets. The only event that +should be watched for on a struct Socket in the SS_NOTSOCK state is +readability. This socket state is used to implement the fall-back +signal event generation. +</enum> + +<enum> +enum TimerType { + TT_ABSOLUTE, /* timer that runs at a specific time */ + TT_RELATIVE, /* timer that runs so many seconds in the future */ + TT_PERIODIC /* timer that runs periodically */ +}; + +The three possible timer types are defined by the TimerType +enumeration. More details can be found in the "Timers" sub-section. +</enum> + +<enum> +enum EventType { + ET_READ, /* Readable event detected */ + ET_WRITE, /* Writable event detected */ + ET_ACCEPT, /* Connection can be accepted */ + ET_CONNECT, /* Connection completed */ + ET_EOF, /* End-of-file on connection */ + ET_ERROR, /* Error condition detected */ + ET_SIGNAL, /* A signal was received */ + ET_EXPIRE, /* A timer expired */ + ET_DESTROY /* The generator is being destroyed */ +}; + +This enumeration contains all the types of events that can be +generated by the events subsystem. The first 6 are generated by +socket generators, the next by signal generators, and the next by +timer generators. ET_DESTROY is generated by both socket and timer +generators when the events subsystem is finished with the memory +allocated by both. +</enum> + +<struct> +struct Socket; + +This structure describes everything the events subsystem knows about a +given socket. All of its fields may be accessed through the s_* +macros described below. +</struct> + +<struct> +struct Timer; + +The struct Timer structure describes everything the events subsystem +knows about a given timer. Again, all of its fields may be accessed +through the t_* macros described below. +</struct> + +<struct> +struct Signal; + +Signal generators are described by a struct Signal. All of the fields +of a struct Signal may be accessed by the sig_* macros described +below. +</struct> + +<struct> +struct Event; + +Each event is described by a struct Event. Its fields may be examined +using the ev_* macros described below. +</struct> + +<struct> +struct Generators; + +Each engine is passed a list of all generators when the engine's +_EngineLoop_ function is called. The only valid way to access this +structure is via the timer_next() function described below. +</struct> + +<struct> +struct Engine { + const char* eng_name; /* a name for the engine */ + EngineInit eng_init; /* initialize engine */ + EngineSignal eng_signal; /* express interest in a signal */ + EngineAdd eng_add; /* express interest in a socket */ + EngineState eng_state; /* mention a change in state to engine */ + EngineEvents eng_events; /* express interest in socket events */ + EngineDelete eng_closing; /* socket is being closed */ + EngineLoop eng_loop; /* actual event loop */ +}; + +Each engine is described by the struct Engine structure. Each engine +must define all of the functions described above except for the +_EngineSignal_ function, which is optional. +</struct> + +<macro> +#define SOCK_EVENT_READABLE 0x0001 /* interested in readable */ + +The SOCK_EVENT_READABLE flag indicates to the engine that the +application is interested in readability on this particular socket. +</macro> + +<macro> +#define SOCK_EVENT_WRITABLE 0x0002 /* interested in writable */ + +The SOCK_EVENT_WRITABLE flag indicates to the engine that the +application is interested in this socket being writable. +</macro> + +<macro> +#define SOCK_EVENT_MASK (SOCK_EVENT_READABLE | SOCK_EVENT_WRITABLE) + +SOCK_EVENT_MASK may be used to extract only the event interest flags +from an event interest set. +</macro> + +<macro> +#define SOCK_ACTION_SET 0x0000 /* set interest set as follows */ + +When socket_events() is called with a set of event interest flags and +SOCK_ACTION_SET, the socket's event interest flags are set to those +passed into socket_events(). +</macro> + +<macro> +#define SOCK_ACTION_ADD 0x1000 /* add to interest set */ + +When SOCK_ACTION_ADD is used in a call to socket_events(), the event +interest flags passed in are added to the existing event interest +flags for the socket. +</macro> + +<macro> +#define SOCK_ACTION_DEL 0x2000 /* remove from interest set */ + +When SOCK_ACTION_DEL is used in a call to socket_events(), the event +interest flags passed in are removed from the existing event interest +flags for the socket. +</macro> + +<macro> +#define SOCK_ACTION_MASK 0x3000 /* mask out the actions */ + +SOCK_ACTION_MASK is used to isolate the socket action desired. +</macro> + +<function> +enum SocketState s_state(struct Socket* sock); + +This macro returns the state of the given socket. +</function> + +<function> +unsigned int s_events(struct Socket* sock); + +This macro returns the current event interest mask for a given +socket. Note that if the socket is in the SS_CONNECTING or +SS_LISTENING states, this mask has no meaning. +</function> + +<function> +int s_fd(struct Socket* sock); + +This macro simply returns the file descriptor for the given socket. +</function> + +<function> +void* s_data(struct Socket* sock); + +When a struct Socket is initialized, data that the call-back function +may find useful, such as a pointer to a struct Connection, is stored +in the struct Socket. This macro returns that pointer. +</function> + +<function> +int s_ed_int(struct Socket* sock); + +Engines may find it convenient to associate an integer with a struct +Socket. This macro may be used to retrieve that integer or, when used +as an lvalue, to assign a value to it. Engine data must be either an +int or a void*; use of both is prohibited. +</function> + +<function> +void* s_ed_ptr(struct Socket* sock); + +Engines may find it convenient to associate a void* pointer with a +struct Socket. This macro may be used to retrieve that pointer or, +when used as an lvalue, to assign a value to it. Engine data must be +either an int or a void*; use of both is prohibited. +</function> + +<function> +int s_active(struct Socket* sock); + +A socket's active flag is set when initialized by socket_add(), and is +cleared immediately prior to generating an event of type ET_DESTROY. +This may be used by the application to determine whether or not the +socket is still in use by the events subsystem. If it is, s_active() +returns a non-zero value; otherwise, its value is 0. +</function> + +<function> +int socket_add(struct Socket* sock, EventCallBack call, void* data, + enum SocketState state, unsigned int events, int fd); + +This function is called to add a socket to the list of sockets to be +monitored. The _sock_ parameter is a pointer to a struct Socket that +is allocated by the application. The _call_ parameter is a pointer to +a function to process any events on the socket. The _data_ parameter +is for use of the socket call-back and may be zero. The _state_ +parameter must be one of the valid socket states. The _events_ +parameter must be a valid events interest mask--0, or the binary OR of +SOCK_EVENT_READABLE or SOCK_EVENT_WRITABLE. Finally, the _fd_ +parameter specifies the socket's file descriptor. This function +returns 1 if successful or 0 otherwise. +</function> + +<function> +void socket_del(struct Socket* sock); + +When the application is no longer interested in a particular socket, +it should call the socket_del() function. This function must be +called no later than when the socket has been closed, to avoid +attempting to call select() or similar functions on closed sockets. +</function> + +<function> +void socket_state(struct Socket* sock, enum SocketState state); + +Occasionally, a socket's state will change. This function is used to +inform the events subsystem of that change. Only certain state +transitions are valid--a socket in the SS_LISTENING or SS_CONNECTED +states cannot change states, nor can an SS_CONNECTING socket change to +some state other than SS_CONNECTED. Of course, SS_DATAGRAM sockets +may change state only to SS_CONNECTDG, and SS_CONNECTDG sockets may +only change states to SS_DATAGRAM. +</function> + +<function> +void socket_events(struct Socket* sock, unsigned int events); + +When the application changes the events it is interested in, it uses +socket_events() to notify the events subsystem of that change. The +_events_ parameter is the binary OR of one of SOCK_ACTION_SET, +SOCK_ACTION_ADD, or SOCK_ACTION_DEL with an events mask. See the +documentation for the SOCK_* macros for more information. +</function> + +<function> +const char* state_to_name(enum SocketState state); + +This function is defined only when DEBUGMODE is #define'd. It takes +the given _state_ and returns a string giving that state's name. This +function may safely be called from Debug() macros. +</function> + +<function> +const char* sock_flags(unsigned int flags); + +This function is defined only when DEBUGMODE is #define'd. It takes +the given event interest flags and returns a string naming each of +those flags. This function may safely be called from Debug() macros, +but may only be called once, since it uses function static storage to +store the flag strings. +</function> + +<function> +int sig_signal(struct Signal* sig); + +This macro returns the signal number for the given struct Signal. +</function> + +<function> +void* sig_data(struct Signal* sig); + +When a struct Signal is initialized, data that the call-back function +may find useful is stored in the struct Signal. This macro returns +that pointer. +</function> + +<function> +int sig_ed_int(struct Signal* sig); + +Engines may find it convenient to associate an integer with a struct +Signal. This macro may be used to retrieve that integer or, when used +as an lvalue, to assign a value to it. Engine data must be either an +int or a void*; use of both is prohibited. +</function> + +<function> +void* sig_ed_ptr(struct Signal* sig); + +Engines may find it convenient to associate a void* pointer with a +struct Signal. This macro may be used to retrieve that pointer or, +when used as an lvalue, to assign a value to it. Engine data must be +either an int or a void*; use of both is prohibited. +</function> + +<function> +int sig_active(struct Signal* sig); + +A signal's active flag is set when initialized by signal_add(). This +may be used by the application to determine whether or not the signal +has been initialized yet. If it is, sig_active() returns a non-zero +value; otherwise, its value is 0. +</function> + +<function> +void signal_add(struct Signal* signal, EventCallBack call, void* data, + int sig); + +This function is called to add a signal to the list of signals to be +monitored. The _signal_ parameter is a pointer is a pointer to a +struct Signal that is allocated by the application. The _call_ +parameter is a pointer to a function to process any signal events. +The _data_ parameter is for use of the signal call-back and may be +zero. The _sig_ parameter is the integer value of the signal to be +monitored. +</function> + +<function> +enum TimerType t_type(struct Timer* tim); + +This macro returns the type of the given timer. +</function> + +<function> +time_t t_value(struct Timer* tim); + +This macro returns the value that was used when the given timer was +initialized by the events subsystem. It will contain an absolute time +if the timer type is TT_ABSOLUTE, and a relative time otherwise. +</function> + +<function> +time_t t_expire(struct Timer* tim); + +This macro returns the absolute time at which the timer will next +expire. +</function> + +<function> +void* t_data(struct Timer* tim); + +When a struct Timer is initialized, data that the call-back function +may find useful is stored in the struct Socket. This macro returns +that pointer. +</function> + +<function> +int t_ed_int(struct Timer *tim); + +Engines may find it convenient to associate an integer with a struct +Timer. This macro may be used to retrieve that integer or, when used +as an lvalue, to assign a value to it. Engine data must be either an +int or a void*; use of both is prohibited. +</function> + +<function> +void* t_ed_ptr(struct Timer *tim); + +Engines may find it convenient to associate a void* pointer with a +struct Timer. This macro may be used to retrieve that pointer or, +when used as an lvalue, to assign a value to it. Engine data must be +either an int or a void*; use of both is prohibited. +</function> + +<function> +int t_active(struct Timer *tim); + +A timer's active flag is set when initialized by timer_add(), and is +cleared immediately prior to generating an event of type ET_DESTROY. +This may be used by the application to determine whether or not the +timer is still in use by the events subsystem. If it is, s_active() +returns a non-zero value; otherwise, its value is 0. +</function> + +<function> +void timer_add(struct Timer* timer, EventCallBack call, void* data, + enum TimerType type, time_t value); + +This function is called to initialize and queue a timer. The _timer_ +parameter is a pointer to a struct Timer that is allocated by the +application. The _call_ parameter is a pointer to a function to +process the timer's expiration. The _data_ parameter is for use of +the timer call-back and may be zero. The _type_ parameter must be one +of the valid timer types--TT_ABSOLUTE, TT_RELATIVE, or TT_PERIODIC. +Finally, _value_ is the value for the timer's expiration. +</function> + +<function> +void timer_del(struct Timer* timer); + +When the application no longer needs a TT_PERIODIC timer, or when it +wishes to stop a TT_ABSOLUTE or TT_RELATIVE timer before its +expiration, it should call the timer_del() function. +</function> + +<function> +void timer_chg(struct Timer* timer, enum TimerType type, time_t value); + +Occasionally, an application may wish to delay an existing TT_ABSOLUTE +or TT_RELATIVE timer; this may be done with the timer_chg() function. +The _type_ parameter must be one of TT_ABSOLUTE or +TT_RELATIVE--changing the values of TT_PERIODIC timers is not +supported. The _value_ parameter is the same as would be given to +timer_add() for that particular type of timer. +</function> + +<function> +void timer_run(void); + +When an engine has finished processing the results of its socket and +signal checks--just before it loops around to test for more events--it +should call the timer_run() function to expire any waiting timers. +</function> + +<function> +time_t timer_next(struct Generators* gen); + +Most engines will use a blocking call with a timeout to check for +socket activity. To determine when the next timer needs to be run, +and thus to calculate how long the call should block, the engine +should call timer_next() with the _gen_ parameter passed to the +_EngineLoop_ function. The timer_next() function returns an absolute +time, which may have to be massaged into a relative time before the +engine may use it. +</function> + +<function> +const char* timer_to_name(enum TimerType type); + +This function is defined only when DEBUGMODE is #define'd. It takes +the given _type_ and returns a string giving that type's name. This +function may safely be called from Debug() macros. +</function> + +<function> +enum EventType ev_type(struct Event* ev); + +This macro simply returns the type of the event _ev_. +</function> + +<function> +int ev_data(struct Event* ev); + +When an event is generated, a single integer can be passed along as a +piece of extra information. This can be used, for instance, to carry +an errno value when an ET_ERROR is generated. This macro simply +returns that integer. +</function> + +<function> +struct Socket* ev_socket(struct Event* ev); + +If the event was generated by a socket, this macro returns a pointer +to the struct Socket that generated the event. The results are +undefined if the event was not generated by a socket. +</function> + +<function> +struct Signal* ev_signal(struct Event* ev); + +If the event was generated by a signal, this macro returns a pointer +to the struct Signal that generated the event. The results are +undefined if the event was not generated by a signal. +</function> + +<function> +struct Timer* ev_timer(struct Event* ev); + +If the event was generated by a timer, this macro returns a pointer to +the struct Timer that generated the event. The results are undefined +if the event was not generated by a timer. +</function> + +<function> +void event_init(int max_sockets); + +Before any of the functions or macros described here can be called, +the events subsystem must be initialized by calling event_init(). The +_max_sockets_ parameter specifies to the events subsystem how many +sockets it must be able to support; this figure may be used for memory +allocation by the engines. +</function> + +<function> +void event_loop(void); + +Once the initial sockets are open, signals added, and timers queued, +the application must call the event_loop() function in order to +actually begin monitoring those sockets, signals, and timers. +</function> + +<function> +void event_generate(enum EventType type, void* arg, int data); + +This is the function called by the events subsystem to generate +particular events. The _type_ parameter specifies the type of event +to generate, and the _arg_ parameter must be a pointer to the event's +generator. The _data_ parameter may be used for passing such things +as signal numbers or errno values. +</function> + +<function> +const char* event_to_name(enum EventType type); + +This function is defined only when DEBUGMODE is #define'd. It takes +the given _type_ and returns a string giving that event type's name. +This function may safely be called from Debug() macros. +</function> + +<function> +const char* engine_name(void); + +This function is used to retrieve the name of the engine presently +being used by the events subsystem. +</function> + +<function> +void gen_ref_inc(void* gen); + +This macro increments the reference count of the generator _gen_, +preventing it from simply disappearing without warning. +</function> + +<function> +void gen_ref_dec(void* gen); + +This macro decrements the reference count of the generator _gen_, and +releases the memory associated with it by generating at ET_DESTROY +event if the reference count falls to zero and the generator is marked +for destruction. No references should be made to the generator after +calling this macro. +</function> + +<authors> +Kev <kl...@mi...> +</authors> + +<changelog> +[2001-6-14 Kev] Finished initial description of the events subsystem. + +[2001-6-13 Kev] Initial description of the events subsystem. +</changelog> Index: ircdh/doc/en/api/features.txt diff -u /dev/null ircdh/doc/en/api/features.txt:1.1 --- /dev/null Sat Jan 18 15:28:24 2003 +++ ircdh/doc/en/api/features.txt Sat Jan 18 15:28:14 2003 @@ -0,0 +1,230 @@ +As of u2.10.11, most of the compile-time configuration options present +in previous versions of ircu have been provided via the configuration +file as "features." This document is intended not only to give an +explanation of how to use the features subsystem in new code, but also +how to define new features. + +In the ircd_features.h header file is an enum Feature that lists all +the features known to the features subsystem. The order of entries in +this list must match precisely the order of features as listed in the +features[] table in ircd_features.c. There are four kinds of +features, seven different flags that can be set for features, and +seven different call-backs for more complex features. + +Types of Features + +There are at present four different types of features: NONE, INT, +BOOL, and STR. Features of type "NONE" are complex features, such as +the logging subsystem, that have complicated behavior that's managed +through the use of call-backs. The call-backs available are set, +which is called to set the value of the feature; reset, which is +called to reset the value of the feature back to its default; get, +which is called to send the user a RPL_FEATURE to describe the feature +setting; unmark, which is called prior to reading the configuration +file; mark, which is called after reading the configuration file; and +report, which is used to send a user a list of RPL_STATSFLINE +replies. + +In comparison to type "NONE," the other types are very simple. Type +"INT" is used for features that take an integer value; "BOOL" is for +those features that are boolean types; and "STR" is for those features +that take simple string values. The values for these feature types +are handled directly by the features subsystem, and can be examined +from code with the feature_int(), feature_bool(), and feature_str() +functions, described below. These features have a notify callback, +which is used to warn subsystems that use the values of particular +features that the value has changed. + +Feature Flags + +There are seven feature flags, one of which is used internally by the +feature subsystem. Three of these flags, FEAT_OPER, FEAT_MYOPER, and +FEAT_NODISP, are used to select who can see the settings of those +features; FEAT_OPER permits any operator anywhere on the network to +examine the settings of a particular feature, whereas FEAT_MYOPER only +permits operators local to a server to examine feature values, and +FEAT_NODISP prohibits display of the feature value altogether. If +none of these three flags are specified, then any user may examine +that feature's value. + +Two other flags only have any meaning for string values; they are +FEAT_NULL, which is used to specify that a feature of type "STR" may +have a NULL value, and FEAT_CASE, which specifies that the feature is +case sensitive--this may be used on file names, for example. Note +that if you give "0" as the default value for a feature, you must also +set the FEAT_NULL flag. + +The remaining non-internal flag is FEAT_READ, which simply sets the +feature to be read-only; a feature so marked may only be changed +through the configuration file. + +Marking Features + +When the configuration file is read, there must be some way to +determine if a particular F-line has been removed since the last time +the configuration file was read. The way this is done in the features +subsystem is to have a "mark" for each feature. Prior to reading the +configuration file, all marks are cleared for all features (and all +"unmark" call-backs are called). As each F-line is encountered and +processed, that feature's mark is set. Finally, when the +configuration file has been fully read, all remaining unmarked +features are reset to their default values (and all "mark" call-backs +are called). + +Adding New Features + +To add a new feature, first determine the feature's name (which must +begin with the string "FEAT_") and its type ("NONE," "INT," "BOOL," or +"STR"). Then add the feature to the enum Feature in an appropriate +place (i.e., it's good to group all features affecting operators +separate from those features affecting networking code), and a +corresponding entry in the features[] table in ircd_features.c. It +will be best to use one of the F_?() macros, which are documented +below. Then, whenever you need to refer to the value of a specific +feature, call the appropriate feature_<type>() function, as documented +below. + +<enum> +enum Feature; + +The "Feature" enum lists all of the features known to the feature +subsystem. Each feature name *must* begin with "FEAT_"; the portion +of the name following "FEAT_" will be what you use to set the feature +from the configuration file or with the "set" or "reset" commands. +</enum> + +<function> +int feature_set(struct Client* from, const char* const* fields, int count); + +The feature_set() function takes an array of strings and a count of +the number of strings in the array. The first string is a feature +name, and, for most features, the second string will be that feature's +value. The _from_ parameter is the struct Client describing the user +that issued the "set" command. This parameter may be NULL if +feature_set() is being called from the configuration file subsystem. +</function> + +<function> +int feature_reset(struct Client* from, const char* const* fields, int count); + +The feature_reset() function is very similar in arguments to the +feature_set() function, except that it may not be called from the +configuration file subsystem. It resets the named feature to its +default value. +</function> + +<function> +int feature_get(struct Client* from, const char* const* fields, int count); + +Again, feature_get() is very similar in arguments to the feature_set() +function, except that again it may not be called from the +configuration file subsystem. It reports the value of the named +feature to the user that issued the "get" command. +</function> + +<function> +void feature_unmark(void); + +This function is used to unmark all feature values, as described in +the subsection "Marking Features." It takes no arguments and returns +nothing. +</function> + +<function> +void feature_mark(void); + +The complement to feature_unmark(), feature_mark() resets all +unchanged feature settings to their defaults. See the subsection on +"Marking Features." +</function> + +<function> +void feature_init(void); + +This function initializes the feature interface by setting the default +values for all features correctly. +</function> + +<function> +void feature_report(struct Client* to); + +Reports all F-lines to a user using RPL_STATSFLINE, except those which +the user is not permitted to see due to flag settings. +</function> + +<function> +int feature_int(enum Feature feat); + +To retrieve the values of integer features, call this function. +Calling this function on a different type of feature, such as a "BOOL" +feature, will result in an assertion failure. +</function> + +<function> +int feature_bool(enum Feature feat); + +This function is the complement of feature_int() for features of type +"BOOL." +</function> + +<function> +const char *feature_str(enum Feature feat); + +Use this function to retrieve strings values for features of type +"STR"; you may not modify nor free the string value. +</function> + +<macro> +#define F_N(type, flags, set, reset, get, notify, unmark, mark, report) + +This macro is used in the features[] table to simplify defining a +feature of type "NONE." The _type_ parameter is the name of the +feature excluding the "FEAT_" prefix, and MUST NOT be in +double-quotes. The _flags_ parameter may be 0, FEAT_OPER, or +FEAT_MYOPER--the bitwise OR of these two flags is permissible but +would not make sense. The rest of the arguments are pointers to +functions implementing the named call-back. +</macro> + +<macro> +#define F_I(type, flags, v_int, notify) + +To define integer features, use the F_I() macro. The _type_ and +_flags_ parameters are as for F_N(), and the _v_int_ parameter +specifies the default value of the feature. The _notify_ parameter, +if non-zero, will be called whenever the value of the feature changes. +</macro> + +<macro> +#define F_B(type, flags, v_int, notify) + +This macro is used for defining features of type "BOOL"; it is very +similar to F_I(), but _v_int_ should either 0 (for a "FALSE" value) or +1 (for a "TRUE" value). The _notify_ parameter, if non-zero, will be +called whenever the value of the feature changes. +</macro> + +<macro> +#define F_S(type, flags, v_str, notify) + +Also similar to F_I(), F_S() defines features of type "STR." The +_flags_ argument may be the bitwise OR of one of FEAT_OPER or +FEAT_MYOPER with the special string flags FEAT_NULL and FEAT_CASE, +which are described above in the section "Feature Flags." The +_notify_ parameter, if non-zero, will be called whenever the value of +the feature changes. Note that FEAT_NULL *must* be set if the default +string _v_str_ is set to NULL. +</macro> + +<authors> +Kev <kl...@mi...> +</authors> + +<changelog> +[2001-06-13 Kev] Mention notify with the other callbacks + +[2001-01-02 Kev] Add documentation for new flags and for the notify +mechanism + +[2000-12-18 Kev] Document the features API +</changelog> Index: ircdh/doc/en/api/gline.txt diff -u /dev/null ircdh/doc/en/api/gline.txt:1.1 --- /dev/null Sat Jan 18 15:28:24 2003 +++ ircdh/doc/en/api/gline.txt Sat Jan 18 15:28:14 2003 @@ -0,0 +1,283 @@ +Some users can be very annoying, as any IRC operator can attest. Some +can in fact be downright abusive. Sometimes the best way of dealing +with these users is to ban them from the entire network. The G-line +system permits this. + +G-lines are fairly complicated. A G-line can be active or inactive, +either locally or globally. It can be a purely local G-line, or +global. It could be based on IP address or on host name. In short, +there are many variations on the basic G-line. Worse, there is also +the concept of a "bad channel," or BADCHAN, that has been tacked onto +the G-line subsystem, when it should have been a separate command in +the first place. + +Different types of G-lines are differentiated from each other through +the use of various flags. Some of these flags are maintained solely +by the G-line subsystem, where as others are passed to various +functions in the API. + +<macro> +#define GLINE_MAX_EXPIRE 604800 /* max expire: 7 days */ + +This macro lists the maximum expire time a G-line is permitted to +have. This value is limited to 7 days to prevent abuse of the system. +</macro> + +<macro> +#define GLINE_ACTIVE 0x0001 + +This flag is used to indicate that a given G-line is globally active. +</macro> + +<macro> +#define GLINE_IPMASK 0x0002 + +This flag is used to indicate that a given G-line is an IP mask. This +flag is maintained internally by the G-line subsystem. +</macro> + +<macro> +#define GLINE_BADCHAN 0x0004 + +This flag is used to indicate that a given G-line specifies a BADCHAN, +a channel that users are not permitted to join. This flag is +maintained internally, but is also used in gline_find() to search for +a BADCHAN for a particular channel. +</macro> + +<macro> +#define GLINE_LOCAL 0x0008 + +This flag is used to indicate that a given G-line is a local G-line. +Local G-lines do not affect users on other servers. +</macro> + +<macro> +#define GLINE_ANY 0x0010 + +This flag is passed to gline_find() to signal that function to return +any G-line or BADCHAN that matches the passed mask string. It is +never set on a real G-line. +</macro> + +<macro> +#define GLINE_FORCE 0x0020 + +This flag is passed to gline_add() to force the server to accept an +expire time that might be out of bounds. It is never set on a real +G-line. +</macro> + +<macro> +#define GLINE_EXACT 0x0040 + +This flag is passed to gline_find() to signal that function to return +only G-lines that exactly match the passed mask string. That is, the +ircd_strcmp() function is called to compare the G-line to the mask, +rather than the match() function. This flag is never set on a real +G-line. +</macro> + +<macro> +#define GLINE_LDEACT 0x0080 /* locally deactivated */ + +This flag is set on global G-lines that have been locally +deactivated. This flag is maintained internally by the G-line +subsystem. +</macro> + +<macro> +#define GLINE_GLOBAL 0x0100 /* find only global glines */ + +This flag is passed to gline_find() or gline_lookup() to specify that +the caller is only interested in global G-lines. This flag is never +set on a real G-line. +</macro> + +<macro> +#define GLINE_LASTMOD 0x0200 /* find only glines with non-zero lastmod */ + +This flag is passed to gline_find() or gline_lookup() to specify that +the caller is only interested in G-lines with a non-zero lastmod time, +that is, G-lines that were not set by a U-lined service. This flag is +never set on a real G-line. +</macro> + +<struct> +struct Gline; + +The struct Gline describes everything about a given G-line. None of +its fields may be directly accessed by the application; use the +functions and macros described below instead. +</struct> + +<function> +int GlineIsActive(struct Gline* g); + +This macro returns a non-zero value if the G-line is active, or 0 +otherwise. If a G-line is locally deactivated, this macro will always +return 0. +</function> + +<function> +int GlineIsRemActive(struct Gline* g); + +This macro returns a non-zero value if the G-line is active, ignoring +whether or not it is locally deactivated. +</function> + +<function> +int GlineIsIpMask(struct Gline* g); + +This macro returns a non-zero value if the G-line is an IP mask. +</function> + +<function> +int GlineIsBadChan(struct Gline* g); + +This macro returns a non-zero value if a G-line actually represents a +BADCHAN. +</function> + +<function> +int GlineIsLocal(struct Gline* g); + +This macro returns a non-zero value if a G-line is local only. +</function> + +<function> +char* GlineUser(struct Gline* g); + +This macro returns the user name associated with the G-line. If the +G-line represents a BADCHAN, this will contain the channel name. +</function> + +<function> +char* GlineHost(struct Gline* g); + +This macro returns the host name associated with the G-line. If the +G-line represents a BADCHAN, this will be a NULL pointer. +</function> + +<function> +char* GlineReason(struct Gline* g); + +This macro returns the reason that was given when the G-line was set. +</function> + +<function> +time_t GlineLastMod(struct Gline* g); + +G-lines that were not set by a U-lined service have a modification +time that must be monotonically increasing. This macro simply returns +that modification time. +</function> + +<function> +int gline_propagate(struct Client *cptr, struct Client *sptr, + struct Gline *gline); + +When a global G-line is set or modified, all other servers must be +notified of the new G-line. This function takes care of propagating +the G-line specified by _gline_, originated by the client _sptr_, to +all servers except _cptr_ (which may be a NULL pointer). +</function> + +<function> +int gline_add(struct Client *cptr, struct Client *sptr, char *userhost, + char *reason, time_t expire, time_t lastmod, unsigned int flags); + +This function simply adds a G-line, set by _sptr_ and with a +_userhost_, _reason_, _expire_, and _lastmod_ as specified. The +_flags_ parameter is a bit mask consisting of the binary OR of +GLINE_FORCE, GLINE_LOCAL, or GLINE_ACTIVE, as appropriate. The +gline_add() function also calls gline_propagate() to propagate the +G-line, and kills off any local users matching the G-line if it is +active. +</function> + +<function> +int gline_activate(struct Client *cptr, struct Client *sptr, + struct Gline *gline, time_t lastmod, unsigned int flags); + +This function activates the G-line specified by _gline_, setting its +_lastmod_ time as specified. If _flags_ is GLINE_LOCAL and if the +G-line is locally deactivated, this function will turn off the local +deactivation flag, but will not modify _lastmod_. If the G-line is +globally deactivated, passing this function the GLINE_LOCAL flag will +have no effect. +</function> + +<function> +int gline_deactivate(struct Client *cptr, struct Client *sptr, + struct Gline *gline, time_t lastmod, unsigned int flags); + +This function is similar to gline_activate() except that it +deactivates the G-line. If the given G-line is local, or if it was +set by a U-lined service (and GLINE_LOCAL was not passed via _flags_), +then the G-line is deleted from memory. In all other cases, the +G-line is simply deactivated, either locally (if GLINE_LOCAL was +passed via _flags_) or globally. Global deactivation will update the +_lastmod_ time. +</function> + +<function> +struct Gline *gline_find(char *userhost, unsigned int flags); + +This function looks up a G-line matching the given _userhost_ value, +under control of the _flags_ parameter. Valid _flags_ that may be +passed are: GLINE_BADCHAN, GLINE_ANY, GLINE_GLOBAL, GLINE_LASTMOD, or +GLINE_EXACT, each described above. +</function> + +<function> +struct Gline *gline_lookup(struct Client *cptr, unsigned int flags); + +This function looks up a G-line matching the given client, specified +by _cptr_, under the control of the _flags_. Valid values for _flags_ +are GLINE_GLOBAL and GLINE_LASTMOD, as described above. +</function> + +<function> +void gline_free(struct Gline *gline); + +This function releases all storage associated with a given G-line. +</function> + +<function> +void gline_burst(struct Client *cptr); + +This function generates a burst of all existing global G-lines and +BADCHANs and sends them to the server specified by _cptr_. +</function> + +<function> +int gline_resend(struct Client *cptr, struct Gline *gline); + +This function resends the _gline_ to a server specified by _cptr_. +This may be used if, for instance, it is discovered that a server is +not synchronized with respect to a particular G-line. +</function> + +<function> +int gline_list(struct Client *sptr, char *userhost); + +This function sends the information about a G-line matching _userhost_ +to the client specified by _sptr_. If _userhost_ is a NULL pointer, a +list of all G-lines is sent. +</function> + +<function> +void gline_stats(struct Client *sptr); + +This function generates a list of all G-lines, sending them to the +user _sptr_ by a /STATS G response. +</function> + +<authors> +Kev <kl...@mi...> +</authors> + +<changelog> +[2001-6-15 Kev] Initial documentation for the G-line API. +</changelog> Index: ircdh/doc/en/api/ircd_snprintf.txt diff -u /dev/null ircdh/doc/en/api/ircd_snprintf.txt:1.1 --- /dev/null Sat Jan 18 15:28:24 2003 +++ ircdh/doc/en/api/ircd_snprintf.txt Sat Jan 18 15:28:14 2003 @@ -0,0 +1,268 @@ +These functions are intended to be a complete replacement for sprintf +and sprintf_irc. They are a (nearly) complete reimplementation, and +of course they're snprintf clones, making it more difficult for +accidental buffer overflows to crop up. + +First off, what's missing? These functions support all ANSI C +conversion specifiers and selected ones from ISO 9x, with the +exception of all floating-point conversions. The floating-point +conversions are tricky, and will likely be dependent on the +representation of a floating-point number on a particular +architecture. While that representation is likely to conform to some +standard, it is not currently used in ircu, so seemed like a good +thing to omit, given the difficulty of implementing it. + +There are two more things missing from this implementation that would +be required by ANSI; the first is support for multibyte character +strings, and the second is support for locales, neither of which have +any relevance for ircu, so again omission seemed to be a good policy. +Additionally, %#x always causes '0x' (or '0X') to be printed, even if +the number is zero. + +These functions also have some extensions not seen in a +standards-compliant implementation; technically, the ISO 9x extensions +fall into this category, for instance. The ISO 9x extensions +supported are type extensions--%ju, %tu, and %zu, for instance; %qu +and %hhu are also supported. The extensions added for use in ircu are +%Tu, which takes a time_t, and the new %C conversion, which inserts +either a numeric or a nick, dependent on the <dest> parameter. The +GNU %m extension, which inserts the strerror() string corresponding to +the current value of errno, is also supported, as is a special %v +extension, which essentially does a recursive call to ircd_snprintf. + +The following description is descended from the Linux man page for the +printf family of functions. + +The format string is composed of zero or more directives: ordinary +characters (not %), which are copied unchanged to the output stream; +and conversion specifications, each of which results in fetching zero +or more subsequent arguments. Each conversion specification is +introduced by the character %. The arguments must correspond properly +(after type promotion) with the conversion specifier. After the %, +the following appear in sequence: + +* Zero or more of the following flags: + + # specifying that the value should be converted to an "alternate + form." For c, d, i, n, p, s, and u conversions, this option + has no effect. For o conversions, the precision of the number + is increased to force the first character of the output string + to a zero (except if a zero value is printed with an explicit + precision of zero). For x and X conversions, the string '0x' + (or '0X' for X conversions) is prepended to it. For e, E, f, + g, and G conversions, the result will always contain a decimal + point, even if no digits follow it (normally, a decimal point + appears in the results of those conversions only if a digit + follows). For g and G conversions, trailing zeros are not + removed from the result as they would otherwise be. For C + conversions, if the destination is local and the origin is a + user, the nick!user@host form is used. + + 0 specifying zero padding. For all conversions except n, the + converted value is padded on the left with zeros rather than + blanks. If a precision is given with a numeric conversion (d, + i, o, u, i, x, and X), the 0 flag is ignored. + + - (a negative field width flag) indicates the converted value is + to be left adjusted on the field boundary. Except for n + conversions, the converted value is padded on the right with + blanks, rather than on the left with blanks or zeros. A - + overrides a 0 if both are given. + + ' ' (a space) specifying that a blank should be left before a + positive number produced by a signed conversion (d, e, E, f, + g, G, or i). + + + specifying that a sign always be placed before a number + produced by a signed conversion. A + overrides a space if + both are used. + + : specifying that a struct Client name should be preceded by a + ':' character if the destination is a user + +* An optional decimal digit string specifying a minimum field width. + If the converted value has fewer characters than the field width, it + will be padded with spaces on the left (or right, if the + left-adjustment flag has been given) to fill out the field width. + +* An optional precision, in the form of a period (`.') followed by an + opt... [truncated message content] |
From: Toni G. <zo...@us...> - 2003-01-18 23:25:09
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:25:08 UTC Removed files: doc/Authors doc/Configure.help doc/irc.1 doc/ircd.8 doc/readme.crules doc/readme.indent doc/readme.who doc/readme.www Log message: Documentacion ---------------------- diff included ---------------------- Index: ircdh/doc/Authors diff -u ircdh/doc/Authors:1.1.1.1 ircdh/doc/Authors:removed --- ircdh/doc/Authors:1.1.1.1 Fri Jul 26 14:58:23 2002 +++ ircdh/doc/Authors Sat Jan 18 15:25:08 2003 @@ -1,171 +0,0 @@ -/************************************************************************ - * IRC - Internet Relay Chat, doc/AUTHORS - * Copyright (C) 1990 - * - * AUTHORS FILE: - * This file attempts to remember all contributors to the IRC - * developement. Names can be only added this file, no name - * should never be removed. This file must be included into all - * distributions of IRC and derived works. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 1, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -IRC was conceived of and written by Jarkko Oikarinen <jt...@to...>. -IRC was originally written in University of Oulu, Computing Center. -Jan 1991 - IRC 2.6 jt...@to... - - Multiple Channels and protocol changes - -Contributions were made by a cast of dozens, including the following: - -Markku Jarvinen <mt...@tu...>: Emacs-like editing facility for the client - -Kimmo Suominen <ki...@ka...>: HP-UX port - -Jeff Trim <jt...@or...>: enhancements and advice - -Vijay Subramaniam <vi...@ll...>: advice and ruthless publicity - -Karl Kleinpaste <ka...@ci...>: user's manual - -Greg Lindahl <gl...@vi...>: AUTOMATON code, the Wumpus GM automaton, -myriad bug fixes - -Bill Wisner <wi...@ha...>: numerous bug fixes and code -enhancements - -Tom Davis <con...@ze...> and Tim Russell <ru...@ze...>: -VMS modifications - -Markku Savela <ms...@te...>: advice, support, and being the -incentive to do some of our *own* coding. :) - -Tom Hopkins <ho...@bu...>: bug fixes, quarantine lines, -consolidation of various patches. - -Christopher Davis <ck...@cs...>: EFnet/Anet gateway coding, -many automata ;), documentation fixing. - -Helen Rose <hr...@cs...>: documentation updating, and fixing. - -Tom Hinds <ro...@bu...>: emacs client updating. - -Tim Miller <ce...@bu...>: various server and client-breaking -features. - -Darren Reed <av...@co...>: various bug fixes and enhancements. -Introduced nickname and channelname hash tables into the server. - -The version 2.2 release was coordinated by Mike Bolotski -<mi...@sa...>. - -The version 2.4 release was coordinated by Markku Savela and -Chelsea Ashley Dyerman - -The version 2.5.2 release was coordinated by Christopher Davis, Helen Rose, -and Tom Hopkins. - -The versions 2.6.2, 2.7 and 2.8 releases were coordinated by Darren Reed. - -Contributions for the 2.8 release from the following people: -Matthew Green <ph...@co...> -Chuck Kane <ck...@ec...> -Matt Lyle <ma...@oc...> -Vesa Ruokonen <ruo...@lu...> - -Markku Savela <Mar...@vt...> / April 1990 -Fixed various bugs in 2.2PL1 release server (2.2msa.4) and changed -sockets to use non-blocking mode (2.2msa.9). [I have absolutely -nothing to do with clients :-] - -Chelsea Ashley Dyerman <ch...@ea...> / April 1990 -Rewrote the Makefiles, restructuring of source tree. Added libIrcd.a to -the Makefile macros, numerous reformatting of server text messages, and -added mkversion.sh to keep track of compilation statistics. Numerous -bug fixes and enhancements, and co-coordinator of the 2.4 release. - -Jarle Lyngaas (nm...@al...) added Note functions to ircd. - -Armin Gruner <gr...@in...> / May, June 1990: -* Patched KILL-line feature for ircd.conf, works now. - Enhancement: Time intervals can be specified in passwd-field. - Result: KILL-Line is only active during these intervals -* Patched PRIVMSG handling, now OPER can specify masks for sending - private messages, advantage: msg to all at a specified server or host. -* Little tests on irc 2.5 alpha, fixed some little typos in client code. - Change: common/debug.c has been moved to ircd/s_debug.c, and a - irc/c_debug.c has been created, for the benefit that wrong server msg - are displayed if client does not recognize them. (strange, if a server - sends an 'unknown command', isn't it?) - -Tom Hopkins <ho...@bu...> / September, October 1990: -* Patched msa's K lines for servers (Q lines). -* Consolidated several patches, including Stealth's logging patch. -* Fixed several minor bugs. -* Has done lots of other stuff that I can't seem to remember, but he - always works on code, so he has to have done alot more than three - lines worth. :) - -Thanks go to those persons not mentioned here who have added their advice, -opinions, and code to IRC. - -Various modifications, bugreports, cleanups and testing by: - -Hugo Calendar <hu...@uc...> -Bo Adler <ad...@cs...> -Michael Sandrof <ms...@an...> -Jon Solomon <js...@cs...> -Jan Peterson <jl...@ha...> -Nathan Glasser <na...@br...> -Helen Rose <hr...@ef...> -Mike Pelletier <st...@ca...> -Basalat Ali Raja <gw...@ta...> -Eric P. Scott <ep...@to...> -Dan Goodwin <fo...@wp...> -Noah Friedman <fri...@ai...> - - -UNDERNET (1991 - 1999) --------- - -The Undernet versions (TSpre8, u2.9 and u2.10) are based on ircd-2.8.10 and -contain thousands of hours of work by Carlo Wood <ca...@ru...> -(Run on IRC). The number of protocol enhancements, changes and additions that -have been added are too many to summarize. All patches are kept in the patch -repository at http://www.xs4all.nl/~carlo17/ircd-dev/ - -Various additions and bugfixes have been contributed by: - -Aaron <agi...@sc...> -CapVideo <ma...@pu...> -Chaos <si...@tr...> -Cym <cy...@ac...> -Derrick <di...@se...> -Ensor <dh...@ra...> -flux <cml...@uc...> -Ghostwolf <fo...@wo...> -Jamey <wo...@du...> -Jarle <ja...@II...> -Kev <kl...@mi...> -Nemesi <co...@ti...> -Niels <ni...@ho...> -record <jeg...@cl...> -smg <sm...@lm...> -SeKs <in...@st...> -Simon- <si...@pe...> -Starfox <st...@qu...> -Trio <tr...@b6...> -WildThang <dvm...@an...> -Xorath <vo...@wh...> Index: ircdh/doc/Configure.help diff -u ircdh/doc/Configure.help:1.2 ircdh/doc/Configure.help:removed --- ircdh/doc/Configure.help:1.2 Sat Jul 27 02:55:54 2002 +++ ircdh/doc/Configure.help Sat Jan 18 15:25:08 2003 @@ -1,1230 +0,0 @@ -# Format of this file: description<nl>variable<nl>helptext<nl><nl>. -# If the question being documented is of type "choice", we list -# only the first occurring config variable. The help texts -# must not contain empty lines. No variable should occur twice; if it -# does, only the first occurrence will be used by Configure. The lines -# in a help text should be indented two positions. Lines starting with -# `#' are ignored. Limit your lines to 78 characters. -# -# If you add a help text to this file, please try to be as gentle as -# possible. Don't use unexplained acronyms and generally write for the -# hypothetical admin who has just downloaded ircu for the first time. -# Tell them what to do if they're unsure. Technical information -# should go in a README in the Documentation directory. Mention all -# the relevant READMEs and HOWTOs in the help text. -# -# All this was shamelessly stolen from several different sources. Many -# thanks to all the contributors. The texts are copyrighted # (c) 1997 -# by Carlo Wood and governed by the GNU Public License. -# - -Do you want to change your previous configuration -CHANGE_CONFIG - You will be presented a series of questions that you have to answer - in order to configure the IRC daemon, prior to compilation. - If you went through this before, then your choices have been stored - in a file '.config'. If you want to use the same stored configuration - now, specify 'n'; this will quickly skip through all questions that - you already answered previously, only prompting you for NEW questions. - Note that NEW questions only can occur when you just upgraded to a - new version. Note also that if you abort by pressing ^C (control-C) - anywhere, then all answers are lost; you must finish it before the - answers are stored. - Pressing a 'c' or 'C' (followed by a return) on any question will - Continue the script in "use_defaults mode", that means that it will - take all default values unless it finds a NEW question (like when you - specify a 'n' here). 'C' will finish everything, but a 'c' will - only finish the current paragraph. - If you are unsure, or if you want to change a previously entered - configuration, specify 'y'. - -Which compiler do you want to use -CC - Here you need to specify the C compiler you want to use. - Using 'gcc' is highly recommended, you might even want to install it - on your machine first. Note that you can specify the full path if you - are not sure if the compiler is in your PATH (or whether or not the right - compiler will be used). An example is: "/usr/ucb/cc". - The package needs an ANSI compiler. Some compilers need an extra option - to compile ANSI C. In those cases you can add these options also here. - For example, on a HPUX-8.x you would use (if you don't have gcc): - "cc -Aa -D_HPUX_SOURCE". - Note that you should not use quotes. - -What flags should I pass to $CC -CFLAGS - These are the compiler flags, used for CC when compiling. - If you are not using gcc, it might be possible that your compiler is not - supporting -g and -O at the same time. The -g option is necessary to be - able to debug the daemon in the case it contains a bug that makes the - ircd core dump. Unless you use a version that is proven to be VERY stable, - it is highly recommended to use this option. All Undernet production servers - are expected to use it in order to help coder-com to track down bugs. - The -O3 will optimize the code - it also makes debugging harder. - If you have plenty of cpu cycles then you can use -O2 instead of -O3: - it will disable inlining which makes it easier to debug or core dump, - the daemon will use a few percent more cpu however. - If you are not running a production server you should remove the -Ox. - Ircd developers can optionally use more options to turn on extra warnings. - Developers (which are using gcc of course ;), should use: - "-g -Wall -pedantic -DGODMODE" - Note that you should not use quotes. - Note that the server uses several non-ANSI (though POSIX.1) function calls. - -Do you need extra include directories -EXTRA_INCLUDEDIRS - If your compiler needs extra include directories, you can specify them - here as a space separated list of directories. Do not use quotes and do - not specify the '-I' prefix. Usually you don't have to specify any - extra include directory, in that case you should specify "none" here. - If unsure, try "none" (without quotes) and see if all the '#include' - header files are found during compilation. - -Which linker flags do you need -LDFLAGS - Here you can specify extra flags that will be passed to the linker. - Usually you will not need to pass any flags and you can therefore - specify "none" here (without the quotes). - SunOS users may want to add "-Bstatic" (but only if you need it). - You can also specify any "-L..." flags here if you need those for - extra libraries. - -Which extra libraries do you need -IRCDLIBS - Some Operating Systems need linking with extra libraries for some of the - functions used by the daemon. In some cases, it is not known which - libraries are needed, even when the Operating System is known. This is - for instance the case with SunOS, some need -lresolv, while others don't. - If you forget to add a library then this will result in 'undefined variables' - during linking. If you do not know which library to add, it might be - helpful to use the unix command `nm', which lists the variables of a - library. For instance, if you get "unknown variable '_res_mkquery'", and you - wonder if this is in /usr/lib/libresolv.so, you can do: - nm /usr/lib/libresolv.so | grep res_mkquery - Do not use the leading '_' in the grep, this underscore is added by the - assembler but is not part of the original variable name and does not show - up in the output of nm. - Most libraries are in /lib or /usr/lib, which are scanned by default. In - some cases you will need to tell the linker where to search for a library. - You can do this by adding an -L... option to IRCDLIBS. For instance: - "-L/usr/ucblib -lucb" will look for 'libucb.so' in /usr/ucblib too. - Here is a list of what you MAYBE need to specify depending on your - Operating System: - OS Specify here - NeXT != 2.0 -lsys_s - Dynix/ptx -lsocket -linet -lnsl -lseq - Dell SVR4 -lsocket -lnsl -lucb - All others Default provided by autoconf - If unsure use the default provided by autoconf. - -Where should I install the ircd binary -BINDIR - After compilation (by typing 'make'), you can install the server with - the command 'make install'. This will install the ircd in the directory - you specify here. The package tries to use a meaningful name by naming - the binary "ircd.<tag>", where <tag> is the name of the last patch that - was applied by the maintainer. A symbolic link (to be specified next) - will be used to point to this binary. This allows a /RESTART to - immediately start the new version, while keeping the old binary. - Note that you need to have write permissions in this directory during - the install. Please re-check the permissions/owner and group after - installation. - -What should the name of the installed symbolic link to the executable be -SYMLINK - 'make install' installs the binary with an unique name, however it makes - a symbolic link to this newly installed executable which always has the - same name, so you can use /RESTART and/or use this name in scripts that - automatically restart the ircd after a reboot or crash. - Here you can specify the name of that symbolic link. Note that it may - not contain a '/'; it is just the name if the symbolic link and will be - installed in BINDIR. - -Which permissions do you want the binary to have -IRCDMODE - Here you need to specify the octal file mode of the ircd binary. - Recommended is 711 - but you might need setuid or something. - Note that using a setuid and starting the daemon as another user - does prohibit the daemon from core dumping in case of a crash on some - Operating Systems. - -Which owner do you want the binary to have -IRCDOWN -This will be the owner of the ircd binary after installation. - -Which group do you want the binary to have -IRCDGRP -This will be the group of the ircd binary after installation. - -Where should I install the man page -MANDIR - This is the base directory where the manual page of the ircd is installed. - If you are not root on your system, you can change it to your personal - manpath directory (which of course should be in your MANPATH environment - variable then). - -Use inlining for a few crucial functions -FORCEINLINE - This will increases the size of the executable with 7 kb, but it also - speeds up execution a bit :). Your compiler needs to understand the - keyword __inline__ (GNU gcc and egcs do). - If unsure, try if `y' compiles. If it doesn't, you can try using a - C++ compiler (ie, configure CC to be 'g++' instead 'gcc'). - -You have poll(), but do you want to use it -USE_POLL - Some Operating Systems implement select() by calling poll(), others - implement poll() by calling select(). The best performance will be - achieved by calling the lowest (sys)call ourselves of course. - The Undernet Daemon allows you to use select() or poll(). - If you specify 'y' here, the daemon will use poll() directly, otherwise - it will use select(). If you don't know what your Operating System - uses as syscall, you can compile the server with USE_POLL and detach - the running process with 'strace -p <pid>', 'truss -p <pid>' or - 'trace -p <pid>' depending on your Operating System, these UNIX commands - will show you the syscalls and therefore show if you use poll() or select(). - The advantage of using poll() is that you are not bothered by the limits - of select() and fd_set size (ie, the number of clients that connect). - The following Operating Systems seem to use poll(): - Solaris 2.x, SunOS 4.x, AIX, Digital UNIX, and NetBSD. - linux-2.2.x use poll(), but only of your glibc was compiled with that - kernel (and it won't unless you compile it yourself). - The following Operating Systems use select(): - linux-2.0.x. - If unsure, test it (a ./configure check will be added in ircu2.10.06). - -What is the domain name of your network -DOMAINNAME - This define allows you to specify what you consider to be 'local'. - It is only used for statistics. When you issue the IRC command /stats w, - the server will respond with statistics of how many clients have been - connecting to your server in the last minute, hour and day. It will - give these statistics for all connections (including the servers), all - clients (from anywhere) and also for clients whose hostname ends on - the domain you specify here. So if you are an ISP and you want to know - specifically the client load from your own domain, specify that domain - here. If you are unsure what to do, then it isn't really important what - you give here, just don't give an empty string. A good guess is the last - two parts of your own hostname (ie, if your hostname is foo.bar.nowhere.org, - specify 'nowhere.org'). Note that the string you give should NOT start - with a '.' and you should not use quotes. - -What is the network name of your network -NETWORK_NAME - Especifica el nombre de la red, lo muestra en los raws 001 y 005. - -Please give a random seed of eight characters -RANDOM_SEED - You should specify exactly eight characters (0-9A-Za-z) here. Do not use - quotes or any other special characters. This value is used to initialize - the random generator of the server which is used to generate PING/PONG - cookies in order to stop spoofing IP-numbers (a PING with a random number is - sent to this IP-number and if the client doesn't respond with the - exact same number, access is denied). In order to make the random - number impossible to guess, it is important that you use your own random - seed here. - -Does your host have a reliable clock -RELIABLE_CLOCK - You should really ONLY specify 'y' here when your system clock is - stable and accurate at all times (within a few seconds). - If you are running ntpdate on a regular basis, or an equivalent - like xntpd, to keep your system clock synchronized over the network, - then you might have an accurate clock. However, this is not guaranteed, - for example, it is known that xntpd gives unstable results on linux - in some cases. Note that an unstable clock is worse then an clock that - has a constant offset, because the servers attempt to correct for a - constant offset, but do not correct jumps of your system clock ! - In general you SHOULD be running ntpdate or equivalent AND make sure it - works when you run a production server on Undernet. Otherwise leave - your clock alone and specify 'n' here. - If unsure specify 'n' ! - -Change root (/) after start of daemon -CHROOTDIR - If you are a security freak and you want to the daemon to run in - its own environment, then you can specify 'y' here. The daemon will - change '/' to 'DPATH' (which you will have to specify later). - If this confuses you or if you are uncertain, specify 'n'. - -Do you want the daemon set its own uid/gid -CONFIG_SETUGID - If you specify 'y' here, then the daemon will attempt to set its - User ID (uid) and Group ID (gid) to the numeric values that you will - have to specify next. This only makes sense if you (have to) start - the server as root. The most secure operation of the server is to - not use setuid stuff (here or by means of setting the file mode) - and to run the server as a special user only (ie 'irc'). Of course - this user must have access to all log and configuration files. - Note that using a setuid and starting the daemon as another user - does prohibit the daemon from core dumping in case of a crash on some - Operating Systems. - This option is actually only necessary when you use the Change Root - option, because otherwise you can use the file mode to set the uid - and gid. Note that the server refuses to run as root. - If unsure, specify 'n'. - -UID of irc daemon -IRC_UID - Ok, if you insist on using this option: Here you must specify the - numeric value of the uid that you want the server to run as. - Note that you need to look in the right /etc/passwd file, which isn't - the same file when you used the Change Root option. - -GID of irc daemon -IRC_GID - Ok, if you insist on using this option: Here you must specify the - numeric value of the gid that you want the server to run as. - Note that you need to look in the right /etc/group file, which isn't - the same file when you used the Change Root option. - -Allow to specify configuration file on command line -CMDLINE_CONFIG - If you specify 'y' here, you will be allowed to specify the ircd.conf - path (the ircd daemon configuration file) on the command line when - starting the daemon (with the -f <ircd.conf file> option). - Note that defining this 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. Note also that defining this is - a major security hole if other users have accounts on the same machine; - when your ircd goes down and some other user starts up the server with - a new conf file that has some extra O-lines. So don't use this unless - you're debugging. - -Set up a Unix domain socket to connect clients/servers -UNIXPORT - If there are lots of users having an account on the same machine - (which is very unlikely because the server needs all cpu ;), then - using a UNIX domain socket to connect these clients to is more - efficient then letting them connect via TCP/IP. A UNIX domain - socket is a special device that will be created in your File System. - Your client must also support connecting to a UNIX domain socket. - The name of the special device must be specified in the "ircd.conf" - file by means of an extra 'P: line', see doc/example.conf for the - syntax. - If you don't have many IRC-ing users on the same host as the server, - or when your local IRC client doesn't support UNIX domain sockets, - specify 'n' here. Otherwise specify 'y'. - -Do you need virtual hosting -VIRTUAL_HOST - This is only needed when you want to run two or more servers on the - same machine and on the same port (but different devices). - In general you will only need this if you have at least two ethernet - cards in your machine with a different IP-number. - If you specify 'y' here, then you can "bind" a server to one of your - interfaces. You should use the command line option '-w' to tell the - server to which interface to bind to. No error is reported if this - fails, the server will simply not run. - If no '-w' option is given then the server name specified in the - 'M: line' of the "ircd.conf" file of the server is used, provided it - resolves to an IP-number of one of your interfaces. Note that - normally the name does not have to resolve, but when you define this, - it MUST resolve or you must use the -w command line option, or the - "bind" will fail. - If you are unsure, specify 'n'. - -Will you connect to more then one server at a time -HUB - All servers of one IRC "network" are connected in a "tree" (no loops). - Servers that are only connected to one other server (called the - 'uplink') are called "leafs", servers that are connected to more then - one other server are called HUBs. - If you specify 'n' here then your server will prevent itself from acciden- - tally connecting to two servers at once, which is good because this is - generally bad for servers in "leaf" positions (they are net.wise located - too bad to route traffic). Note that on Undernet all newly linked servers - are linked as leafs during their test phase, and should specify 'n' here. - -Do you want support for the old I:*:ONE:*:: construct -USEONE - Server versions prior to ircu2.10.05 used to use the string "ONE" - as password in an I: line to indicate that only one connection was - allowed for any given IP number that matched that I: line. - This method only counted the *local* connections though. - As of ircu2.10.05 you can specifiy a single(!) digit as password - which then will allow that many connections from the same IP number. - However, now the IP numbers of ALL clients are counted, also those - that are connected to other servers. - If you do not use the depricated "ONE" password in your ircd.conf, - specify 'n' here. Note that if you you DO use the "ONE" password - and you specify 'n' here, then you should change all occurances of - "ONE" to "1" (this is the recommended procedure). - If you are lazy and you don't want to change the "ONE" passwords - into a "1", then specify 'y' here. - -Send a short message instead of the MOTD to connecting clients -NODEFAULTMOTD - Every time a client connects to your server, the full Message Of - The Day (as specified in its file MPATH) is sent to the client. - Even while many clients allow the user to ignore the message of - the day: the server still sends it. Many users never read the - message of the day anyway, making it a huge waste of bandwidth. - If you specify 'y' here than the server won't send the MOTD by - default to the client, but rather tell the client when the MOTD - was last changed and how to receive the MOTD by typing /MOTD. - If unsure specify 'n'. - -Do you want to enable debugging output -DEBUGMODE - Sometimes things just don't work. This doesn't have to be a crash, - but it is also possible that your server just doesn't want to start - at all, or disallows clients to connect at all, etc. - With all such drastic and REPRODUCIBLE problems, it makes sense to - recompile the server with this option set and then running the - ircd (irc daemon) with the (extra) command line options: -t -x9 - This will make the server run in the foreground and write debug output - to the terminal; in a lot of cases this can give a clue on what is - wrong (although more often it doesn't). - Because defining DEBUGMODE uses a LOT of cpu and is never useful - unless you are debugging a reproducible test case, you should never - specify 'y' here except for the reason just mentioned. - You should certainly NEVER specify 'y' for a server that runs on a - production net. - -Do you want memory- allocation and/or leak checking -DEBUGMALLOC - If you specify 'y' here, then the server will start to do book keeping - on the allocated memory blocks. This uses extra cpu and memory, - so normally you do not want this - unless you are debugging. - This option uses 8 bytes extra per allocated memory block. - The main purpose of this option is to check if a call to free(2) is done - with a valid pointer - if the pointer was not previously returned by - malloc(2), calloc(2) or realloc(2), the server will core dump in a place - that allows the maintainer to get an idea of what went wrong - but only - when the server was compiled with the -g flag of course. - You also need to specify 'y' here if you want to search for memory leaks. - On a production server, specify 'n' - unless you have lots of cpu to - spare and you volunteer to search for memory leaks - contact the - maintainer in this case. - If unsure, specify 'n'. - -Do you want to have boundary checking -MEMMAGICNUMS - One of the most nasty bugs are those where buffer overruns are involved. - In an attempt to catch those in an early stage, this option will add - so called "magic numbers" to the beginning and end of each allocated - memory block. When a block is freed or reallocated, the magic numbers - are checked and the server core dumps when they were corrupted. - This option uses 12 bytes extra per allocated memory block. - It doesn't really use much extra cpu compared to defining DEBUGMALLOC, so - you might as well specify 'y' here, just in case. It only makes sense - though if you compiled the server with compiler option '-g'. - If unsure, specify 'n'. - -Do you want memory leak testing (stats M) -MEMLEAKSTATS - If you specify 'y' here then the server will start to do extra book keeping - on the allocated memory blocks, counting the number of currently allocated - blocks per source code location (file and line number). You will be able - to retrieve these statistics with the command /stats M. - When there is a memory leak, then allocated memory blocks that were allocated - under certain conditions are never freed (however the contents of those - memory blocks are never used anymore); this would result in a (slow?) - increase of the count of allocated memory blocks. This option allows to - find where these blocks were allocated which might give a clue on the memory - leak problem. - This option uses 4 bytes extra per allocated memory block. - If you want to look for memory leaks, specify 'y' - otherwise specify 'n'. - -Do you want extra info on allocated sizes -MEMSIZESTATS - If you specify 'y' here then the server will start to do extra book keeping - on the sizes of the allocated memory blocks. /stats M will not only return - the number of allocated blocks, but also the total number of allocated - bytes involved. If you defined MEMLEAKSTATS to look for memory leaks, it - will give the total number of allocated memory per source code location - (file and line number). - This option uses 4 bytes extra per allocated memory block, unless you already - specified 'y' for MEMMAGICNUMS (boundary checking), because in that case - it was already included (and it doesn't matter what you specify here). - I think you should specify 'y' here, its more fun to see the sizes :). - -Do you want support for a time interval with /stats M -MEMTIMESTATS - If you specify 'y' here then the server will start to do extra book keeping - on the allocated memory blocks, storing the time at which the memory block - was allocated. This especially slows down /stats M (but unless you use - that command frequently, it shouldn't really matter) and uses again 4 bytes - of extra memory per allocated memory block. - This option is especially useful if you are looking for memory leaks - because it allows you to specify a time window with /stats M for which - counted blocks must be returned. This allows to ignore recently allocated - blocks and permanently allocated blocks (since the start of the server). - -Are you testing on a host without DNS -NODNS - If you are playing with the server off-line, and no DNS is available, then - long delays occur before the server starts up because it tries to resolv - the name given on the M:line (which usually isn't given in /etc/hosts) and - for each connecting client. - If you specify 'y' here, then a call to gethostbyname() will be done only - for the real hostname, and the server will not try to resolv clients that - connect to `localhost'. - Note that other calls to gethostbyname() are still done anyway if you - use VIRTUAL_HOST and that the server still tries to resolv clients - that connect to the real IP-number of the server. - -Directory where all ircd stuff sits -DPATH - DPATH is provided so that the other path names may be provided in just - filename form. It is the Default PATH. When the server starts, it - chdir's to DPATH before chroot or any other file operation, making - it the "current directory" for the server. This is where core files - will go if the server core dumps. - Note that you should not include quotes here. - Note also that the command line option "-d <dir>" overrides the DPATH - you give here, except for the chroot (if you use that). - -Server configuration file -CPATH - This is the IRC daemon Configuration filename, mostly called "ircd.conf". - If you just specify the filename, the server will read its configuration - file from the Default Path "DPATH", which you specified above. However, - you are also allowed to specify a full path. - Note that you should not include quotes here. - -Server MOTD file -MPATH - MPATH is the filename, relative to DPATH, or the full path, of the - "Message Of The Day" file; mostly called "ircd.motd". The contents - of this file will be sent to every client that connects to the server, - after registration. - Note that you should not include quotes here. - -Server remote MOTD file (3 lines max) -RPATH - RPATH is the filename, relative to DPATH, or the full path, of the - "Remote Message Of The Day" file; mostly called "remote.motd". The - contents of this file will be sent to every remote client that issues - a /MOTD <your server name>. Only the first three lines are sent, so - you might want to keep it that short ;). - Note that you should not include quotes here. - -File for server pid -PPATH - PPATH is the filename, relative to DPATH, or the full path, of the - "PID file", mostly called "ircd.pid". It is used for storing the - server's PID so a ps(1) isn't necessary. - Note that you should not include quotes here. - -Do you want to log the use of /WHO x% (recommended) -CONFIG_LOG_WHOX - Specify 'y' here if you want to log the use of /WHO ... x%... by your - Opers (see doc/readme.who). This is highly recommended since it will - reduce the abuse of this `spy' function. Note: You can disable this - spy function completely below, in which case you can give 'n' here. - If unsure specify 'y'. - -Give the path and(or) filename of this log file -WPATH - WPATH is the filename, relative to DPATH, or the full path, of the - log file where the use of /WHO ... x% ... by your Opers will be logged - (see doc/readme.who), mostly called "whox.log". - Note that you should not include quotes here. - -Do you want to log G-lines to a separate file -CONFIG_LOG_GLINES - Specify 'y' here if you want to log G-lines (Global access bans) - to a local file. - -Give the path and(or) filename of this log file -GPATH - GPATH is the filename, relative to DPATH, or the full path, of the - log file where the G-lines will be stored, mostly called "gline.log". - Note that you should not include quotes here. - -Do you want to log connecting users to a separate file -CONFIG_LOG_USERS - Specify 'y' here if you want to log who is connecting to your server. - This file can grow VERY fast on a large net work, so you probably - want to specify 'n' here. - -Give the path and(or) filename of this log file -FNAME_USERLOG - Here you need to specify the name of the log file where the server - should write the data about connecting users to. You can also specify - a full path. Note that you should not include quotes here. - -Do you want to log Opers to a separate file -CONFIG_LOG_OPERS - Specify 'y' here if you want to log who is successfully becoming an - IRC Operator on your server. - -Give the path and(or) filename of this log file -FNAME_OPERLOG - Here you need to specify the name of the log file where the server - should write the data about Opering users. You can also specify a - full path. Note that you should not include quotes here. - -Do you want to use syslog -USE_SYSLOG - If you are the sys admin of this machine, or if you have permission - of the sys admin to do so, you can let the server write data about - certain events to the syslog. You will be prompted for the events - that you want to log being one or more of: KILL's, SQUIT's, CONNECT's, - OPERing, Connecting Users and finally the log facility. - If you are unsure, specify 'n'. It is probably not a good idea to use - this on a large IRC net work. - -Log all operator kills to syslog -SYSLOG_KILL - Specify 'y' here if you want all KILLs to be written to syslog. - Note that on a large IRC net work this is a LOT of data. - -Log all remote squits for all servers to syslog -SYSLOG_SQUIT - Specify 'y' here if you want all SQUITs to be written to syslog. - Note that on a large IRC net work this is a LOT of data. - -Log remote connect messages for other all servers -SYSLOG_CONNECT - Specify 'y' here if you want all CONNECTs to be written to syslog. - Note that on a large IRC net work this is a LOT of data. - -Log all users who successfully become an Oper -SYSLOG_OPER - Specify 'y' here if you want all OPERs to be written to syslog. - Note that on a large IRC net work this is a LOT of data. - -Send userlog stuff to syslog -SYSLOG_USERS - Specify 'y' here if you want all connecting users to be written to syslog. - Note that on a large IRC net work this is EXTREMELY MUCH data. - You really want to specify 'n' here. - -Log facility (daemon, user, local0-7) -CONFIG_DAEMON - Well if you got this far and still need help, then I think you should - go back and specify 'n' at the question "Do you want to use syslog". - -Which local facility (0-7) -INT_LOCAL - Well if you got this far and still need help, then I think you should - go back and specify 'n' at the question "Do you want to use syslog". - -Use m4 as a preprocessor on CPATH -M4_PREPROC - If you use m4 macro's in your "ircd.conf" file, then you need to specify 'y', - which will enable m4 preprocessing of the "ircd.conf" file. - If you are unsure specify 'n'. Note using m4 macros has often lead to - problems (passwords or server names that match a macro name for instance), - while the benefits of using m4 are highly doubtful. Unless you are - already a m4 wizard and insist on using it I recommend to specify 'n' here. - -Use crypted passwords for N: lines -CRYPT_LINK_PASSWORD - In order to allow other servers to connect to you, you need to specify - two configuration lines in the "ircd.conf" configuration file (CPATH). - Each of these lines contains a password; the C: line is used for connecting - to a remote server and contains the password that is sent to the remote - server for authentication, thus this password must be in plain text. - The other is the N: line and contains the password that the remote server - is sending to you. For security reasons it is advised to store this - password in DES encrypted form. If you specify 'y' here, you will be - allowed to use the DES encrypted password in the password field of the - N: line, see doc/example.conf for more details. Note that you should - use *different* passwords in the C: and N: lines respectively for obvious - reasons. - -Use crypted passwords for operators -CRYPT_OPER_PASSWORD - In order to allow certain users to become IRC OPERators, they must - authenticate themselves with a password. This password is matched - against an 'O: line' in the "ircd.conf" configuration file, see - doc/example.conf for more details. If you specify 'y' here, you are - allowed to use the DES encrypted form of these passwords in your - "ircd.conf" file (even more, your Opers don't have to tell you their - real password, they can provide the DES encrypted form themselves). - Since it has happened often in the past that the "ircd.conf" file - was compromised somehow, you are highly encouraged to specify 'y' here - and use the DES encrypted form. You can find a program 'mkpasswd' in - the ircd/crypt directory that will allow you to generate the encrypted - form. - -Max size of the total of of all sendqs (bytes) -BUFFERPOOL - This specifies the maximum amount of RAM that your server will allocate - for buffering sendQ's. Small leafs can use a value as little as 1000000, - while large HUBs need to specify a value as high as 20000000. - If you run out of memory, clients and/or servers are dropped with the - error "Buffer allocation error". Then you will have to up this number - (and install more RAM if appropriate). - If you want a more educated guess for this value then realize that any - value is good if you _really_ rather want to drop servers and clients - then allocate more memory; this will be the case when there is the - danger to run out memory for other allocations. - Even if you run the daemon on a dedicated machine, then specifying the - maximum of the RAM you have is a Bad Thing because really running out - of memory is a lot worse then dropping clients in a controlled way: - if possible you should have memory left for all the internal structures - (channels, clients, banlists, receive buffers) at all times. - On average, clients seem to use 150 bytes of sendQ, but at peak moments - this can easily increase to 2032 bytes per client (sendQs are allocated - in chunks of 2032 bytes). - The maximum possible ammount that can be allocated for sendQs is the - number of connected clients times whatever you specified as maximum - sendQ in your Y: lines in the ircd.conf file. Likely, that value will - be larger then the ammount of RAM you have. - The educated guess I talked about earlier would be 'number of clients' - times * 2048 bytes + 'size of net.burst' * n, where `n' is 1 for leafs - and up till 5 for HUB's. The 'size of net.burst' is about 125 bytes - per online client (on the total network). - For large HUBs with 4000 clients on undernet (30,000 users), this results - in 27 Mb. Leafs could use 12 Mb. Of course you can use less when you - have less than 4000 local clients. - Don't forget to specify this value in bytes. - -Max receive queue for clients (bytes) -CLIENT_FLOOD - Currently, everything that a client sends to a server is read by the server - and stored in a buffer (the clients receive queue). The server will - process messages from this queue one by one (running over all clients - each time). When a client sends new messages faster they get processed, - and the size of its receive buffer reaches this value, the client is - dropped with the error "Excess flood". A reasonable value is 1024 bytes. - The maximum size is 8000 bytes. - -Maximum number of network connections (23 - (FD_SETSIZE-4)) -MAXCONNECTIONS - This specifies the maximum number of network connections the server - will use. You also need some non-network connects (log files etc), so - the maximum value is "FD_SETSIZE-4". The minimum value is 23. - The only benefit of using a small value is that your server uses less - memory - but *only* when you really have a small (client) load. - Routing server that hardly take clients can use 128 here for instance. - Servers that are always full should just specify the maximum amount - that still works (which might be less then FD_SETSIZE-4, some OS need - kernel hacking to allow more then 1024 fds per process). The only max. - value that is guaranteed to work is 252 ;). Note that if the value of - FD_SETSIZE is for instance 1024, then that doesn't mean you can't - connect MORE clients - but in this case you certainly need kernel - hacking. Find an experienced admin with the same Operating System and - ask him what the maximum is and how to achieve it. - -Default client listen port -PORTNUM - This is the default listen port. You can specify more listen ports - in the "ircd.conf" file with 'P: lines'; see doc/example.conf for more - details on P: lines. Note that /stats p currently only shows P: lines, - which might be a reason for you to use a less often used value here. - Note that there is actually no difference between client and server - listen ports, but it is good practice to separate them for statistical - purpose (bandwidth usage statistics). - -Nickname history length -NICKNAMEHISTORYLENGTH - This value specifies the length of the nick name history list, which - is only used for /WHOWAS. It uses about 300 to 400 bytes per entry. - Note that at a net.break so many client disappear that the whole - "whowas" list refreshed a few times (unless you make it as big as - 20,000 of course - but you shouldn't because thats a waste of ram - and cpu). A reasonable value is 'total number of clients' / 25. - -Allow Opers to see (dis)connects of local clients -ALLOW_SNO_CONNEXIT - If you specify 'y' here, you will be allowed to see all client connects and - disconnects as a server notice. The historical reason for adding this - option was to detect clone bots that connected to your server. However, - on a large IRC network like Undernet, the number of clients that connect - are so huge that it is not possible to keep an eye on this and everyone - has been filtering these notices out anyway. Next to that it turned out - to use no less then 10% of the total cpu usage last time I measured it - (this has been improved after that, but still). - Unless you insist on seeing those notices you should specify 'n' here. - Note that in the meantime Undernet has a LOT of other (semi- and fully- - automated) ways to detect clone bots, which work a LOT better for this - purpose. - -Show IP address in client connection notices -SNO_CONNEXIT_IP - Usually when showing a client connection, a nick, userid and hostname are - displayed. Selecting 'y' here will also display the numeric IP and connection - class of the connecting client. This can be useful for detecting spoofed DNS and - virtual hosted clones. This does use extra CPU though and is generally not needed, - however if a connection monitor bot is the only client that looks at these - notices, it is more efficient than sending USERIP for every connection. This - option makes the server compatible with Hybrid tcm bots. - -Do you want to use R: lines in your configuration file -R_LINES - If you specify 'y' here you will be allowed to use R:lines in the "ircd.conf". - This allows more freedom in restricting connections to your server by - calling an external program to determine whether to allow the connection. - It also uses a lot of overhead however, and can bog things down, so you should - consider whether you really need them, and if you can handle the extra load. - If unsure, specify 'n'. - -Process R: lines every rehash -R_LINES_REHASH - You may not want to have the R: lines checks everywhere since this can - cost a lot of time and delays. If you specify 'y' here, then R: lines are - checked whenever the "ircd.conf" file is reloaded (when the REHASH command - is used, or a signal SIGHUP is received by the daemon). This shouldn't be - too much of a drain on the system if the R:lines programs are short. - -Process R: lines always -R_LINES_OFTEN - If you specify 'y' here then R: lines will be checked as often as K: lines. - Note that this is -very- likely to cause a severe drain on your resources. - Use at your own risk, specify 'n' unless your really sure. - -Allow (local) Opers to see all local invisible users -SHOW_INVISIBLE_USERS - If you specify 'y' here, then your (local) IRC Operators will be able to - see all local invisible users (clients connected to your own server). - The reason for this is to hunt for clone bots, make sure your Operators do - not use this "feature" for spying on individuals and respect the user that - wishes to be invisible (mostly meaning that they don't want to be found when - on certain channels). - Note: If you answer 'n' here, then you will also not be able to see remote - invisible users (if you specify 'y' you will also get a configuration - question that asks you to specify whether or not you want your Opers to see - remote invisible users or not). - -Allow Opers to see all invisible users -SHOW_ALL_INVISIBLE_USERS - If you specify 'y' here, then your global IRC Operators (O:) will be able - to see ALL invisible users. The reason for this is to hunt for clone bots, - make sure your Operators do not use this "feature" for spying on individuals - and respect the user that wishes to be invisible (mostly meaning that they - don't want to be found when on certain channels). - -Allow HELPERS to see all invisible users' -WHOX_HELPERS - If you specify 'y', any HELPER will be able to see ALL invisible users. - The reason for this is to hunt for clone bots, - make sure your Operators do not use this "feature" for spying on individuals - and respect the user that wishes to be invisible (mostly meaning that they - don't want to be found when on certain channels). - -Allow global Opers (O:) to see inside secret channels -OPERS_SEE_IN_SECRET_CHANNELS - If you specify 'y' here, then your global IRC Operators (O:) will be able - to see who is on a specified, secret channel, without joining themselfs. - This can be needed to make a reasonable judgement in the case of a "channel - takeover" being reported, while the channel is set invite only. - See doc/readme.who for more details. - -Allow local Opers (o:) to see inside secret channels -LOCOP_SEE_IN_SECRET_CHANNELS - If you specify 'y' here, then your local IRC Operators (o:) will be able - to see who is on a specified, secret channel, without joining themselfs. - This can be needed to make a reasonable judgement in the case of a "channel - takeover" being reported, while the channel is set invite only. - See doc/readme.who for more details. - If unsure, specify 'n'. - -Don't truncate obnoxiously long /who output for opers -UNLIMIT_OPER_QUERY - A /who command can sometimes return several hundred lines of info. To - reduce flooding and sending too much, the output is truncated. By - answering 'y' to this, when an IRC Operator uses /who, the output will - not be truncated, no matter how much data is returned. - -Allow Opers to use the KILL command -OPER_KILL - You can select 'n' if you don't think operators should be able - to use the KILL command, and wish to prevent your operators from - using it. This will not, however, prevent operators on other - servers from issuing KILLs to your clients. You probably want to - select 'y' for this unless you really really don't think KILL - should -ever- be used by an operator. - -Allow Opers to use the REHASH command -OPER_REHASH - Allows operators to use the REHASH command to reload the servers - configuration file (ircd.conf) if you select 'n', you can still - reload the configuration file with a unix command, - kill -HUP `cat ircd.pid`. If unsure, select 'y'. - -Allow Opers to use the RESTART command -OPER_RESTART - Allows an operator to use the RESTART command to cause the server - to restart, using the ircd executable in SPATH. If unsure, select 'y'. - -Allow Opers to use the DIE command -OPER_DIE - Allows an operator to use the DIE command to shutdown the server - online. If you select 'n' you will need to send the server a kill - signal to shutdown the server. If unsure, select 'y'. - -Allow Opers to add local G-lines -OPER_LGLINE - Allows operators to add local G-lines with the GLINE command. This is - like a *local* KILL, except that the user being killed can't immediately - reconnect: He will have to wait for the G-line to expire. - The reason for adding this is that a KILL is rather useless for removing - (or 'warning') abusers (it is still THE command to remove ghosts and - a-like, the reason KILL was added in the first place). However, adding - G-lines for a dynamic IP with expire times larger then 10 minutes is highly - discouraged: The user will already have dialed in via another IP or account - and the G-line would only harm other, innocent, users. - -Allow Opers to connect from a remote site -OPER_REMOTE - If you select 'n' for this, clients must be on the 'same network' as - the server in order to gain oper privledges. If you're not sure, just - select 'y'. - -Allow Opers to join channels using a master key - ESNET -OPER_JOIN_GOD_ESNET - If you choose "yes", an OPER can join any channel writing - a master key "GOD". She can join through keys, invite, bans, and so on. - Useful to run local Channel Services. - -Allow Opers to join channels using a master key - ESNET -OPER_CHANNEL_SERVICE_ESNET - If you choose "yes", an OPER can set mode "+k" on himself. That is, - nobody will can kick or deop him. Useful to run local Channel Services. - -Local Channel Services has no Flood Control - ESNET -CS_NO_FLOOD_ESNET - If you choose "yes", a local channel service (user with mode +k) won't - have flood control. Useful if you are running local bots as ChServ. - -Allow Opers to bypass UWorld mode changes - ESNET -OPER_XMODE_ESNET - If you choose "yes", an oper can make channel mode changes - without being OP in that channel. He only need to include - the "extended mode" (flag "x") in his mode command. - -ESNET Distributed DataBase Support -BDD - If you choose "yes", your server will can manage - Distributed DataBases. A "database" directory will be - created into IRCd home directory to support nick - and channel registration, etc. - -Directory where distributed database resides - ESNET -DBPATH - Path to the Distributed Database directory. This path can be - absolute, or relative to the configuration directory (DPATH). - -Distributed Clone Control support - ESNET -BDD_CLONES - Control clones locally using ESNET Distributed DataBases. - -Dinamic Negotiation link-by-link - ESNET -ESNET_NEG - The server<->server links negotiates nonstandard - features, like compression or encryption. - -ZLIB compression between servers - ESNET -ZLIB_ESNET - Compress the server<->server links. - -Allow local opers to use the REHASH command -LOCOP_REHASH - Allows a local operator (defined by a lowercase o:line in ircd.conf) - to cause the server to reload its configuration file (ircd.conf) with - the REHASH command. If unsure, select 'n'. - -Allow local opers to use the RESTART command -LOCOP_RESTART - Allows a local operator (defined by a lowercase o:line in ircd.conf) - to use the RESTART command. If unsure, select 'n'. - -Allow local opers to use the DIE command -LOCOP_DIE - Allows a local operator (defined by a lowercase o:line in ircd.conf) - to use the DIE command. If unsure, select 'n'. - -Allow local opers to add local G-lines -LOCOP_LGLINE - Allows a local operator (defined by a lowercase o:line in ircd.conf) - to add local G-lines with the GLINE command. This is like a *local* KILL, - except that the user being killed can't immediately reconnect: He will - have to wait for the G-line to expire. - -Do you want to have a default LIST parameter -CONFIG_LIST - Pre-Undernet, the LIST command could either be given with one channel - name, or without any parameter. In the last case it would simply list - all channels. In time the IRC networks grew big, until the output of - the LIST command always filled up the sendQ of the client (and dis- - connected it). This was fixed by Carlo Wood (Run@IRC) on request of a - Dutch ISP whose users complained about this: The LIST output is now - generated in small chunks, generating more each time when there is room - in the clients sendQ. However, then it turned out that LIST (now it - worked) used 50% of all cpu (not even mentioning the bandwidth)... - This was unacceptable and the mentioned patch was disabled. On the - other hand we wanted LIST to work at least partly, so a few new - parameters have been added to LIST: <,>,C<,C>,T<,T> each followed by - a number they filter respectively the number of users on the channel, - the creation time of the channel (or age, depended on the value of - the number) and the topic set time. - If you specify 'y' here, then each time a "/LIST" (without parameter) - is issued by a client, a default parameter is used. Note that when - a parameter is used, the client can still max. sendq out - the send - flood control only works without any parameter. - If you specify 'n' here then a "/LIST" without parameters will list - all channels (and work), but as just said: it uses a LOT of cpu and - bandwidth on a large net.work. - If you specify 'y' you will be prompted for the default parameter. - -Give default LIST parameter -DEFAULT_LIST - Here you need to specify the default LIST parameter which is used - when the server receives a LIST without any parameter. - You should use something that limits the output to a maximum of a - few hundred channels; for instance "T<10" (topic is set less then - 10 seconds ago) or ">10" (more then 10 users on the channel) or even - a combination of this. Note that you should not include quotes here. - -K: line comments treated as a file -COMMENT_IS_FILE - If you specify 'y' here, then K: line comments (see doc/example.conf - for more details on the K: line syntax) will be treated as a filename - by default. The file needs to exist and will be written to clients - that match that K: line. - If you specify 'n' here, then K: line comments will be treated as - a comments by default. - In both cases you can override the default by prepending a filename - with a '!' or enclose a comment between double quotes. - If unsure, use the default. - -Only nullify idle-time on PRIVMSG -IDLE_FROM_MSG - The IRC command WHOIS gives an idle time for clients. If you want that - this idle time is set to zero only when the clients send a PRIVMSG, - then you should specify a 'y' here. - If you specify a 'n' then the idle time will be nullified on all messages - except the server PING/PONG. - -XMODE Networking - ESNET -XMODE_ESNET - This mode allows the use of "extended modes" in the network. - Extended modes can change channel modes without UWorld intervention. - -Check clone limit (2!) -CHECK_CLONE_LIMIT - Set this to 2. - -Check clone period (20!) -CHECK_CLONE_PERIOD - Set this to 20. - -Check clone delay (600!) -CHECK_CLONE_DELAY - Set this to 600. - -Max auto connects per class (1!) -MAXIMUM_LINKS - Set this to 1. - -Enable message logging -MSGLOG_ENABLED - Define this if you want the server to log received messages in static memory - at parsing time. -This is for debugging purposes only-. You might want to - redefine LOG_MASK_TYPE in s_debug.h and LOG_MASK_LEVEL in s_debug.c too. - The default is to log all messages that change some status in server's data - structures. Select 'n' unless you are debugging the server code. - DO NOT SELECT THIS ON PRODUCTION SERVERS! - -Message log size -MSGLOG_SIZE - Number of messages to log. Keep this low as raising it to 1024 will use 800k - of _static_ memory! Recommended value is 128. You must include this even if - you selected 'n' for MSGLOG_ENABLED. - -Only allow KILLs of local clients -LOCAL_KILL_ONLY - This only allows operators of this server to KILL clients directly connected - to this server. Operators will not be able to issue KILLs for clients on - other servers. Some networks (not Undernet) require that this be defined - for newly linking servers, but if you haven't been told to do otherwise, - specify 'n' here. - -Max server idle time (60) -TIMESEC - This is the maximum idle time for the server. If no messages are received - in TIMSEC seconds, PINGFREQUENCY and CONNECTFREQUENCY are checked. - Recommended value is 60 seconds. - -KILL nick chase time limit (30) -KILLCHASETIMELIMIT - This is the maximum amount of time a KILL command will automatically change - to the current nick of a user that has just changed nicks from the one given - with the original KILL. Don't change th... [truncated message content] |
From: Toni G. <zo...@us...> - 2003-01-18 23:21:53
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:21:53 UTC Log message: Directory /cvsroot/irc-dev/ircdh/doc/en/api added to the repository |
From: Toni G. <zo...@us...> - 2003-01-18 23:21:36
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:21:35 UTC Log message: Directory /cvsroot/irc-dev/ircdh/doc/en added to the repository |
From: Toni G. <zo...@us...> - 2003-01-18 23:21:36
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:21:35 UTC Log message: Directory /cvsroot/irc-dev/ircdh/doc/es added to the repository |
From: Toni G. <zo...@us...> - 2003-01-18 23:16:21
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 23:16:19 UTC Modified files: doc/Makefile.in doc/example.conf doc/history/ChangeLog.07 doc/history/ChangeLog.10 Log message: Documentacion ---------------------- diff included ---------------------- Index: ircdh/doc/Makefile.in diff -u ircdh/doc/Makefile.in:1.2 ircdh/doc/Makefile.in:1.3 --- ircdh/doc/Makefile.in:1.2 Sat Jan 18 11:09:01 2003 +++ ircdh/doc/Makefile.in Sat Jan 18 15:16:08 2003 @@ -18,40 +18,48 @@ #### Start of system configuration section. #### -prefix=@prefix@ -INSTALL=@INSTALL@ -SHELL=@SHPROG@ -RM=@RMPROG@ +prefix = @prefix@ +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ +INSTALL = @INSTALL@ +SHELL = @SHPROG@ +RM = @RMPROG@ @SET_MAKE@ -# The following variables are replaced by what you give during configuration : -MANDIR= +MANDIR = @mandir@ #### End of system configuration section. #### all: +build: + +clean: + distclean: ${RM} -f Makefile stamp-m maintainer-clean: distclean +depend: + install: - cd ${srcdir} && (test -d ${MANDIR}/man8 || mkdir ${MANDIR}/man8 || mkdir -p ${MANDIR}/man8) 2> /dev/null && ${INSTALL} -m 644 ircd.8 ${MANDIR}/man8 + cd ${srcdir} && (test -d ${MANDIR}/man8 || mkdir ${MANDIR}/man8 || mkdir -p ${MANDIR}/man8) 2> /dev/null && ${INSTALL} -m 644 en/ircd.8 ${MANDIR}/man8 uninstall: ${RM} -f ${MANDIR}/man8/ircd.8 # You need GNU make for this to work. -#Makefile: ../config/config.status Makefile.in ../config/gen.doc.Makefile \ -# ../config/.config stamp-m -# @echo "recreating doc/Makefile" -# @cd ../config; \ -# CONFIG_FILES=../doc/Makefile CONFIG_HEADERS= ./config.status > /dev/null; \ -# RM=${RM} ${SHELL} ./gen.doc.Makefile +# Makefile: ../config/config.status Makefile.in ../config/gen.doc.Makefile \ +# ../config/.config stamp-m +# @echo "recreating doc/Makefile" +# @cd ../config; \ +# CONFIG_FILES=../doc/Makefile CONFIG_HEADERS= ./config.status > /dev/null; \ +# RM=${RM} ${SHELL} ./gen.doc.Makefile -#stamp-m: -# echo timestamp > stamp-m +# stamp-m: +# echo timestamp > stamp-m -#../config/config.status: -# @cd ../config; ${MAKE} config.status +# ../config/config.status: +# @cd ../config; ${MAKE} config.status Index: ircdh/doc/example.conf diff -u ircdh/doc/example.conf:1.1 ircdh/doc/example.conf:1.2 --- ircdh/doc/example.conf:1.1 Sat Jul 27 08:09:19 2002 +++ ircdh/doc/example.conf Sat Jan 18 15:16:08 2003 @@ -1,13 +1,17 @@ # ircd.conf configuration file for ircd version ircu2.9.mu and ircu2.10 # +# Last Updated: 26, June 2001. +# # Written by Niels <ni...@un...>, based on the original example.conf, # server code and some real-life (ahem) experience. # +# Updated and heavily modified by Braden <db...@ya...>. +# # Thanks and credits to: Run, Trillian, Cym, Morrissey, Chaos, Flynn, # Xorath, WildThang, Mmmm, SeKs, Ghostwolf and # all other Undernet IRC Admins and Operators, # and programmers working on the Undernet ircd. - +# # This is an example of the configuration file used by the Undernet ircd. # # This document is based on a (fictious) server in Europe with a @@ -16,85 +20,98 @@ # to one in the US by itself. # # All configuration options start with a letter identifying the option, -# and a colon separated list of options. An asterisk indicates an -# unused field. +# and a colon separated list of options. Unused fields should be left +# blank. # # Please note that when ircd puts the configuration lines into practice, # it parses them exactly the other way round than they are listed here. +# It reads the lines in reverse order. +# # This means that you should start your I: lines with the "fall through", # most vanilla one and end with the most detailed. # -# There is a difference between the ``hostname'' and the ``server name'' +# There is a difference between the "hostname" and the "server name" # of the machine that the server is run on. For example, the host can -# have ``veer.cs.vu.nl'' as FQDN, and ``Amsterdam.NL.EU.undernet.org'' as +# have "veer.cs.vu.nl" as FQDN, and "Amsterdam.NL.EU.undernet.org" as # server name. -# A ``server mask'' is something like '*.EU.UnderNet.org'', which is -# matched by 'Amsterdam.NL.EU.undernet.org' but not by -# 'Manhattan.KS.US.undernet.org'. +# A "server mask" is something like "*.EU.UnderNet.org", which is +# matched by "Amsterdam.NL.EU.undernet.org" but not by +# "Manhattan.KS.US.undernet.org". +# +# Please do NOT just rename the example.conf to ircd.conf and expect +# it to work. + +# [M:line] # # First some information about the server. -# M:<server name>:<virtual ip>:<description>:<server port>:<server numeric> +# M:<server name>:<virtual host>:<description>:<not used>:<server numeric> # -# The <virtual ip> must be either be empty, contain a "*", or contain -# the IP address of an interface on your system. If it contains an address, -# the address will be bound to if you have specified virtual hosting. -# -# The <server port> is the port that other servers can connect to. -# Client ports need to be specified with a P: line, see below. +# <virtual host> must contain either a * or a valid IPv4 address in +# dotted quad notation. (127.0.0.1) The address MUST be the address +# of a physical interface on the host. This address is used for outgoing +# connections only, see P:lines for listener virtual hosting. +# If in doubt put a * or the IP of your primary interface here. +# The server must be compiled with virtual hosting turned on to get this +# to work correctly. # # Note that <server numeric> has to be unique on the network your server -# is running on, must be between 1 and 64, and is not updated on a rehash. +# is running on, must be between 0 and 4095, and is not updated on a rehash. +M:London.UK.Eu.UnderNet.org::University of London, England::1 -# M:London.UK.Eu.UnderNet.org:127.0.0.1:University of London, England:4400:1 -M:London.UK.Eu.UnderNet.org:*:University of London, England:4400:1 +# [A:line] # # This sets information that can be retrieved with the /ADMIN command. # It should contain at least an admin Email contact address. # A:<line 1>:<line 2>:<line 3> - A:The University of London:Undernet IRC server:IRC Admins <ir...@lo...> + +# [Y:lines] # -# All connections to the server are associated with a certain ``connection -# class'', be they incoming or outgoing (initiated by the server), be they +# All connections to the server are associated with a certain "connection +# class", be they incoming or outgoing (initiated by the server), be they # clients, servers or Martians. (Note that ircd doesn't have direct support # for Martians (yet?); they will have to register as normal users. ;-) # Take the following Y: lines only as a guide. # Y:<class>:<ping freq>:<connect freq>:<maximum links>:<sendq size> - +# +# <connect freq> applies only to servers, and specifies the frequency +# that the server tries to autoconnect. setting this to 0 will cause +# the server to attempt to connect repeatedly with no delay until the +# <maximum links> condition is satisfied. This is a Bad Thing(tm). +# +# <maximum links> should be set at either 0 or 1. +# # Server classes: 90 = all your uplinks for who you do not wish to hub; -# else in classes 80 and/or 70. -# 50 = leaf servers (only used if your server is a hub) - -Y:90:90:300:1:1700000 -Y:80:90:300:1:1700000 -Y:70:90:300:1:1700000 -Y:50:90:300:10:1700000 +# 80 = leaf servers (only used if your server is a hub) +Y:90:90:300:1:9000000 +Y:80:90:300:0:9000000 # Client classes. 10 = locals; 2 = for all .net and .com that are not # in Europe; 1 = for everybody. - Y:10:90:0:100:160000 Y:2:90:0:5:80000 Y:1:90:0:400:160000 + +# [I:lines] # # To allow clients to connect, they need authorization. This can be # done based on hostmask, address mask, and/or with a password. # With intelligent use of classes and the maxconnections field in the # Y: lines, you can let in a specific domain, but get rid of all other -# domains in the same toplevel, thus setting up some sort of 'reverse -# K: line'. +# domains in the same toplevel, thus setting up some sort of "reverse +# K: line". # I:<IP mask or crap to force resolving>:<opt passwd>:<hostmask>::<class> - +# # Technical description (for examples, see below): -# For every connecting client, the IP-number is know. A reverse lookup +# For every connecting client, the IP address is known. A reverse lookup # on this IP-number is done to get the (/all) hostname(s). # Each hostname that belongs to this IP-number is matched to <hostmask>, # and the I: line is used when any matches; the client will then show -# with this particular hostname. If none of the hostnames matches, then +# with this particular hostname. If none of the hostnames match, then # the IP-number is matched against the <IP mask ...> field, if this matches # then the I: line is used nevertheless and the client will show with the # first (main) hostname if any; if the IP-number did not resolve then the @@ -109,20 +126,19 @@ # match this I: line: # I:jolan.ppro::foobar::1 # Finally, I: lines with empty <IP mask ..> or <hostmask> fields are skipped. - -# This is the 'fallback' entry. All .uk, .nl, and all unresolved are +# +# This is the "fallback" entry. All .uk, .nl, and all unresolved are # in these two lines. # By using two different lines, multiple connections from a single IP # are only allowed from hostnames which have both valid forward and # reverse DNS mappings. - I:*@*:1:Unresolved::1 I:Resolved::*@*::1 # If you don't want unresolved dudes to be able to connect to your # server, use just: # I:NotMatchingCrap::*@*::1 - +# # Here, take care of all American ISPs. I:Resolved::*@*.com::2 I:Resolved::*@*.net::2 @@ -143,7 +159,7 @@ # You can request a more complete listing, including the "list of standard # K-lines" from the Routing Committee; it will also be sent to you if # you apply for a server and get accepted. - +# # Ourselves - this makes sure that we can get in, no matter how full # the server is (hopefully). I:*@193.37.*::*@*.london.ac.uk::10 @@ -156,44 +172,67 @@ # that have "dial??.*" as host mask: # I:Resolved:1:*@*.swipnet.se::1 # I:Resolved:2:*@dial??.*::1 +# +# If you are not worried about who connects, this line will allow everyone +# to connect. +I:*::*::1 + +# [T:lines] # # It is possible to show a different Message of the Day to a connecting # client depending on its origin. # T:<hostmask>:<path to motd file> - +# or: +# T:<classnumber>:<path to motd file> +# # DPATH/net_com.motd contains a special MOTD where users are encouraged # to register their domains and get their own I: lines if they're in # Europe, or move to US.UnderNet.org if they're in the USA. T:*.net:net_com.motd T:*.com:net_com.motd +T:2:net_com.motd # A different MOTD for ourselves, where we point out that the helpdesk # better not be bothered with questions regarding irc... T:*.london.ac.uk:london.motd + +# [U:lines] # -# One of the many nice features of Undernet is ``Uworld'', a program +# One of the many nice features of Undernet is "Uworld", a program # connected to the net as a server. This allows it to broadcast any mode -# change, thus allowing opers to, for example, 'unlock' a channel that +# change, thus allowing opers to, for example, "unlock" a channel that # has been taken over. # There is only one slight problem: the TimeStamp protocol prevents this. # So there is a configuration option to allow them anyway from a certain # server. +# U:<Server Name>:<Juped Nicks>:* +# # Note: (1) These lines are agreed on by every server admin on Undernet; # (2) These lines must be the same on every single server, or results # will be disasterous; (3) This is a useful feature, not something that # is a liability and abused regularly (well... :-) # If you're on Undernet, you MUST have these lines. I cannnot stress -# this enough. +# this enough. If all of the servers don't have the same lines, the +# servers will try to undo the mode hacks that Uworld does. Make SURE that +# all of the servers have the EXACT same Ulines. +# # As of ircu2.10.05 is it possible to Jupe nicks. Juped nicks need to be # added to U: lines. As per CFV-0095, the following nicks must be juped, # it is not allowed to jupe others as well. +U:Uworld.EU.undernet.org:EuWorld,E,StatServ,NoteServ:* +U:Uworld2.undernet.org:UWorld2,ChanSvr,ChanSaver,ChanServ:* +U:Uworld.undernet.org:Uworld,NickSvr,NickSaver,NickServ:* +U:channels.undernet.org:LPT1,X,login:* +U:channels2.undernet.org:LPT2,W,Undernet:* +U:channels3.undernet.org:COM1,V,protocol:* +U:channels4.undernet.org:COM2,U,pass:* +U:channels5.undernet.org:COM3,Y,AUX:* +U:channels6.undernet.org:COM4,Z,newpass:* -U:Uworld.EU.undernet.org:EuWorld,E,protocol,StatServ,NoteServ,Undernet:* -U:Uworld2.undernet.org:UWorld2,W,ChanSvr,ChanSaver,ChanServ,COM1,COM2,COM3,COM4:* -U:Uworld.undernet.org:Uworld,X,NickSvr,NickSaver,NickServ,LPT1,LPT2,AUX:* +# [K:lines] # # While running your server, you will most probably encounter individuals # or groups of persons that you do not wish to have access to your server. @@ -208,7 +247,7 @@ # Note that K: lines are local to the server; if you ban a person or a # whole domain from your server, they can get on IRC via any other server # that doesn't have them K: lined (yet). - +# # With a simple comment, using quotes: K:*.au:"Please use a nearer server":* K:*.edu:"Please use a nearer server":* @@ -224,16 +263,13 @@ # even if an IP address has a properly resolving host name. k:192.168.*:!klines/martians:* -# -# A more flexible way of restricting access to your server is the use -# of "restriction lines". These tell the server to start up an (external) -# program, upon whose output is decided whether the client is allowed -# access. The program should print "Y" or "N <reason>" on its stdout. -# Note that the use of R: lines is discouraged and deprecated, needs a -# compile-time define, eats CPU cycles and may well be taken out in -# future releases of ircd. -# R:<host/IP mask>:<program name>:<username mask> +# Additionally, you may specify a hostmask prefixed with $R to indicate +# a match should be performed against the "real-name" / "info" field +# instead of the host/IP. +K:$R*sub7*:"You are infected with a Trojan":* + +# [C:lines] # # You probably want your server connected to other servers, so your users # have other users to chat with. @@ -246,54 +282,52 @@ # server links is provided for ircd to decide what links to allow, what # to let humans do themselves, and what links to (forcefully) disallow. # -# The Connection and Allowing connection lines (also known as C/N lines) +# The Connection lines (also known as C lines) # define what servers the server connect to, and which servers are -# allowed to connect. Note that they come in pairs; they do not work if -# one if present and the other is absent. +# allowed to connect. # C:<remote hostname or IP>:<password>:<remote server name>:<port>:<class> -# N:<remote hostname or IP>:<password>:<remote server name>:<hostmask>:<class> # -# If you wish to use ident, prepend "username@" to the hostname or IP -# address (the first field). -# If the "port" field is omitted, the server will not attempt to -# establish a link with that server ("not autoconnecting"). -# The (optional) "host mask" field tells the server to represent itself -# with "hostmask" dot-seperateed fields stripped from its servername -# and replace it with "*.". -# For example, if hostmask == 2 and the local server name is -# "irc.sub.domain.com" it would be sent as "*.domain.com". This allows -# for easier routing and linking of new servers. -# This feature is not used on Undernet. - +# The "port" field defines the default port the server tries to connect +# to if an operator uses /connect without specifying a port. This is also +# the port used when the server attempts to auto-connect to the remote +# server. (See Y:lines for more informationa about auto-connects). +# # Our primary uplink. C:1.2.3.4:passwd:Amsterdam.NL.Eu.UnderNet.org:4400:90 -N:1.2.3.4:passwd:Amsterdam.NL.Eu.UnderNet.org::90 + +# [H:lines] # # If your server starts on a bit larger network, you'll probably get # assigned one or two uplinks to which your server can connect. # If your uplink(s) also connect to other servers than yours (which is # probable), you need to define your uplink as being allowed to "hub". -# H:<allowed hostmask>::<server name> +# H:<allowed hostmask>::<server name>:<maximum hops that can be introduced> H:*.*::Amsterdam.NL.Eu.UnderNet.org + +# [L:lines] # # Of course, the opposite is also possible: forcing a server to be # a leaf. L: lines follow Murphy's Law: if you use them, there's a big # chance that routing will be screwed up afterwards. # L:<opt disallowed hostmask>::<server mask>:<opt max depth> + +# [D:lines] # # For an advanced, real-time rule-based routing decision making system # you can use Disallow lines. For more information, see doc/readme.crules. # D:<server mask that ircd will refuse to connect to>::<rule> # d:<server mask that ircd will not autoconnect to>::<rule> -D:*.US.UnderNet.org::connected(*.US.UnderNet.org) -d:*.EU.UnderNet.org::connected(Amsterdam.NL.EU.*) - +# D:*.US.UnderNet.org::connected(*.US.UnderNet.org) +# d:*.EU.UnderNet.org::connected(Amsterdam.NL.EU.*) +# # The following line is recommended for leaf servers: -d:*::directcon(*) +# d:*::directcon(*) + +# [O:lines] # # Inevitably, you have reached the part about "IRC Operators". Oper status # grants some special privileges to a user, like the power to make the @@ -313,44 +347,251 @@ # Local operators are designated with a lowercase 'o' # O:<host/IP mask>:<encrypted password>:<Nick>::<connection class> # o:<host/IP mask>:<encrypted password>:<Nick>::<connection class> - +# +# The encrypted password is optional. If you wish to encrypt your password, +# there is a utility in the ircd. Please read the file tools/README. O:*@*.cs.vu.nl:VRKLKuGKn0jLs:Niels::10 +o:*@*.uu.net:noncryptedpass:Braden::10 # Note that the <connection class> is optional, but leaving it away # puts the O: lines in class 0, which usually only accepts one connection # at a time. If you want users to Oper up more then once per O: line, # then use a connection class that allows more then one connection, # for example (using class 10 as in the example above): -# Y:10:90:0:100:160000 # -# When your server gets fuller, you will notice delays when trying to -# connect to your server's primary listening port. Via the Port lines -# it is possible to specify additional ports (both AF_UNIX and AF_INET) -# for ircd to listen to. +# Once you OPER your connection class changes no matter where you are or +# your previous connection classes. If the defined connection class is 10 +# for the O:line, then your new connection class is 10. +# Y:10:90:0:100:160000 + + +# [P:lines] +# When your server gets more full, you will notice delays when trying to +# connect to your server's primary listening port. It is possible via the +# Port lines to specify additional ports for the ircd to listen to. # De facto ports are: 6667 - standard; 6660-6669 - additional client # ports; -# +# Undernet uses 4400 for server listener ports. # These are just hints, they are in no way official IANA or IETF policies. +# IANA says we should use port 194, but that requires us to run as root, so +# we don't do that. # -# On a side note, the /UPING command uses port 7007/udp. If your server -# is located behind a firewall, you may want to make another hole in it -# for this port. +# P:<hostmask>:<interface>:<[CS][H]>:<port number> # -# P:<hostmask, or path>:::<client port number> +# The hostmask setting allows you to specify a range of IP addresses that +# you will allow connections from. This should only contain IP addresses +# and '*' if used. This field only uses IP addresses. This does not use +# DNS in any way so you can't use it to allow *.nl or *.uk. Attempting +# to specify anything other than numbers, dots and stars [0-9.*] will result +# in the port allowing connections from anyone. +# +# The interface setting allows multiply homed hosts to specify which +# interface to use on a port by port basis, if an interface is not specified +# the default interface will be used. The interface MUST be the complete +# IP address for a real hardware interface on the machine running ircd. +# If you want to use virtual hosting *YOU* *MUST* *USE* *THIS* otherwise it +# WILL bind to all interfaces - not what most people seem to expect. +# +# The [CS][H] field is an optional field to specify that a port is a +# server port or a client port and whether it's hidden or not. +# If used the first character MUST be either a C or S. +# If you want to hide a port from /stats p from non-opers follow the C +# or S with an H +# +# C = Client (Ports 6660-6669) +# S = Server (Port 4400) +# +# P:<hostmask>:<interface>:<[CS][H]>:<port number> +# +# This is a normal server port, you need to have at least one server +# port defined if you want to connect your server to other servers. +P:::S:4400 + +# This is a Server port that is Hidden +#P:::SH:4401 -P::::6667 +# The following are normal client ports +P:::C:6667 P::::6668 -P:*.nl:::6666 -P:/tmp/.ircd:::6667 +P:192.168.*:::6666 -# -# Well, you have now reached the end of this sample configuration file -# If you have any questions, feel free to mail <doc...@un...> -# or <was...@un...>. -# If you are interested in linking your server to the Undernet IRC network -# visit http://www.routing-com.undernet.org/, and if there are any problems -# then contact <rou...@un...> asking for information. -# Upgrades of the Undernet ircd can be found on http://coder-com.undernet.org/. +# This is a hidden client port, listening on the interface associated +# with the IP address 168.8.21.107 +#P:*:168.8.21.107:CH:7000 + + +# [Q:lines] +# +# This allows you (the admin) to disallow the usage of /OPMODE and +# /CLEARMODE on certain sensitive channels. Opers trying to do that +# will receive a short notice. Depending on the setting of +# OPER_FORCE_OPMODE, OPER_FORCE_LOPMODE and LOCOP_FORCE_LOPMODE, +# global/local opers may override these lines by prefixing the +# channel name with an exclamation mark ('!') +# +# Q:<channel>:<reason> +# +# Note that since the hash mark ('#') is used to start a comment, +# you will have to escape it in the channel name (see below). + +# Q:\#shells:"Thou shalt not support the h4><0rz" +# Q:&kiddies:"They can take care of themselves" + + +# [F:lines] +# +# IRC servers have a large number of options and features. Most of these +# are set at compile time through the use of #define's--see "make config" +# for more details--but we are working to move many of these into the +# configuration file. Feature lines are the hook we're using for this. +# F:<Option>:<Value> +# +# The entire purpose of F:lines are so that you do not have to recompile +# the IRCD everytime you want to change a feature. All of the features +# are listed below, and at the bottom is how to set logging. +# +# A Special Thanks to Kev for writing the documentation of F:lines. It can +# be found at doc/readme.features and the logging documentation can be +# found at doc/readme.log. The defaults used by the Undernet network are +# below. +# +# F:DOMAINNAME:<obtained from /etc/resolv.conf by ./configure> +# F:RELIABLE_CLOCK:FALSE +# F:BUFFERPOOL:27000000 +# F:HAS_FERGUSON_FLUSHER:FALSE +# F:CLIENT_FLOOD:1024 +# F:SERVER_PORT:4400 +# F:NODEFAULTMOTD:TRUE +# F:MOTD_BANNER +# F:KILL_IPMISMATCH:FALSE +# F:IDLE_FROM_MSG:TRUE +# F:HUB:FALSE +# F:WALLOPS_OPER_ONLY:FALSE +# F:NODNS:FALSE +# F:RANDOM_SEED:<you should set one explicitly> +# F:DEFAULT_LIST_PARAM +# F:NICKNAMEHISTORYLENGTH:800 +# F:HOST_HIDING:TRUE +# F:HIDDEN_HOST:users.undernet.org +# F:HIDDEN_IP:127.0.0.1 +# F:CONNEXIT_NOTICES:FALSE +# F:KILLCHASETIMELIMIT:30 +# F:MAXCHANNELSPERUSER:10 +# F:AVBANLEN:40 +# F:MAXBANS:45 +# F:MAXSILES:15 +# F:HANGONGOODLINK:300 +# F:HANGONRETRYDELAY:10 +# F:CONNECTTIMEOUT:90 +# F:TIMESEC:60 +# F:MAXIMUM_LINKS:1 +# F:PINGFREQUENCY:120 +# F:CONNECTFREQUENCY:600 +# F:DEFAULTMAXSENDQLENGTH:40000 +# F:GLINEMAXUSERCOUNT:20 +# F:MPATH:ircd.motd +# F:RPATH:remote.motd +# F:PPATH:ircd.pid +# F:VIRTUAL_HOST:FALSE +# F:TOS_SERVER:0x08 +# F:TOS_CLIENT:0x08 +# F:POLLS_PER_LOOP:200 +# F:CRYPT_OPER_PASSWORD:TRUE +# F:OPER_NO_CHAN_LIMIT:TRUE +# F:OPER_MODE_LCHAN:TRUE +# F:OPER_WALK_THROUGH_LMODES:FALSE +# F:NO_OPER_DEOP_LCHAN:FALSE +# F:SHOW_INVISIBLE_USERS:TRUE +# F:SHOW_ALL_INVISIBLE_USERS:TRUE +# F:UNLIMIT_OPER_QUERY:FALSE +# F:LOCAL_KILL_ONLY:FALSE +# F:CONFIG_OPERCMDS:FALSE +# F:OPER_KILL:TRUE +# F:OPER_REHASH:TRUE +# F:OPER_RESTART:TRUE +# F:OPER_DIE:TRUE +# F:OPER_GLINE:TRUE +# F:OPER_LGLINE:TRUE +# F:OPER_JUPE:TRUE +# F:OPER_LJUPE:TRUE +# F:OPER_OPMODE:TRUE +# F:OPER_LOPMODE:TRUE +# F:OPER_FORCE_OPMODE:TRUE +# F:OPER_FORCE_LOPMODE:TRUE +# F:OPER_BADCHAN:FALSE +# F:OPER_LBADCHAN:FALSE +# F:OPER_SET:FALSE +# F:OPERS_SEE_IN_SECRET_CHANNELS:TRUE +# F:OPER_WIDE_GLINE:TRUE +# F:LOCOP_KILL:TRUE +# F:LOCOP_REHASH:TRUE +# F:LOCOP_RESTART:FALSE +# F:LOCOP_DIE:FALSE +# F:LOCOP_LGLINE:TRUE +# F:LOCOP_LJUPE:TRUE +# F:LOCOP_LOPMODE:TRUE +# F:LOCOP_FORCE_LOPMODE:TRUE +# F:LOCOP_LBADCHAN:FALSE +# F:LOCOP_SET:FALSE +# F:LOCOP_SEE_IN_SECRET_CHANNELS:FALSE +# F:LOCOP_WIDE_GLINE:FALSE +# F:HIS_MAP:TRUE +# F:HIS_SNOTICES:TRUE +# F:HIS_SNOTICES_OPER_ONLY:TRUE +# F:HIS_DESYNCS:TRUE +# F:HIS_DEBUG_OPER_ONLY:TRUE +# F:HIS_WALLOPS:TRUE +# F:HIS_LINKS:TRUE +# F:HIS_TRACE:TRUE +# F:HIS_STATS_l:TRUE +# F:HIS_STATS_c:TRUE +# F:HIS_STATS_g:TRUE +# F:HIS_STATS_h:TRUE +# F:HIS_STATS_k:TRUE +# F:HIS_STATS_f:TRUE +# F:HIS_STATS_i:TRUE +# F:HIS_STATS_j:TRUE +# F:HIS_STATS_M:TRUE +# F:HIS_STATS_m:TRUE +# F:HIS_STATS_o:TRUE +# F:HIS_STATS_p:TRUE +# F:HIS_STATS_q:TRUE +# F:HIS_STATS_r:TRUE +# F:HIS_STATS_d:TRUE +# F:HIS_STATS_e:TRUE +# F:HIS_STATS_t:TRUE +# F:HIS_STATS_T:TRUE +# F:HIS_STATS_u:FALSE +# F:HIS_STATS_U:TRUE +# F:HIS_STATS_v:TRUE +# F:HIS_STATS_w:FALSE +# F:HIS_STATS_x:TRUE +# F:HIS_STATS_y:TRUE +# F:HIS_STATS_z:TRUE +# F:HIS_WHOIS_SERVERNAME:TRUE +# F:HIS_WHOIS_IDLETIME:TRUE +# F:HIS_WHO_SERVERNAME:TRUE +# F:HIS_WHO_HOPCOUNT:TRUE +# F:HIS_BANWHO:TRUE +# F:HIS_KILLWHO:TRUE +# F:HIS_REWRITE:TRUE +# F:HIS_REMOTE:1 +# F:HIS_NETSPLIT:TRUE +# F:HIS_SERVERNAME:"*.undernet.org" +# F:HIS_SERVERINFO:"The Undernet Underworld" +# F:HIS_URLSERVERS:"http://www.undernet.org/servers.php" +# F:NETWORK:"UnderNet" +# F:URL_CLIENTS:"ftp://ftp.undernet.org/pub/irc/clients" + + +# Well, you have now reached the end of this sample configuration +# file. If you have any questions, feel free to mail +# <cod...@un...>. If you are interested in linking your +# server to the Undernet IRC network visit +# http://www.routing-com.undernet.org/, and if there are any +# problems then contact <rou...@un...> asking for +# information. Upgrades of the Undernet ircd can be found on +# http://coder-com.undernet.org/. # # For the rest: Good Luck! # Index: ircdh/doc/history/ChangeLog.07 diff -u ircdh/doc/history/ChangeLog.07:1.1 ircdh/doc/history/ChangeLog.07:1.2 --- ircdh/doc/history/ChangeLog.07:1.1 Wed Aug 21 10:59:40 2002 +++ ircdh/doc/history/ChangeLog.07 Sat Jan 18 15:16:09 2003 @@ -1,7 +1,7 @@ # # ChangeLog for Undernet ircu Servers # -# $Id: ChangeLog.07,v 1.1 2002/08/21 17:59:40 zolty Exp $ +# $Id: ChangeLog.07,v 1.2 2003/01/18 23:16:09 zolty Exp $ # # Please insert new entries on the top of the list, a one or two line comment # is sufficient. Please include your name on the entries we know who to blame. Index: ircdh/doc/history/ChangeLog.10 diff -u ircdh/doc/history/ChangeLog.10:1.1 ircdh/doc/history/ChangeLog.10:1.2 --- ircdh/doc/history/ChangeLog.10:1.1 Wed Aug 21 10:59:40 2002 +++ ircdh/doc/history/ChangeLog.10 Sat Jan 18 15:16:09 2003 @@ -1,48 +1,10 @@ # # ChangeLog for ircu2.10.10 # -# $Id: ChangeLog.10,v 1.1 2002/08/21 17:59:40 zolty Exp $ +# $Id: ChangeLog.10,v 1.2 2003/01/18 23:16:09 zolty Exp $ # # Insert new changes at beginning of the change list. # --------------------------- Released 2.10.10.pl20 -* protocol_violation doesn't exist in this version *sigh*. --------------------------- Released 2.10.10.pl19 -* Fix parse_server() so it doesn't core on an invalid prefix --------------------------- Released 2.10.10.pl18 (dammit) -* Fix ping so that users can't tell who they're pinging -- Isomer -* Use sendto_one() method of sending numeric replies, rather than u2.10.11's - send_reply--since it hasn't been back-ported to u2.10.10 and since I'm too - lazy to do so. -Kev -* Fix the cores and other interesting behavior as a result of the breakage of - "/mode <nick> -os" -Kev --------------------------- Released 2.10.10.pl17 -* Admin's complaining that users can't see that their carefully written MOTD - -- Isomer --------------------------- Released 2.10.10.pl16 -* Oops, missed a "* " in ms_wallops -- Isomer -* Fix typo in ircd.c -- Isomer -* Add prefixes to things before they are sent to clients -- Isomer -* Make ircd.c compile on gcc 3.0 -- mbuna -* fix core in s_user.c, thanks to mbuna -- Isomer -* Make ircd.c compile again :) -* Attempt fixing core with +s, the memory leak etc. Thanks to [Tri]! -- Isomer -* More hub hiding stuff -- Isomer -* Fix bug in unique_name_vector -- Vampire -* Don't send errors on directed privmsgs (suggested by Vampire-) -- Isomer -* Don't core for invalid modes in burst -- Isomer -* Cleanup to m_names.c, thanks to net -- Isomer -* After a long battle, we lost to the superior strength of res.c. - res.c replaced with the original -- Isomer -* Don't report "No such server" on remote commands. oops -- Isomer -* Changed Undernet -> NETWORK, *.undernet.org -> HEAD_IN_SAND_SERVERNAME, - "The Undernet Underworld" -> HEAD_IN_SAND_SERVERINFO -- Isomer -* Remove servernames from /who, someones clinically blind, or stupid. Sigh - -- Isomer -* You now can't /msg a -n but +m or +b'd channel -- Isomer -* Hacked DNS -- Isomer -* Rewrote hop count for /who. -- Isomer -* Removed DNS caching. If it breaks, blame Mr RIP. -- Isomer -------------------------- Released 2.10.10.pl15 * Fiddle with /KILL and various exits to make the user experience uniform, no matter who's doing the killing or where. Previously, differences in ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2003-01-18 22:55:32
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 22:55:31 UTC Added files: ircd/m_wallvoices.c Log message: Se me olvido el archivo ;) ---------------------- diff included ---------------------- Index: ircdh/ircd/m_wallvoices.c diff -u /dev/null ircdh/ircd/m_wallvoices.c:1.1 --- /dev/null Sat Jan 18 14:55:31 2003 +++ ircdh/ircd/m_wallvoices.c Sat Jan 18 14:55:21 2003 @@ -0,0 +1,161 @@ +/* + * IRC - Internet Relay Chat, ircd/m_wallvoices.c + * Copyright (c) 2002 hikari + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_wallvoices.c,v 1.1 2003/01/18 22:55:21 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "channel.h" +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_user.h" +#include "send.h" + +#include <assert.h> + +/* + * m_wallvoices - local generic message handler + */ +int m_wallvoices(struct Client *cptr, struct Client *sptr, int parc, + char *parv[]) +{ + struct Channel *chptr; + + assert(0 != cptr); + assert(cptr == sptr); + + ClrFlag(sptr, FLAG_TS8); + + if (parc < 2 || EmptyString(parv[1])) + return send_reply(sptr, ERR_NORECIPIENT, "WALLVOICES"); + + if (parc < 3 || EmptyString(parv[parc - 1])) + return send_reply(sptr, ERR_NOTEXTTOSEND); + + if (IsChannelName(parv[1]) && (chptr = FindChannel(parv[1]))) + { + if (client_can_send_to_channel(sptr, chptr)) + { + if ((chptr->mode.mode & MODE_NOPRIVMSGS) && + check_target_limit(sptr, chptr, chptr->chname, 0)) + return 0; + sendcmdto_channel_butone(sptr, CMD_WALLVOICES, chptr, cptr, + SKIP_DEAF | SKIP_BURST | SKIP_NONVOICES, + "%H :+ %s", chptr, parv[parc - 1]); + } + else + send_reply(sptr, ERR_CANNOTSENDTOCHAN, parv[1]); + } + else + send_reply(sptr, ERR_NOSUCHCHANNEL, parv[1]); + + return 0; +} + +/* + * ms_wallvoices - server message handler + */ +int ms_wallvoices(struct Client *cptr, struct Client *sptr, int parc, + char *parv[]) +{ + struct Channel *chptr; + assert(0 != cptr); + assert(0 != sptr); + + if (parc < 3 || !IsUser(sptr)) + return 0; + + if ((chptr = FindChannel(parv[1]))) + { + if (client_can_send_to_channel(sptr, chptr)) + { + sendcmdto_channel_butone(sptr, CMD_WALLVOICES, chptr, cptr, + SKIP_DEAF | SKIP_BURST | SKIP_NONVOICES, + "%H :%s", chptr, parv[parc - 1]); + } + else + send_reply(sptr, ERR_CANNOTSENDTOCHAN, parv[1]); + } + return 0; +} ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2003-01-18 22:54:46
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 22:54:44 UTC Modified files: ChangeLog configure include/channel.h include/client.h include/handlers.h include/ircd_alloc.h include/ircd_features.h include/msg.h include/numeric.h include/patchlevel.h include/s_user.h include/send.h include/supported.h ircd/IPcheck.c ircd/Makefile.in ircd/channel.c ircd/client.c ircd/ircd.c ircd/ircd_alloc.c ircd/ircd_features.c ircd/list.c ircd/m_account.c ircd/m_admin.c ircd/m_away.c ircd/m_burst.c ircd/m_create.c ircd/m_error.c ircd/m_gline.c ircd/m_join.c ircd/m_kick.c ircd/m_kill.c ircd/m_map.c ircd/m_mode.c ircd/m_nick.c ircd/m_notice.c ircd/m_oper.c ircd/m_part.c ircd/m_pong.c ircd/m_privmsg.c ircd/m_server.c ircd/m_settime.c ircd/m_userhost.c ircd/m_version.c ircd/m_wallchops.c ircd/m_who.c ircd/m_whois.c ircd/map.c ircd/numnicks.c ircd/parse.c ircd/s_bsd.c ircd/s_conf.c ircd/s_err.c ircd/s_misc.c ircd/s_stats.c ircd/s_user.c ircd/send.c ircd/whocmds.c Log message: 2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha14 * ircd/s_user.c: Fusion de los modos normales y hispano. * include/client.h: Fusiono los modos normales y de hispano bajo Flags *flags. * ircd/wallvoices.c: Nuevo comando, manda notices a @ y + del canal. * Nuevos parches Undernet, hasta el u2.10.11.04. ---------------------- diff included ---------------------- Index: ircdh/ChangeLog diff -u ircdh/ChangeLog:1.8 ircdh/ChangeLog:1.9 --- ircdh/ChangeLog:1.8 Sat Jan 18 11:53:48 2003 +++ ircdh/ChangeLog Sat Jan 18 14:54:26 2003 @@ -1,3 +1,13 @@ +2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha14 + * ircd/s_user.c: Fusion de los modos normales y hispano. + + * include/client.h: Fusiono los modos normales y de hispano bajo Flags *flags. + + * ircd/wallvoices.c: Nuevo comando, manda notices a @ y + del canal. + + * Nuevos parches Undernet, hasta el u2.10.11.04. + + 2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha13 * Nuevos comandos: ACCOUNT, JUPE, CLEARMODE, OPMODE, SET, RESET, PRIV, ASLL. Index: ircdh/configure diff -u ircdh/configure:1.4 ircdh/configure:1.5 --- ircdh/configure:1.4 Sat Jan 18 11:09:00 2003 +++ ircdh/configure Sat Jan 18 14:54:26 2003 @@ -4050,6 +4050,15 @@ rm -f $ac_file mv conftest.h $ac_file fi +echo ATENCION: Este IRCD es una version ALPHA con lo que implica +echo que puede que no se compile bajo ciertas maquinas o que se +echo compila pero sale "warnings". O que se surjan cosas raras +echo o bugs. +echo +echo Si encuentras bugs, se agradeceria mucho que lo avises al mail +echo zo...@ir... o en la lista irc...@li... +echo +echo Estamos trabajando en ello. IRC-Dev.Net 2003 fi; done EOF Index: ircdh/include/channel.h diff -u ircdh/include/channel.h:1.8 ircdh/include/channel.h:1.9 --- ircdh/include/channel.h:1.8 Sat Jan 18 11:09:02 2003 +++ ircdh/include/channel.h Sat Jan 18 14:54:26 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: channel.h,v 1.8 2003/01/18 19:09:02 zolty Exp $ + * $Id: channel.h,v 1.9 2003/01/18 22:54:26 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -123,7 +123,6 @@ #define IsModelessChannel(name) (*(name) == '+') #define IsChannelName(name) (*(name) == '#' || \ IsModelessChannel(name) || IsLocalChannel(name)) - typedef enum ChannelGetType { CGT_NO_CREATE, Index: ircdh/include/client.h diff -u ircdh/include/client.h:1.3 ircdh/include/client.h:1.4 --- ircdh/include/client.h:1.3 Sat Jan 18 11:09:02 2003 +++ ircdh/include/client.h Sat Jan 18 14:54:26 2003 @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * - * $Id: client.h,v 1.3 2003/01/18 19:09:02 zolty Exp $ + * $Id: client.h,v 1.4 2003/01/18 22:54:26 zolty Exp $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h @@ -77,41 +77,43 @@ * source file, or in the source file itself (when only used in that file). */ -#define PRIV_CHAN_LIMIT 1 /* no channel limit on oper */ -#define PRIV_MODE_LCHAN 2 /* oper can mode local chans */ -#define PRIV_WALK_LCHAN 3 /* oper can walk thru local modes */ -#define PRIV_DEOP_LCHAN 4 /* no deop oper on local chans */ -#define PRIV_SHOW_INVIS 5 /* show local invisible users */ -#define PRIV_SHOW_ALL_INVIS 6 /* show all invisible users */ -#define PRIV_UNLIMIT_QUERY 7 /* unlimit who queries */ - -#define PRIV_KILL 8 /* oper can KILL */ -#define PRIV_LOCAL_KILL 9 /* oper can local KILL */ -#define PRIV_REHASH 10 /* oper can REHASH */ -#define PRIV_RESTART 11 /* oper can RESTART */ -#define PRIV_DIE 12 /* oper can DIE */ -#define PRIV_GLINE 13 /* oper can GLINE */ -#define PRIV_LOCAL_GLINE 14 /* oper can local GLINE */ -#define PRIV_JUPE 15 /* oper can JUPE */ -#define PRIV_LOCAL_JUPE 16 /* oper can local JUPE */ -#define PRIV_OPMODE 17 /* oper can OP/CLEARMODE */ -#define PRIV_LOCAL_OPMODE 18 /* oper can local OP/CLEARMODE */ -#define PRIV_SET 19 /* oper can SET */ -#define PRIV_WHOX 20 /* oper can use /who x */ -#define PRIV_BADCHAN 21 /* oper can BADCHAN */ -#define PRIV_LOCAL_BADCHAN 22 /* oper can local BADCHAN */ -#define PRIV_SEE_CHAN 23 /* oper can see in secret chans */ - -#define PRIV_PROPAGATE 24 /* propagate oper status */ -#define PRIV_DISPLAY 25 /* "Is an oper" displayed */ -#define PRIV_SEE_OPERS 26 /* display hidden opers */ +enum Priv { + PRIV_CHAN_LIMIT, /* no channel limit on oper */ + PRIV_MODE_LCHAN, /* oper can mode local chans */ + PRIV_WALK_LCHAN, /* oper can walk thru local modes */ + PRIV_DEOP_LCHAN, /* no deop oper on local chans */ + PRIV_SHOW_INVIS, /* show local invisible users */ + PRIV_SHOW_ALL_INVIS, /* show all invisible users */ + PRIV_UNLIMIT_QUERY, /* unlimit who queries */ + + PRIV_KILL, /* oper can KILL */ + PRIV_LOCAL_KILL, /* oper can local KILL */ + PRIV_REHASH, /* oper can REHASH */ + PRIV_RESTART, /* oper can RESTART */ + PRIV_DIE, /* oper can DIE */ + PRIV_GLINE, /* oper can GLINE */ + PRIV_LOCAL_GLINE, /* oper can local GLINE */ + PRIV_JUPE, /* oper can JUPE */ + PRIV_LOCAL_JUPE, /* oper can local JUPE */ + PRIV_OPMODE, /* oper can OP/CLEARMODE */ + PRIV_LOCAL_OPMODE, /* oper can local OP/CLEARMODE */ + PRIV_SET, /* oper can SET */ + PRIV_WHOX, /* oper can use /who x */ + PRIV_BADCHAN, /* oper can BADCHAN */ + PRIV_LOCAL_BADCHAN, /* oper can local BADCHAN */ + PRIV_SEE_CHAN, /* oper can see in secret chans */ + + PRIV_PROPAGATE, /* propagate oper status */ + PRIV_DISPLAY, /* "Is an oper" displayed */ + PRIV_SEE_OPERS, /* display hidden opers */ -#define PRIV_WIDE_GLINE 27 /* oper can set wider G-lines */ + PRIV_WIDE_GLINE, /* oper can set wider G-lines */ -#define PRIV_FORCE_OPMODE 28 /* oper can override a Q-line */ -#define PRIV_FORCE_LOCAL_OPMODE 29 /* oper can override a local channel Q-line */ + PRIV_FORCE_OPMODE, /* oper can override a Q-line */ + PRIV_FORCE_LOCAL_OPMODE, /* oper can override a local channel Q-line */ -#define PRIV_LAST_PRIV 29 /* must be the same as the last priv */ + PRIV_LAST_PRIV /* must be the same as the last priv */ +}; #define _PRIV_NBITS (8 * sizeof(unsigned long)) @@ -119,7 +121,57 @@ #define _PRIV_BIT(priv) (1 << ((priv) % _PRIV_NBITS)) struct Privs { - unsigned long priv_mask[(PRIV_LAST_PRIV / _PRIV_NBITS) + 1]; + unsigned long priv_mask[(PRIV_LAST_PRIV + _PRIV_NBITS - 1) / _PRIV_NBITS]; +}; + +enum Flag { + FLAG_PINGSENT, /* Unreplied ping sent */ + FLAG_DEADSOCKET, /* Local socket is dead--Exiting soon */ + FLAG_KILLED, /* Prevents "QUIT" from being sent for this */ + FLAG_BLOCKED, /* socket is in a blocked condition */ + FLAG_CLOSING, /* set when closing to suppress errors */ + FLAG_UPING, /* has active UDP ping request */ + FLAG_CHKACCESS, /* ok to check clients access if set */ + FLAG_HUB, /* server is a hub */ + FLAG_SERVICE, /* server is a service */ + FLAG_LOCAL, /* set for local clients */ + FLAG_GOTID, /* successful ident lookup achieved */ + FLAG_DOID, /* I-lines say must use ident return */ + FLAG_NONL, /* No \n in buffer */ + FLAG_TS8, /* Why do you want to know? */ + FLAG_MAP, /* Show server on the map */ + FLAG_JUNCTION, /* Junction causing the net.burst */ + FLAG_BURST, /* Server is receiving a net.burst */ + FLAG_BURST_ACK, /* Server is waiting for eob ack */ + FLAG_IPCHECK, /* Added or updated IPregistry data */ + + FLAG_LOCOP, /* Local operator -- SRB */ + FLAG_SERVNOTICE, /* server notices such as kill */ + FLAG_OPER, /* Operator */ + FLAG_INVISIBLE, /* makes user invisible */ + FLAG_WALLOP, /* send wallops to them */ + FLAG_DEAF, /* Makes user deaf */ + FLAG_CHSERV, /* Disallow KICK or MODE -o on the user; + don't display channels in /whois */ + FLAG_DEBUG, /* send global debug/anti-hack info */ + FLAG_ACCOUNT, /* account name has been set */ + FLAG_HIDDENHOST, /* user's host is hidden */ +#if defined(BDD) +/* Flags de los modos Hispano */ + FLAG_NICKREGISTERED, /* Nick Registrado */ + FLAG_NICKSUSPENDED, /* Nick Suspendido */ + FLAG_HELPOP, /* Es un oper con modo +h */ + FLAG_BOT, /* Es un bot */ + FLAG_HIDDENVIEWER, /* Ver ips reales */ + FLAG_MSGONLYREG, /* Solo recibir mensajes de usuarios con +r */ +#endif /* BDD */ + _FLAG_COUNT, + FLAG_LOCAL_UMODES = FLAG_LOCOP, /* First local mode flag */ + FLAG_GLOBAL_UMODES = FLAG_OPER /* First global mode flag */ +}; + +struct Flags { + unsigned long flag_bits[((_FLAG_COUNT + _PRIV_NBITS - 1) / _PRIV_NBITS)]; }; struct Connection { @@ -213,10 +265,7 @@ time_t cli_firsttime; /* time client was created */ time_t cli_lastnick; /* TimeStamp on nick */ int cli_marker; /* /who processing marker */ - unsigned int cli_flags; /* client flags */ -#if defined(BDD) - unsigned int cli_hmodes; /* HISPANO user modes (flag extensions) */ -#endif + struct Flags cli_flags; /* client flags */ unsigned int cli_hopcount; /* number of servers to this 0 = local */ struct in_addr cli_ip; /* Real ip# NOT defined for remote servers! */ short cli_status; /* Client type */ @@ -246,9 +295,6 @@ #define cli_lastnick(cli) ((cli)->cli_lastnick) #define cli_marker(cli) ((cli)->cli_marker) #define cli_flags(cli) ((cli)->cli_flags) -#ifdef BDD -#define cli_hmodes(cli) ((cli->cli_hmodes) -#endif #define cli_hopcount(cli) ((cli)->cli_hopcount) #define cli_ip(cli) ((cli)->cli_ip) #define cli_status(cli) ((cli)->cli_status) @@ -378,172 +424,112 @@ (STAT_SERVER | STAT_CONNECTING | STAT_HANDSHAKE)) /* - * FLAGS macros - */ -#define FLAGS_PINGSENT 0x0001 /* Unreplied ping sent */ -#define FLAGS_DEADSOCKET 0x0002 /* Local socket is dead--Exiting soon */ -#define FLAGS_KILLED 0x0004 /* Prevents "QUIT" from being sent for this */ -#define FLAGS_OPER 0x0008 /* Operator */ -#define FLAGS_LOCOP 0x0010 /* Local operator -- SRB */ -#define FLAGS_INVISIBLE 0x0020 /* makes user invisible */ -#define FLAGS_WALLOP 0x0040 /* send wallops to them */ -#define FLAGS_SERVNOTICE 0x0080 /* server notices such as kill */ -#define FLAGS_BLOCKED 0x0100 /* socket is in a blocked condition */ -#define FLAGS_ACCOUNT 0x0200 /* account name has been set */ -#define FLAGS_CLOSING 0x0400 /* set when closing to suppress errors */ -#define FLAGS_UPING 0x0800 /* has active UDP ping request */ -#define FLAGS_CHKACCESS 0x1000 /* ok to check clients access if set */ -#define FLAGS_HUB 0x2000 /* server is a hub */ -#define FLAGS_SERVICE 0x4000 /* server is a service */ -#define FLAGS_HIDDENHOST 0x8000 /* user's host is hidden */ -#define FLAGS_LOCAL 0x00010000 /* set for local clients */ -#define FLAGS_GOTID 0x00020000 /* successful ident lookup achieved */ -#define FLAGS_DOID 0x00040000 /* I-lines say must use ident return */ -#define FLAGS_NONL 0x00080000 /* No \n in buffer */ -#define FLAGS_TS8 0x00100000 /* Why do you want to know? */ -#define FLAGS_MAP 0x00800000 /* Show server on the map */ -#define FLAGS_JUNCTION 0x01000000 /* Junction causing the net.burst */ -#define FLAGS_DEAF 0x02000000 /* Makes user deaf */ -#define FLAGS_CHSERV 0x04000000 /* Disallow KICK or MODE -o on the user; - don't display channels in /whois */ -#define FLAGS_BURST 0x08000000 /* Server is receiving a net.burst */ -#define FLAGS_BURST_ACK 0x10000000 /* Server is waiting for eob ack */ -#define FLAGS_DEBUG 0x20000000 /* send global debug/anti-hack info */ -#define FLAGS_IPCHECK 0x40000000 /* Added or updated IPregistry data */ - -#define SEND_UMODES \ - (FLAGS_INVISIBLE|FLAGS_OPER|FLAGS_WALLOP|FLAGS_DEAF|FLAGS_CHSERV|FLAGS_DEBUG|FLAGS_ACCOUNT|FLAGS_HIDDENHOST) -#define ALL_UMODES (SEND_UMODES|FLAGS_SERVNOTICE|FLAGS_LOCOP) -#define FLAGS_ID (FLAGS_DOID|FLAGS_GOTID) - -/* * flags macros. */ -#define DoAccess(x) (cli_flags(x) & FLAGS_CHKACCESS) -#define IsAnOper(x) (cli_flags(x) & (FLAGS_OPER|FLAGS_LOCOP)) -#define IsBlocked(x) (cli_flags(x) & FLAGS_BLOCKED) -#define IsBurst(x) (cli_flags(x) & FLAGS_BURST) -#define IsBurstAck(x) (cli_flags(x) & FLAGS_BURST_ACK) -#define IsBurstOrBurstAck(x) (cli_flags(x) & (FLAGS_BURST|FLAGS_BURST_ACK)) -#define IsChannelService(x) (cli_flags(x) & FLAGS_CHSERV) -#define IsDead(x) (cli_flags(x) & FLAGS_DEADSOCKET) -#define IsDeaf(x) (cli_flags(x) & FLAGS_DEAF) -#define IsIPChecked(x) (cli_flags(x) & FLAGS_IPCHECK) -#define IsIdented(x) (cli_flags(x) & FLAGS_GOTID) -#define IsInvisible(x) (cli_flags(x) & FLAGS_INVISIBLE) -#define IsJunction(x) (cli_flags(x) & FLAGS_JUNCTION) -#define IsLocOp(x) (cli_flags(x) & FLAGS_LOCOP) -#define IsLocal(x) (cli_flags(x) & FLAGS_LOCAL) -#define IsOper(x) (cli_flags(x) & FLAGS_OPER) -#define IsUPing(x) (cli_flags(x) & FLAGS_UPING) -#define NoNewLine(x) (cli_flags(x) & FLAGS_NONL) -#define SendDebug(x) (cli_flags(x) & FLAGS_DEBUG) -#define SendServNotice(x) (cli_flags(x) & FLAGS_SERVNOTICE) -#define SendWallops(x) (cli_flags(x) & FLAGS_WALLOP) -#define IsHub(x) (cli_flags(x) & FLAGS_HUB) -#define IsService(x) (cli_flags(x) & FLAGS_SERVICE) -#define IsAccount(x) (cli_flags(x) & FLAGS_ACCOUNT) -#define IsHiddenHost(x) (cli_flags(x) & FLAGS_HIDDENHOST) +#define FlagSet(fset, flag) ((fset)->flag_bits[_PRIV_IDX(flag)] |= \ + _PRIV_BIT(flag)) +#define FlagClr(fset, flag) ((fset)->flag_bits[_PRIV_IDX(flag)] &= \ + ~(_PRIV_BIT(flag))) +#define FlagHas(fset, flag) ((fset)->flag_bits[_PRIV_IDX(flag)] & \ + _PRIV_BIT(flag)) +#define SetFlag(cli, flag) FlagSet(&cli_flags(cli), flag) +#define ClrFlag(cli, flag) FlagClr(&cli_flags(cli), flag) +#define HasFlag(cli, flag) FlagHas(&cli_flags(cli), flag) + +#define DoAccess(x) HasFlag(x, FLAG_CHKACCESS) +#define IsAnOper(x) (HasFlag(x, FLAG_OPER) || HasFlag(x, FLAG_LOCOP)) +#define IsBlocked(x) HasFlag(x, FLAG_BLOCKED) +#define IsBurst(x) HasFlag(x, FLAG_BURST) +#define IsBurstAck(x) HasFlag(x, FLAG_BURST_ACK) +#define IsBurstOrBurstAck(x) (HasFlag(x, FLAG_BURST) || HasFlag(x, FLAG_BURST_ACK)) +#define IsChannelService(x) HasFlag(x, FLAG_CHSERV) +#define IsDead(x) HasFlag(x, FLAG_DEADSOCKET) +#define IsDeaf(x) HasFlag(x, FLAG_DEAF) +#define IsIPChecked(x) HasFlag(x, FLAG_IPCHECK) +#define IsIdented(x) HasFlag(x, FLAG_GOTID) +#define IsInvisible(x) HasFlag(x, FLAG_INVISIBLE) +#define IsJunction(x) HasFlag(x, FLAG_JUNCTION) +#define IsLocOp(x) HasFlag(x, FLAG_LOCOP) +#define IsLocal(x) HasFlag(x, FLAG_LOCAL) +#define IsOper(x) HasFlag(x, FLAG_OPER) +#define IsUPing(x) HasFlag(x, FLAG_UPING) +#define NoNewLine(x) HasFlag(x, FLAG_NONL) +#define SendDebug(x) HasFlag(x, FLAG_DEBUG) +#define SendServNotice(x) HasFlag(x, FLAG_SERVNOTICE) +#define SendWallops(x) HasFlag(x, FLAG_WALLOP) +#define IsHub(x) HasFlag(x, FLAG_HUB) +#define IsService(x) HasFlag(x, FLAG_SERVICE) +#define IsAccount(x) HasFlag(x, FLAG_ACCOUNT) +#define IsHiddenHost(x) HasFlag(x, FLAG_HIDDENHOST) #define HasHiddenHost(x) (IsAccount(x) && IsHiddenHost(x)) +#if defined(BDD) +/* Macros comprobacion modos hispano */ +#define IsNickRegistered(x) HasFlag(x, FLAG_NICKREGISTERED) +#define IsNickSuspended(x) HasFlag(x, FLAG_NICKSUSPENDED) +#define IsHelpOp(x) HasFlag(x, FLAG_HELPOP) +#define IsBot(x) HasFlag(x, FLAG_BOT) +#define IsHiddenViewer(x) HasFlag(x, FLAG_HIDDENVIEWER) +#define IsMsgOnlyReg(x) HasFlag(x, FLAG_MSGONLYREG) +#endif /* BDD */ #define IsPrivileged(x) (IsAnOper(x) || IsServer(x)) -#define SetAccess(x) (cli_flags(x) |= FLAGS_CHKACCESS) -#define SetBurst(x) (cli_flags(x) |= FLAGS_BURST) -#define SetBurstAck(x) (cli_flags(x) |= FLAGS_BURST_ACK) -#define SetChannelService(x) (cli_flags(x) |= FLAGS_CHSERV) -#define SetDeaf(x) (cli_flags(x) |= FLAGS_DEAF) -#define SetDebug(x) (cli_flags(x) |= FLAGS_DEBUG) -#define SetGotId(x) (cli_flags(x) |= FLAGS_GOTID) -#define SetIPChecked(x) (cli_flags(x) |= FLAGS_IPCHECK) -#define SetInvisible(x) (cli_flags(x) |= FLAGS_INVISIBLE) -#define SetJunction(x) (cli_flags(x) |= FLAGS_JUNCTION) -#define SetLocOp(x) (cli_flags(x) |= FLAGS_LOCOP) -#define SetOper(x) (cli_flags(x) |= FLAGS_OPER) -#define SetUPing(x) (cli_flags(x) |= FLAGS_UPING) -#define SetWallops(x) (cli_flags(x) |= FLAGS_WALLOP) -#define SetServNotice(x) (cli_flags(x) |= FLAGS_SERVNOTICE) -#define SetHub(x) (cli_flags(x) |= FLAGS_HUB) -#define SetService(x) (cli_flags(x) |= FLAGS_SERVICE) -#define SetAccount(x) (cli_flags(x) |= FLAGS_ACCOUNT) -#define SetHiddenHost(x) (cli_flags(x) |= FLAGS_HIDDENHOST) - -#define ClearAccess(x) (cli_flags(x) &= ~FLAGS_CHKACCESS) -#define ClearBurst(x) (cli_flags(x) &= ~FLAGS_BURST) -#define ClearBurstAck(x) (cli_flags(x) &= ~FLAGS_BURST_ACK) -#define ClearChannelService(x) (cli_flags(x) &= ~FLAGS_CHSERV) -#define ClearDeaf(x) (cli_flags(x) &= ~FLAGS_DEAF) -#define ClearDebug(x) (cli_flags(x) &= ~FLAGS_DEBUG) -#define ClearIPChecked(x) (cli_flags(x) &= ~FLAGS_IPCHECK) -#define ClearInvisible(x) (cli_flags(x) &= ~FLAGS_INVISIBLE) -#define ClearLocOp(x) (cli_flags(x) &= ~FLAGS_LOCOP) -#define ClearOper(x) (cli_flags(x) &= ~FLAGS_OPER) -#define ClearUPing(x) (cli_flags(x) &= ~FLAGS_UPING) -#define ClearWallops(x) (cli_flags(x) &= ~FLAGS_WALLOP) -#define ClearServNotice(x) (cli_flags(x) &= ~FLAGS_SERVNOTICE) -#define ClearHiddenHost(x) (cli_flags(x) &= ~FLAGS_HIDDENHOST) - -/* free flags */ -#define FREEFLAG_SOCKET 0x0001 /* socket needs to be freed */ -#define FREEFLAG_TIMER 0x0002 /* timer needs to be freed */ - +#define SetAccess(x) SetFlag(x, FLAG_CHKACCESS) +#define SetBurst(x) SetFlag(x, FLAG_BURST) +#define SetBurstAck(x) SetFlag(x, FLAG_BURST_ACK) +#define SetChannelService(x) SetFlag(x, FLAG_CHSERV) +#define SetDeaf(x) SetFlag(x, FLAG_DEAF) +#define SetDebug(x) SetFlag(x, FLAG_DEBUG) +#define SetGotId(x) SetFlag(x, FLAG_GOTID) +#define SetIPChecked(x) SetFlag(x, FLAG_IPCHECK) +#define SetInvisible(x) SetFlag(x, FLAG_INVISIBLE) +#define SetJunction(x) SetFlag(x, FLAG_JUNCTION) +#define SetLocOp(x) SetFlag(x, FLAG_LOCOP) +#define SetOper(x) SetFlag(x, FLAG_OPER) +#define SetUPing(x) SetFlag(x, FLAG_UPING) +#define SetWallops(x) SetFlag(x, FLAG_WALLOP) +#define SetServNotice(x) SetFlag(x, FLAG_SERVNOTICE) +#define SetHub(x) SetFlag(x, FLAG_HUB) +#define SetService(x) SetFlag(x, FLAG_SERVICE) +#define SetAccount(x) SetFlag(x, FLAG_ACCOUNT) +#define SetHiddenHost(x) SetFlag(x, FLAG_HIDDENHOST) #if defined(BDD) - -/* Bits de los modos hispano */ -#define HMODE_NICKREGISTERED 0x00000001 /* Nick is registered (HISPANO/ESNET) */ -#define HMODE_SOCKS 0x00000004 /* se esta chekeando socks */ -#define HMODE_WRSOCKS 0x00000008 /* se tiene ke escribir en socks */ -#define HMODE_HELPOP 0x00000010 /* Es un oper con modo +h */ -#define HMODE_SERVICESBOT 0x00000020 /* Es un bot de canales */ -#define HMODE_HIDDEN 0x00000040 /* Ip Oculta */ -#define HMODE_HIDDENVIEWER 0x00000080 /* Ip Oculta */ -#define HMODE_NICKSUSPENDED 0x00000100 /* Nick Suspendido */ -#define HMODE_MSGONLYREG 0x00000200 /* Solo recibir mensajes de usuarios con +r */ - -/* Modos hispano a propagar */ -#define SEND_HMODES \ - (HMODE_NICKREGISTERED | HMODE_HELPOP | HMODE_SERVICESBOT | HMODE_HIDDEN | HMODE_HIDDENVIEWER \ - | HMODE_NICKSUSPENDED | HMODE_MSGONLYREG) - -/* Modos hispano TODOS */ -#define ALL_HMODES \ - (SEND_HMODES) - -/* Macros comprobacion modos hispano */ -#define IsNickRegistered(x) ((x)->hmodes & HMODE_NICKREGISTERED) -#define DoingSocks(x) ((x)->hmodes & HMODE_SOCKS) -#define DoingWrSocks(x) ((x)->hmodes & HMODE_WRSOCKS) -#define IsHelpOp(x) ((x)->hmodes & HMODE_HELPOP) -#define IsServicesBot(x) ((x)->hmodes & HMODE_SERVICESBOT) -#define IsHidden(x) ((x)->hmodes & HMODE_HIDDEN) -#define IsHiddenViewer(x) ((x)->hmodes & HMODE_HIDDENVIEWER) -#define IsNickSuspended(x) ((x)->hmodes & HMODE_NICKSUSPENDED) -#define IsMsgOnlyReg(x) ((x)->hmodes & HMODE_MSGONLYREG) - /* Macros para poner modos hispano */ -#define SetNickRegistered(x) ((x)->hmodes |= HMODE_NICKREGISTERED) -#define SetSocks(x) ((x)->hmodes |= HMODE_SOCKS) -#define SetWrSocks(x) ((x)->hmodes |= HMODE_WRSOCKS) -#define SetHelpOp(x) ((x)->hmodes |= HMODE_HELPOP) -#define SetServicesBot(x) ((x)->hmodes |= HMODE_SERVICESBOT) -#define SetHidden(x) ((x)->hmodes |= HMODE_HIDDEN) -#define SetHiddenViewer(x) ((x)->hmodes |= HMODE_HIDDENVIEWER) -#define SetNickSuspended(x) ((x)->hmodes |= HMODE_NICKSUSPENDED) -#define SetMsgOnlyReg(x) ((x)->hmodes |= HMODE_MSGONLYREG) +#define SetNickRegistered(x) SetFlag(x, FLAG_NICKREGISTERED) +#define SetNickSuspended(x) SetFlag(x, FLAG_NICKSUSPENDED) +#define SetHelpOp(x) SetFlag(x, FLAG_HELPOP) +#define SetBot(x) SetFlag(x, FLAG_BOT) +#define SetHiddenViewer(x) SetFlag(x, FLAG_HIDDENVIEWER) +#define SetMsgOnlyReg(x) SetFlag(x, FLAG_MSGONLYREG) +#endif /* BDD */ +#define ClearAccess(x) ClrFlag(x, FLAG_CHKACCESS) +#define ClearBurst(x) ClrFlag(x, FLAG_BURST) +#define ClearBurstAck(x) ClrFlag(x, FLAG_BURST_ACK) +#define ClearChannelService(x) ClrFlag(x, FLAG_CHSERV) +#define ClearDeaf(x) ClrFlag(x, FLAG_DEAF) +#define ClearDebug(x) ClrFlag(x, FLAG_DEBUG) +#define ClearIPChecked(x) ClrFlag(x, FLAG_IPCHECK) +#define ClearInvisible(x) ClrFlag(x, FLAG_INVISIBLE) +#define ClearLocOp(x) ClrFlag(x, FLAG_LOCOP) +#define ClearOper(x) ClrFlag(x, FLAG_OPER) +#define ClearUPing(x) ClrFlag(x, FLAG_UPING) +#define ClearWallops(x) ClrFlag(x, FLAG_WALLOP) +#define ClearServNotice(x) ClrFlag(x, FLAG_SERVNOTICE) +#define ClearHiddenHost(x) ClrFlag(x, FLAG_HIDDENHOST) +#if defined (BDD) /* Macros para borrar modos hispano */ -#define ClearNickRegistered(x) ((x)->hmodes &= ~HMODE_NICKREGISTERED) -#define ClearSocks(x) ((x)->hmodes &= ~HMODE_SOCKS) -#define ClearWrSocks(x) ((x)->hmodes &= ~HMODE_WRSOCKS) -#define ClearHelpOp(x) ((x)->hmodes &= ~HMODE_HELPOP) -#define ClearServicesBot(x) ((x)->hmodes &= ~HMODE_SERVICESBOT) -#define ClearHidden(x) ((x)->hmodes &= ~HMODE_HIDDEN) -#define ClearHiddenViewer(x) ((x)->hmodes &= ~HMODE_HIDDENVIEWER) -#define ClearNickSuspended(x) ((x)->hmodes &= ~HMODE_NICKSUSPENDED) -#define ClearMsgOnlyReg(x) ((x)->hmodes &= ~HMODE_MSGONLYREG) - +#define ClearNickRegistered(x) ClrFlag(x, FLAG_NICKREGISTERED) +#define ClearNickSuspended(x) ClrFlag(x, FLAG_NICKSUSPENDED) +#define ClearHelpOp(x) ClrFlag(x, FLAG_HELPOP) +#define ClearBot(x) ClrFlag(x, FLAG_BOT) +#define ClearHiddenViewer(x) ClrFlag(x, FLAG_HIDDENVIEWER) +#define ClearMsgOnlyReg(x) ClrFlag(x, FLAG_MSGONLYREG) #endif /* BDD */ +/* free flags */ +#define FREEFLAG_SOCKET 0x0001 /* socket needs to be freed */ +#define FREEFLAG_TIMER 0x0002 /* timer needs to be freed */ /* server notice stuff */ Index: ircdh/include/handlers.h diff -u ircdh/include/handlers.h:1.3 ircdh/include/handlers.h:1.4 --- ircdh/include/handlers.h:1.3 Sat Jan 18 11:53:48 2003 +++ ircdh/include/handlers.h Sat Jan 18 14:54:26 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: handlers.h,v 1.3 2003/01/18 19:53:48 zolty Exp $ + * $Id: handlers.h,v 1.4 2003/01/18 22:54:26 zolty Exp $ */ #ifndef INCLUDED_handlers_h #define INCLUDED_handlers_h @@ -139,6 +139,7 @@ extern int m_userip(struct Client *, struct Client *, int, char *[]); extern int m_version(struct Client *, struct Client *, int, char *[]); extern int m_wallchops(struct Client *, struct Client *, int, char *[]); +extern int m_wallvoices(struct Client *, struct Client *, int, char *[]); extern int m_watch(struct Client *, struct Client *, int, char *[]); extern int m_who(struct Client *, struct Client *, int, char *[]); extern int m_whois(struct Client *, struct Client *, int, char *[]); @@ -248,6 +249,7 @@ extern int ms_version(struct Client *, struct Client *, int, char *[]); extern int ms_wallchops(struct Client *, struct Client *, int, char *[]); extern int ms_wallops(struct Client *, struct Client *, int, char *[]); +extern int ms_wallvoices(struct Client *, struct Client *, int, char *[]); extern int ms_wallusers(struct Client *, struct Client *, int, char *[]); extern int ms_whois(struct Client *, struct Client *, int, char *[]); Index: ircdh/include/ircd_alloc.h diff -u ircdh/include/ircd_alloc.h:1.2 ircdh/include/ircd_alloc.h:1.3 --- ircdh/include/ircd_alloc.h:1.2 Sat Jan 18 11:09:03 2003 +++ ircdh/include/ircd_alloc.h Sat Jan 18 14:54:26 2003 @@ -19,11 +19,14 @@ * * Commentary by Bleep (Thomas Helvey) * - * $Id: ircd_alloc.h,v 1.2 2003/01/18 19:09:03 zolty Exp $ + * $Id: ircd_alloc.h,v 1.3 2003/01/18 22:54:26 zolty Exp $ */ #ifndef INCLUDED_ircd_alloc_h #define INCLUDED_ircd_alloc_h +#undef FROBONMALLOC +#undef FROBONFREE + /* * memory resource allocation and test functions */ @@ -39,7 +42,12 @@ #define INCLUDED_stdlib_h #endif +#ifdef FROBONFREE +extern void MyFrobulatingFree(void *x); +#define MyFree(x) do { MyFrobulatingFree((x)); (x) = 0; } while(0) +#else #define MyFree(x) do { free((x)); (x) = 0; } while(0) +#endif extern void *MyMalloc(size_t size); extern void *MyCalloc(size_t nelem, size_t size); Index: ircdh/include/ircd_features.h diff -u ircdh/include/ircd_features.h:1.1 ircdh/include/ircd_features.h:1.2 --- ircdh/include/ircd_features.h:1.1 Sat Jan 18 11:09:03 2003 +++ ircdh/include/ircd_features.h Sat Jan 18 14:54:27 2003 @@ -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: ircd_features.h,v 1.1 2003/01/18 19:09:03 zolty Exp $ + * $Id: ircd_features.h,v 1.2 2003/01/18 22:54:27 zolty Exp $ */ #ifndef INCLUDED_features_h #define INCLUDED_features_h @@ -46,6 +46,7 @@ FEAT_HOST_HIDING, FEAT_HIDDEN_HOST, FEAT_HIDDEN_IP, + FEAT_AUTOHIDE, FEAT_CONNEXIT_NOTICES, /* features that probably should not be touched */ Index: ircdh/include/msg.h diff -u ircdh/include/msg.h:1.5 ircdh/include/msg.h:1.6 --- ircdh/include/msg.h:1.5 Sat Jan 18 11:53:48 2003 +++ ircdh/include/msg.h Sat Jan 18 14:54:27 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: msg.h,v 1.5 2003/01/18 19:53:48 zolty Exp $ + * $Id: msg.h,v 1.6 2003/01/18 22:54:27 zolty Exp $ */ #ifndef INCLUDED_msg_h #define INCLUDED_msg_h @@ -197,6 +197,10 @@ #define MSG_WALLCHOPS "WALLCHOPS" /* WC */ #define TOK_WALLCHOPS "WC" #define CMD_WALLCHOPS MSG_WALLCHOPS, TOK_WALLCHOPS + +#define MSG_WALLVOICES "WALLVOICES" /* WV */ +#define TOK_WALLVOICES "WV" +#define CMD_WALLVOICES MSG_WALLVOICES, TOK_WALLVOICES #define MSG_CPRIVMSG "CPRIVMSG" /* CPRI */ #define TOK_CPRIVMSG "CP" Index: ircdh/include/numeric.h diff -u ircdh/include/numeric.h:1.6 ircdh/include/numeric.h:1.7 --- ircdh/include/numeric.h:1.6 Sat Jan 18 11:09:03 2003 +++ ircdh/include/numeric.h Sat Jan 18 14:54:27 2003 @@ -305,6 +305,7 @@ /* RPL_USERS 393 Dalnet,EFNet,IRCnet */ /* RPL_END_USERS 394 Dalnet,EFNet,IRCnet */ /* RPL_NOUSERS 395 Dalnet,EFNet,IRCnet */ +#define RPL_HOSTHIDDEN 396 /* UMODE +x completed succesfuly */ /* * Errors are in the range from 400-599 currently and are grouped by what Index: ircdh/include/patchlevel.h diff -u ircdh/include/patchlevel.h:1.8 ircdh/include/patchlevel.h:1.9 --- ircdh/include/patchlevel.h:1.8 Sat Jan 18 11:53:48 2003 +++ ircdh/include/patchlevel.h Sat Jan 18 14:54:27 2003 @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: patchlevel.h,v 1.8 2003/01/18 19:53:48 zolty Exp $ + * $Id: patchlevel.h,v 1.9 2003/01/18 22:54:27 zolty Exp $ * */ -#define PATCHLEVEL ".alpha13" +#define PATCHLEVEL ".alpha14" #define RELEASE "1.0" Index: ircdh/include/s_user.h diff -u ircdh/include/s_user.h:1.6 ircdh/include/s_user.h:1.7 --- ircdh/include/s_user.h:1.6 Sat Jan 18 11:09:04 2003 +++ ircdh/include/s_user.h Sat Jan 18 14:54:28 2003 @@ -1,7 +1,7 @@ /* * s_user.h * - * $Id: s_user.h,v 1.6 2003/01/18 19:09:04 zolty Exp $ + * $Id: s_user.h,v 1.7 2003/01/18 22:54:28 zolty Exp $ */ #ifndef INCLUDED_s_user_h #define INCLUDED_s_user_h @@ -17,6 +17,7 @@ struct User; struct Channel; struct MsgBuf; +struct Flags; /* * Macros @@ -43,6 +44,11 @@ #define HUNTED_ISME 0 /* if this server should execute the command */ #define HUNTED_PASS 1 /* if message passed onwards successfully */ +/* send sets for send_umode() */ +#define ALL_UMODES 0 /* both local and global user modes */ +#define SEND_UMODES 1 /* global user modes only */ +#define SEND_UMODES_BUT_OPER 2 /* global user modes except for FLAG_OPER */ + /* used when sending to #mask or $mask */ #define MATCH_SERVER 1 @@ -79,23 +85,17 @@ extern void user_count_memory(size_t *count_out, size_t *bytes_out); -extern int do_nick_name(char *nick); extern int set_nick_name(struct Client *cptr, struct Client *sptr, const char *nick, int parc, char *parv[], int flags); -#ifdef BDD -extern void send_umode_out(struct Client *cptr, struct Client *sptr, int old, - int oldh, int registrado, int prop); -#else -extern void send_umode_out(struct Client *cptr, struct Client *sptr, int old, - int prop); -#endif -extern int whisper(struct Client *source, const char *nick, - const char *channel, const char *text, int is_notice); +extern void send_umode_out(struct Client *cptr, struct Client *sptr, + struct Flags *old, int prop); +extern int whisper(struct Client *source, const char *nick, const char *channel, + const char *text, int is_notice); extern void send_user_info(struct Client *to, char *names, int rpl, InfoFormatter fmt); extern int add_silence(struct Client *sptr, const char *mask); -extern int hide_hostmask(struct Client *cptr, unsigned int flags); +extern int hide_hostmask(struct Client *cptr, unsigned int flag); extern int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[]); extern int is_silenced(struct Client *sptr, struct Client *acptr); @@ -109,13 +109,8 @@ int MustBeOper, const char *pattern, int server, int parc, char *parv[]); extern struct Client *next_client(struct Client *next, const char *ch); extern char *umode_str(struct Client *cptr); -#if defined(BDD) -extern void send_umode(struct Client *cptr, struct Client *sptr, int old, - int sendmask, int oldh, int sendhmask); -#else -extern void send_umode(struct Client *cptr, struct Client *sptr, int old, - int sendmask); -#endif +extern void send_umode(struct Client *cptr, struct Client *sptr, + struct Flags *old, int sendset); extern int del_silence(struct Client *sptr, char *mask); extern void set_snomask(struct Client *, unsigned int, int); extern int is_snomask(char *); Index: ircdh/include/send.h diff -u ircdh/include/send.h:1.6 ircdh/include/send.h:1.7 --- ircdh/include/send.h:1.6 Sat Jan 18 11:09:04 2003 +++ ircdh/include/send.h Sat Jan 18 14:54:28 2003 @@ -1,7 +1,7 @@ /* * send.h * - * $Id: send.h,v 1.6 2003/01/18 19:09:04 zolty Exp $ + * $Id: send.h,v 1.7 2003/01/18 22:54:28 zolty Exp $ */ #ifndef INCLUDED_send_h #define INCLUDED_send_h @@ -65,6 +65,7 @@ #define SKIP_DEAF 0x01 /* skip users that are +d */ #define SKIP_BURST 0x02 /* skip users that are bursting */ #define SKIP_NONOPS 0x04 /* skip users that aren't chanops */ +#define SKIP_NONVOICES 0x08 /* skip users that aren't voiced (includes chanops) */ /* Send command to all users having a particular flag set */ extern void sendwallto_group_butone(struct Client *from, int type, Index: ircdh/include/supported.h diff -u ircdh/include/supported.h:1.2 ircdh/include/supported.h:1.3 --- ircdh/include/supported.h:1.2 Sat Jan 18 11:09:04 2003 +++ ircdh/include/supported.h Sat Jan 18 14:54:29 2003 @@ -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: supported.h,v 1.2 2003/01/18 19:09:04 zolty Exp $ + * $Id: supported.h,v 1.3 2003/01/18 22:54:29 zolty Exp $ * * Description: This file has the featureset that ircu announces on connecting * a client. It's in this .h because it's likely to be appended @@ -71,6 +71,7 @@ " MAP" \ " USERIP" \ " WALLCHOPS" \ + " WALLVOICES" \ " WHOX" /* Index: ircdh/ircd/IPcheck.c diff -u ircdh/ircd/IPcheck.c:1.8 ircdh/ircd/IPcheck.c:1.9 --- ircdh/ircd/IPcheck.c:1.8 Sat Jan 18 11:09:04 2003 +++ ircdh/ircd/IPcheck.c Sat Jan 18 14:54:29 2003 @@ -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: IPcheck.c,v 1.8 2003/01/18 19:09:04 zolty Exp $ + * $Id: IPcheck.c,v 1.9 2003/01/18 22:54:29 zolty Exp $ * * * @@ -450,7 +450,7 @@ { /* * trying to find an entry for a server causes this to happen, - * servers should never have FLAGS_IPCHECK set + * servers should never have FLAG_IPCHECK set */ return; } Index: ircdh/ircd/Makefile.in diff -u ircdh/ircd/Makefile.in:1.10 ircdh/ircd/Makefile.in:1.11 --- ircdh/ircd/Makefile.in:1.10 Sat Jan 18 11:53:48 2003 +++ ircdh/ircd/Makefile.in Sat Jan 18 14:54:30 2003 @@ -176,6 +176,7 @@ m_userip.c \ m_version.c \ m_wallchops.c \ + m_wallvoices.c \ m_wallops.c \ m_wallusers.c \ m_watch.c \ Index: ircdh/ircd/channel.c diff -u ircdh/ircd/channel.c:1.8 ircdh/ircd/channel.c:1.9 --- ircdh/ircd/channel.c:1.8 Sat Jan 18 11:09:04 2003 +++ ircdh/ircd/channel.c Sat Jan 18 14:54:31 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: channel.c,v 1.8 2003/01/18 19:09:04 zolty Exp $ + * $Id: channel.c,v 1.9 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -417,6 +417,7 @@ struct Membership *member) { struct SLink *tmp; + char tmphost[HOSTLEN + 1]; char nu_host[NUH_BUFSIZE]; char nu_realhost[NUH_BUFSIZE]; char nu_ip[NUI_BUFSIZE]; @@ -435,9 +436,19 @@ (cli_user(cptr))->host); #endif - if (HasHiddenHost(cptr)) - sr = make_nick_user_host(nu_realhost, cli_name(cptr), - (cli_user(cptr))->username, cli_user(cptr)->realhost); + if (IsAccount(cptr)) + { + if (HasHiddenHost(cptr)) + sr = make_nick_user_host(nu_realhost, cli_name(cptr), + cli_user(cptr)->username, cli_user(cptr)->realhost); + else + { + ircd_snprintf(0, tmphost, HOSTLEN, "%s.%s", + cli_user(cptr)->account, feature_str(FEAT_HIDDEN_HOST)); + sr = make_nick_user_host(nu_realhost, cli_name(cptr), + cli_user(cptr)->username, tmphost); + } + } for (tmp = chptr->banlist; tmp; tmp = tmp->next) { @@ -1118,7 +1129,8 @@ a HACK(4) notice will be sent if he would not have been supposed to join normally. */ if (IsLocalChannel(chptr->chname) && HasPriv(sptr, PRIV_WALK_LCHAN) && - !BadPtr(key) && compall("OVERRIDE", key) == 0) + !BadPtr(key) && compall("OVERRIDE", key) == 0 + && compall("OVERRIDE", chptr->mode.key) != 0) overrideJoin = MAGIC_OPER_OVERRIDE; if (chptr->mode.mode & MODE_INVITEONLY) @@ -2080,6 +2092,9 @@ state->parc--; state->max_args--; + if ((int)t_limit < 0) /* don't permit a negative limit */ + return; + if (!(state->flags & MODE_PARSE_WIPEOUT) && (!t_limit || t_limit == state->chptr->mode.limit)) return; @@ -2094,6 +2109,10 @@ return; } + /* Can't remove a limit that's not there */ + if (state->dir == MODE_DEL && !state->chptr->mode.limit) + return; + if (state->done & DONE_LIMIT) /* allow limit to be set only once */ return; state->done |= DONE_LIMIT; @@ -2152,7 +2171,7 @@ return; state->done |= DONE_KEY; - t_len = KEYLEN + 1; + t_len = KEYLEN; /* clean up the key string */ s = t_str; @@ -2410,7 +2429,7 @@ { if (state->flags & MODE_PARSE_SET && MyUser(state->sptr) && (len > (feature_int(FEAT_AVBANLEN) * feature_int(FEAT_MAXBANS)) || - count >= feature_int(FEAT_MAXBANS))) + count > feature_int(FEAT_MAXBANS))) { send_reply(state->sptr, ERR_BANLISTFULL, state->chptr->chname, ban->value.ban.banstr); @@ -2848,6 +2867,7 @@ joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan, unsigned int flags) { unsigned int len; + int is_local; assert(0 != jbuf); @@ -2859,6 +2879,8 @@ return; } + is_local = IsLocalChannel(chan->chname); + if (jbuf->jb_type == JOINBUF_TYPE_PART || jbuf->jb_type == JOINBUF_TYPE_PARTALL) { @@ -2878,7 +2900,8 @@ * exactly the same logic, albeit somewhat more concise, as was in * the original m_part.c */ - if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || IsLocalChannel(chan->chname)) /* got to remove user here */ + /* got to remove user here */ + if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || is_local) remove_user_from_channel(jbuf->jb_source, chan); } else @@ -2903,7 +2926,7 @@ } if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || - jbuf->jb_type == JOINBUF_TYPE_JOIN || IsLocalChannel(chan->chname)) + jbuf->jb_type == JOINBUF_TYPE_JOIN || is_local) return; /* don't send to remote */ /* figure out if channel name will cause buffer to be overflowed */ Index: ircdh/ircd/client.c diff -u ircdh/ircd/client.c:1.1 ircdh/ircd/client.c:1.2 --- ircdh/ircd/client.c:1.1 Sat Jan 18 11:09:04 2003 +++ ircdh/ircd/client.c Sat Jan 18 14:54:31 2003 @@ -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: client.c,v 1.1 2003/01/18 19:09:04 zolty Exp $ + * $Id: client.c,v 1.2 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -106,109 +106,115 @@ } static struct { - unsigned int priv; + enum Priv priv; enum Feature feat; - unsigned int flag; + enum { + FEATFLAG_DISABLES_PRIV, + FEATFLAG_ENABLES_PRIV, + FEATFLAG_GLOBAL_OPERS, + FEATFLAG_LOCAL_OPERS, + FEATFLAG_ALL_OPERS + } flag; } feattab[] = { { - PRIV_WHOX, FEAT_LAST_F, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_WHOX, FEAT_LAST_F, FEATFLAG_ALL_OPERS}, { - PRIV_DISPLAY, FEAT_LAST_F, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_DISPLAY, FEAT_LAST_F, FEATFLAG_ALL_OPERS}, { - PRIV_CHAN_LIMIT, FEAT_OPER_NO_CHAN_LIMIT, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_CHAN_LIMIT, FEAT_OPER_NO_CHAN_LIMIT, FEATFLAG_ALL_OPERS}, { - PRIV_MODE_LCHAN, FEAT_OPER_MODE_LCHAN, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_MODE_LCHAN, FEAT_OPER_MODE_LCHAN, FEATFLAG_ALL_OPERS}, { - PRIV_LOCAL_OPMODE, FEAT_OPER_MODE_LCHAN, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_LOCAL_OPMODE, FEAT_OPER_MODE_LCHAN, FEATFLAG_ALL_OPERS}, { - PRIV_WALK_LCHAN, FEAT_OPER_WALK_THROUGH_LMODES, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_WALK_LCHAN, FEAT_OPER_WALK_THROUGH_LMODES, FEATFLAG_ALL_OPERS}, { - PRIV_DEOP_LCHAN, FEAT_NO_OPER_DEOP_LCHAN, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_DEOP_LCHAN, FEAT_NO_OPER_DEOP_LCHAN, FEATFLAG_ALL_OPERS}, { - PRIV_SHOW_INVIS, FEAT_SHOW_INVISIBLE_USERS, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_SHOW_INVIS, FEAT_SHOW_INVISIBLE_USERS, FEATFLAG_ALL_OPERS}, { - PRIV_SHOW_ALL_INVIS, FEAT_SHOW_ALL_INVISIBLE_USERS, - (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_SHOW_ALL_INVIS, FEAT_SHOW_ALL_INVISIBLE_USERS, FEATFLAG_ALL_OPERS}, { - PRIV_UNLIMIT_QUERY, FEAT_UNLIMIT_OPER_QUERY, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_UNLIMIT_QUERY, FEAT_UNLIMIT_OPER_QUERY, FEATFLAG_ALL_OPERS}, { - PRIV_KILL, FEAT_LOCAL_KILL_ONLY, 0}, + PRIV_KILL, FEAT_LOCAL_KILL_ONLY, FEATFLAG_DISABLES_PRIV}, { - PRIV_GLINE, FEAT_CONFIG_OPERCMDS, ~0}, + PRIV_GLINE, FEAT_CONFIG_OPERCMDS, FEATFLAG_ENABLES_PRIV}, { - PRIV_JUPE, FEAT_CONFIG_OPERCMDS, ~0}, + PRIV_JUPE, FEAT_CONFIG_OPERCMDS, FEATFLAG_ENABLES_PRIV}, { - PRIV_OPMODE, FEAT_CONFIG_OPERCMDS, ~0}, + PRIV_OPMODE, FEAT_CONFIG_OPERCMDS, FEATFLAG_ENABLES_PRIV}, { - PRIV_BADCHAN, FEAT_CONFIG_OPERCMDS, ~0}, + PRIV_BADCHAN, FEAT_CONFIG_OPERCMDS, FEATFLAG_ENABLES_PRIV}, { - PRIV_PROPAGATE, FEAT_LAST_F, FLAGS_OPER}, + PRIV_PROPAGATE, FEAT_LAST_F, FEATFLAG_GLOBAL_OPERS}, { - PRIV_SEE_OPERS, FEAT_LAST_F, FLAGS_OPER}, + PRIV_SEE_OPERS, FEAT_LAST_F, FEATFLAG_GLOBAL_OPERS}, { - PRIV_KILL, FEAT_OPER_KILL, FLAGS_OPER}, + PRIV_KILL, FEAT_OPER_KILL, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_KILL, FEAT_OPER_KILL, FLAGS_OPER}, + PRIV_LOCAL_KILL, FEAT_OPER_KILL, FEATFLAG_GLOBAL_OPERS}, { - PRIV_REHASH, FEAT_OPER_REHASH, FLAGS_OPER}, + PRIV_REHASH, FEAT_OPER_REHASH, FEATFLAG_GLOBAL_OPERS}, { - PRIV_RESTART, FEAT_OPER_RESTART, FLAGS_OPER}, + PRIV_RESTART, FEAT_OPER_RESTART, FEATFLAG_GLOBAL_OPERS}, { - PRIV_DIE, FEAT_OPER_DIE, FLAGS_OPER}, + PRIV_DIE, FEAT_OPER_DIE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_GLINE, FEAT_OPER_GLINE, FLAGS_OPER}, + PRIV_GLINE, FEAT_OPER_GLINE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_GLINE, FEAT_OPER_LGLINE, FLAGS_OPER}, + PRIV_LOCAL_GLINE, FEAT_OPER_LGLINE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_JUPE, FEAT_OPER_JUPE, FLAGS_OPER}, + PRIV_JUPE, FEAT_OPER_JUPE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_JUPE, FEAT_OPER_LJUPE, FLAGS_OPER}, + PRIV_LOCAL_JUPE, FEAT_OPER_LJUPE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_OPMODE, FEAT_OPER_OPMODE, FLAGS_OPER}, + PRIV_OPMODE, FEAT_OPER_OPMODE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_OPMODE, FEAT_OPER_LOPMODE, FLAGS_OPER}, + PRIV_LOCAL_OPMODE, FEAT_OPER_LOPMODE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_FORCE_OPMODE, FEAT_OPER_FORCE_OPMODE, FLAGS_OPER}, + PRIV_FORCE_OPMODE, FEAT_OPER_FORCE_OPMODE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_FORCE_LOCAL_OPMODE, FEAT_OPER_FORCE_LOPMODE, FLAGS_OPER}, + PRIV_FORCE_LOCAL_OPMODE, FEAT_OPER_FORCE_LOPMODE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_BADCHAN, FEAT_OPER_BADCHAN, FLAGS_OPER}, + PRIV_BADCHAN, FEAT_OPER_BADCHAN, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_BADCHAN, FEAT_OPER_LBADCHAN, FLAGS_OPER}, + PRIV_LOCAL_BADCHAN, FEAT_OPER_LBADCHAN, FEATFLAG_GLOBAL_OPERS}, { - PRIV_SET, FEAT_OPER_SET, FLAGS_OPER}, + PRIV_SET, FEAT_OPER_SET, FEATFLAG_GLOBAL_OPERS}, { - PRIV_SEE_CHAN, FEAT_OPERS_SEE_IN_SECRET_CHANNELS, FLAGS_OPER}, + PRIV_SEE_CHAN, FEAT_OPERS_SEE_IN_SECRET_CHANNELS, FEATFLAG_GLOBAL_OPERS}, { - PRIV_WIDE_GLINE, FEAT_OPER_WIDE_GLINE, FLAGS_OPER}, + PRIV_WIDE_GLINE, FEAT_OPER_WIDE_GLINE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_KILL, FEAT_LOCOP_KILL, FLAGS_LOCOP}, + PRIV_LOCAL_KILL, FEAT_LOCOP_KILL, FEATFLAG_LOCAL_OPERS}, { - PRIV_REHASH, FEAT_LOCOP_REHASH, FLAGS_LOCOP}, + PRIV_REHASH, FEAT_LOCOP_REHASH, FEATFLAG_LOCAL_OPERS}, { - PRIV_RESTART, FEAT_LOCOP_RESTART, FLAGS_LOCOP}, + PRIV_RESTART, FEAT_LOCOP_RESTART, FEATFLAG_LOCAL_OPERS}, { - PRIV_DIE, FEAT_LOCOP_DIE, FLAGS_LOCOP}, + PRIV_DIE, FEAT_LOCOP_DIE, FEATFLAG_LOCAL_OPERS}, { - PRIV_LOCAL_GLINE, FEAT_LOCOP_LGLINE, FLAGS_LOCOP}, + PRIV_LOCAL_GLINE, FEAT_LOCOP_LGLINE, FEATFLAG_LOCAL_OPERS}, { - PRIV_LOCAL_JUPE, FEAT_LOCOP_LJUPE, FLAGS_LOCOP}, + PRIV_LOCAL_JUPE, FEAT_LOCOP_LJUPE, FEATFLAG_LOCAL_OPERS}, { - PRIV_LOCAL_OPMODE, FEAT_LOCOP_LOPMODE, FLAGS_LOCOP}, + PRIV_LOCAL_OPMODE, FEAT_LOCOP_LOPMODE, FEATFLAG_LOCAL_OPERS}, { - PRIV_FORCE_LOCAL_OPMODE, FEAT_LOCOP_FORCE_LOPMODE, FLAGS_LOCOP}, + PRIV_FORCE_LOCAL_OPMODE, FEAT_LOCOP_FORCE_LOPMODE, FEATFLAG_LOCAL_OPERS}, { - PRIV_LOCAL_BADCHAN, FEAT_LOCOP_LBADCHAN, FLAGS_LOCOP}, + PRIV_LOCAL_BADCHAN, FEAT_LOCOP_LBADCHAN, FEATFLAG_LOCAL_OPERS}, { - PRIV_SET, FEAT_LOCOP_SET, FLAGS_LOCOP}, + PRIV_SET, FEAT_LOCOP_SET, FEATFLAG_LOCAL_OPERS}, { - PRIV_SEE_CHAN, FEAT_LOCOP_SEE_IN_SECRET_CHANNELS, FLAGS_LOCOP}, + PRIV_SEE_CHAN, FEAT_LOCOP_SEE_IN_SECRET_CHANNELS, FEATFLAG_LOCAL_OPERS}, { - PRIV_WIDE_GLINE, FEAT_LOCOP_WIDE_GLINE, FLAGS_LOCOP}, + PRIV_WIDE_GLINE, FEAT_LOCOP_WIDE_GLINE, FEATFLAG_LOCAL_OPERS}, { - 0, FEAT_LAST_F, 0} + PRIV_LAST_PRIV, FEAT_LAST_F, 0} }; + /* client_set_privs(struct Client* client) * * Sets the privileges for opers. @@ -236,22 +242,34 @@ /* This sequence is temporary until the .conf is carefully rewritten */ - for (i = 0; feattab[i].priv; i++) + for (i = 0; feattab[i].priv != PRIV_LAST_PRIV; i++) { - if (feattab[i].flag == 0) - { - if (feature_bool(feattab[i].feat)) - PrivSet(&antiprivs, feattab[i].priv); - } - else if (feattab[i].flag == ~0) + if (feattab[i].flag == FEATFLAG_ENABLES_PRIV) { if (!feature_bool(feattab[i].feat)) PrivSet(&antiprivs, feattab[i].priv); } - else if (cli_flags(client) & feattab[i].flag) + else if (feattab[i].feat == FEAT_LAST_F || feature_bool(feattab[i].feat)) { - if (feattab[i].feat == FEAT_LAST_F || feature_bool(feattab[i].feat)) - PrivSet(&privs, feattab[i].priv); + if (feattab[i].flag == FEATFLAG_DISABLES_PRIV) + { + PrivSet(&antiprivs, feattab[i].priv); + } + else if (feattab[i].flag == FEATFLAG_ALL_OPERS) + { + if (IsAnOper(client)) + PrivSet(&privs, feattab[i].priv); + } + else if (feattab[i].flag == FEATFLAG_GLOBAL_OPERS) + { + if (IsOper(client)) + PrivSet(&privs, feattab[i].priv); + } + else if (feattab[i].flag == FEATFLAG_LOCAL_OPERS) + { + if (IsLocOp(client)) + PrivSet(&privs, feattab[i].priv); + } } } Index: ircdh/ircd/ircd.c diff -u ircdh/ircd/ircd.c:1.8 ircdh/ircd/ircd.c:1.9 --- ircdh/ircd/ircd.c:1.8 Sat Jan 18 11:53:49 2003 +++ ircdh/ircd/ircd.c Sat Jan 18 14:54:31 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: ircd.c,v 1.8 2003/01/18 19:53:49 zolty Exp $ + * $Id: ircd.c,v 1.9 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -372,7 +372,7 @@ Debug((DEBUG_DEBUG, "check_pings(%s)=status:%s limit: %d current: %d", cli_name(cptr), - (cli_flags(cptr) & FLAGS_PINGSENT) ? "[Ping Sent]" : "[]", + HasFlag(cptr, FLAG_PINGSENT) ? "[Ping Sent]" : "[]", max_ping, (int)(CurrentTime - cli_lasttime(cptr)))); @@ -420,12 +420,12 @@ continue; } - if (!(cli_flags(cptr) & FLAGS_PINGSENT)) + if (!HasFlag(cptr, FLAG_PINGSENT)) { /* If we havent PINGed the connection and we havent heard from it in a * while, PING it to make sure it is still alive. */ - cli_flags(cptr) |= FLAGS_PINGSENT; + SetFlag(cptr, FLAG_PINGSENT); /* If we're late in noticing don't hold it against them :) */ cli_lasttime(cptr) = CurrentTime - max_ping; @@ -435,14 +435,8 @@ else { char *asll_ts = militime_float(NULL); -#ifdef P09_SUPPORT - if (Protocol(cptr) < 10) - sendcmdto_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts, - cli_name(cptr), asll_ts); - else -#endif - sendcmdto_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts, - cli_name(cptr), asll_ts); + sendcmdto_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts, + cli_name(cptr), asll_ts); } } Index: ircdh/ircd/ircd_alloc.c diff -u ircdh/ircd/ircd_alloc.c:1.2 ircdh/ircd/ircd_alloc.c:1.3 --- ircdh/ircd/ircd_alloc.c:1.2 Sat Jan 18 11:09:05 2003 +++ ircdh/ircd/ircd_alloc.c Sat Jan 18 14:54:31 2003 @@ -19,13 +19,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: ircd_alloc.c,v 1.2 2003/01/18 19:09:05 zolty Exp $ + * $Id: ircd_alloc.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" #include "ircd_alloc.h" #include "ircd_string.h" #include "s_debug.h" +#include <string.h> #include <assert.h> @@ -47,29 +48,104 @@ noMemHandler = handler; } +#if defined(FROBONFREE) || defined(FROBONMALLOC) +static void memfrob(void *ptr, size_t size) +{ + unsigned char *p = ptr, *ep = p + size - 4; + while (p <= ep) + { + *(unsigned long *)p = 0xDEADBEEF; + p += 4; + } + switch (ep - p) + { + case 3: + *(unsigned short *)p = 0xDEAD; + p[2] = 0xBE; + return; + case 2: + *(unsigned short *)p = 0xDEAD; + return; + case 1: + *p++ = 0xDE; + return; + } + return; +} +#endif + void *MyMalloc(size_t size) { - void *p = malloc(size); + void *p = +#ifdef FROBONFREE + malloc(size + sizeof(size_t)); +#else + malloc(size); +#endif if (!p) (*noMemHandler) (); +#ifdef FROBONFREE + *(size_t *)p = size; + p = ((size_t *)p) + 1; +#endif +#ifdef FROBONMALLOC + memfrob(p, size); +#endif return p; } -void *MyRealloc(void *p, size_t size) +void *MyRealloc(void *x, size_t size) { - void *x = realloc(p, size); +#ifdef FROBONFREE + size_t old_size = ((size_t *)x)[-1]; + if (old_size > size) + memfrob(((char *)x) + size, old_size - size); + x = realloc(((size_t *)x) - 1, size + sizeof(size_t)); +#else + x = realloc(x, size); +#endif if (!x) (*noMemHandler) (); + /* Both are needed in all cases to work with realloc... */ +#if defined(FROBONMALLOC) && defined(FROBONFREE) + if (old_size < size) + memfrob(((char *)x) + old_size, size - old_size); +#endif +#ifdef FROBONFREE + *(size_t *)x = size; + x = ((size_t *)x) + 1; +#endif return x; } void *MyCalloc(size_t nelem, size_t size) { - void *p = calloc(nelem, size); + void *p = +#ifdef FROBONFREE + malloc(nelem * size + sizeof(size_t)); +#else + malloc(nelem * size); +#endif if (!p) (*noMemHandler) (); +#ifdef FROBONFREE + *((size_t *)p) = nelem * size; + p = ((size_t *)p) + 1; +#endif + memset(p, 0, size * nelem); return p; } + +#ifdef FROBONFREE +void MyFrobulatingFree(void *p) +{ + size_t *stp = (size_t *)p; + if (p == NULL) + return; + memfrob(p, stp[-1]); + free(stp - 1); +} +#endif #else /* defined(MDEBUG) */ /* Index: ircdh/ircd/ircd_features.c diff -u ircdh/ircd/ircd_features.c:1.1 ircdh/ircd/ircd_features.c:1.2 --- ircdh/ircd/ircd_features.c:1.1 Sat Jan 18 11:09:05 2003 +++ ircdh/ircd/ircd_features.c Sat Jan 18 14:54:31 2003 @@ -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: ircd_features.c,v 1.1 2003/01/18 19:09:05 zolty Exp $ + * $Id: ircd_features.c,v 1.2 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -31,7 +31,7 @@ #include "ircd_reply.h" #include "ircd_string.h" #include "match.h" -//#include "motd.h" +#include "motd.h" #include "msg.h" #include "numeric.h" #include "numnicks.h" @@ -39,7 +39,7 @@ #include "s_bsd.h" #include "s_debug.h" #include "s_misc.h" -//#include "s_stats.h" +#include "s_stats.h" #include "send.h" #include "struct.h" #include "support.h" @@ -266,20 +266,21 @@ F_B(WALLOPS_OPER_ONLY, 0, 0, 0), F_B(NODNS, 0, 0, 0), F_N(RANDOM_SEED, FEAT_NODISP, random_seed_set, 0, 0, 0, 0, 0, 0), -// F_S(DEFAULT_LIST_PARAM, FEAT_NULL, 0, list_set_default), + F_S(DEFAULT_LIST_PARAM, FEAT_NULL, 0, list_set_default), F_I(NICKNAMEHISTORYLENGTH, 0, 800, whowas_realloc), - F_B(HOST_HIDING, 0, 0, 0), + F_B(HOST_HIDING, 0, 1, 0), F_S(HIDDEN_HOST, FEAT_CASE, "users.undernet.org", 0), F_S(HIDDEN_IP, 0, "127.0.0.1", 0), F_B(CONNEXIT_NOTICES, 0, 0, 0), + F_B(AUTOHIDE, 0, 1, 0), /* features that probably should not be touched */ - F_I(KILLCHASETIMELIMIT, 0, 30, 0), F_I(MAXCHANNELSPERUSER, 0, 10, 0), F_I(AVBANLEN, 0, 40, 0), F_I(MAXBANS, 0, 30, 0), F_I(MAXSILES, 0, 15, 0), F_I(HANGONGOODLINK, 0, 300, 0), F_I(HANGONRETRYDELAY, 0, 10, 0), F_I(CONNECTTIMEOUT, 0, 90, 0), F_I(TIMESEC, 0, 60, 0), F_I(MAXIMUM_LINKS, 0, 1, init_class), /* reinit class 0 as needed */ + F_I(KILLCHASETIMELIMIT, 0, 30, 0), F_I(MAXCHANNELSPERUSER, 0, 10, 0), F_I(AVBANLEN, 0, 40, 0), F_I(MAXBANS, 0, 45, 0), F_I(MAXSILES, 0, 15, 0), F_I(HANGONGOODLINK, 0, 300, 0), F_I(HANGONRETRYDELAY, 0, 10, 0), F_I(CONNECTTIMEOUT, 0, 90, 0), F_I(TIMESEC, 0, 60, 0), F_I(MAXIMUM_LINKS, 0, 1, init_class), /* reinit class 0 as needed */ F_I(PINGFREQUENCY, 0, 120, init_class), F_I(CONNECTFREQUENCY, 0, 600, init_class), F_I(DEFAULTMAXSENDQLENGTH, 0, 40000, init_class), F_I(GLINEMAXUSERCOUNT, 0, 20, 0), /* Some misc. default paths */ -// F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init), -// F_S(RPATH, FEAT_CASE | FEAT_MYOPER, "remote.motd", motd_init), + F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init), + F_S(RPATH, FEAT_CASE | FEAT_MYOPER, "remote.motd", motd_init), F_S(PPATH, FEAT_CASE | FEAT_MYOPER | FEAT_READ, "ircd.pid", 0), /* Networking features */ F_B(VIRTUAL_HOST, 0, 0, 0), Index: ircdh/ircd/list.c diff -u ircdh/ircd/list.c:1.7 ircdh/ircd/list.c:1.8 --- ircdh/ircd/list.c:1.7 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/list.c Sat Jan 18 14:54:31 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: list.c,v 1.7 2003/01/18 19:09:06 zolty Exp $ + * $Id: list.c,v 1.8 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -533,8 +533,8 @@ watchs.inuse, tmp = watchs.inuse * sizeof(struct Watch)); mem += tmp; inuse += watchs.inuse, - sendto_one(cptr, ":%s %d %s :Totals: inuse %d %d", - me.name, RPL_STATSDEBUG, name, inuse, mem); + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Totals: inuse %d %d", + inuse, mem); } #endif Index: ircdh/ircd/m_account.c diff -u ircdh/ircd/m_account.c:1.1 ircdh/ircd/m_account.c:1.2 --- ircdh/ircd/m_account.c:1.1 Sat Jan 18 11:53:49 2003 +++ ircdh/ircd/m_account.c Sat Jan 18 14:54:31 2003 @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_account.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + * $Id: m_account.c,v 1.2 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -126,7 +126,7 @@ } ircd_strncpy(cli_user(acptr)->account, parv[2], ACCOUNTLEN); - hide_hostmask(acptr, FLAGS_ACCOUNT); + hide_hostmask(acptr, FLAG_ACCOUNT); sendcmdto_serv_butone(sptr, CMD_ACCOUNT, cptr, "%C %s", acptr, cli_user(acptr)->account); Index: ircdh/ircd/m_admin.c diff -u ircdh/ircd/m_admin.c:1.2 ircdh/ircd/m_admin.c:1.3 --- ircdh/ircd/m_admin.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_admin.c Sat Jan 18 14:54:31 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_admin.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_admin.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -114,10 +114,12 @@ */ int m_admin(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { + struct Client *acptr; + assert(0 != cptr); assert(cptr == sptr); - if (parc > 1) + if (parc > 1 && (!(acptr = find_match_server(parv[1])) || !IsMe(acptr))) return send_reply(sptr, ERR_NOPRIVILEGES); return send_admin_info(sptr); Index: ircdh/ircd/m_away.c diff -u ircdh/ircd/m_away.c:1.2 ircdh/ircd/m_away.c:1.3 --- ircdh/ircd/m_away.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_away.c Sat Jan 18 14:54:31 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_away.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_away.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -158,13 +158,15 @@ int m_away(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { char *away_message = parv[1]; + int was_away = cli_user(sptr)->away != 0; assert(0 != cptr); assert(cptr == sptr); if (user_set_away(cli_user(sptr), away_message)) { - sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message); + if (!was_away) + sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message); send_reply(sptr, RPL_NOWAWAY); } else Index: ircdh/ircd/m_burst.c diff -u ircdh/ircd/m_burst.c:1.2 ircdh/ircd/m_burst.c:1.3 --- ircdh/ircd/m_burst.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_burst.c Sat Jan 18 14:54:31 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_burst.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_burst.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -144,9 +144,6 @@ unsigned int parse_flags = (MODE_PARSE_FORCE | MODE_PARSE_BURST); int param, nickpos = 0, banpos = 0; char modestr[BUFSIZE], nickstr[BUFSIZE], banstr[BUFSIZE]; -#ifdef P09_SUPPORT - int ts_sent = 0; -#endif if (parc < 3) return protocol_violation(sptr, "Too few parameters for BURST"); @@ -173,6 +170,8 @@ continue; if (strchr(parv[param], 'i') || strchr(parv[param], 'k')) { + /* Clear any outstanding rogue invites */ + mode_invite_clear(chptr); for (member = chptr->members; member; member = nmember) { nmember = member->next_member; Index: ircdh/ircd/m_create.c diff -u ircdh/ircd/m_create.c:1.2 ircdh/ircd/m_create.c:1.3 --- ircdh/ircd/m_create.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_create.c Sat Jan 18 14:54:31 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_create.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_create.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -127,9 +127,6 @@ chanTS = atoi(parv[2]); - joinbuf_init(&join, sptr, cptr, JOINBUF_TYPE_JOIN, 0, 0); - joinbuf_init(&create, sptr, cptr, JOINBUF_TYPE_CREATE, 0, chanTS); - /* A create that didn't appear during a burst has that servers idea of * the current time. Use it for lag calculations. */ @@ -141,13 +138,17 @@ { static time_t rate; sendto_opmask_butone_ratelimited(0, SNO_NETWORK, &rate, - "Timestamp drift from %C (%is)", - cli_user(sptr)->server, chanTS - TStime()); - - /* If this server is >5 minutes fast, squit it */ - if (TStime() - chanTS < -5 * 60 * 60) - ... [truncated message content] |
From: Toni G. <zo...@us...> - 2003-01-18 19:54:08
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 19:53:59 UTC Modified files: ChangeLog include/handlers.h include/msg.h include/patchlevel.h ircd/Makefile.in ircd/ircd.c ircd/m_connect.c ircd/m_server.c ircd/parse.c ircd/s_debug.c ircd/s_serv.c Added files: include/jupe.h ircd/jupe.c ircd/m_account.c ircd/m_asll.c ircd/m_clearmode.c ircd/m_get.c ircd/m_jupe.c ircd/m_opmode.c ircd/m_privs.c ircd/m_reset.c ircd/m_set.c Log message: 2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha13 * Nuevos comandos: ACCOUNT, JUPE, CLEARMODE, OPMODE, SET, RESET, PRIV, ASLL. ---------------------- diff included ---------------------- Index: ircdh/ChangeLog diff -u ircdh/ChangeLog:1.7 ircdh/ChangeLog:1.8 --- ircdh/ChangeLog:1.7 Sat Jan 18 11:09:00 2003 +++ ircdh/ChangeLog Sat Jan 18 11:53:48 2003 @@ -1,3 +1,8 @@ +2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha13 + * Nuevos comandos: ACCOUNT, JUPE, CLEARMODE, OPMODE, SET, RESET, + PRIV, ASLL. + + 2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha12 * {*watch*}: Adapto el codigo del watch al ircd. Index: ircdh/include/handlers.h diff -u ircdh/include/handlers.h:1.2 ircdh/include/handlers.h:1.3 --- ircdh/include/handlers.h:1.2 Sat Jan 18 11:09:03 2003 +++ ircdh/include/handlers.h Sat Jan 18 11:53:48 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: handlers.h,v 1.2 2003/01/18 19:09:03 zolty Exp $ + * $Id: handlers.h,v 1.3 2003/01/18 19:53:48 zolty Exp $ */ #ifndef INCLUDED_handlers_h #define INCLUDED_handlers_h @@ -103,6 +103,7 @@ extern int m_invite(struct Client *, struct Client *, int, char *[]); extern int m_ison(struct Client *, struct Client *, int, char *[]); extern int m_join(struct Client *, struct Client *, int, char *[]); +extern int m_jupe(struct Client *, struct Client *, int, char *[]); extern int m_kick(struct Client *, struct Client *, int, char *[]); extern int m_links(struct Client *, struct Client *, int, char *[]); extern int m_links_redirect(struct Client *, struct Client *, int, char *[]); @@ -147,22 +148,30 @@ * Comandos de usuario privilegiado (Ircop & Helper) */ extern int mo_admin(struct Client *, struct Client *, int, char *[]); +extern int mo_asll(struct Client *, struct Client *, int, char *[]); +extern int mo_clearmode(struct Client *, struct Client *, int, char *[]); extern int mo_close(struct Client *, struct Client *, int, char *[]); extern int mo_connect(struct Client *, struct Client *, int, char *[]); #ifdef BDD extern int mo_dbq(struct Client *, struct Client *, int, char *[]); #endif extern int mo_die(struct Client *, struct Client *, int, char *[]); +extern int mo_get(struct Client *, struct Client *, int, char *[]); extern int mo_gline(struct Client *, struct Client *, int, char *[]); extern int mo_info(struct Client *, struct Client *, int, char *[]); +extern int mo_jupe(struct Client *, struct Client *, int, char *[]); extern int mo_kill(struct Client *, struct Client *, int, char *[]); extern int mo_notice(struct Client *, struct Client *, int, char *[]); extern int mo_oper(struct Client *, struct Client *, int, char *[]); +extern int mo_opmode(struct Client *, struct Client *, int, char *[]); extern int mo_ping(struct Client *, struct Client *, int, char *[]); +extern int mo_privs(struct Client *, struct Client *, int, char *[]); extern int mo_privmsg(struct Client *, struct Client *, int, char *[]); extern int mo_rehash(struct Client *, struct Client *, int, char *[]); +extern int mo_reset(struct Client *, struct Client *, int, char *[]); extern int mo_restart(struct Client *, struct Client *, int, char *[]); extern int mo_rping(struct Client *, struct Client *, int, char *[]); +extern int mo_set(struct Client *, struct Client *, int, char *[]); extern int mo_settime(struct Client *, struct Client *, int, char *[]); extern int mo_squit(struct Client *, struct Client *, int, char *[]); extern int mo_stats(struct Client *, struct Client *, int, char *[]); @@ -183,12 +192,15 @@ /* * Comandos servidor <=> servidor */ +extern int ms_account(struct Client *, struct Client *, int, char *[]); extern int ms_admin(struct Client *, struct Client *, int, char *[]); +extern int ms_asll(struct Client *, struct Client *, int, char *[]); extern int ms_away(struct Client *, struct Client *, int, char *[]); #ifdef BDD extern int ms_bmode(struct Client *, struct Client *, int, char *[]); #endif extern int ms_burst(struct Client *, struct Client *, int, char *[]); +extern int ms_clearmode(struct Client *, struct Client *, int, char *[]); extern int ms_connect(struct Client *, struct Client *, int, char *[]); extern int ms_create(struct Client *, struct Client *, int, char *[]); #ifdef BDD @@ -204,6 +216,7 @@ extern int ms_info(struct Client *, struct Client *, int, char *[]); extern int ms_invite(struct Client *, struct Client *, int, char *[]); extern int ms_join(struct Client *, struct Client *, int, char *[]); +extern int ms_jupe(struct Client *, struct Client *, int, char *[]); extern int ms_kick(struct Client *, struct Client *, int, char *[]); extern int ms_kill(struct Client *, struct Client *, int, char *[]); extern int ms_links(struct Client *, struct Client *, int, char *[]); @@ -214,6 +227,7 @@ extern int ms_nick(struct Client *, struct Client *, int, char *[]); extern int ms_notice(struct Client *, struct Client *, int, char *[]); extern int ms_oper(struct Client *, struct Client *, int, char *[]); +extern int ms_opmode(struct Client *, struct Client *, int, char *[]); extern int ms_part(struct Client *, struct Client *, int, char *[]); extern int ms_ping(struct Client *, struct Client *, int, char *[]); extern int ms_pong(struct Client *, struct Client *, int, char *[]); Index: ircdh/include/jupe.h diff -u /dev/null ircdh/include/jupe.h:1.1 --- /dev/null Sat Jan 18 11:54:01 2003 +++ ircdh/include/jupe.h Sat Jan 18 11:53:48 2003 @@ -0,0 +1,73 @@ +/* + * IRC - Internet Relay Chat, include/jupe.h + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * Copyright (C) 2000 Kevin L. Mitchell <kl...@mi...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: jupe.h,v 1.1 2003/01/18 19:53:48 zolty Exp $ + */ +#ifndef INCLUDED_jupe_h +#define INCLUDED_jupe_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif + + +struct Client; + +#define JUPE_MAX_EXPIRE 604800 /* max expire: 7 days */ + +struct Jupe { + struct Jupe *ju_next; + struct Jupe **ju_prev_p; + char *ju_server; + char *ju_reason; + time_t ju_expire; + time_t ju_lastmod; + unsigned int ju_flags; +}; + +#define JUPE_ACTIVE 0x0001 +#define JUPE_LOCAL 0x0002 +#define JUPE_LDEACT 0x0004 /* locally deactivated */ + +#define JUPE_MASK (JUPE_ACTIVE | JUPE_LOCAL) +#define JUPE_ACTMASK (JUPE_ACTIVE | JUPE_LDEACT) + +#define JupeIsActive(j) (((j)->ju_flags & JUPE_ACTMASK) == JUPE_ACTIVE) +#define JupeIsRemActive(j) ((j)->ju_flags & JUPE_ACTIVE) +#define JupeIsLocal(j) ((j)->ju_flags & JUPE_LOCAL) + +#define JupeServer(j) ((j)->ju_server) +#define JupeReason(j) ((j)->ju_reason) +#define JupeLastMod(j) ((j)->ju_lastmod) + +extern int jupe_add(struct Client *cptr, struct Client *sptr, char *server, + char *reason, time_t expire, time_t lastmod, unsigned int flags); +extern int jupe_activate(struct Client *cptr, struct Client *sptr, + struct Jupe *jupe, time_t lastmod, unsigned int flags); +extern int jupe_deactivate(struct Client *cptr, struct Client *sptr, + struct Jupe *jupe, time_t lastmod, unsigned int flags); +extern struct Jupe *jupe_find(char *server); +extern void jupe_free(struct Jupe *jupe); +extern void jupe_burst(struct Client *cptr); +extern int jupe_resend(struct Client *cptr, struct Jupe *jupe); +extern int jupe_list(struct Client *sptr, char *server); +extern int jupe_memory_count(size_t *ju_size); + +#endif /* INCLUDED_jupe_h */ Index: ircdh/include/msg.h diff -u ircdh/include/msg.h:1.4 ircdh/include/msg.h:1.5 --- ircdh/include/msg.h:1.4 Sat Jan 18 11:09:03 2003 +++ ircdh/include/msg.h Sat Jan 18 11:53:48 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: msg.h,v 1.4 2003/01/18 19:09:03 zolty Exp $ + * $Id: msg.h,v 1.5 2003/01/18 19:53:48 zolty Exp $ */ #ifndef INCLUDED_msg_h #define INCLUDED_msg_h @@ -318,12 +318,40 @@ #define TOK_PROTO "PROTO" #define CMD_PROTO MSG_PROTO, TOK_PROTO +#define MSG_JUPE "JUPE" /* JUPE */ +#define TOK_JUPE "JU" +#define CMD_JUPE MSG_JUPE, TOK_JUPE + #define MSG_OPMODE "OPMODE" /* OPMO */ #define TOK_OPMODE "OM" #define CMD_OPMODE MSG_OPMODE, TOK_OPMODE +#define MSG_CLEARMODE "CLEARMODE" /* CLMO */ +#define TOK_CLEARMODE "CM" +#define CMD_CLEARMODE MSG_CLEARMODE, TOK_CLEARMODE + +#define MSG_ACCOUNT "ACCOUNT" /* ACCO */ +#define TOK_ACCOUNT "AC" +#define CMD_ACCOUNT MSG_ACCOUNT, TOK_ACCOUNT + +#define MSG_ASLL "ASLL" /* ASLL */ +#define TOK_ASLL "LL" +#define CMD_ASLL MSG_ASLL, TOK_ASLL + #define MSG_POST "POST" /* POST */ #define TOK_POST "POST" + +#define MSG_SET "SET" /* SET */ +#define TOK_SET "SET" + +#define MSG_RESET "RESET" /* RESE */ +#define TOK_RESET "RESET" + +#define MSG_GET "GET" /* GET */ +#define TOK_GET "GET" + +#define MSG_PRIVS "PRIVS" /* PRIV */ +#define TOK_PRIVS "PRIVS" # if defined(BDD) #define MSG_DB "DB" /* Base de Datos ESNET */ Index: ircdh/include/patchlevel.h diff -u ircdh/include/patchlevel.h:1.7 ircdh/include/patchlevel.h:1.8 --- ircdh/include/patchlevel.h:1.7 Sat Jan 18 11:09:03 2003 +++ ircdh/include/patchlevel.h Sat Jan 18 11:53:48 2003 @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: patchlevel.h,v 1.7 2003/01/18 19:09:03 zolty Exp $ + * $Id: patchlevel.h,v 1.8 2003/01/18 19:53:48 zolty Exp $ * */ -#define PATCHLEVEL ".alpha12" +#define PATCHLEVEL ".alpha13" #define RELEASE "1.0" Index: ircdh/ircd/Makefile.in diff -u ircdh/ircd/Makefile.in:1.9 ircdh/ircd/Makefile.in:1.10 --- ircdh/ircd/Makefile.in:1.9 Sat Jan 18 11:09:04 2003 +++ ircdh/ircd/Makefile.in Sat Jan 18 11:53:48 2003 @@ -99,12 +99,16 @@ ircd_string.c \ ircd_tea.c \ ircd_xopen.c \ + jupe.c \ list.c \ listener.c \ + m_account.c \ m_admin.c \ + m_asll.c \ m_away.c \ m_bmode.c \ m_burst.c \ + m_clearmode.c \ m_close.c \ m_config.c \ m_connect.c \ @@ -119,13 +123,15 @@ m_die.c \ m_endburst.c \ m_error.c \ - m_gline.c \ + m_get.c \ m_ghost.c \ + m_gline.c \ m_help.c \ m_info.c \ m_invite.c \ m_ison.c \ m_join.c \ + m_jupe.c \ m_kick.c \ m_kill.c \ m_links.c \ @@ -138,19 +144,23 @@ m_nick.c \ m_notice.c \ m_oper.c \ + m_opmode.c \ m_part.c \ m_pass.c \ m_ping.c \ m_pong.c \ m_privmsg.c \ + m_privs.c \ m_proto.c \ m_quit.c \ m_rehash.c \ m_rename.c \ + m_reset.c \ m_restart.c \ m_rping.c \ m_rpong.c \ m_server.c \ + m_set.c \ m_settime.c \ m_silence.c \ m_squit.c \ Index: ircdh/ircd/ircd.c diff -u ircdh/ircd/ircd.c:1.7 ircdh/ircd/ircd.c:1.8 --- ircdh/ircd/ircd.c:1.7 Sat Jan 18 11:09:05 2003 +++ ircdh/ircd/ircd.c Sat Jan 18 11:53:49 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: ircd.c,v 1.7 2003/01/18 19:09:05 zolty Exp $ + * $Id: ircd.c,v 1.8 2003/01/18 19:53:49 zolty Exp $ */ #include "config.h" @@ -34,7 +34,7 @@ #include "ircd_reply.h" #include "ircd_signal.h" #include "ircd_string.h" -//#include "jupe.h" +#include "jupe.h" #include "list.h" #include "match.h" #include "motd.h" @@ -247,7 +247,7 @@ time_t next = 0; struct ConnectionClass *cltmp; struct ConfItem *con_conf = 0; -// struct Jupe* ajupe; + struct Jupe *ajupe; unsigned int con_class = 0; assert(ET_EXPIRE == ev_type(ev)); @@ -261,12 +261,9 @@ if (!(aconf->status & CONF_SERVER) || aconf->port == 0) continue; -#if 0 -/* FIXME-ZOLTAN */ /* Also skip juped servers */ if ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe)) continue; -#endif /* Skip this entry if the use of it is still on hold until * future. Otherwise handle this entry (and set it on hold until next Index: ircdh/ircd/jupe.c diff -u /dev/null ircdh/ircd/jupe.c:1.1 --- /dev/null Sat Jan 18 11:54:01 2003 +++ ircdh/ircd/jupe.c Sat Jan 18 11:53:49 2003 @@ -0,0 +1,341 @@ +/* + * IRC - Internet Relay Chat, ircd/jupe.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Finland + * Copyright (C) 2000 Kevin L. Mitchell <kl...@mi...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: jupe.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + */ +#include "config.h" + +#include "jupe.h" +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_alloc.h" +#include "ircd_features.h" +#include "ircd_log.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "match.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_bsd.h" +#include "s_misc.h" +#include "send.h" +#include "struct.h" +#include "support.h" +#include "sys.h" /* FALSE bleah */ + +#include <assert.h> +#include <string.h> + +static struct Jupe *GlobalJupeList = 0; + +static struct Jupe *make_jupe(char *server, char *reason, time_t expire, + time_t lastmod, unsigned int flags) +{ + struct Jupe *ajupe; + + ajupe = (struct Jupe *)MyMalloc(sizeof(struct Jupe)); /* alloc memory */ + assert(0 != ajupe); + + DupString(ajupe->ju_server, server); /* copy vital information */ + DupString(ajupe->ju_reason, reason); + ajupe->ju_expire = expire; + ajupe->ju_lastmod = lastmod; + ajupe->ju_flags = flags & JUPE_MASK; /* set jupe flags */ + + ajupe->ju_next = GlobalJupeList; /* link it into the list */ + ajupe->ju_prev_p = &GlobalJupeList; + if (GlobalJupeList) + GlobalJupeList->ju_prev_p = &ajupe->ju_next; + GlobalJupeList = ajupe; + + return ajupe; +} + +static int do_jupe(struct Client *cptr, struct Client *sptr, struct Jupe *jupe) +{ + struct Client *acptr; + + if (!JupeIsActive(jupe)) /* no action to be taken on inactive jupes */ + return 0; + + acptr = FindServer(jupe->ju_server); + + /* server isn't online or isn't local or is me */ + if (!acptr || !MyConnect(acptr) || IsMe(acptr)) + return 0; + + return exit_client_msg(cptr, acptr, &me, "Juped: %s", jupe->ju_reason); +} + +static void +propagate_jupe(struct Client *cptr, struct Client *sptr, struct Jupe *jupe) +{ + if (JupeIsLocal(jupe)) /* don't propagate local jupes */ + return; + + sendcmdto_serv_butone(sptr, CMD_JUPE, cptr, "* %c%s %Tu %Tu :%s", + JupeIsRemActive(jupe) ? '+' : '-', jupe->ju_server, + jupe->ju_expire - CurrentTime, jupe->ju_lastmod, jupe->ju_reason); +} + +int +jupe_add(struct Client *cptr, struct Client *sptr, char *server, char *reason, + time_t expire, time_t lastmod, unsigned int flags) +{ + struct Jupe *ajupe; + + assert(0 != server); + assert(0 != reason); + + /* + * You cannot set a negative (or zero) expire time, nor can you set an + * expiration time for greater than JUPE_MAX_EXPIRE. + */ + if (expire <= 0 || expire > JUPE_MAX_EXPIRE) + { + if (!IsServer(cptr) && MyConnect(cptr)) + send_reply(cptr, ERR_BADEXPIRE, expire); + return 0; + } + + expire += CurrentTime; /* convert from lifetime to timestamp */ + + /* Inform ops and log it */ + sendto_opmask_butone(0, SNO_NETWORK, "%s adding %sJUPE for %s, expiring at " + "%Tu: %s", + feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr) ? + cli_name(sptr) : cli_name((cli_user(sptr))->server), + flags & JUPE_LOCAL ? "local " : "", server, expire + TSoffset, reason); + + log_write(LS_JUPE, L_INFO, LOG_NOSNOTICE, + "%#C adding %sJUPE for %s, expiring at %Tu: %s", sptr, + flags & JUPE_LOCAL ? "local " : "", server, expire + TSoffset, reason); + + /* make the jupe */ + ajupe = make_jupe(server, reason, expire, lastmod, flags); + + propagate_jupe(cptr, sptr, ajupe); + + return do_jupe(cptr, sptr, ajupe); /* remove server if necessary */ +} + +int +jupe_activate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe, + time_t lastmod, unsigned int flags) +{ + unsigned int saveflags = 0; + + assert(0 != jupe); + + saveflags = jupe->ju_flags; + + if (flags & JUPE_LOCAL) + jupe->ju_flags &= ~JUPE_LDEACT; + else + { + jupe->ju_flags |= JUPE_ACTIVE; + + if (jupe->ju_lastmod >= lastmod) /* force lastmod to increase */ + jupe->ju_lastmod++; + else + jupe->ju_lastmod = lastmod; + } + + if ((saveflags & JUPE_ACTMASK) == JUPE_ACTIVE) + return 0; /* was active to begin with */ + + /* Inform ops and log it */ + sendto_opmask_butone(0, SNO_NETWORK, "%s activating JUPE for %s, expiring " + "at %Tu: %s", + feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr) ? + cli_name(sptr) : cli_name((cli_user(sptr))->server), + jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason); + + log_write(LS_JUPE, L_INFO, LOG_NOSNOTICE, + "%#C activating JUPE for %s, expiring at %Tu: %s", sptr, + jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason); + + if (!(flags & JUPE_LOCAL)) /* don't propagate local changes */ + propagate_jupe(cptr, sptr, jupe); + + return do_jupe(cptr, sptr, jupe); +} + +int +jupe_deactivate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe, + time_t lastmod, unsigned int flags) +{ + unsigned int saveflags = 0; + + assert(0 != jupe); + + saveflags = jupe->ju_flags; + + if (!JupeIsLocal(jupe)) + { + if (flags & JUPE_LOCAL) + jupe->ju_flags |= JUPE_LDEACT; + else + { + jupe->ju_flags &= ~JUPE_ACTIVE; + + if (jupe->ju_lastmod >= lastmod) /* force lastmod to increase */ + jupe->ju_lastmod++; + else + jupe->ju_lastmod = lastmod; + } + + if ((saveflags & JUPE_ACTMASK) != JUPE_ACTIVE) + return 0; /* was inactive to begin with */ + } + + /* Inform ops and log it */ + sendto_opmask_butone(0, SNO_NETWORK, "%s %s JUPE for %s, expiring at %Tu: " + "%s", + feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr) ? + cli_name(sptr) : cli_name((cli_user(sptr))->server), + JupeIsLocal(jupe) ? "removing local" : "deactivating", + jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason); + + log_write(LS_JUPE, L_INFO, LOG_NOSNOTICE, + "%#C %s JUPE for %s, expiring at %Tu: %s", sptr, + JupeIsLocal(jupe) ? "removing local" : "deactivating", + jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason); + + if (JupeIsLocal(jupe)) + jupe_free(jupe); + else if (!(flags & JUPE_LOCAL)) /* don't propagate local changes */ + propagate_jupe(cptr, sptr, jupe); + + return 0; +} + +struct Jupe *jupe_find(char *server) +{ + struct Jupe *jupe; + struct Jupe *sjupe; + + for (jupe = GlobalJupeList; jupe; jupe = sjupe) + { /* go through jupes */ + sjupe = jupe->ju_next; + + if (jupe->ju_expire <= CurrentTime) /* expire any that need expiring */ + jupe_free(jupe); + else if (0 == ircd_strcmp(server, jupe->ju_server)) /* found it yet? */ + return jupe; + } + + return 0; +} + +void jupe_free(struct Jupe *jupe) +{ + assert(0 != jupe); + + *jupe->ju_prev_p = jupe->ju_next; /* squeeze this jupe out */ + if (jupe->ju_next) + jupe->ju_next->ju_prev_p = jupe->ju_prev_p; + + MyFree(jupe->ju_server); /* and free up the memory */ + MyFree(jupe->ju_reason); + MyFree(jupe); +} + +void jupe_burst(struct Client *cptr) +{ + struct Jupe *jupe; + struct Jupe *sjupe; + + for (jupe = GlobalJupeList; jupe; jupe = sjupe) + { /* go through jupes */ + sjupe = jupe->ju_next; + + if (jupe->ju_expire <= CurrentTime) /* expire any that need expiring */ + jupe_free(jupe); + else if (!JupeIsLocal(jupe)) /* forward global jupes */ + sendcmdto_one(&me, CMD_JUPE, cptr, "* %c%s %Tu %Tu :%s", + JupeIsRemActive(jupe) ? '+' : '-', jupe->ju_server, + jupe->ju_expire - CurrentTime, jupe->ju_lastmod, jupe->ju_reason); + } +} + +int jupe_resend(struct Client *cptr, struct Jupe *jupe) +{ + if (JupeIsLocal(jupe)) /* don't propagate local jupes */ + return 0; + + sendcmdto_one(&me, CMD_JUPE, cptr, "* %c%s %Tu %Tu :%s", + JupeIsRemActive(jupe) ? '+' : '-', jupe->ju_server, + jupe->ju_expire - CurrentTime, jupe->ju_lastmod, jupe->ju_reason); + + return 0; +} + +int jupe_list(struct Client *sptr, char *server) +{ + struct Jupe *jupe; + struct Jupe *sjupe; + + if (server) + { + if (!(jupe = jupe_find(server))) /* no such jupe */ + return send_reply(sptr, ERR_NOSUCHJUPE, server); + + /* send jupe information along */ + send_reply(sptr, RPL_JUPELIST, jupe->ju_server, jupe->ju_expire + TSoffset, + JupeIsLocal(jupe) ? cli_name(&me) : "*", + JupeIsActive(jupe) ? '+' : '-', jupe->ju_reason); + } + else + { + for (jupe = GlobalJupeList; jupe; jupe = sjupe) + { /* go through jupes */ + sjupe = jupe->ju_next; + + if (jupe->ju_expire <= CurrentTime) /* expire any that need expiring */ + jupe_free(jupe); + else /* send jupe information along */ + send_reply(sptr, RPL_JUPELIST, jupe->ju_server, + jupe->ju_expire + TSoffset, + JupeIsLocal(jupe) ? cli_name(&me) : "*", + JupeIsActive(jupe) ? '+' : '-', jupe->ju_reason); + } + } + + /* end of jupe information */ + return send_reply(sptr, RPL_ENDOFJUPELIST); +} + +int jupe_memory_count(size_t *ju_size) +{ + struct Jupe *jupe; + unsigned int ju = 0; + + for (jupe = GlobalJupeList; jupe; jupe = jupe->ju_next) + { + ju++; + ju_size += sizeof(struct Jupe); + ju_size += jupe->ju_server ? (strlen(jupe->ju_server) + 1) : 0; + ju_size += jupe->ju_reason ? (strlen(jupe->ju_reason) + 1) : 0; + } + return ju; +} Index: ircdh/ircd/m_account.c diff -u /dev/null ircdh/ircd/m_account.c:1.1 --- /dev/null Sat Jan 18 11:54:01 2003 +++ ircdh/ircd/m_account.c Sat Jan 18 11:53:49 2003 @@ -0,0 +1,135 @@ +/* + * IRC - Internet Relay Chat, ircd/m_account.c + * Copyright (C) 2002 Kevin L. Mitchell <kl...@mi...> + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_account.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "client.h" +#include "ircd.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "msg.h" +#include "numnicks.h" +#include "s_user.h" +#include "send.h" + +#include <assert.h> + +/* + * ms_account - server message handler + * + * parv[0] = sender prefix + * parv[1] = numeric of client to act on + * parv[2] = account name (12 characters or less) + */ +int ms_account(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + struct Client *acptr; + + if (parc < 3) + return need_more_params(sptr, "ACCOUNT"); + + if (!IsServer(sptr)) + return protocol_violation(cptr, "ACCOUNT from non-server %s", + cli_name(sptr)); + + if (!(acptr = findNUser(parv[1]))) + return 0; /* Ignore ACCOUNT for a user that QUIT; probably crossed */ + + if (IsAccount(acptr)) + return protocol_violation(cptr, "ACCOUNT for already registered user %s " + "(%s -> %s)", cli_name(acptr), cli_user(acptr)->account, parv[2]); + + assert(0 == cli_user(acptr)->account[0]); + + if (strlen(parv[2]) > ACCOUNTLEN) + { + return protocol_violation(cptr, + "Received account (%s) longer than %d for %s; ignoring.", parv[2], + ACCOUNTLEN, cli_name(acptr)); + } + + ircd_strncpy(cli_user(acptr)->account, parv[2], ACCOUNTLEN); + hide_hostmask(acptr, FLAGS_ACCOUNT); + + sendcmdto_serv_butone(sptr, CMD_ACCOUNT, cptr, "%C %s", acptr, + cli_user(acptr)->account); + + return 0; +} Index: ircdh/ircd/m_asll.c diff -u /dev/null ircdh/ircd/m_asll.c:1.1 --- /dev/null Sat Jan 18 11:54:01 2003 +++ ircdh/ircd/m_asll.c Sat Jan 18 11:53:49 2003 @@ -0,0 +1,183 @@ +/* + * IRC - Internet Relay Chat, ircd/m_asll.c + * Copyright (C) 2002 Alex Badea <va...@p1...> + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_asll.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "numeric.h" +#include "numnicks.h" +#include "match.h" +#include "msg.h" +#include "send.h" +#include "s_bsd.h" +#include "s_user.h" + +#include <assert.h> +#include <stdlib.h> + +static int send_asll_reply(struct Client *from, struct Client *to, char *server, + int rtt, int up, int down) +{ + sendcmdto_one(from, CMD_NOTICE, to, + (up + || down) ? "%C :AsLL for %s -- RTT: %ims Upstream: %ims Downstream: %ims" + : rtt ? "%C :AsLL for %s -- RTT: %ims [no asymm info]" : + "%C :AsLL for %s -- [unknown]", to, server, rtt, up, down); + return 0; +} + +/* + * ms_asll - server message handler + */ +int ms_asll(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + char *mask; + struct Client *acptr; + int i; + + if (parc < 2) + return need_more_params(sptr, "ASLL"); + + if (parc > 5) + { + if (!(acptr = findNUser(parv[1]))) + return 0; + if (MyUser(acptr)) + send_asll_reply(sptr, acptr, parv[2], atoi(parv[3]), atoi(parv[4]), + atoi(parv[5])); + else + sendcmdto_prio_one(sptr, CMD_ASLL, acptr, "%C %s %s %s %s", + acptr, parv[2], parv[3], parv[4], parv[5]); + return 0; + } + + if (hunt_server_prio_cmd(sptr, CMD_ASLL, cptr, 1, "%s %C", 2, parc, + parv) != HUNTED_ISME) + return 0; + mask = parv[1]; + + for (i = 0; i <= HighestFd; i++) + { + acptr = LocalClientArray[i]; + if (!acptr || !IsServer(acptr) || !MyConnect(acptr) + || match(mask, cli_name(acptr))) + continue; + sendcmdto_prio_one(&me, CMD_ASLL, sptr, "%C %s %i %i %i", sptr, + cli_name(acptr), cli_serv(acptr)->asll_rtt, + cli_serv(acptr)->asll_to, cli_serv(acptr)->asll_from); + } + return 0; +} + +/* + * mo_asll - oper message handler + */ +int mo_asll(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + char *mask; + struct Client *acptr; + int i; + + if (parc < 2) + return need_more_params(sptr, "ASLL"); + + if (parc == 2 && MyUser(sptr)) + parv[parc++] = cli_name(&me); + + if (hunt_server_prio_cmd(sptr, CMD_ASLL, cptr, 1, "%s %C", 2, parc, + parv) != HUNTED_ISME) + return 0; + mask = parv[1]; + + for (i = 0; i <= HighestFd; i++) + { + acptr = LocalClientArray[i]; + if (!acptr || !IsServer(acptr) || !MyConnect(acptr) + || match(mask, cli_name(acptr))) + continue; + send_asll_reply(&me, sptr, cli_name(acptr), cli_serv(acptr)->asll_rtt, + cli_serv(acptr)->asll_to, cli_serv(acptr)->asll_from); + } + return 0; +} Index: ircdh/ircd/m_clearmode.c diff -u /dev/null ircdh/ircd/m_clearmode.c:1.1 --- /dev/null Sat Jan 18 11:54:01 2003 +++ ircdh/ircd/m_clearmode.c Sat Jan 18 11:53:49 2003 @@ -0,0 +1,323 @@ +/* + * IRC - Internet Relay Chat, ircd/m_tmpl.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * Copyright (C) 2000 Kevin L. Mitchell <kl...@mi...> + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_clearmode.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "client.h" +#include "channel.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_alloc.h" +#include "ircd_features.h" +#include "ircd_log.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "list.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_conf.h" +#include "send.h" +#include "support.h" + +#include <assert.h> + +/* + * do_clearmode(struct Client *cptr, struct Client *sptr, + * struct Channel *chptr, char *control) + * + * This is the function that actually clears the channel modes. + */ +static int +do_clearmode(struct Client *cptr, struct Client *sptr, struct Channel *chptr, + char *control) +{ + static int flags[] = { + MODE_CHANOP, 'o', + MODE_VOICE, 'v', + MODE_PRIVATE, 'p', + MODE_SECRET, 's', + MODE_MODERATED, 'm', + MODE_TOPICLIMIT, 't', + MODE_INVITEONLY, 'i', + MODE_NOPRIVMSGS, 'n', + MODE_KEY, 'k', + MODE_BAN, 'b', + MODE_LIMIT, 'l', + MODE_REGONLY, 'r', + 0x0, 0x0 + }; + int *flag_p; + unsigned int del_mode = 0; + char control_buf[20]; + int control_buf_i = 0; + struct ModeBuf mbuf; + struct SLink *link, *next; + struct Membership *member; + + /* Um...yeah, like it's supposed to have any modes at all. */ + if (IsModelessChannel(chptr->chname)) + return 0; + + /* Ok, so what are we supposed to get rid of? */ + for (; *control; control++) + { + for (flag_p = flags; flag_p[0]; flag_p += 2) + if (*control == flag_p[1]) + { + del_mode |= flag_p[0]; + break; + } + } + + if (!del_mode) + return 0; /* nothing to remove; ho hum. */ + + modebuf_init(&mbuf, sptr, cptr, chptr, (MODEBUF_DEST_CHANNEL | /* Send MODE to channel */ + MODEBUF_DEST_OPMODE | /* Treat it like an OPMODE */ + MODEBUF_DEST_HACK4)); /* Generate a HACK(4) notice */ + + modebuf_mode(&mbuf, MODE_DEL | (del_mode & chptr->mode.mode)); + chptr->mode.mode &= ~del_mode; /* and of course actually delete them */ + + /* If we're removing invite, remove all the invites */ + if (del_mode & MODE_INVITEONLY) + mode_invite_clear(chptr); + + /* + * If we're removing the key, note that; note that we can't clear + * the key until after modebuf_* are done with it + */ + if (del_mode & MODE_KEY && *chptr->mode.key) + modebuf_mode_string(&mbuf, MODE_DEL | MODE_KEY, chptr->mode.key, 0); + + /* If we're removing the limit, note that and clear the limit */ + if (del_mode & MODE_LIMIT && chptr->mode.limit) + { + modebuf_mode_uint(&mbuf, MODE_DEL | MODE_LIMIT, chptr->mode.limit); + chptr->mode.limit = 0; /* not referenced, so safe */ + } + + /* + * Go through and mark the bans for deletion; note that we can't + * free them until after modebuf_* are done with them + */ + if (del_mode & MODE_BAN) + { + for (link = chptr->banlist; link; link = next) + { + next = link->next; + + modebuf_mode_string(&mbuf, MODE_DEL | MODE_BAN, /* delete ban */ + link->value.ban.banstr, 1); + + MyFree(link->value.ban.who); /* free up who string */ + free_link(link); /* and of course the link itself */ + } + + chptr->banlist = 0; + } + + /* Deal with users on the channel */ + if (del_mode & (MODE_BAN | MODE_CHANOP | MODE_VOICE)) + for (member = chptr->members; member; member = member->next_member) + { + if (IsZombie(member)) /* we ignore zombies */ + continue; + + if (del_mode & MODE_BAN) /* If we cleared bans, clear the valid flags */ + ClearBanValid(member); + + /* Drop channel operator status */ + if (IsChanOp(member) && del_mode & MODE_CHANOP) + { + modebuf_mode_client(&mbuf, MODE_DEL | MODE_CHANOP, member->user); + member->status &= ~CHFL_CHANOP; + } + + /* Drop voice */ + if (HasVoice(member) && del_mode & MODE_VOICE) + { + modebuf_mode_client(&mbuf, MODE_DEL | MODE_VOICE, member->user); + member->status &= ~CHFL_VOICE; + } + } + + /* And flush the modes to the channel */ + modebuf_flush(&mbuf); + + /* Finally, we can clear the key... */ + if (del_mode & MODE_KEY) + chptr->mode.key[0] = '\0'; + + /* Ok, build control string again */ + for (flag_p = flags; flag_p[0]; flag_p += 2) + if (del_mode & flag_p[0]) + control_buf[control_buf_i++] = flag_p[1]; + + control_buf[control_buf_i] = '\0'; + + /* Log it... */ + log_write(LS_OPERMODE, L_INFO, LOG_NOSNOTICE, "%#C CLEARMODE %H %s", sptr, + chptr, control_buf); + + /* Then send it */ + if (!IsLocalChannel(chptr->chname)) + sendcmdto_serv_butone(sptr, CMD_CLEARMODE, cptr, "%H %s", chptr, + control_buf); + + return 0; +} + +/* + * ms_clearmode - server message handler + * + * parv[0] = Send prefix + * parv[1] = Channel name + * parv[2] = Control string + */ +int +ms_clearmode(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + struct Channel *chptr; + + if (parc < 3) + return need_more_params(sptr, "CLEARMODE"); + + if (!IsPrivileged(sptr)) + { + protocol_violation(sptr, "No priviledges on source for CLEARMODE, desync?"); + return send_reply(sptr, ERR_NOPRIVILEGES); + } + + if (!IsChannelName(parv[1]) || IsLocalChannel(parv[1]) || + !(chptr = FindChannel(parv[1]))) + return send_reply(sptr, ERR_NOSUCHCHANNEL, parv[1]); + + return do_clearmode(cptr, sptr, chptr, parv[2]); +} + +/* + * mo_clearmode - oper message handler + * + * parv[0] = Send prefix + * parv[1] = Channel name + * parv[2] = Control string + */ +int +mo_clearmode(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + struct Channel *chptr; + char *control = "ovpsmikbl"; /* default control string */ + char *chname, *qreason; + int force = 0; + + if (!feature_bool(FEAT_CONFIG_OPERCMDS)) + return send_reply(sptr, ERR_DISABLED, "CLEARMODE"); + + if (parc < 2) + return need_more_params(sptr, "CLEARMODE"); + + if (parc > 2) + control = parv[2]; + + chname = parv[1]; + if (*chname == '!') + { + chname++; + if (!HasPriv(sptr, + IsLocalChannel(chname) ? PRIV_FORCE_LOCAL_OPMODE : PRIV_FORCE_OPMODE)) + return send_reply(sptr, ERR_NOPRIVILEGES); + force = 1; + } + + if (!HasPriv(sptr, IsLocalChannel(chname) ? PRIV_LOCAL_OPMODE : PRIV_OPMODE)) + return send_reply(sptr, ERR_NOPRIVILEGES); + + if (('#' != *chname && '&' != *chname) || !(chptr = FindChannel(chname))) + return send_reply(sptr, ERR_NOSUCHCHANNEL, chname); + + if (!force && (qreason = find_quarantine(chptr->chname))) + return send_reply(sptr, ERR_QUARANTINED, chptr->chname, qreason); + + return do_clearmode(cptr, sptr, chptr, control); +} Index: ircdh/ircd/m_connect.c diff -u ircdh/ircd/m_connect.c:1.2 ircdh/ircd/m_connect.c:1.3 --- ircdh/ircd/m_connect.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_connect.c Sat Jan 18 11:53:49 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_connect.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_connect.c,v 1.3 2003/01/18 19:53:49 zolty Exp $ */ /* @@ -89,7 +89,7 @@ #include "ircd_log.h" #include "ircd_reply.h" #include "ircd_string.h" -//#include "jupe.h" +#include "jupe.h" #include "match.h" #include "msg.h" #include "numeric.h" @@ -118,7 +118,7 @@ const char *rule; struct ConfItem *aconf; struct Client *acptr; -// struct Jupe *ajupe; + struct Jupe *ajupe; assert(0 != cptr); assert(0 != sptr); @@ -176,15 +176,12 @@ /* * Check to see if the server is juped; if it is, disallow the connect */ -#if 0 -/* FIXME-ZOLTAN */ if ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe)) { sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Server %s is juped: %s", sptr, JupeServer(ajupe), JupeReason(ajupe)); return 0; } -#endif /* * Allow opers to /connect foo.* 0 bah.* to connect foo and bah @@ -242,7 +239,7 @@ const char *rule; struct ConfItem *aconf; struct Client *acptr; -// struct Jupe* ajupe; + struct Jupe *ajupe; assert(0 != cptr); assert(cptr == sptr); @@ -324,15 +321,13 @@ /* * Check to see if the server is juped; if it is, disallow the connect */ -#if 0 -/* FIXME-ZOLTAN */ if ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe)) { sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Server %s is juped: %s", sptr, JupeServer(ajupe), JupeReason(ajupe)); return 0; } -#endif + /* * Get port number from user, if given. If not specified, * use the default from configuration structure. If missing Index: ircdh/ircd/m_get.c diff -u /dev/null ircdh/ircd/m_get.c:1.1 --- /dev/null Sat Jan 18 11:54:01 2003 +++ ircdh/ircd/m_get.c Sat Jan 18 11:53:49 2003 @@ -0,0 +1,102 @@ +/* + * IRC - Internet Relay Chat, ircd/m_get.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_get.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_features.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "numeric.h" +#include "numnicks.h" +#include "send.h" + +#include <assert.h> + +/* + * mo_get - oper message handler + */ +int mo_get(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + return feature_get(sptr, (const char *const *)parv + 1, parc - 1); +} Index: ircdh/ircd/m_jupe.c diff -u /dev/null ircdh/ircd/m_jupe.c:1.1 --- /dev/null Sat Jan 18 11:54:01 2003 +++ ircdh/ircd/m_jupe.c Sat Jan 18 11:53:49 2003 @@ -0,0 +1,294 @@ +/* + * IRC - Internet Relay Chat, ircd/m_jupe.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * Copyright (C) 2000 Kevin L. Mitchell <kl...@mi...> + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_jupe.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "client.h" +#include "jupe.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_features.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "match.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_conf.h" +#include "s_misc.h" +#include "send.h" +#include "support.h" + +#include <assert.h> +#include <stdlib.h> +#include <string.h> + +/* + * ms_jupe - server message handler + * + * parv[0] = Send prefix + * + * From server: + * + * parv[1] = Target: server numeric or * + * parv[2] = (+|-)<server name> + * parv[3] = Expiration offset + * parv[4] = Last modification time + * parv[5] = Comment + * + */ +int ms_jupe(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + struct Client *acptr = 0; + struct Jupe *ajupe; + unsigned int flags = 0; + time_t expire_off, lastmod; + char *server = parv[2], *target = parv[1], *reason = parv[5]; + + if (parc < 6) + return need_more_params(sptr, "JUPE"); + + if (!(target[0] == '*' && target[1] == '\0')) + { + if (!(acptr = FindNServer(target))) + return 0; /* no such server */ + + if (!IsMe(acptr)) + { /* manually propagate, since we don't set it */ + sendcmdto_one(sptr, CMD_JUPE, acptr, "%s %s %s %s :%s", target, server, + parv[3], parv[4], reason); + return 0; + } + + flags |= JUPE_LOCAL; + } + + if (*server == '-') + server++; + else if (*server == '+') + { + flags |= JUPE_ACTIVE; + server++; + } + + expire_off = atoi(parv[3]); + lastmod = atoi(parv[4]); + + ajupe = jupe_find(server); + + if (ajupe) + { + if (JupeIsLocal(ajupe) && !(flags & JUPE_LOCAL)) /* global over local */ + jupe_free(ajupe); + else if (JupeLastMod(ajupe) < lastmod) + { /* new modification */ + if (flags & JUPE_ACTIVE) + return jupe_activate(cptr, sptr, ajupe, lastmod, flags); + else + return jupe_deactivate(cptr, sptr, ajupe, lastmod, flags); + } + else if (JupeLastMod(ajupe) == lastmod || IsBurstOrBurstAck(cptr)) + return 0; + else + return jupe_resend(cptr, ajupe); /* other server desynched WRT jupes */ + } + + return jupe_add(cptr, sptr, server, reason, expire_off, lastmod, flags); +} + +/* + * mo_jupe - oper message handler + * + * parv[0] = Send prefix + * parv[1] = [[+|-]<server name>] + * + * Local (to me) style: + * + * parv[2] = [Expiration offset] + * parv[3] = [Comment] + * + * Global (or remote local) style: + * + * parv[2] = [target] + * parv[3] = [Expiration offset] + * parv[4] = [Comment] + * + */ +int mo_jupe(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + struct Client *acptr = 0; + struct Jupe *ajupe; + unsigned int flags = 0; + time_t expire_off; + char *server = parv[1], *target = 0, *reason; + + if (parc < 2) + return jupe_list(sptr, 0); + + if (*server == '+') + { + flags |= JUPE_ACTIVE; + server++; + } + else if (*server == '-') + server++; + else + return jupe_list(sptr, server); + + if (!feature_bool(FEAT_CONFIG_OPERCMDS)) + return send_reply(sptr, ERR_DISABLED, "JUPE"); + + if (parc == 4) + { + expire_off = atoi(parv[2]); + reason = parv[3]; + flags |= JUPE_LOCAL; + } + else if (parc > 4) + { + target = parv[2]; + expire_off = atoi(parv[3]); + reason = parv[4]; + } + else + return need_more_params(sptr, "JUPE"); + + if (target) + { + if (!(target[0] == '*' && target[1] == '\0')) + { + if (!(acptr = find_match_server(target))) + return send_reply(sptr, ERR_NOSUCHSERVER, target); + + if (!IsMe(acptr)) + { /* manually propagate, since we don't set it */ + if (!HasPriv(sptr, PRIV_GLINE)) + return send_reply(sptr, ERR_NOPRIVILEGES); + + sendcmdto_one(sptr, CMD_JUPE, acptr, "%C %c%s %s %Tu :%s", acptr, + flags & JUPE_ACTIVE ? '+' : '-', server, parv[3], TStime(), reason); + return 0; + } + else if (!HasPriv(sptr, PRIV_LOCAL_GLINE)) + return send_reply(sptr, ERR_NOPRIVILEGES); + + flags |= JUPE_LOCAL; + } + else if (!HasPriv(sptr, PRIV_GLINE)) + return send_reply(sptr, ERR_NOPRIVILEGES); + } + + ajupe = jupe_find(server); + + if (ajupe) + { + if (JupeIsLocal(ajupe) && !(flags & JUPE_LOCAL)) /* global over local */ + jupe_free(ajupe); + else + { + if (flags & JUPE_ACTIVE) + return jupe_activate(cptr, sptr, ajupe, TStime(), flags); + else + return jupe_deactivate(cptr, sptr, ajupe, TStime(), flags); + } + } + + return jupe_add(cptr, sptr, server, reason, expire_off, TStime(), flags); +} + +/* + * m_jupe - user message handler + * + * parv[0] = Send prefix + * + * From user: + * + * parv[1] = [<server name>] + * + */ +int m_jupe(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + if (parc < 2) + return jupe_list(sptr, 0); + + return jupe_list(sptr, parv[1]); +} Index: ircdh/ircd/m_opmode.c diff -u /dev/null ircdh/ircd/m_opmode.c:1.1 --- /dev/null Sat Jan 18 11:54:01 2003 +++ ircdh/ircd/m_opmode.c Sat Jan 18 11:53:49 2003 @@ -0,0 +1,180 @@ +/* + * IRC - Internet Relay Chat, ircd/m_tmpl.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * Copyright (C) 2000 Kevin L. Mitchell <kl...@mi...> + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_opmode.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are ... [truncated message content] |
From: Toni G. <zo...@us...> - 2002-12-01 00:35:35
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2002-12-01 00:35:34 UTC Added files: include/ircd_tea.h ircd/ircd_tea.c Log message: Ops! Faltaban 2 archivos. ---------------------- diff included ---------------------- Index: ircdh/include/ircd_tea.h diff -u /dev/null ircdh/include/ircd_tea.h:1.1 --- /dev/null Sat Nov 30 16:35:34 2002 +++ ircdh/include/ircd_tea.h Sat Nov 30 16:35:24 2002 @@ -0,0 +1,30 @@ +/* + * IRC - Internet Relay Chat, ircd/ircd_tea.h + * Copyright (C) 1999 IRC-Hispano.org - ESNET - jcea & savage + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: ircd_tea.h,v 1.1 2002/12/01 00:35:24 zolty Exp $ + */ +#ifndef INCLUDED_ircd_tea_h +#define INCLUDED_ircd_tea_h + +extern void ircd_tea(unsigned int v[], unsigned int k[], unsigned int x[]); +extern void ircd_untea(unsigned int v[], unsigned int k[], unsigned int x[]); + +#endif /* INCLUDED_ircd_tea_h */ Index: ircdh/ircd/ircd_tea.c diff -u /dev/null ircdh/ircd/ircd_tea.c:1.1 --- /dev/null Sat Nov 30 16:35:34 2002 +++ ircdh/ircd/ircd_tea.c Sat Nov 30 16:35:24 2002 @@ -0,0 +1,86 @@ +/* + * IRC - Internet Relay Chat, ircd/ircd_tea.c + * Copyright (C) 1999 IRC-Hispano.org - ESNET - jcea & savage + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: ircd_tea.c,v 1.1 2002/12/01 00:35:24 zolty Exp $ + */ + + +/* + * ircd_tea(cifrado) + * + * Cifra 64 bits de datos, usando clave de 64 bits (los 64 bits superiores son cero) + * Se cifra v[0]^x[0], v[1]^x[1], para poder hacer CBC facilmente. + * + */ +void ircd_tea(unsigned int v[], unsigned int k[], unsigned int x[]) +{ + unsigned int y = v[0] ^ x[0]; + unsigned int z = v[1] ^ x[1]; + unsigned int a = k[0]; + unsigned int b = k[1]; + unsigned int c = 0; + unsigned int d = 0; + unsigned int n = 32; + unsigned int sum = 0; + unsigned int delta = 0x9E3779B9; + + while (n-- > 0) + { + sum += delta; + y += ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b); + z += ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d); + } + + x[0] = y; + x[1] = z; +} + +/* + * ircd_untea(descifrado) + * + * Cifra 64 bits de datos, usando clave de 64 bits (los 64 bits superiores son cero) + * Se cifra v[0]^x[0], v[1]^x[1], para poder hacer CBC facilmente. + * + */ +void ircd_untea(unsigned int v[], unsigned int k[], unsigned int x[]) +{ + unsigned int y = v[0]; + unsigned int z = v[1]; + unsigned int a = k[0]; + unsigned int b = k[1]; + unsigned int c = 0; + unsigned int d = 0; + unsigned int n = 32; + unsigned int sum = 0xC6EF3720; + unsigned int delta = 0x9E3779B9; + + /* sum = delta << 5, in general sum = delta * n */ + + while (n-- > 0) + { + z -= ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d); + y -= ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b); + sum -= delta; + } + + x[0] = y; + x[1] = z; +} ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2002-12-01 00:34:19
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2002-12-01 00:34:17 UTC Modified files: ChangeLog configure config/config-sh.in include/client.h include/ircd_xopen.h include/patchlevel.h include/s_bdd.h include/s_user.h include/struct.h include/whowas.h ircd/IPcheck.c ircd/Makefile.in ircd/channel.c ircd/hash.c ircd/ircd.c ircd/m_bmode.c ircd/m_db.c ircd/m_dbq.c ircd/m_ghost.c ircd/m_join.c ircd/m_kick.c ircd/m_kill.c ircd/m_mode.c ircd/m_nick.c ircd/m_oper.c ircd/m_rename.c ircd/m_server.c ircd/m_stats.c ircd/m_userhost.c ircd/m_userip.c ircd/m_watch.c ircd/m_who.c ircd/packet.c ircd/parse.c ircd/s_auth.c ircd/s_bdd.c ircd/s_bsd.c ircd/s_conf.c ircd/s_debug.c ircd/s_serv.c ircd/s_user.c ircd/watch.c Log message: 2001-12-01 Toni Garcia <zo...@ir...> 1.0.alpha11 * ircd/s_debug.c: Eliminadas opciones de version en desuso. * ircd/packet.c: Por un bug gordo encontrado, pongo el packet.c original mientras se arregla el bug. * ircd/m_{userhost|userip}.c: Ampliacion del user*_formatter, para que muestre una u otra cosa si tienes +X o no. * ircd/m_nick.c: Adaptacion del soporte autoghost nick!. * ircd/{channel|m_bmode|m_ghost|m_join|m_mode|m_rename}.c: Adaptacion y normalizacion de funciones BDD. * ircd/IPcheck.c: He dejado la adaptacion, sin acabar, del soporte de clones mediante BDD, por este causa, la dejo oculta en el make config. * {include|ircd}/s_user.{h|c}: Se reescribe y se adapta el codigo del sistema de autentificacion de nicks mediante la BDD. * ircd/m_{db|dbq}.c: Se adapta y normaliza todo el codigo y agregar soporte P09. * {include|ircd}/s_bdd.{h|c}: Se reescriben todas las funciones normalizando mas o menos el codigo con el tal de mantener una uniformidad del codigo. Agregado soporte P09. * {include|ircd}/ircd_tea.{h|c}: Se agregan funciones ircd_tea y ircd_untea de encriptacion/desencriptacion. ---------------------- diff included ---------------------- Index: ircdh/ChangeLog diff -u ircdh/ChangeLog:1.5 ircdh/ChangeLog:1.6 --- ircdh/ChangeLog:1.5 Thu Oct 24 02:57:49 2002 +++ ircdh/ChangeLog Sat Nov 30 16:34:06 2002 @@ -1,3 +1,33 @@ +2001-12-01 Toni Garcia <zo...@ir...> 1.0.alpha11 + * ircd/s_debug.c: Eliminadas opciones de version en desuso. + + * ircd/packet.c: Por un bug gordo encontrado, pongo el packet.c original + mientras se arregla el bug. + + * ircd/m_{userhost|userip}.c: Ampliacion del user*_formatter, para que + muestre una u otra cosa si tienes +X o no. + + * ircd/m_nick.c: Adaptacion del soporte autoghost nick!. + + * ircd/{channel|m_bmode|m_ghost|m_join|m_mode|m_rename}.c: Adaptacion y + normalizacion de funciones BDD. + + * ircd/IPcheck.c: He dejado la adaptacion, sin acabar, del soporte de clones + mediante BDD, por este causa, la dejo oculta en el make config. + + * {include|ircd}/s_user.{h|c}: Se reescribe y se adapta el codigo del sistema + de autentificacion de nicks mediante la BDD. + Hago que se meta a los helpers con HANDLER de Oper. Comprobar que funciona. + + * ircd/m_{db|dbq}.c: Se adapta y normaliza todo el codigo y agregar soporte P09. + + * {include|ircd}/s_bdd.{h|c}: Se reescriben todas las funciones normalizando + mas o menos el codigo con el tal de mantener una uniformidad del codigo. + Agregado soporte P09. + + * {include|ircd}/ircd_tea.{h|c}: Se agregan funciones ircd_tea y ircd_untea + de encriptacion/desencriptacion. + 2002-10-24 Toni Garcia <zo...@ir...> 1.0.alpha10 Completada la migracion al u2.10.10. Las preguntas en el makeconfig sobre BDD y P09_SUPPORT han sido ocultas al estar incompletas. En el proximo Index: ircdh/config/config-sh.in diff -u ircdh/config/config-sh.in:1.6 ircdh/config/config-sh.in:1.7 --- ircdh/config/config-sh.in:1.6 Thu Oct 24 02:57:51 2002 +++ ircdh/config/config-sh.in Sat Nov 30 16:34:06 2002 @@ -368,26 +368,25 @@ mainmenu_option next_comment comment 'Mandatory defines (you should leave these untouched)' -# bool 'HISPANO/ESNET: Distributed DataBase Support' BDD y - # if [ "$BDD" = "y" ]; then - # eval DBPATH_DEFAULT="database" - # string 'HISPANO/ESNET: Directory where distributed database resides' DBPATH $DBPATH_DEFAULT + bool 'HISPANO/ESNET: Distributed DataBase Support' BDD y + if [ "$BDD" = "y" ]; then + eval DBPATH_DEFAULT="database" + string 'HISPANO/ESNET: Directory where distributed database resides' DBPATH $DBPATH_DEFAULT # bool 'HISPANO/ESNET: Distributed Clone Control support' BDD_CLONES y - # bool 'HISPANO/ESNET: CHAN_DB features (join # FUNDADOR, modeX)' BDD_CHAN_HACK y - # bool 'HISPANO/ESNET: OPER_DB features (join # OPER, modeX)' BDD_OPER_HACK y - # if [ "$BDD_OPER_HACK" = "y" ]; then - # # bool 'HISPANO/ESNET: OPER_DB features only on registered (CHAN_DB) channels' BDD_OPER_HACK_ONLYREG n - # bool 'HISPANO/ESNET: OPER_DB members can be Chanserv (+k)' BDD_OPER_HACK_KMODE y - # fi - # bool 'HISPANO/ESNET: Soporte para la ocultacion de IPs' BDD_VIP y - # if [ "$BDD_VIP" = "y" ]; then - # bool 'HISPANO/ESNET: Ignorar el flag "+x" a menos que el usuario este en la tabla "v" o "w"' BDD_VIP3 n - # if [ "$BDD_VIP3" = "n" ]; then - # bool 'HISPANO/ESNET: Ocultación de IP de TODOS los usuarios' BDD_VIP2 y - # fi - # fi - # bool 'HISPANO/ESNET: Proteccion contra Wingates y Socks4 proxies' PROXY_PROTECTION y - # fi + bool 'HISPANO/ESNET: CHAN_DB features (join # FUNDADOR, modeX)' BDD_CHAN_HACK y + bool 'HISPANO/ESNET: OPER_DB features (join # OPER, modeX)' BDD_OPER_HACK y + if [ "$BDD_OPER_HACK" = "y" ]; then + # bool 'HISPANO/ESNET: OPER_DB features only on registered (CHAN_DB) channels' BDD_OPER_HACK_ONLYREG n + bool 'HISPANO/ESNET: OPER_DB members can be Chanserv (+k)' BDD_OPER_HACK_KMODE y + fi + bool 'HISPANO/ESNET: Soporte para la ocultacion de IPs' BDD_VIP y + if [ "$BDD_VIP" = "y" ]; then + bool 'HISPANO/ESNET: Ignorar el flag "+x" a menos que el usuario este en la tabla "v" o "w"' BDD_VIP3 n + if [ "$BDD_VIP3" = "n" ]; then + bool 'HISPANO/ESNET: Ocultación de IP de TODOS los usuarios' BDD_VIP2 y + fi + fi + fi bool 'HISPANO/ESNET: XMODE Networking' XMODE_ESNET y # bool 'HISPANO/ESNET: Dinamic Negotiation link-by-link' ESNET_NEG y # if [ "$ESNET_NEG" = "y" ]; then Index: ircdh/configure diff -u ircdh/configure:1.2 ircdh/configure:1.3 --- ircdh/configure:1.2 Sun Aug 18 15:49:41 2002 +++ ircdh/configure Sat Nov 30 16:34:06 2002 @@ -15,8 +15,12 @@ cd zlib ./configure echo -echo ATENCION: En este ircd se esta haciendo una limpieza de sources, con lo -echo que implica que puede que no se compile bajo ciertas maquinas o que se -echo compila pero sale "warnings". +echo ATENCION: Este IRCD es una version ALPHA con lo que implica +echo que puede que no se compile bajo ciertas maquinas o que se +echo compila pero sale "warnings". O que se surjan cosas raras +echo o bugs. +echo +echo Si encuentras bugs, se agradeceria mucho que lo avises al mail +echo zo...@ir... o en la lista irc...@li... echo echo Estamos trabajando en ello. IRC-Dev.Net 2002 Index: ircdh/include/client.h diff -u ircdh/include/client.h:1.1 ircdh/include/client.h:1.2 --- ircdh/include/client.h:1.1 Thu Oct 24 02:57:51 2002 +++ ircdh/include/client.h Sat Nov 30 16:34:06 2002 @@ -18,10 +18,13 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * - * $Id: client.h,v 1.1 2002/10/24 09:57:51 zolty Exp $ + * $Id: client.h,v 1.2 2002/12/01 00:34:06 zolty Exp $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h +#ifndef INCLUDED_config_h +#include "config.h" +#endif #ifndef INCLUDED_sys_types_h #include <sys/types.h> /* time_t, size_t */ #define INCLUDED_sys_types_h Index: ircdh/include/ircd_xopen.h diff -u ircdh/include/ircd_xopen.h:1.1 ircdh/include/ircd_xopen.h:1.2 --- ircdh/include/ircd_xopen.h:1.1 Thu Oct 24 02:57:51 2002 +++ ircdh/include/ircd_xopen.h Sat Nov 30 16:34:06 2002 @@ -1,12 +1,11 @@ /* * ircd_xopen.h * - * $Id: ircd_xopen.h,v 1.1 2002/10/24 09:57:51 zolty Exp $ + * $Id: ircd_xopen.h,v 1.2 2002/12/01 00:34:06 zolty Exp $ */ #ifndef INCLUDED_ircd_xopen_h #define INCLUDED_ircd_xopen_h extern const char *ircd_crypt(const char *key, const char *salt); -extern void ircd_tea(unsigned int v[], unsigned int k[], unsigned int x[]); #endif /* INCLUDED_ircd_xopen_h */ Index: ircdh/include/patchlevel.h diff -u ircdh/include/patchlevel.h:1.5 ircdh/include/patchlevel.h:1.6 --- ircdh/include/patchlevel.h:1.5 Thu Oct 24 02:57:51 2002 +++ ircdh/include/patchlevel.h Sat Nov 30 16:34:06 2002 @@ -15,11 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: patchlevel.h,v 1.5 2002/10/24 09:57:51 zolty Exp $ + * $Id: patchlevel.h,v 1.6 2002/12/01 00:34:06 zolty Exp $ * */ -#define PATCHLEVEL ".alpha10" +#define PATCHLEVEL ".alpha11" #define RELEASE "1.0" Index: ircdh/include/s_bdd.h diff -u ircdh/include/s_bdd.h:1.2 ircdh/include/s_bdd.h:1.3 --- ircdh/include/s_bdd.h:1.2 Thu Oct 24 02:57:51 2002 +++ ircdh/include/s_bdd.h Sat Nov 30 16:34:06 2002 @@ -15,53 +15,99 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: s_bdd.h,v 1.3 2002/12/01 00:34:06 zolty Exp $ */ +#ifndef INCLUDED_s_bdd_h +#define INCLUDED_s_bdd_h +#ifndef INCLUDED_config_h +#include "config.h" +#endif + +#ifdef BDD -#ifndef S_BDD_H -#define S_BDD_H +struct Client; +/* + * General defines + */ +/* + * Las tablas con los registros, serie, version ... + */ +#define BDD_TABLE_MAX 256 + +/* + * Defines de las tablas de la BDD + */ +#define BDD_INIT 'a' /* Primera Tabla */ +#define BDD_BOTSDB 'b' /* Tabla de bots */ +#define BDD_CHANDB 'c' /* Tabla de canales */ +#define BDD_CLONESDB 'i' /* Tabla de Ilines/clones */ +#define BDD_NICKDB 'n' /* Tabla de nicks */ +#define BDD_OPERDB 'o' /* Tabla de opers */ +#define BDD_VHOSTDB 'v' /* Tabla de vhosts */ +#define BDD_VHOSTDB2 'w' /* Tabla de vhosts 2 */ +#define BDD_END 'z' /* Ultima Tabla */ + +/* + * Para las features de los pseudoBOTS + */ +#define BDD_CHANSERV "ChanServ" /* Bots de canales */ +#define BDD_NICKSERV "NickServ" /* Bot de nicks */ -#include "struct.h" -#if defined(BDD) -#define ESNET_BDD 'a' -#define ESNET_BDD_END 'z' -#define ESNET_NICKDB 'n' -#define ESNET_CLONESDB 'i' - -#define BDD_OPERDB 'o' -#define BDD_CHANDB 'c' -#define BDD_BOTSDB 'b' -#define BDD_IPVIRTUALDB 'v' -#define BDD_IPVIRTUAL2DB 'w' - -/* Para las features de los pseudoBOTS */ -#define BDD_CHANSERV "ChanServ" -#define BDD_NICKSERV "NickServ" -#define BDD_CANAL_NOTIF_SOCKS "SocksChannel" - -struct db_reg { - char *clave; - char *valor; - struct db_reg *next; +/* + * Structures + */ +struct Bdd { + char *key; + char *content; + struct Bdd *next; }; -#endif /* BDD */ -#ifdef BDD -void reload_db(void); -void initdb(void); -struct DB_nick *find_db_nick(char *nick); -void tx_num_serie_dbs(aClient *cptr); +struct bdd_memory_table { + char *pos; + unsigned int len; + char *point_r; + char *point_w; +}; -void tea(unsigned int v[], unsigned int k[], unsigned int x[]); -struct db_reg *db_buscar_registro(char tabla, char *clave); -/* -int db_es_miembro(char tabla, char *clave, char *subcadena); -*/ -int db_es_residente(char tabla); -unsigned int db_num_serie(char tabla); -unsigned int db_cuantos(char tabla); -#endif +/* + * Prototypes + */ +extern struct Bdd **bdd_data_table[BDD_TABLE_MAX]; +extern int bdd_resident_table[BDD_TABLE_MAX]; +extern unsigned long int bdd_count_table[BDD_TABLE_MAX]; +extern unsigned long int bdd_id_table[BDD_TABLE_MAX]; +extern unsigned long int bdd_hashtable_hi[BDD_TABLE_MAX]; +extern unsigned long int bdd_hashtable_lo[BDD_TABLE_MAX]; + +extern int bdd_table_is_resident(unsigned char table); +extern unsigned long int bdd_id_in_table(unsigned char table); +extern unsigned long int bdd_count_in_table(unsigned char table); + +extern void bdd_init(void); +extern int bdd_open(unsigned int registry, char *buf, unsigned char table, + struct bdd_memory_table *dump); +extern int bdd_read(struct bdd_memory_table *dump, char *buf); +extern void bdd_add(char *registry, unsigned char table, int save_disk); +extern void bdd_del(char *registry, unsigned char table); +extern void bdd_drop(unsigned char table); +extern void bdd_close(struct bdd_memory_table *dump); +extern void bdd_hash_write(unsigned char table); +extern struct Bdd *bdd_find_reg(unsigned char table, char *key); +extern int bdd_is_member(unsigned char table, char *key, char *subcadena); +extern char *bdd_get_botname(char *bot); + +extern void bdd_reload(void); +extern void bdd_die(char *msg, unsigned char table); +extern void bdd_burst(struct Client *cptr); +extern void report_bdd(struct Client *sptr); + +extern void corta_si_multiples_hubs(struct Client *cptr, unsigned char table, + char *msg); + +#endif /* BDD */ /* -- mman.h no contiene algunas definicieones en plataformas antiguas -- */ #ifndef MAP_FAILED @@ -72,4 +118,4 @@ #endif /* -- savage 1999/11/19 -- */ -#endif /* S_BDD_H */ +#endif /* INCLUDED_s_bdd_h */ Index: ircdh/include/s_user.h diff -u ircdh/include/s_user.h:1.4 ircdh/include/s_user.h:1.5 --- ircdh/include/s_user.h:1.4 Thu Oct 24 02:57:51 2002 +++ ircdh/include/s_user.h Sat Nov 30 16:34:06 2002 @@ -1,10 +1,13 @@ /* * s_user.h * - * $Id: s_user.h,v 1.4 2002/10/24 09:57:51 zolty Exp $ + * $Id: s_user.h,v 1.5 2002/12/01 00:34:06 zolty Exp $ */ #ifndef INCLUDED_s_user_h #define INCLUDED_s_user_h +#ifndef INCLUDED_config_h +#include "config.h" +#endif #ifndef INCLUDED_sys_types_h #include <sys/types.h> #define INCLUDED_sys_types_h @@ -43,11 +46,26 @@ #define MATCH_SERVER 1 #define MATCH_HOST 2 +#ifdef BDD +/* used in set_nick_name */ +#define NICK_GHOST 0x01 /* Ha hecho un Ghost */ +#define NICK_IDENTIFY 0x02 /* Esta identificado */ +#define NICK_EQUIVALENT 0x04 /* Es un nick equivalente */ + +#define SetGhost(x) ((x) |= NICK_GHOST) +#define SetIdentify(x) ((x) |= NICK_IDENTIFY) +#define SetNickEquivalent(x) ((x) |= NICK_EQUIVALENT) +#define IsGhost(x) ((x) & NICK_GHOST) +#define IsIdentify(x) ((x) & NICK_IDENTIFY) +#define IsNickEquivalent(x) ((x) & NICK_EQUIVALENT) +#endif /* BDD */ + #define COOKIE_VERIFIED 0xffffffff extern struct SLink *opsarray[]; -typedef char *(*InfoFormatter) (struct Client * who, char *buf); +typedef char *(*InfoFormatter) (struct Client * who, struct Client * sptr, + char *buf); /* * Prototypes @@ -62,8 +80,13 @@ extern int user_set_away(struct User *user, char *message); extern int do_nick_name(char *nick); extern int set_nick_name(struct Client *cptr, struct Client *sptr, - const char *nick, int parc, char *parv[]); + const char *nick, int parc, char *parv[], int flags); +#ifdef BDD +extern void send_umode_out(struct Client *cptr, struct Client *sptr, int old, + int oldh, int registrado); +#else extern void send_umode_out(struct Client *cptr, struct Client *sptr, int old); +#endif extern int whisper(struct Client *source, const char *nick, const char *channel, const char *text, int is_notice); extern void send_user_info(struct Client *to, char *names, int rpl, @@ -95,13 +118,10 @@ extern int send_supported(struct Client *cptr); #if defined BDD_VIP -extern char *get_virtualhost(aClient *sptr); -extern char *get_visiblehost(aClient *sptr, aClient *acptr); +extern char *get_virtualhost(struct Client *sptr); +extern char *get_visiblehost(struct Client *sptr, struct Client *acptr); +extern void make_virtualhost(struct Client *acptr, int mostrar); +extern int verifica_clave_nick(char *nick, char *hash, char *clave); #endif - -#ifdef WATCH -extern int chequea_estado_watch(aClient *cptr, int raw); -extern int borra_lista_watch(aClient *cptr); -#endif /* WATCH */ #endif /* INCLUDED_s_user_h */ Index: ircdh/include/struct.h diff -u ircdh/include/struct.h:1.5 ircdh/include/struct.h:1.6 --- ircdh/include/struct.h:1.5 Thu Oct 24 02:57:51 2002 +++ ircdh/include/struct.h Sat Nov 30 16:34:06 2002 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: struct.h,v 1.5 2002/10/24 09:57:51 zolty Exp $ + * $Id: struct.h,v 1.6 2002/12/01 00:34:06 zolty Exp $ */ #ifndef INCLUDED_struct_h #define INCLUDED_struct_h @@ -55,7 +55,7 @@ unsigned int nn_mask; /* [Remote] FD_SETSIZE - 1 */ char nn_capacity[4]; /* numeric representation of server capacity */ #ifdef BDD - unsigned long esnet_db; /* Mascara de grifo abierto para cada BDD */ + unsigned long bdd_mask; /* Mascara de grifo abierto para cada BDD */ #endif char *last_error_msg; /* Allocated memory with last message receive with an ERROR */ char by[NICKLEN + 1]; Index: ircdh/include/whowas.h diff -u ircdh/include/whowas.h:1.6 ircdh/include/whowas.h:1.7 --- ircdh/include/whowas.h:1.6 Thu Oct 24 02:57:51 2002 +++ ircdh/include/whowas.h Sat Nov 30 16:34:06 2002 @@ -16,10 +16,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: whowas.h,v 1.6 2002/10/24 09:57:51 zolty Exp $ + * $Id: whowas.h,v 1.7 2002/12/01 00:34:06 zolty Exp $ */ #ifndef INCLUDED_whowas_h #define INCLUDED_whowas_h +#ifndef INCLUDED_config_h +#include "config.h" +#endif #ifndef INCLUDED_sys_types_h #include <sys/types.h> /* size_t */ #define INCLUDED_sys_types_h Index: ircdh/ircd/IPcheck.c diff -u ircdh/ircd/IPcheck.c:1.6 ircdh/ircd/IPcheck.c:1.7 --- ircdh/ircd/IPcheck.c:1.6 Thu Oct 24 02:57:52 2002 +++ ircdh/ircd/IPcheck.c Sat Nov 30 16:34:06 2002 @@ -16,25 +16,29 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: IPcheck.c,v 1.6 2002/10/24 09:57:52 zolty Exp $ + * $Id: IPcheck.c,v 1.7 2002/12/01 00:34:06 zolty Exp $ * * * * This file should be edited in a window with a width of 141 characters * ick */ +#include "s_debug.h" /* provisional */ #include "IPcheck.h" #include "client.h" +#include "config.h" #include "ircd.h" #include "msg.h" #include "numnicks.h" /* NumNick, NumServ (GODMODE) */ #include "ircd_alloc.h" +#include "s_bdd.h" #include "s_bsd.h" /* SetIPChecked */ #include "s_debug.h" /* Debug */ #include "s_user.h" /* TARGET_DELAY */ #include "send.h" #include <assert.h> +#include <stdlib.h> #include <string.h> @@ -233,16 +237,16 @@ int clones = 0; #endif - -#ifdef BDD_CLONES -/* - * Si lo que sigue no se verifica, Throttle. - * Si tiene Iline, no debe bloquearlo por throttle - */ + Debug((DEBUG_INFO, "Contenido del ADDR: %u", addr)); +#ifdef BDD_CLONES_1 + /* + * Si lo que sigue no se verifica, Throttle. + * Si tiene Iline, no debe bloquearlo por throttle + */ if (IPbusca_clones_cptr(cptr) != -1) clones = 1; #endif - + Debug((DEBUG_INFO, "CHEQUEO EN IPCHECK XDDDDDDD")); if (0 == entry) { entry = ip_registry_new_entry(); @@ -272,15 +276,19 @@ if (0 == ++entry->attempts) /* Check for overflow */ --entry->attempts; + Debug((DEBUG_INFO, "CHEQUEO EN IPCHECK XD")); + if (entry->attempts <= IPCHECK_CLONE_LIMIT) { if (next_target_out) #ifdef BDD_CLONES { +/* FIXME-ZOLTAN if (clones) *next_target_out = CurrentTime - (TARGET_DELAY * start_targets - 1); else - *next_target_out = CurrentTime - (TARGET_DELAY * free_targets - 1); +*/ + *next_target_out = CurrentTime - (TARGET_DELAY * free_targets - 1); } #else *next_target_out = CurrentTime - (TARGET_DELAY * free_targets - 1); @@ -295,12 +303,12 @@ return 1; #else #ifdef BDD_CLONES -/* - * Si lo que sigue no se verifica, Throttle. - * Si tiene Iline, no debe bloquearlo por throttle - */ + /* + * Si lo que sigue no se verifica, Throttle. + * Si tiene Iline, no debe bloquearlo por throttle + */ if (clones) - return 0; + return 1; #endif --entry->connected; return 0; @@ -631,17 +639,17 @@ } #ifdef BDD_CLONES +#if 0 int IPbusca_clones(char *host) { - struct db_reg *reg; + struct Bdd *bdd; - reg = db_buscar_registro(ESNET_CLONESDB, host); - if (reg == NULL) + bdd = bdd_find_reg(BDD_CLONESDB, host); + if (!bdd) return -1; - return atoi(reg->valor); + return atoi(bdd->content); } - -int IPbusca_clones_cptr(aClient *cptr) +int IPbusca_clones_cptr(unsigned int addr) { char host_buf[HOSTLEN + 1]; struct hostent *hp; @@ -670,5 +678,5 @@ } return -1; } - +#endif #endif Index: ircdh/ircd/Makefile.in diff -u ircdh/ircd/Makefile.in:1.7 ircdh/ircd/Makefile.in:1.8 --- ircdh/ircd/Makefile.in:1.7 Thu Oct 24 02:57:52 2002 +++ ircdh/ircd/Makefile.in Sat Nov 30 16:34:06 2002 @@ -80,6 +80,7 @@ ircd_reply.c \ ircd_signal.c \ ircd_string.c \ + ircd_tea.c \ ircd_xopen.c \ list.c \ listener.c \ @@ -333,8 +334,8 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. IPcheck.o: IPcheck.c ../include/IPcheck.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ + ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/msg.h ../include/numnicks.h \ ../include/ircd_alloc.h ../include/fda.h ../include/s_bsd.h \ ../include/s_debug.h ../include/s_user.h ../include/send.h @@ -345,21 +346,21 @@ ../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \ ../include/ircd_reply.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/whowas.h -class.o: class.c ../include/class.h ../include/client.h ../include/dbuf.h \ + ../include/numnicks.h ../include/querycmds.h ../include/s_bdd.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/whowas.h +class.o: class.c ../include/class.h ../include/client.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ - ../include/list.h ../include/numeric.h ../include/s_conf.h \ - ../include/s_debug.h ../include/send.h -crule.o: crule.c ../include/crule.h ../include/client.h ../include/dbuf.h \ + ../include/struct.h ../include/list.h ../include/numeric.h \ + ../include/s_conf.h ../include/s_debug.h ../include/send.h +crule.o: crule.c ../include/crule.h ../include/client.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ - ../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \ - ../include/ircd_string.h ../include/match.h ../include/s_bsd.h \ - ../include/s_debug.h + ../include/struct.h ../include/ircd_alloc.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 @@ -390,9 +391,9 @@ ../include/ircd_string.h ../config/config.h ../config/setup.h \ ../include/ircd_chattr.h ../include/s_debug.h ../include/ircd_defs.h ircd_log.o: ircd_log.c ../include/ircd_log.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/struct.h ../include/s_serv.h ../include/ircd_string.h \ - ../config/config.h ../config/setup.h ../include/ircd_chattr.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ + ../include/ircd_defs.h ../include/ircd_handler.h ../include/struct.h \ + ../include/s_serv.h ../include/ircd_string.h ../include/ircd_chattr.h \ ../include/s_debug.h ircd_osdep.o: ircd_osdep.c ../include/ircd_osdep.h ircd_relay.o: ircd_relay.c ../include/ircd_relay.h ../include/channel.h \ @@ -404,8 +405,8 @@ ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_user.h ../include/send.h ircd_reply.o: ircd_reply.c ../include/ircd_reply.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ + ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/numeric.h ../include/s_conf.h \ ../include/s_debug.h ../include/send.h ircd_signal.o: ircd_signal.c ../include/ircd_signal.h ../include/ircd.h \ @@ -414,10 +415,11 @@ ircd_string.o: ircd_string.c ../include/ircd_string.h ../config/config.h \ ../config/setup.h ../include/ircd_chattr.h ../include/ircd_defs.h \ chattr.tab.c +ircd_tea.o: ircd_tea.c ircd_xopen.o: ircd_xopen.c ../include/ircd_xopen.h list.o: list.c ../include/list.h ../include/class.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ + ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/listener.h \ ../include/match.h ../include/numeric.h ../include/res.h \ @@ -425,22 +427,22 @@ ../include/s_misc.h ../include/s_user.h ../include/send.h \ ../include/support.h ../include/watch.h ../include/whowas.h listener.o: listener.c ../include/listener.h ../include/ircd_defs.h \ - ../include/client.h ../include/dbuf.h ../include/ircd_handler.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ + ../include/client.h ../config/config.h ../config/setup.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_osdep.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/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_admin.o: m_admin.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ ../include/ircd_reply.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_conf.h ../include/s_user.h \ ../include/send.h -m_away.o: m_away.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_away.o: m_away.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/s_user.h ../include/send.h @@ -449,8 +451,8 @@ ../include/dbuf.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/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ - ../include/s_user.h ../include/send.h + ../include/numeric.h ../include/numnicks.h ../include/s_bdd.h \ + ../include/s_debug.h ../include/s_user.h ../include/send.h m_burst.o: m_burst.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ @@ -459,91 +461,100 @@ ../include/ircd_chattr.h ../include/list.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ ../include/s_misc.h ../include/send.h -m_close.o: m_close.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_close.o: m_close.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ ../include/ircd_reply.h ../include/numeric.h ../include/s_bsd.h \ ../include/send.h m_config.o: m_config.c ../include/sys.h ../config/config.h \ ../config/setup.h -m_connect.o: m_connect.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \ - ../include/hash.h ../include/ircd.h ../config/config.h \ - ../config/setup.h ../include/struct.h ../include/ircd_log.h \ +m_connect.o: m_connect.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/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_cnotice.o: m_cnotice.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/s_user.h -m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/s_user.h +m_cnotice.o: m_cnotice.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/s_user.h +m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/s_user.h m_create.o: m_create.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ ../include/dbuf.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/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h -m_db.o: m_db.c -m_dbq.o: m_dbq.c -m_defaults.o: m_defaults.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_db.o: m_db.c ../include/client.h ../config/config.h ../config/setup.h \ + ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/list.h ../include/match.h \ + ../include/msg.h ../include/numnicks.h ../include/s_bdd.h \ + ../include/s_conf.h ../include/send.h +m_dbq.o: m_dbq.c ../include/client.h ../config/config.h ../config/setup.h \ + ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/fda.h ../include/ircd_chattr.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_bdd.h \ + ../include/send.h +m_defaults.o: m_defaults.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ ../include/ircd_reply.h ../include/numeric.h ../include/numnicks.h \ ../include/send.h ../include/version.h -m_destruct.o: m_destruct.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_destruct.o: m_destruct.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/send.h -m_desynch.o: m_desynch.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_desynch.o: m_desynch.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/numeric.h ../include/numnicks.h \ ../include/s_bsd.h ../include/send.h -m_die.o: m_die.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_bsd.h ../include/send.h -m_endburst.o: m_endburst.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_die.o: m_die.c ../include/client.h ../config/config.h ../config/setup.h \ + ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_bsd.h ../include/send.h +m_endburst.o: m_endburst.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/send.h -m_error.o: m_error.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_error.o: m_error.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/hash.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/numeric.h ../include/numnicks.h \ ../include/s_debug.h ../include/s_misc.h ../include/send.h -m_gline.o: m_gline.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/gline.h \ - ../config/config.h ../config/setup.h ../include/hash.h \ +m_gline.o: m_gline.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/gline.h ../include/hash.h \ ../include/ircd.h ../include/struct.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_misc.h ../include/send.h \ ../include/support.h m_ghost.o: m_ghost.c -m_help.o: m_help.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_help.o: m_help.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/send.h -m_info.o: m_info.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_info.o: m_info.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/s_misc.h ../include/s_user.h \ @@ -555,9 +566,9 @@ ../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_ison.o: m_ison.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_ison.o: m_ison.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/numeric.h ../include/send.h m_join.o: m_join.c ../include/channel.h ../config/config.h \ @@ -566,24 +577,24 @@ ../include/hash.h ../include/ircd.h ../include/struct.h \ ../include/ircd_chattr.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_user.h ../include/send.h \ - ../include/handlers.h + ../include/numnicks.h ../include/s_bdd.h ../include/s_user.h \ + ../include/send.h ../include/handlers.h m_kick.o: m_kick.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ ../include/dbuf.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/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h -m_kill.o: m_kill.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_kill.o: m_kill.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_misc.h \ - ../include/send.h ../include/whowas.h -m_links.o: m_links.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ + ../include/s_user.h ../include/send.h ../include/whowas.h +m_links.o: m_links.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.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_user.h \ @@ -595,19 +606,18 @@ ../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/send.h -m_lusers.o: m_lusers.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/handlers.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_lusers.o: m_lusers.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/handlers.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 -m_map.o: m_map.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/map.h ../include/numeric.h \ - ../include/send.h +m_map.o: m_map.c ../include/client.h ../config/config.h ../config/setup.h \ + ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/map.h \ + ../include/numeric.h ../include/send.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/ircd_handler.h \ @@ -616,9 +626,9 @@ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_debug.h ../include/s_user.h \ ../include/send.h -m_motd.o: m_motd.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_motd.o: m_motd.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.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 \ @@ -631,21 +641,21 @@ ../include/numeric.h ../include/numnicks.h ../include/s_user.h \ ../include/send.h m_nick.o: m_nick.c ../include/IPcheck.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../config/config.h \ - ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ + ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_chattr.h \ ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_user.h ../include/send.h -m_notice.o: m_notice.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_chattr.h ../include/ircd_relay.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/match.h ../include/msg.h \ +m_notice.o: m_notice.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd_chattr.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 ../include/handlers.h -m_oper.o: m_oper.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_oper.o: m_oper.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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 \ @@ -657,31 +667,31 @@ ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/numeric.h \ ../include/numnicks.h ../include/send.h -m_pass.o: m_pass.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/send.h -m_ping.o: m_ping.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/ircd.h \ +m_pass.o: m_pass.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/send.h +m_ping.o: m_ping.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd.h \ ../include/struct.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_debug.h ../include/send.h -m_pong.o: m_pong.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_pong.o: m_pong.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ ../include/struct.h ../include/ircd_string.h ../include/ircd_chattr.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_user.h ../include/send.h -m_privmsg.o: m_privmsg.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_privmsg.o: m_privmsg.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ ../include/ircd_chattr.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_proto.o: m_proto.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_proto.o: m_proto.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.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/numeric.h \ ../include/numnicks.h ../include/s_debug.h ../include/s_misc.h \ @@ -692,40 +702,46 @@ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/sprintf_irc.h ../include/struct.h \ ../include/s_misc.h -m_rename.o: m_rename.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h -m_restart.o: m_restart.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_rename.o: m_rename.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_string.h ../include/ircd_chattr.h \ + ../include/ircd_tea.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_bdd.h ../include/s_conf.h \ + ../include/s_user.h ../include/send.h ../include/watch.h \ + ../include/whowas.h +m_restart.o: m_restart.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \ ../include/send.h -m_rping.o: m_rping.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_rping.o: m_rping.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/opercmds.h ../include/s_user.h \ ../include/send.h -m_rpong.o: m_rpong.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_rpong.o: m_rpong.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/opercmds.h ../include/send.h -m_server.o: m_server.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \ - ../include/hash.h ../include/ircd.h ../config/config.h \ - ../config/setup.h ../include/struct.h ../include/ircd_log.h \ +m_server.o: m_server.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/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_settime.o: m_settime.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_settime.o: m_settime.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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 \ @@ -737,9 +753,9 @@ ../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_squit.o: m_squit.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_squit.o: m_squit.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ ../include/struct.h ../include/ircd_chattr.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \ ../include/match.h ../include/s_debug.h ../include/s_misc.h \ @@ -752,20 +768,20 @@ ../include/fda.h ../include/ircd_chattr.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/list.h ../include/listener.h \ ../include/match.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/opercmds.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_serv.h ../include/s_user.h ../include/send.h \ - ../include/userload.h -m_time.o: m_time.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ + ../include/numnicks.h ../include/opercmds.h ../include/s_bdd.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ + ../include/s_misc.h ../include/s_serv.h ../include/s_user.h \ + ../include/send.h ../include/userload.h +m_time.o: m_time.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/s_misc.h ../include/s_user.h \ ../include/send.h -m_tmpl.o: m_tmpl.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_tmpl.o: m_tmpl.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/numeric.h ../include/numnicks.h \ ../include/send.h @@ -776,47 +792,47 @@ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h m_trace.o: m_trace.c ../include/class.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../config/config.h \ - ../config/setup.h ../include/struct.h ../include/ircd_reply.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ + ../include/ircd_defs.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/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/version.h -m_uping.o: m_uping.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_uping.o: m_uping.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/match.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ ../include/s_user.h ../include/send.h ../include/uping.h m_user.o: m_user.c ../include/handlers.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ + ../config/config.h ../config/setup.h ../include/dbuf.h \ + ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/ircd_chattr.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ ../include/send.h -m_users.o: m_users.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ +m_users.o: m_users.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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_misc.h \ ../include/s_user.h ../include/s_serv.h ../include/send.h -m_userhost.o: m_userhost.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \ +m_userhost.o: m_userhost.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/numeric.h \ ../include/s_user.h ../include/struct.h -m_userip.o: m_userip.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \ +m_userip.o: m_userip.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/numeric.h \ ../include/s_user.h ../include/struct.h -m_version.o: m_version.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../config/config.h ../config/setup.h \ +m_version.o: m_version.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.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/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_debug.h ../include/s_user.h \ @@ -828,31 +844,32 @@ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_user.h \ ../include/send.h -m_wallops.o: m_wallops.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \ +m_wallops.o: m_wallops.c ../include/client.h ../config/config.h \ + ../config/setup.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/numeric.h \ ../include/send.h ../include/msg.h ../include/s_bsd.h \ ../include... [truncated message content] |
From: Zolty <zo...@us...> - 2002-10-24 09:59:52
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2002-10-24 09:59:51 UTC Added files: ircd/m_admin.c ircd/m_rename.c Log message: 2002-10-24 Toni Garcia <zo...@ir...> 1.0.alpha10 Faltaban 2 archivos :) ---------------------- diff included ---------------------- Index: ircdh/ircd/m_admin.c diff -u /dev/null ircdh/ircd/m_admin.c:1.1 --- /dev/null Thu Oct 24 02:59:51 2002 +++ ircdh/ircd/m_admin.c Thu Oct 24 02:59:41 2002 @@ -0,0 +1,170 @@ +/* + * IRC - Internet Relay Chat, ircd/m_admin.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_admin.c,v 1.1 2002/10/24 09:59:41 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "client.h" +#include "ircd.h" +#include "ircd_reply.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_conf.h" +#include "s_user.h" +#include "send.h" + +#include <assert.h> + +/* + * m_admin - generic message handler + * + * parv[0] = sender prefix + * parv[1] = servername + */ +int m_admin(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + assert(0 != cptr); + assert(cptr == sptr); + + if (parc > 1) + { + sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, sptr->name); + return 0; + } + + return send_admin_info(sptr, find_admin()); +} + +#define HEAD_IN_SAND_REMOTE 0 /* Provisional */ +/* + * mo_admin - oper message handler + * + * parv[0] = sender prefix + * parv[1] = servername + */ +int mo_admin(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + assert(0 != cptr); + assert(cptr == sptr); + + if (parc > 1) + { + struct Client *acptr; + if (!(acptr = find_match_server(parv[1]))) + return send_error_to_client(sptr, ERR_NOSUCHSERVER, parv[1]); + + parv[1] = acptr->name; +#ifdef P09_SUPPORT + if (hunt_server(HEAD_IN_SAND_REMOTE, cptr, sptr, ":%s " MSG_ADMIN " :%s", + 1, parc, parv) != HUNTED_ISME) +#else + if (hunt_server(HEAD_IN_SAND_REMOTE, cptr, sptr, "%s%s " TOK_ADMIN " :%s", + 1, parc, parv) != HUNTED_ISME) +#endif + return 0; + } + return send_admin_info(sptr, find_admin()); +} + + +/* + * ms_admin - server message handler + * + * parv[0] = sender prefix + * parv[1] = servername + */ +int ms_admin(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + assert(0 != cptr); + assert(0 != sptr); + + if (parc < 2) + return 0; + +#ifdef P09_SUPPORT + if (hunt_server(0, cptr, sptr, ":%s " MSG_ADMIN " :%s", 1, parc, + parv) != HUNTED_ISME) +#else + if (hunt_server(0, cptr, sptr, "%s%s " TOK_ADMIN " :%s", 1, parc, + parv) != HUNTED_ISME) +#endif + return 0; + + return send_admin_info(sptr, find_admin()); +} Index: ircdh/ircd/m_rename.c diff -u /dev/null ircdh/ircd/m_rename.c:1.1 --- /dev/null Thu Oct 24 02:59:51 2002 +++ ircdh/ircd/m_rename.c Thu Oct 24 02:59:41 2002 @@ -0,0 +1,237 @@ +/* + * IRC - Internet Relay Chat, ircd/m_rename.c + * Copyright (C) 2000 IRC-Hispano.org - ESNET - jcea + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: m_rename.c,v 1.1 2002/10/24 09:59:41 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "client.h" + +#include <assert.h> + +#ifdef BDD +int m_rename(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + char buf[NICKLEN + 2]; + char buf2[NICKLEN + 1024]; + aClient *acptr; + aClient *bcptr; + char nick[NICKLEN + 2]; + + if (!IsServer(cptr) || !IsServer(sptr) || parc != 2) + return 0; + + if (!find_conf_host(cptr->confs, sptr->name, CONF_UWORLD) + || (sptr->from != cptr)) + { + sendto_serv_butone(cptr, + ":%s DESYNC :HACK(4): El nodo '%s' dice que '%s' solicita " + "cambio de nick para '%s'", me.name, cptr->name, sptr->name, parv[1]); + sendto_op_mask(SNO_HACK4 | SNO_SERVKILL | SNO_RENAME | SNO_RENAME2, + "HACK(4): El nodo '%s' dice que '%s' solicita " + "cambio de nick para '%s'", cptr->name, sptr->name, parv[1]); + return 0; + } + +#ifdef P09_SUPPORT + sendto_serv_butone(cptr, ":%s RENAME :%s", sptr->name, parv[1]); + sendto_serv_butone(cptr, ":%s RENAME :%s", sptr->name, parv[1]); +#else + sendto_serv_butone(cptr, ":%s RENAME :%s", sptr -, parv[1]); +#endif + + sendto_op_mask(SNO_RENAME, + "El nodo '%s' solicita un cambio de nick para '%s'", sptr->name, parv[1]); + + strncpy(buf, parv[1], sizeof(buf)); + buf[sizeof(buf) - 1] = '\0'; + + if (!do_nick_name(buf)) + return 0; + + if (FindServer(buf)) + return 0; + + acptr = FindClient(buf); + + if (!acptr || !MyConnect(acptr)) + return 0; + + { + unsigned int v[2], k[2], x[2]; + + k[0] = k[1] = x[0] = x[1] = 0; + + v[0] = base64toint(acptr->yxx); + v[1] = base64toint(me.yxx); + + bcptr = acptr; + + do + { + tea(v, k, x); + v[1] += 4096; +/* +** El 'if' que sigue lo necesitamos +** para que todos los valores tengan +** la misma probabilidad. +*/ + if (x[0] >= 4294000000ul) + continue; + sprintf_irc(nick, "inv%.6d", (int)(x[0] % 1000000)); + bcptr = FindClient(nick); + } + while (bcptr); + } + + sendto_op_mask(SNO_RENAME | SNO_RENAME2, + "Cambiamos el nick '%s' a '%s', a peticion del nodo '%s'", parv[1], nick, + sptr->name); + + { + static void send_umode_out(struct Client *a, struct Client *b, int c, int d, + int e); + int of, oh; + + of = acptr->flags; + oh = acptr->hmodes; + + if (IsNickRegistered(acptr) || IsNickSuspended(acptr)) + { /* Parche DB69 */ + ClearNickRegistered(acptr); + ClearNickSuspended(acptr); + ClearHelpOp(acptr); +#if defined(BDD) && defined(BDD_VIP) +#if !defined(BDD_VIP2) + if (MyConnect(acptr)) + { + if (!db_buscar_registro(BDD_IPVIRTUAL2DB, acptr->name) + && !db_buscar_registro(BDD_IPVIRTUALDB, acptr->name)) + { + ClearHidden(acptr); + } + } +#endif +#endif + if (!IsAnOper(acptr)) + ClearHiddenViewer(acptr); + send_umode_out(cptr, acptr, of, oh, IsRegistered(acptr)); + } + } + + acptr->lastnick = now; + + /* Esto manda una copia al propio usuario */ + sendto_common_channels(acptr, ":%s " MSG_NICK " :%s", acptr->name, nick); + add_history(acptr, 1); + +#ifdef P09_SUPPORT + sendto_lowprot_butone(cptr, 9, + ":%s " MSG_NICK " %s " TIME_T_FMT, acptr->name, nick, acptr->lastnick); + sendto_highprot_butone(cptr, 10, + "%s%s " MSG_NICK " %s " TIME_T_FMT, NumNick(acptr), nick, + acptr->lastnick); +#else + sendto_serv_butone(cptr, + "%s%s " TOK_NICK " %s " TIME_T_FMT, NumNick(acptr), nick, + acptr->lastnick); +#endif + + if (acptr->name[0]) + { + hRemClient(acptr); + /* + * Avisamos a sus contactos que el nick + * ha salido (ha cambiado de nick). + */ + chequea_estado_watch(acptr, RPL_LOGOFF, NULL, NULL); + + } + strcpy(acptr->name, nick); + hAddClient(acptr); + +#ifdef BDD_VIP + acptr->user->virtualhost[0] = '\0'; +#endif + /* + * Avisamos a sus contactos que el nick + * ha entrado (ha cambiado de nick). + */ + chequea_estado_watch(acptr, RPL_LOGON, NULL, NULL); + + return 0; +} +#endif ----------------------- End of diff ----------------------- |
From: Zolty <zo...@us...> - 2002-10-24 09:38:13
|
Update of /cvsroot/irc-dev/ircdh/ircd/test In directory usw-pr-cvs1:/tmp/cvs-serv28539/test Log Message: Directory /cvsroot/irc-dev/ircdh/ircd/test added to the repository |
From: Zolty <zo...@us...> - 2002-08-22 22:07:22
|
Update of /cvsroot/irc-dev/ircdh In directory usw-pr-cvs1:/tmp/cvs-serv27992 Modified Files: TODO_IRCDEV Log Message: Actualizacion Todo Index: TODO_IRCDEV =================================================================== RCS file: /cvsroot/irc-dev/ircdh/TODO_IRCDEV,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TODO_IRCDEV 15 Aug 2002 23:10:14 -0000 1.3 +++ TODO_IRCDEV 22 Aug 2002 22:07:12 -0000 1.4 @@ -1,8 +1,8 @@ Fichero TODO de IRC-DEV. +Cosas Pendientes: Acciones Prioridad ============================================ - - P10: Usar 100% numericos. Media - P10: Usar tokens en los comandos. Media - Eliminar el soporte P09. Baja @@ -11,14 +11,15 @@ - Nuevo ircd.conf usando bison Media - Mover la mayoria de las preguntas del make config a un .conf Baja - - Comando WALLUSERS Media - Version Windows WIN32/WIN64 Muy Baja - Cambios en varios numericos Media -Cambios en varios numericos ------------------------------------------------------------------- +Documentacion: + +2002-08-15 Cambios en varios numericos Media +------------------------------------------------------------------------ Mover numerico de /STATS E, 239 (Hispano) al 223 (Dalnet). Por colision de numericos con nuevas features de undernet, hay que @@ -38,3 +39,51 @@ Seria conveniente avisar a Undernet de los numericos utilizados para que los reserven. + + +2002-07-26 Version Windows WIN32/WIN64 Baja +------------------------------------------------------------------------ +Hacer el port, con un makefile especifico para solo win32 desde la +consola del visual C, mas un directorio para compilar con el entorno +grafico del visual C. + +Crear un os_windows.c con los defines y macros propios de windows, para +pasarlo a ircd_osdep.c al compilar. Lo mismo con la gestion de sockets. + +Lo ideal es ir haciendo en cuando tengamos toda la migracion hecha y +con las preguntas del make config en el ircd.conf ya que un "make config" +en windows es un rollo. + + +2002-07-26 Comando WALLUSERS Media +------------------------------------------------------------------------ +Implementacion de una variante de WALLOPS, que la diferencia es que +los WALLUSERS, lo pueden recibir todos los usuarios, y los WALLOPS +solo los ircops y helpers, los que tienen +w claro. + + +2002-07-26 Mover preguntas del make config a un .conf Media +------------------------------------------------------------------------ + + +2002-07-26 Nuevo ircd.conf usando bison Media +------------------------------------------------------------------------ + + +2002-07-26 Cada comando un .c Alta +------------------------------------------------------------------------ + + +2002-07-26 Soporte IPv6 Media +------------------------------------------------------------------------ + +2002-07-26 Eliminar el soporte P09. Baja +------------------------------------------------------------------------ + + +2002-07-26 P10: Usar tokens en los comandos. Media +------------------------------------------------------------------------ + + +2002-07-26 P10: Usar 100% numericos. Media +------------------------------------------------------------------------ |
From: Zolty <zo...@us...> - 2002-08-22 20:27:17
|
Update of /cvsroot/irc-dev/ircdh/ircd In directory usw-pr-cvs1:/tmp/cvs-serv8672/ircdh/ircd Modified Files: IPcheck.c channel.c hash.c ircd_string.c match.c querycmds.c s_bdd.c s_debug.c s_err.c s_user.c support.c table_gen.c version.c.SH Log Message: 2002-08-22 Toni Garcia <zo...@ir...> 1.0.alpha9 * En los parches anteriores, hice un cambio: - El modo +R lo puede poner CUALQUIERA. * Sincronizacion Hispano u2.10.H.05.16 al u2.10.H.04.24. * ircd/querycmds.c: En el /VERSION, hago que se muestre el version hispano equivalente. Solo es provisional, se quitara en el futuro, junto con los mensajes de parches de ESNET-Hispano. * include/patchlevel.h: Limpieza en el codigo. Y renombramos el ircd como "IRC-Dev 1.0.alpha9". Index: IPcheck.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/IPcheck.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- IPcheck.c 21 Aug 2002 17:59:40 -0000 1.4 +++ IPcheck.c 22 Aug 2002 20:27:13 -0000 1.5 @@ -27,17 +27,17 @@ #include "client.h" #endif #include "ircd.h" -#include "numnicks.h" /* NumNick, NumServ (GODMODE) */ +#include "numnicks.h" /* NumNick, NumServ (GODMODE) */ #if 0 #include "ircd_alloc.h" #endif -#include "s_bsd.h" /* SetIPChecked */ -#include "s_debug.h" /* Debug */ -#include "s_user.h" /* TARGET_DELAY */ +#include "s_bsd.h" /* SetIPChecked */ +#include "s_debug.h" /* Debug */ +#include "s_user.h" /* TARGET_DELAY */ #include "send.h" #include <assert.h> -#include <stdio.h> /* NULL ... bleah */ +#include <stdio.h> /* NULL ... bleah */ /* Provisional */ #include "h.h" Index: channel.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/channel.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- channel.c 21 Aug 2002 17:59:40 -0000 1.4 +++ channel.c 22 Aug 2002 20:27:13 -0000 1.5 @@ -546,10 +546,12 @@ { Reg1 Link *lp; + if (IsChannelService(cptr) #if defined(BDD) - if (IsServicesBot(cptr)) - return 0; /* siempre pueden */ + || (IsServicesBot(cptr)) #endif + ) + return 0; /* siempre pueden */ lp = IsMember(cptr, chptr); @@ -2646,7 +2648,8 @@ * Rebuild list of channels joined to be the actual result of the * JOIN. Note that "JOIN 0" is the destructive problem. */ - for (name = ircd_strtok(&p, parv[1], ","); name; name = ircd_strtok(&p, NULL, ",")) + for (name = ircd_strtok(&p, parv[1], ","); name; + name = ircd_strtok(&p, NULL, ",")) { size_t len; if (MyConnect(sptr)) @@ -2914,7 +2917,8 @@ if (*jbuf) { /* check for channels that need TS's */ p = NULL; - for (name = ircd_strtok(&p, jbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) + for (name = ircd_strtok(&p, jbuf, ","); name; + name = ircd_strtok(&p, NULL, ",")) { chptr = get_channel(sptr, name, !CREATE); if (chptr && chptr->mode.mode & MODE_SENDTS) @@ -2956,7 +2960,8 @@ if (*mbuf) { /* ok, send along modes for creation events to P9 */ p = NULL; - for (name = ircd_strtok(&p, mbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) + for (name = ircd_strtok(&p, mbuf, ","); name; + name = ircd_strtok(&p, NULL, ",")) { chptr = get_channel(sptr, name, !CREATE); sendto_lowprot_butone(cptr, 9, ":%s MODE %s +o %s " TIME_T_FMT, @@ -3041,7 +3046,8 @@ *cbuf = '\0'; /* Start with empty buffer */ /* For each channel in the comma seperated list: */ - for (name = ircd_strtok(&p, parv[1], ","); name; name = ircd_strtok(&p, NULL, ",")) + for (name = ircd_strtok(&p, parv[1], ","); name; + name = ircd_strtok(&p, NULL, ",")) { badop = 0; /* Default is to accept the op */ if ((chptr = FindChannel(name))) @@ -3127,7 +3133,8 @@ is not needed after all are 2.10 */ sendto_lowprot_butone(cptr, 9, ":%s JOIN %s", parv[0], cbuf); p = NULL; - for (name = ircd_strtok(&p, cbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) + for (name = ircd_strtok(&p, cbuf, ","); name; + name = ircd_strtok(&p, NULL, ",")) sendto_lowprot_butone(cptr, 9, ":%s MODE %s +o %s " TIME_T_FMT, sptr->user->server->name, name, parv[0], chanTS); #endif @@ -4449,9 +4456,8 @@ if (is_silenced(sptr, acptr)) { - sendto_one(sptr, - ":%s NOTICE %s :You can't talk to %s. (S)he is silencing you", me.name, - sptr->name, acptr->name); + sendto_one(sptr, err_str(ERR_ISSILENCING), me.name, sptr->name, + acptr->name); return 0; } Index: hash.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/hash.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- hash.c 21 Aug 2002 17:59:40 -0000 1.4 +++ hash.c 22 Aug 2002 20:27:13 -0000 1.5 @@ -498,7 +498,8 @@ strncpy(temp, nicks, 512); temp[512] = '\000'; p = NULL; - for (one = ircd_strtok(&p, temp, ","); one; one = ircd_strtok(&p, NULL, ",")) + for (one = ircd_strtok(&p, temp, ","); one; + one = ircd_strtok(&p, NULL, ",")) { if (!*one) continue; Index: ircd_string.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/ircd_string.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ircd_string.c 21 Aug 2002 17:59:40 -0000 1.1 +++ ircd_string.c 22 Aug 2002 20:27:13 -0000 1.2 @@ -41,27 +41,27 @@ */ char *ircd_strtok(char **save, char *str, char *fs) { - char *pos = *save; /* keep last position across calls */ + char *pos = *save; /* keep last position across calls */ char *tmp; if (str) - pos = str; /* new string scan */ + pos = str; /* new string scan */ while (pos && *pos && strchr(fs, *pos) != NULL) - pos++; /* skip leading separators */ + pos++; /* skip leading separators */ if (!pos || !*pos) - return (pos = *save = NULL); /* string contains only sep's */ + return (pos = *save = NULL); /* string contains only sep's */ - tmp = pos; /* now, keep position of the token */ + tmp = pos; /* now, keep position of the token */ while (*pos && strchr(fs, *pos) == NULL) - pos++; /* skip content of the token */ + pos++; /* skip content of the token */ if (*pos) - *pos++ = '\0'; /* remove first sep after the token */ + *pos++ = '\0'; /* remove first sep after the token */ else - pos = NULL; /* end of string */ + pos = NULL; /* end of string */ *save = pos; return (tmp); @@ -91,22 +91,22 @@ { p2 = NULL; for (t = ircd_strtok(&p2, cbuf, ","); t; t = ircd_strtok(&p2, NULL, ",")) - if (0 == ircd_strcmp(s, t)) - break; - else if (p2) - p2[-1] = ','; + if (0 == ircd_strcmp(s, t)) + break; + else if (p2) + p2[-1] = ','; } else t = NULL; if (!t) { if (l) - *(cp - 1) = ','; + *(cp - 1) = ','; else - l = 1; + l = 1; strcpy(cp, s); if (p) - cp += (p - s); + cp += (p - s); } else if (p2) p2[-1] = ','; @@ -121,7 +121,7 @@ * including asm library versions and memcpy, if compiled with the * optimizer on. (-O2 for gcc) --Bleep */ -char *ircd_strncpy(char* s1, const char* s2, size_t n) +char *ircd_strncpy(char *s1, const char *s2, size_t n) { char *endp = s1 + n; char *s = s1; @@ -136,8 +136,13 @@ #ifndef FORCEINLINE -NTL_HDR_strChattr { NTL_SRC_strChattr } -NTL_HDR_strCasediff { NTL_SRC_strCasediff } +NTL_HDR_strChattr +{ +NTL_SRC_strChattr} + +NTL_HDR_strCasediff +{ +NTL_SRC_strCasediff} #endif /* !FORCEINLINE */ /*============================================================================= @@ -163,7 +168,8 @@ const char *ra = a; const char *rb = b; - while (ToLower(*ra) == ToLower(*rb)) { + while (ToLower(*ra) == ToLower(*rb)) + { if (!*ra++) return 0; else @@ -183,7 +189,8 @@ int left = n; if (!left--) return 0; - while (ToLower(*ra) == ToLower(*rb)) { + while (ToLower(*ra) == ToLower(*rb)) + { if (!*ra++ || !left--) return 0; else @@ -218,35 +225,40 @@ assert(0 != list); assert(0 != vector); assert(0 < size); - + /* * ignore spurious tokens */ while (token == *start) ++start; - for (end = strchr(start, token); end; end = strchr(start, token)) { + for (end = strchr(start, token); end; end = strchr(start, token)) + { *end++ = '\0'; /* * ignore spurious tokens */ while (token == *end) ++end; - for (i = 0; i < count; ++i) { + for (i = 0; i < count; ++i) + { if (0 == ircd_strcmp(vector[i], start)) - break; + break; } - if (i == count) { + if (i == count) + { vector[count++] = start; if (count == size) - return count; + return count; } start = end; } - if (*start) { - for (i = 0; i < count; ++i) { + if (*start) + { + for (i = 0; i < count; ++i) + { if (0 == ircd_strcmp(vector[i], start)) - return count; + return count; } vector[count++] = start; } @@ -278,20 +290,22 @@ assert(0 != list); assert(0 != vector); assert(1 < size); - + vector[count++] = start; - for (end = strchr(start, token); end; end = strchr(start, token)) { + for (end = strchr(start, token); end; end = strchr(start, token)) + { *end++ = '\0'; start = end; - if (*start) { + if (*start) + { vector[count++] = start; if (count < size) - continue; + continue; } break; } return count; -} +} /* * host_from_uh - get the host.domain part of a us...@ho...main string @@ -317,18 +331,17 @@ * this new faster inet_ntoa was ripped from: * From: Thomas Helvey <to...@in...> */ -static const char *IpQuadTab[] = -{ - "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", - "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", - "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", - "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", - "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", - "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", - "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", - "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", - "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", - "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", +static const char *IpQuadTab[] = { + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", + "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", + "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", + "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", + "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", + "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", + "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", + "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", + "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", + "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", @@ -371,7 +384,7 @@ { char *p = buf; const unsigned char *a = (const unsigned char *)in; - const char* n; + const char *n; assert(0 != buf); assert(0 != in); @@ -413,13 +426,13 @@ static char buf[16]; unsigned char *s = (unsigned char *)&in.s_addr; unsigned char a, b, c, d; - + a = *s++; b = *s++; c = *s++; d = *s++; sprintf_irc(buf, "%u.%u.%u.%u", a, b, c, d); - + return buf; } @@ -432,15 +445,15 @@ int inet_netof(struct in_addr in) { int addr = in.s_net; - + if (addr & 0x80 == 0) return ((int)in.s_net); if (addr & 0x40 == 0) return ((int)in.s_net * 256 + in.s_host); - + return ((int)in.s_net * 256 + in.s_host * 256 + in.s_lh); -} +} #endif Index: match.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/match.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- match.c 21 Aug 2002 17:59:40 -0000 1.2 +++ match.c 22 Aug 2002 20:27:13 -0000 1.3 @@ -876,8 +876,7 @@ switch (*m) { case '\\': - if ((m[1] == '\\') || (m[1] == '*') || (m[1] == '?') - || (m[1] == '\0')) + if ((m[1] == '\\') || (m[1] == '*') || (m[1] == '?') || (m[1] == '\0')) break; continue; case '0': Index: querycmds.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/querycmds.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- querycmds.c 18 Aug 2002 22:59:22 -0000 1.3 +++ querycmds.c 22 Aug 2002 20:27:13 -0000 1.4 @@ -133,7 +133,8 @@ if (hunt_server(0, cptr, sptr, ":%s VERSION :%s", 1, parc, parv) == HUNTED_ISME) sendto_one(sptr, rpl_str(RPL_VERSION), - me.name, parv[0], version, debugmode, me.name, serveropts); + me.name, parv[0], version, debugmode, me.name, serveropts, + versionhispano); return 0; } Index: s_bdd.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_bdd.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- s_bdd.c 21 Aug 2002 17:59:40 -0000 1.5 +++ s_bdd.c 22 Aug 2002 20:27:13 -0000 1.6 @@ -300,10 +300,6 @@ { *reg3 = reg2; - if (reg->clave) - RunFree(reg->clave); - if (reg->valor) - RunFree(reg->valor); RunFree(reg); tabla_cuantos[tabla]--; break; @@ -329,23 +325,17 @@ /* lo borro primero, por si es un cambio */ db_eliminar_registro(tabla, clave); - c = RunMalloc(strlen(clave) + 1); - if (!c) - return; - v = RunMalloc(strlen(valor) + 1); - if (!v) - { - RunFree(c); - return; - } +/* +** Guardamos los datos del registro justo al lado del registro, para +** reducir la ocupacion de memoria y, sobre todo, el numero de +** Mallocs. +*/ + reg = + RunMalloc(sizeof(struct db_reg) + strlen(clave) + 1 + strlen(valor) + 1); + assert(reg); - reg = RunMalloc(sizeof(struct db_reg)); - if (!reg) - { - RunFree(c); - RunFree(v); - return; - } + c = (char *)reg + sizeof(struct db_reg); + v = c + strlen(clave) + 1; strcpy(c, clave); strcpy(v, valor); @@ -428,7 +418,7 @@ /* * db_es_miembro (tabla, clave, subcadena) * - * varor registro es una lista separada por comas, y si subcadena es + * valor registro es una lista separada por comas, y si subcadena es # una de ellas, retorna la posicion, sino 0 * 1999/07/03 sa...@ap... */ @@ -899,10 +889,6 @@ for (reg = tabla_datos[que_bdd][i]; reg != NULL; reg = reg2) { reg2 = reg->next; - if (reg->clave) - RunFree(reg->clave); - if (reg->valor) - RunFree(reg->valor); RunFree(reg); } tabla_datos[que_bdd][i] = NULL; Index: s_debug.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_debug.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- s_debug.c 18 Aug 2002 22:59:22 -0000 1.4 +++ s_debug.c 22 Aug 2002 20:27:13 -0000 1.5 @@ -224,7 +224,7 @@ '-', #endif #endif - 'D','B','9','5', + 'D','B','9','6', #ifdef BDD '+', #else Index: s_err.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_err.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- s_err.c 15 Aug 2002 23:10:15 -0000 1.4 +++ s_err.c 22 Aug 2002 20:27:13 -0000 1.5 @@ -43,7 +43,7 @@ {RPL_CREATED, ":This server was created %s"}, /* 004 */ #if defined(BDD) && defined(BDD_VIP) - {RPL_MYINFO, "%s %s dioswkgxXrhS biklmnopstvrR"}, + {RPL_MYINFO, "%s %s dioswkgxXrRhS biklmnopstvrR"}, #elif defined(BDD) {RPL_MYINFO, "%s %s dioswkgrhS biklmnopstvrR"}, #else @@ -263,8 +263,13 @@ {ERR_ISCHANSERVICE, "%s %s :Cannot kick or deop channel service"}, /* 485 */ {0, (char *)NULL}, +#ifdef BDD +/* 486 */ + {ERR_NONONREG, ":You need +r mode to send a private message to user %s"}, +#else /* 486 */ {0, (char *)NULL}, +#endif /* 487 */ {0, (char *)NULL}, /* 488 */ @@ -312,7 +317,7 @@ /* 509 */ {0, (char *)NULL}, /* 510 */ - {0, (char *)NULL}, + {ERR_ISSILENCING, ":You can't talk to %s. (S)he is silencing you"}, /* 511 */ {ERR_SILELISTFULL, "%s :Your silence list is full"}, #ifdef WATCH @@ -442,7 +447,7 @@ /* 350 */ {0, (char *)NULL}, /* 351 */ - {RPL_VERSION, "%s.%s %s :%s"}, + {RPL_VERSION, "%s.%s %s :%s %s"}, /* 352 */ {RPL_WHOREPLY, "%s"}, /* 353 */ Index: s_user.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_user.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- s_user.c 21 Aug 2002 17:59:40 -0000 1.7 +++ s_user.c 22 Aug 2002 20:27:13 -0000 1.8 @@ -290,6 +290,7 @@ return (ch - nick); } + #if 0 /* * canonize @@ -764,6 +765,7 @@ sprintf(buf, "NICKLEN=%d AWAYLEN=%d QUITLEN=%d CHANNELLEN=%d" "KICKLEN=%d TOPICLEN=%d", NICKLEN, AWAYLEN, QUITLEN, CHANNELLEN, KICKLEN, TOPICLEN); + sendto_one(sptr, rpl_str(RPL_ISUPPORT), me.name, nick, buf); sprintf(buf, "CHANMODES=b,k,l,imnpst"); #if defined(BDD) @@ -820,6 +822,7 @@ HMODE_HIDDENVIEWER, 'X', HMODE_SERVICESBOT, 'B', HMODE_NICKSUSPENDED, 'S', + HMODE_MSGONLYREG, 'R', 0, 0 }; #endif /* BDD */ @@ -2028,6 +2031,15 @@ { if (MyUser(sptr) && check_target_limit(sptr, acptr, acptr->name, 0)) continue; +#ifdef BDD + if (MyUser(sptr) && IsMsgOnlyReg(acptr) && !IsNickRegistered(sptr) + && !IsAnOper(sptr)) + { + sendto_one(sptr, err_str(ERR_NONONREG), me.name, parv[0], + acptr->name); + continue; + } +#endif if (!is_silenced(sptr, acptr)) { if (!notice && MyConnect(sptr) && acptr->user && acptr->user->away) @@ -2048,15 +2060,13 @@ { if (MyUser(sptr) || (Protocol(sptr->from) < 10)) { - sendto_one(sptr, - ":%s NOTICE %s :You can't talk to %s. (S)he is silencing you", - me.name, sptr->name, acptr->name); + sendto_one(sptr, err_str(ERR_ISSILENCING), me.name, sptr->name, + acptr->name); } else { - sendto_one(sptr, - ":%s NOTICE %s%s :You can't talk to %s. (S)he is silencing you", - me.name, NumNick(sptr), acptr->name); + sendto_one(sptr, err_str(ERR_ISSILENCING), me.name, sptr->name, + acptr->name); } } } @@ -2253,15 +2263,13 @@ { if (MyUser(sptr) || (Protocol(sptr->from) < 10)) { - sendto_one(sptr, - ":%s NOTICE %s :You can't talk to %s. (S)he is silencing you", - me.name, sptr->name, tcptr->name); + sendto_one(sptr, err_str(ERR_ISSILENCING), me.name, sptr->name, + tcptr->name); } else { - sendto_one(sptr, - ":%s NOTICE %s%s :You can't talk to %s. (S)he is silencing you", - me.name, NumNick(sptr), tcptr->name); + sendto_one(sptr, err_str(ERR_ISSILENCING), me.name, sptr->name, + tcptr->name); } return 0; } Index: support.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/support.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- support.c 21 Aug 2002 17:59:40 -0000 1.4 +++ support.c 22 Aug 2002 20:27:13 -0000 1.5 @@ -28,7 +28,7 @@ #include "support.h" #include "sys.h" -#include <signal.h> /* kill */ +#include <signal.h> /* kill */ #include <stdarg.h> #include <stdio.h> #include <string.h> Index: table_gen.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/table_gen.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- table_gen.c 21 Aug 2002 17:59:40 -0000 1.1 +++ table_gen.c 22 Aug 2002 20:27:14 -0000 1.2 @@ -99,7 +99,7 @@ moveMacro(NTL_GRAPH, NTL_PRINT); markString(NTL_PRINT, " "); - markRange(NTL_IRCCH, 0, (char) UCHAR_MAX); + markRange(NTL_IRCCH, 0, (char)UCHAR_MAX); unMarkString(NTL_IRCCH, "\007\040\054\240"); markRange(NTL_IRCCL, '\300', '\326'); @@ -344,5 +344,3 @@ printf("\n"); } } - - Index: version.c.SH =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/version.c.SH,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- version.c.SH 18 Aug 2002 22:49:43 -0000 1.3 +++ version.c.SH 22 Aug 2002 20:27:14 -0000 1.4 @@ -71,10 +71,8 @@ const char *generation = "$generation"; const char *creation = "$creation"; -const char *version = "$cvsversion" PATCH2 PATCH3 PATCH4 PATCH5 PATCH6\ - PATCH7 PATCH8 PATCH9 PATCH10 PATCH11 PATCH12 PATCH13 PATCH14 PATCH15\ - PATCH16 PATCH17 PATCH18 PATCH19 PATCH20 PATCH21 PATCH22 PATCH23 PATCH24\ - PATCH25 PATCH26 PATCH27 PATCH28 PATCH29 PATCH30 PATCH31 PATCH32; +const char *version = "IRC-Dev" RELEASE PATCHLEVEL; +const char *versionhispano = "$cvsversion"; const char *infotext[] = { "IRC --", |
From: Zolty <zo...@us...> - 2002-08-22 20:27:16
|
Update of /cvsroot/irc-dev/ircdh In directory usw-pr-cvs1:/tmp/cvs-serv8672/ircdh Modified Files: .patches CAMBIOS2_10_H_05 ChangeLog todo.jcea Log Message: 2002-08-22 Toni Garcia <zo...@ir...> 1.0.alpha9 * En los parches anteriores, hice un cambio: - El modo +R lo puede poner CUALQUIERA. * Sincronizacion Hispano u2.10.H.05.16 al u2.10.H.04.24. * ircd/querycmds.c: En el /VERSION, hago que se muestre el version hispano equivalente. Solo es provisional, se quitara en el futuro, junto con los mensajes de parches de ESNET-Hispano. * include/patchlevel.h: Limpieza en el codigo. Y renombramos el ircd como "IRC-Dev 1.0.alpha9". Index: .patches =================================================================== RCS file: /cvsroot/irc-dev/ircdh/.patches,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- .patches 6 Aug 2002 18:45:19 -0000 1.8 +++ .patches 22 Aug 2002 20:27:12 -0000 1.9 @@ -1 +1 @@ -u2.10.H.05.16+IRCDEV.00 +u2.10.H.05.24 Index: CAMBIOS2_10_H_05 =================================================================== RCS file: /cvsroot/irc-dev/ircdh/CAMBIOS2_10_H_05,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CAMBIOS2_10_H_05 6 Aug 2002 18:45:19 -0000 1.7 +++ CAMBIOS2_10_H_05 22 Aug 2002 20:27:12 -0000 1.8 @@ -1,5 +1,64 @@ $Id$ +* 2002/08/22 jc...@ar... (u2.10.H.05.24) FEATURE + ----------------------------------------------------------------------- + Con el crecimiento de IRC-Hispano (mas de 45.000 usuarios simultaneos, + mas de 15.000 canales simultaneos), tener un limite de 30 baneos por + canal es un poco pobre. Lo amplio a 75. + +* 2002/08/20 zo...@ir... (u2.10.H.05.23) CLEANUP + ----------------------------------------------------------------------- + Se documenta el archivo numeric.h con los RPL/ERR que se usan en varios + ircd's de redes como Undernet, IRCnet, EFNet, DalNet, PTLink y daemones + como Unreal, aircd,... + + Se ha basado en el numeric.h del u2.10.12 de Undernet, visible en + http://coder-com.undernet.org/cgi-bin/cvsweb.cgi/ircu2.10/include/numeric.h + ?rev=1.23&content-type=text/x-cvsweb-markup&only_with_tag=MAIN + +* 2002/08/20 zo...@ir... (u2.10.H.05.22) CLEANUP + ----------------------------------------------------------------------- + Para la respuesta del comando USERIP, ahora se utiliza el "numeric" + 340, como en Undernet, en vez de los "numeric" 307 (compilacion sin BDD) + y 380 (compilacion con BDD). + +* 2002/08/13 ni...@ir... (u2.10.H.05.21) CLEANUP + ----------------------------------------------------------------------- + Las notificaciones al ususario de que esta silenciado se hacen con un + numeric en vez de usar un notice del servidor. Utilizamos el 510 para + ello. + +* 2002/08/13 ni...@ir... (u2.10.H.05.20) FEATURE + ----------------------------------------------------------------------- + Nuevo modo de usuario, el +R, que solo permite recibir mensajes privados + de usuarios que tengan modo +r. Al contrario que en DalNet, este modo va + ligado con el +r, perdiendolo cuando perdamos el +r. Un ircop, aunque no + tenga modo +r, puede hablar a un +R. + + Se utiliza el numerico 486 que es el utilizado en DalNet. + +* 2002/08/12 jc...@ar... (DB96 - u2.10.H.05.19) FEATURE + ----------------------------------------------------------------------- + Reescribo algunas rutinas de la BDD. Ahora el alta de un nuevo registro + supone un unico MALLOC en vez de tres. Idem los FREE. Ello supone un + menor consumo de memoria, una mayor "localidad" en las referencias + y un mayor rendimiento en general. + + Aun se puede optimizar mas, pero vayamos poco a poco... + +* 2002/08/11 ni...@ir... (u2.10.H.05.18) FIX + ----------------------------------------------------------------------- + Cuando un usuario +k, al hacer PART de un canal donde esta baneado, o + sin voz ni op en el mismo estando el canal +m, se ha de poder ver su + mensaje de salida del canal (si lo especifica). Analogamente, para + cuando lo que se hace es un QUIT. + +* 2002/08/06 ni...@ir... (u2.10.H.05.17) FIX + ----------------------------------------------------------------------- + Una macro mas: + + KICKLEN: longitud maxima del mensaje de kick. + * 2002/08/06 ni...@ir... (u2.10.H.05.16) FEATURE ----------------------------------------------------------------------- Se introducen dos nuevas macros: @@ -12,7 +71,7 @@ En la lista de features devueltas por el numeric 005, se introducen esas dos tambien. - + * 2002/08/06 ni...@ir... (u2.10.H.05.15) CLEANUP ----------------------------------------------------------------------- Analogamente a lo que ya se hace en las caidas por "Ping Timeout", en Index: ChangeLog =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ChangeLog,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ChangeLog 21 Aug 2002 17:59:39 -0000 1.3 +++ ChangeLog 22 Aug 2002 20:27:13 -0000 1.4 @@ -1,4 +1,17 @@ -2002-08-21 Toni Garcia <zo...@ir...> +2002-08-22 Toni Garcia <zo...@ir...> 1.0.alpha9 + * En los parches anteriores, hice un cambio: + - El modo +R lo puede poner CUALQUIERA. + + * Sincronizacion Hispano u2.10.H.05.16 al u2.10.H.04.24. + + * ircd/querycmds.c: En el /VERSION, hago que se muestre el version hispano + equivalente. Solo es provisional, se quitara en el futuro, junto con los + mensajes de parches de ESNET-Hispano. + + * include/patchlevel.h: Limpieza en el codigo. Y renombramos el ircd como + "IRC-Dev 1.0.alpha9". + +2002-08-21 Toni Garcia <zo...@ir...> 1.0.alpha8 * ircd/common.c/.h: Ha sido eliminado. * ircd/table_gen: La tabla de caracteres que estaba en common.c ha sido colocado @@ -13,7 +26,7 @@ este fichero "ChangeLog". -2002-08-19 Toni Garcia <zo...@ir...> +2002-08-19 Toni Garcia <zo...@ir...> 1.0.alpha7 * "Make indent": A partir de ahora es obligatorio hacer un make indent ANTES de hacer un commit. @@ -42,7 +55,7 @@ Pero aun no estan implementadas. -2002-08-16 Toni Garcia <zo...@ir...> +2002-08-16 Toni Garcia <zo...@ir...> 1.0.alpha6 Documentacion de los numericos utilizados en las redes mundiales para ver los numericos libres y los que estan en conflicto. @@ -50,7 +63,7 @@ utiliza en undernet. -2002-08-15 Toni Garcia <zo...@ir...> +2002-08-15 Toni Garcia <zo...@ir...> 1.0.alpha5 Comienzo de la ordenacion del codigo. * Muevo todos los defines del whocmds.c al .h ya que nos hara falta cuando pongamos cada comando, un *.c. @@ -77,7 +90,7 @@ * Se mueven los defines *LEN y similiares al nuevo fichero ircd_defs.h. -2002-08-06 Toni Garcia <zo...@ir...> +2002-08-06 Toni Garcia <zo...@ir...> 1.0.alpha4 Sincronizacion con u2.10.H.05.16 y varios cambios. * include/{struct.h|channel.h}: Nuevas macros KICKLEN, AWAYLEN y QUITLEN independientemente del TOPICLEN. @@ -93,31 +106,25 @@ estetica del mismo. -2002-08-03 Toni Garcia <zo...@ir...> +2002-08-03 Toni Garcia <zo...@ir...> 1.0.alpha3 * {ircd|include}/whowas.{c|h}: Ver ips reales y/o virtuales segun si tienes +X o no al ejecutar el comando WHOWAS sobre un nick. -2002-08-01 Toni Garcia <zo...@ir...> +2002-08-01 Toni Garcia <zo...@ir...> 1.0.alpha2 Sincronizacion con u2.10.H.05.14. * doc/ejemplo.conf: Cambios esteticos. * ircd/chkconf.c: El rango de numericos es 0-4095, no 1-64. -2002-07-27 Toni Garcia <zo...@ir...> - Sincronizacion con u2.10.H.05.11. +2002-07-27 Toni Garcia <zo...@ir...> 1.0.alpha1 + Sincronizacion con u2.10.H.05.09-11. Implementacion de lineas E. * ircd/crypt/tea/*: Soporte Windows para el programa cifranick. - -2002-07-27 Toni Garcia <zo...@ir...> - Sincronizacion con u2.10.H.05.10. * doc/ejemplo.conf: Explicacion y ejemplos de E y F lines. - -2002-07-27 Toni Garcia <zo...@ir...> - Sincronizacion con u2.10.H.05.09. Implementacion de las lineas E. * ircd/chkconf.c: Parseo de la linea E. * ircd/s_conf.c: Parseo de la linea E, nueva funcion find_exception() y modificacion en find_kill() para que si tiene una E-line, no pueda @@ -133,8 +140,6 @@ * include/numeric.h: Definicion del numerico de las E-Lines en el numerico 239. - -2002-07-27 Toni Garcia <zo...@ir...> * config/config-in.sh: Nueva pregunta en el "make config" para el nombre de la red. @@ -144,14 +149,10 @@ * ircd/s_user.c: Modificar los raw 001 y 005. - -2002-07-27 Toni Garcia <zo...@ir...> * config/config-in.sh: Cambios en los valores de por defecto de: - WATCH: pasa de ser 96 a 128 - CLIENT_FLOOD: pasa de ser 1024 a 2048 - UID/GID: Y por defecto ya que es necesario - -2002-07-27 Toni Garcia <zo...@ir...> * include/patchlevel.h: Actualizacion de la version en el define PATCH1 que estaba en H.01. Index: todo.jcea =================================================================== RCS file: /cvsroot/irc-dev/ircdh/todo.jcea,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- todo.jcea 1 Aug 2002 21:24:38 -0000 1.4 +++ todo.jcea 22 Aug 2002 20:27:13 -0000 1.5 @@ -1,5 +1,29 @@ $Id$ +13/Ago/02 +La variable que contiene losmodos de usuario esta superpoblada y +apenas le queda ya algun bit libre. Habia que mover lo que son +flags internos del usuario (si se le ha hecho PING o no, si es TS8, etc) +a una variable separada, preferiblemente que exista SOLO cuando el +usuario/conexion es local. + +13/Ago/02 +Cuando un usuario esta silenciado, recibe un "notice" del servidor, +informandole de este hecho. Eso deberia cambiarse por un NUMERIC. + +06/Ago/02 +Poder poner, al conectar, una clave de servidor y otra de nick, al mismo tiempo. + +06/Ago/02 +Documentar en el registro (irc.org) correspondiente el uso +de QUITLEN y AWAYLEN. + +05/Ago/02 +Estudiar la conveniencia de que el taman~o del comentario de los +QUIT y de las GLINES no este vinculado a TOPICLEN. El problema se +nota cuando un usuario tiene una IP Virtual larga, que se puede +cortar cuando le cae una GLINE. + 29/Jul/02: Canal con +n, status del usuario sin +o ni +v, ban al nick unicamente, cuando se cambia de nick y se pone otra vez el baneado, puede escribir en el |
From: Zolty <zo...@us...> - 2002-08-22 20:27:16
|
Update of /cvsroot/irc-dev/ircdh/include In directory usw-pr-cvs1:/tmp/cvs-serv8672/ircdh/include Modified Files: channel.h ircd_chattr.h ircd_string.h patchlevel.h s_bsd.h version.h Log Message: 2002-08-22 Toni Garcia <zo...@ir...> 1.0.alpha9 * En los parches anteriores, hice un cambio: - El modo +R lo puede poner CUALQUIERA. * Sincronizacion Hispano u2.10.H.05.16 al u2.10.H.04.24. * ircd/querycmds.c: En el /VERSION, hago que se muestre el version hispano equivalente. Solo es provisional, se quitara en el futuro, junto con los mensajes de parches de ESNET-Hispano. * include/patchlevel.h: Limpieza en el codigo. Y renombramos el ircd como "IRC-Dev 1.0.alpha9". Index: channel.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/channel.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- channel.h 18 Aug 2002 22:59:22 -0000 1.5 +++ channel.h 22 Aug 2002 20:27:13 -0000 1.6 @@ -41,7 +41,7 @@ #define KEYLEN 23 #define CHANNELLEN 64 -#define MAXBANS 30 +#define MAXBANS 75 #define MAXBANLENGTH 1024 /* Index: ircd_chattr.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/ircd_chattr.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ircd_chattr.h 21 Aug 2002 17:59:40 -0000 1.1 +++ ircd_chattr.h 22 Aug 2002 20:27:13 -0000 1.2 @@ -41,32 +41,32 @@ /* * Character attribute macros */ -#define NTL_ALNUM 0x0001 /* (NTL_ALPHA | NTL_DIGIT) */ -#define NTL_ALPHA 0x0002 /* (NTL_LOWER | NTL_UPPER) */ -#define NTL_CNTRL 0x0004 /* \000 - \037 == 0x00 - 0x1F */ -#define NTL_DIGIT 0x0008 /* 0123456789 */ -#define NTL_GRAPH 0x0010 /* (NTL_ALNUM | NTL_PUNCT) */ -#define NTL_LOWER 0x0020 /* abcdefghijklmnopqrstuvwxyz{|}~ */ -#define NTL_PRINT 0x0040 /* (NTL_GRAPH | ' ') */ -#define NTL_PUNCT 0x0080 /* !"#$%&'()*+,-./:;<=>?@_` */ -#define NTL_SPACE 0x0100 /* \011\012\013\014\015\040 */ -#define NTL_UPPER 0x0200 /* ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ */ -#define NTL_IRCCH 0x0400 /* Channel's names charset */ -#define NTL_IRCCL 0x0800 /* Force toLower() in ch-name */ -#define NTL_IRCNK 0x1000 /* Nick names charset, aka isvalid() */ -#define NTL_IRCUI 0x2000 /* UserIDs charset, IRCHN plus tilde */ -#define NTL_IRCHN 0x4000 /* Hostnames charset (weak, RFC 1033) */ -#define NTL_IRCIP 0x8000 /* Numeric IPs charset (DIGIT and .) */ -#define NTL_EOL 0x10000 /* \r\n */ -#define NTL_KTIME 0x20000 /* Valid character for a k:line time */ -#define NTL_CHPFX 0x40000 /* channel prefix char # & + */ +#define NTL_ALNUM 0x0001 /* (NTL_ALPHA | NTL_DIGIT) */ +#define NTL_ALPHA 0x0002 /* (NTL_LOWER | NTL_UPPER) */ +#define NTL_CNTRL 0x0004 /* \000 - \037 == 0x00 - 0x1F */ +#define NTL_DIGIT 0x0008 /* 0123456789 */ +#define NTL_GRAPH 0x0010 /* (NTL_ALNUM | NTL_PUNCT) */ +#define NTL_LOWER 0x0020 /* abcdefghijklmnopqrstuvwxyz{|}~ */ +#define NTL_PRINT 0x0040 /* (NTL_GRAPH | ' ') */ +#define NTL_PUNCT 0x0080 /* !"#$%&'()*+,-./:;<=>?@_` */ +#define NTL_SPACE 0x0100 /* \011\012\013\014\015\040 */ +#define NTL_UPPER 0x0200 /* ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ */ +#define NTL_IRCCH 0x0400 /* Channel's names charset */ +#define NTL_IRCCL 0x0800 /* Force toLower() in ch-name */ +#define NTL_IRCNK 0x1000 /* Nick names charset, aka isvalid() */ +#define NTL_IRCUI 0x2000 /* UserIDs charset, IRCHN plus tilde */ +#define NTL_IRCHN 0x4000 /* Hostnames charset (weak, RFC 1033) */ +#define NTL_IRCIP 0x8000 /* Numeric IPs charset (DIGIT and .) */ +#define NTL_EOL 0x10000 /* \r\n */ +#define NTL_KTIME 0x20000 /* Valid character for a k:line time */ +#define NTL_CHPFX 0x40000 /* channel prefix char # & + */ /* * Tables used for translation and classification macros */ extern const char ToLowerTab_8859_1[]; extern const char ToUpperTab_8859_1[]; -extern const unsigned int IRCD_CharAttrTab[]; +extern const unsigned int IRCD_CharAttrTab[]; /* * Translation macros for channel name case translation @@ -102,4 +102,3 @@ #endif /* INCLUDED_ircd_chattr_h */ - Index: ircd_string.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/ircd_string.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ircd_string.h 21 Aug 2002 17:59:40 -0000 1.1 +++ ircd_string.h 22 Aug 2002 20:27:13 -0000 1.2 @@ -45,7 +45,7 @@ extern char *host_from_uh(char *buf, const char *userhost, size_t len); extern char *ircd_strtok(char **save, char *str, char *fs); #if 0 -extern char *sprintf_irc(char *str, const char *format, ...); +extern char *sprintf_irc(char *str, const char *format, ...); #endif extern char *canonize(char *buf); @@ -104,19 +104,17 @@ #else /* FORCEINLINE */ #ifdef __cplusplus -inline NTL_HDR_strChattr { NTL_SRC_strChattr } -inline NTL_HDR_strCasediff { NTL_SRC_strCasediff } +inline NTL_HDR_strChattr { +NTL_SRC_strChattr} inline NTL_HDR_strCasediff { +NTL_SRC_strCasediff} #else -static __inline__ NTL_HDR_strChattr { NTL_SRC_strChattr } -static __inline__ NTL_HDR_strCasediff { NTL_SRC_strCasediff } +static __inline__ NTL_HDR_strChattr { +NTL_SRC_strChattr} static __inline__ NTL_HDR_strCasediff { +NTL_SRC_strCasediff} #endif -#endif /* FORCEINLINE */ - +#endif /* FORCEINLINE */ /* * Proto types of other externally visible functions - */ -extern int strnChattr(const char *s, const size_t n); + */ extern int strnChattr(const char *s, const size_t n); #endif /* INCLUDED_ircd_string_h */ - - Index: patchlevel.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/patchlevel.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- patchlevel.h 15 Aug 2002 20:55:23 -0000 1.3 +++ patchlevel.h 22 Aug 2002 20:27:13 -0000 1.4 @@ -15,354 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: - * - */ - -/* - * PATCHes - * - * Only put here ADDED special stuff, for instance: ".mu3" or ".ban" - * Please start the patchlevel with a '.' - * - * IMPORTANT: Since u2.9 there is a new format of this file. The reason - * is that this way it shouldn't be needed anymore for the user to edit - * this manually !!! - * If you do, be sure you know what you are doing! + * $Id$ * - * For patch devellopers: - * To make a diff of your patch, edit any of the below lines containing - * a "" (an EMPTY string). Your patch will then succeed, with only an - * offset, on the first empty place in the users patchlevel.h. - * Do not change anyother line, the '\' are to make sure that the 'fuzz' - * will stay 0. --Run - */ - -#define PATCH1 \ - \ - \ - \ - ".H.05" - -/* - * Deliberate empty lines - */ - -#define PATCH2 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH3 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH4 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH5 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH6 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH7 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH8 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH9 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH10 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH11 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH12 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH13 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines */ -#define PATCH14 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH15 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH16 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH17 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH18 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH19 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH20 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH21 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH22 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH23 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH24 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH25 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH26 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH27 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH28 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH29 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH30 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ - -#define PATCH31 \ - \ - \ - \ - "" - -/* - * Deliberate empty lines - */ +#define PATCHLEVEL "alpha9" -#ifdef TESTNET -#define PATCH32 \ - \ - \ - \ - ".testnet" -#else -#define PATCH32 "" -#endif +#define RELEASE "1.0" /* * Deliberate empty lines */ - -/* Do NOT edit those: */ #ifndef BASE_VERSION #define BASE_VERSION "u2.10" Index: s_bsd.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_bsd.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- s_bsd.h 18 Aug 2002 22:59:22 -0000 1.4 +++ s_bsd.h 22 Aug 2002 20:27:13 -0000 1.5 @@ -222,10 +222,12 @@ #define HMODE_HIDDEN 0x00000040 /* Ip Oculta */ #define HMODE_HIDDENVIEWER 0x00000080 /* Ip Oculta */ #define HMODE_NICKSUSPENDED 0x00000100 /* Nick Suspendido */ +#define HMODE_MSGONLYREG 0x00000200 /* Solo recibir mensajes de usuarios con +r */ /* Modos hispano a propagar */ #define SEND_HMODES \ - (HMODE_NICKREGISTERED | HMODE_HELPOP | HMODE_SERVICESBOT | HMODE_HIDDEN | HMODE_HIDDENVIEWER | HMODE_NICKSUSPENDED) + (HMODE_NICKREGISTERED | HMODE_HELPOP | HMODE_SERVICESBOT | HMODE_HIDDEN | HMODE_HIDDENVIEWER \ + | HMODE_NICKSUSPENDED | HMODE_MSGONLYREG) /* Modos hispano TODOS */ #define ALL_HMODES \ @@ -240,6 +242,7 @@ #define IsHidden(x) ((x)->hmodes & HMODE_HIDDEN) #define IsHiddenViewer(x) ((x)->hmodes & HMODE_HIDDENVIEWER) #define IsNickSuspended(x) ((x)->hmodes & HMODE_NICKSUSPENDED) +#define IsMsgOnlyReg(x) ((x)->hmodes & HMODE_MSGONLYREG) /* Macros para poner modos hispano */ #define SetNickRegistered(x) ((x)->hmodes |= HMODE_NICKREGISTERED) @@ -250,6 +253,7 @@ #define SetHidden(x) ((x)->hmodes |= HMODE_HIDDEN) #define SetHiddenViewer(x) ((x)->hmodes |= HMODE_HIDDENVIEWER) #define SetNickSuspended(x) ((x)->hmodes |= HMODE_NICKSUSPENDED) +#define SetMsgOnlyReg(x) ((x)->hmodes |= HMODE_MSGONLYREG) /* Macros para borrar modos hispano */ #define ClearNickRegistered(x) ((x)->hmodes &= ~HMODE_NICKREGISTERED) @@ -260,6 +264,7 @@ #define ClearHidden(x) ((x)->hmodes &= ~HMODE_HIDDEN) #define ClearHiddenViewer(x) ((x)->hmodes &= ~HMODE_HIDDENVIEWER) #define ClearNickSuspended(x) ((x)->hmodes &= ~HMODE_NICKSUSPENDED) +#define ClearMsgOnlyReg(x) ((x)->hmodes &= ~HMODE_MSGONLYREG) #endif /* BDD */ Index: version.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/version.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- version.h 15 Aug 2002 20:55:23 -0000 1.2 +++ version.h 22 Aug 2002 20:27:13 -0000 1.3 @@ -7,6 +7,7 @@ #define INCLUDED_version_h extern const char *version; +extern const char *versionhispano; extern const char *creation; extern const char *infotext[]; extern const char *generation; |
Update of /cvsroot/irc-dev/ircdh/ircd In directory usw-pr-cvs1:/tmp/cvs-serv10291/ircdh/ircd Modified Files: IPcheck.c Makefile.in channel.c chkconf.c crule.c dbuf.c hash.c list.c m_config.c match.c numnicks.c opercmds.c parse.c res.c s_auth.c s_bdd.c s_bsd.c s_conf.c s_misc.c s_ping.c s_serv.c s_socks.c s_user.c send.c support.c whocmds.c whowas.c Added Files: ircd_string.c table_gen.c Removed Files: common.c Log Message: 2002-08-21 Toni Garcia <zo...@ir...> * ircd/common.c/.h: Ha sido eliminado. * ircd/table_gen: La tabla de caracteres que estaba en common.c ha sido colocado en este nuevo fichero. * ircd/ircd_string.c/h: Las funciones que estaban en common.c y en support.c han sido movidos al nuevo fichero. Y se sustituyen en el codigo los "strtoken" por el nuevo "ircd_strtok". * Movidos los archivos viejos de "ChangeLog" de Hispano y Undernet al directorio doc/history. A partir de ahora se documentan los cambios en este fichero "ChangeLog". --- NEW FILE: ircd_string.c --- /* * IRC - Internet Relay Chat, ircd/ircd_string.c * Copyright (C) 1999 Thomas Helvey * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: ircd_string.c,v 1.1 2002/08/21 17:59:40 zolty Exp $ */ #include "ircd_string.h" #include "ircd_defs.h" #include "ircd_chattr.h" #include <assert.h> #include <string.h> #include "sys.h" #include <stdarg.h> #include <signal.h> #include <netinet/in.h> #include "sprintf_irc.h" /* * include the character attribute tables here */ #include "chattr.tab.c" /* * strtoken.c * * Walk through a string of tokens, using a set of separators. * -argv 9/90 */ char *ircd_strtok(char **save, char *str, char *fs) { char *pos = *save; /* keep last position across calls */ char *tmp; if (str) pos = str; /* new string scan */ while (pos && *pos && strchr(fs, *pos) != NULL) pos++; /* skip leading separators */ if (!pos || !*pos) return (pos = *save = NULL); /* string contains only sep's */ tmp = pos; /* now, keep position of the token */ while (*pos && strchr(fs, *pos) == NULL) pos++; /* skip content of the token */ if (*pos) *pos++ = '\0'; /* remove first sep after the token */ else pos = NULL; /* end of string */ *save = pos; return (tmp); } /* * canonize * * reduce a string of duplicate list entries to contain only the unique * items. Unavoidably O(n^2). */ char *canonize(char *buffer) { static char cbuf[BUFSIZE]; char *s; char *t; char *cp = cbuf; int l = 0; char *p = NULL; char *p2; *cp = '\0'; for (s = ircd_strtok(&p, buffer, ","); s; s = ircd_strtok(&p, NULL, ",")) { if (l) { p2 = NULL; for (t = ircd_strtok(&p2, cbuf, ","); t; t = ircd_strtok(&p2, NULL, ",")) if (0 == ircd_strcmp(s, t)) break; else if (p2) p2[-1] = ','; } else t = NULL; if (!t) { if (l) *(cp - 1) = ','; else l = 1; strcpy(cp, s); if (p) cp += (p - s); } else if (p2) p2[-1] = ','; } return cbuf; } /* * ircd_strncpy - optimized strncpy * This may not look like it would be the fastest possible way to do it, * but it generally outperforms everything else on many platforms, * including asm library versions and memcpy, if compiled with the * optimizer on. (-O2 for gcc) --Bleep */ char *ircd_strncpy(char* s1, const char* s2, size_t n) { char *endp = s1 + n; char *s = s1; assert(0 != s1); assert(0 != s2); while (s < endp && (*s++ = *s2++)) ; return s1; } #ifndef FORCEINLINE NTL_HDR_strChattr { NTL_SRC_strChattr } NTL_HDR_strCasediff { NTL_SRC_strCasediff } #endif /* !FORCEINLINE */ /*============================================================================= * Other functions visible externally */ int strnChattr(const char *s, size_t n) { const char *rs = s; unsigned int x = ~0; int r = n; while (*rs && r--) x &= IRCD_CharAttrTab[*rs++ - CHAR_MIN]; return x; } /* * ircd_strcmp - case insensitive comparison of 2 strings * NOTE: see ircd_chattr.h for notes on case mapping. */ int ircd_strcmp(const char *a, const char *b) { const char *ra = a; const char *rb = b; while (ToLower(*ra) == ToLower(*rb)) { if (!*ra++) return 0; else ++rb; } return (*ra - *rb); } /* * ircd_strncmp - counted case insensitive comparison of 2 strings * NOTE: see ircd_chattr.h for notes on case mapping. */ int ircd_strncmp(const char *a, const char *b, size_t n) { const char *ra = a; const char *rb = b; int left = n; if (!left--) return 0; while (ToLower(*ra) == ToLower(*rb)) { if (!*ra++ || !left--) return 0; else ++rb; } return (*ra - *rb); } /* * unique_name_vector - create a unique vector of names from * a token separated list * list - [in] a token delimited null terminated character array * token - [in] the token to replace * vector - [out] vector of strings to be returned * size - [in] maximum number of elements to place in vector * Returns count of elements placed into the vector, if the list * is an empty string { '\0' } 0 is returned. * list, and vector must be non-null and size must be > 0 * Empty strings <token><token> are not placed in the vector or counted. * This function ignores all subsequent tokens when count == size * * NOTE: this function destroys it's input, do not use list after it * is passed to this function */ int unique_name_vector(char *list, char token, char **vector, int size) { int i; int count = 0; char *start = list; char *end; assert(0 != list); assert(0 != vector); assert(0 < size); /* * ignore spurious tokens */ while (token == *start) ++start; for (end = strchr(start, token); end; end = strchr(start, token)) { *end++ = '\0'; /* * ignore spurious tokens */ while (token == *end) ++end; for (i = 0; i < count; ++i) { if (0 == ircd_strcmp(vector[i], start)) break; } if (i == count) { vector[count++] = start; if (count == size) return count; } start = end; } if (*start) { for (i = 0; i < count; ++i) { if (0 == ircd_strcmp(vector[i], start)) return count; } vector[count++] = start; } return count; } /* * token_vector - create a vector of tokens from * a token separated list * list - [in] a token delimited null terminated character array * token - [in] the token to replace * vector - [out] vector of strings to be returned * size - [in] maximum number of elements to place in vector * returns count of elements placed into the vector, if the list * is an empty string { '\0' } 0 is returned. * list, and vector must be non-null and size must be > 1 * Empty tokens are counted and placed in the list * * NOTE: this function destroys it's input, do not use list after it * is passed to this function */ int token_vector(char *list, char token, char **vector, int size) { int count = 0; char *start = list; char *end; assert(0 != list); assert(0 != vector); assert(1 < size); vector[count++] = start; for (end = strchr(start, token); end; end = strchr(start, token)) { *end++ = '\0'; start = end; if (*start) { vector[count++] = start; if (count < size) continue; } break; } return count; } /* * host_from_uh - get the host.domain part of a us...@ho...main string * ripped from get_sockhost */ char *host_from_uh(char *host, const char *userhost, size_t n) { const char *s; assert(0 != host); assert(0 != userhost); if ((s = strchr(userhost, '@'))) ++s; else s = userhost; ircd_strncpy(host, s, n); host[n] = '\0'; return host; } /* * this new faster inet_ntoa was ripped from: * From: Thomas Helvey <to...@in...> */ static const char *IpQuadTab[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255" }; /* * ircd_ntoa - rewrote and renamed yet again :) --Bleep * inetntoa - in_addr to string * changed name to remove collision possibility and * so behaviour is guaranteed to take a pointer arg. * -avalon 23/11/92 * inet_ntoa -- returned the dotted notation of a given * internet number * argv 11/90). * inet_ntoa -- its broken on some Ultrix/Dynix too. -avalon */ const char *ircd_ntoa(const char *in) { static char buf[20]; return ircd_ntoa_r(buf, in); } /* * reentrant version of above */ const char *ircd_ntoa_r(char *buf, const char *in) { char *p = buf; const unsigned char *a = (const unsigned char *)in; const char* n; assert(0 != buf); assert(0 != in); n = IpQuadTab[*a++]; while ((*p = *n++)) ++p; *p++ = '.'; n = IpQuadTab[*a++]; while ((*p = *n++)) ++p; *p++ = '.'; n = IpQuadTab[*a++]; while ((*p = *n++)) ++p; *p++ = '.'; n = IpQuadTab[*a]; while ((*p = *n++)) ++p; return buf; } /* PROVISIONAL */ /* * inetntoa -- Changed the parameter to NOT take a pointer. * -Run 4/8/97 * inetntoa -- Changed name to remove collision possibility and * so behaviour is garanteed to take a pointer arg. * -avalon 23/11/92 * inet_ntoa -- Returned the dotted notation of a given * internet number (some ULTRIX don't have this) * -argv 11/90. * inet_ntoa -- Its broken on some Ultrix/Dynix too. -avalon */ char *inetntoa(struct in_addr in) { static char buf[16]; unsigned char *s = (unsigned char *)&in.s_addr; unsigned char a, b, c, d; a = *s++; b = *s++; c = *s++; d = *s++; sprintf_irc(buf, "%u.%u.%u.%u", a, b, c, d); return buf; } #if 0 #ifndef HAVE_INET_NETOF /* * inet_netof -- return the net portion of an internet number * argv 11/90 */ int inet_netof(struct in_addr in) { int addr = in.s_net; if (addr & 0x80 == 0) return ((int)in.s_net); if (addr & 0x40 == 0) return ((int)in.s_net * 256 + in.s_host); return ((int)in.s_net * 256 + in.s_host * 256 + in.s_lh); } #endif #endif --- NEW FILE: table_gen.c --- /* * IRC - Internet Relay Chat, ircd/table_gen.c * Copyright (C) 1998 Andrea Cocito * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: table_gen.c,v 1.1 2002/08/21 17:59:40 zolty Exp $ */ /* * TABLE GENERATOR * The following part of code is NOT included in the actual server's * or library source, it's just used to build the above tables * * This should rebuild the actual tables and automatically place them * into this source file, note that this part of code is for developers * only, it's supposed to work on both signed and unsigned chars but I * actually tested it only on signed-char architectures, the code and * macros actually used by the server instead DO work and have been tested * on platforms where0 char is both signed or unsigned, this is true as long * as the <limits.h> macros are set properly and without any need to rebuild * the tables (wich as said an admin should NEVER do, tables need to be rebuilt * only when one wants to really change the results or when one has to * compile on architectures where a char is NOT eight bits [?!], yes * it all is supposed to work in that case too... but I can't test it * because I've not found a machine in the world where this happes). * * NEVER -f[un]signed-char on gcc since that does NOT fix the named macros * and you end up in a non-ANSI environment where CHAR_MIN and CHAR_MAX * are _not_ the real limits of a default 'char' type. This is true for * both admins and coders. * */ #include "ircd_chattr.h" #include <stdlib.h> #include <stdio.h> #include <ctype.h> static void zeroTables(void); static void markString(int macro, const char *s); static void unMarkString(int macro, const char *s); static void markRange(int macro, char from, char to); static void moveMacro(int from, int to); static void setLowHi(const char firstlow, const char lastlow, const char firsthi); char NTL_tolower_tab[1 + CHAR_MAX - CHAR_MIN]; /* 256 bytes */ char NTL_toupper_tab[1 + CHAR_MAX - CHAR_MIN]; /* 256 bytes */ int NTL_char_attrib[1 + CHAR_MAX - CHAR_MIN]; /* 256 ints = 0.5 to 2 kilobytes */ /* * makeTables() * Where we make the tables, edit ONLY this to change the tables. */ static void makeTables(void) { /* Start from a known status */ zeroTables(); /* Make the very elementary sets */ markRange(NTL_LOWER, 'a', 'z'); markString(NTL_LOWER, "{|}~"); markRange(NTL_UPPER, 'A', 'Z'); markString(NTL_UPPER, "[\\]^"); markRange(NTL_DIGIT, '0', '9'); markRange(NTL_CNTRL, '\000', '\037'); markString(NTL_PUNCT, "!\"#$%&'()*+,-./:;<=>?@_`"); markString(NTL_SPACE, "\011\012\013\014\015\040"); /* Make the derived sets, * WARNING: The order of these calls is important, some depend on * the results of the previous ones ! */ moveMacro(NTL_LOWER | NTL_UPPER, NTL_ALPHA); moveMacro(NTL_ALPHA | NTL_DIGIT, NTL_ALNUM); moveMacro(NTL_ALNUM | NTL_PUNCT, NTL_GRAPH); moveMacro(NTL_GRAPH, NTL_PRINT); markString(NTL_PRINT, " "); markRange(NTL_IRCCH, 0, (char) UCHAR_MAX); unMarkString(NTL_IRCCH, "\007\040\054\240"); markRange(NTL_IRCCL, '\300', '\326'); markRange(NTL_IRCCL, '\330', '\336'); moveMacro(NTL_ALNUM, NTL_IRCHN); markString(NTL_IRCHN, "-_."); /* Some DNS might allow '_' per RFC 1033 ! */ moveMacro(NTL_DIGIT, NTL_IRCIP); markString(NTL_IRCIP, "."); moveMacro(NTL_DIGIT | NTL_ALPHA, NTL_IRCNK); markString(NTL_IRCNK, "-_`"); moveMacro(NTL_ALNUM, NTL_IRCUI); markRange(NTL_IRCUI, '\xe0', '\xf6'); markRange(NTL_IRCUI, '\xf8', '\xfe'); markRange(NTL_IRCUI, '\xc0', '\xd6'); markRange(NTL_IRCUI, '\xd8', '\xde'); markString(NTL_IRCUI, ".-_^'`~"); markString(NTL_EOL, "\n\r"); markString(NTL_CHPFX, "#&+"); markString(NTL_KTIME, " ,-0123456789"); /* And finally let's take care of the toLower/toUpper stuff */ setLowHi('a', 'z', 'A'); setLowHi('\xe0', '\xf6', '\xc0'); setLowHi('\xf8', '\xfe', '\xd8'); setLowHi('{', '~', '['); } /* * main() * This is the main program to be executed for -DMAKETABLES */ static void dumphw(int *p, int beg); static void dumphb(char *p, int beg); int main(void) { int i; /* Make the tables */ makeTables(); /* Dump them as ANSI C source to be included below */ printf("/*\n * Automatically Generated Tables - DO NOT EDIT\n */\n"); printf("#include <limits.h>\n"); /* NTL_tolower_tab */ printf("const char ToLowerTab_8859_1[] = {\n"); printf("#if (CHAR_MIN<0)\n"); i = (int)((char)SCHAR_MIN); dumphb(NTL_tolower_tab, i); printf(" ,\n"); printf("#endif /* (CHAR_MIN<0) */\n"); i = 0; dumphb(NTL_tolower_tab, i); printf("#if (!(CHAR_MIN<0))\n"); printf(" ,\n"); i = (int)((char)SCHAR_MIN); dumphb(NTL_tolower_tab, i); printf("#endif /* (!(CHAR_MIN<0)) */\n"); printf(" };\n\n"); /* NTL_toupper_tab */ printf("const char ToUpperTab_8859_1[] = {\n"); printf("#if (CHAR_MIN<0)\n"); i = (int)((char)SCHAR_MIN); dumphb(NTL_toupper_tab, i); printf(" ,\n"); printf("#endif /* (CHAR_MIN<0) */\n"); i = 0; dumphb(NTL_toupper_tab, i); printf("#if (!(CHAR_MIN<0))\n"); printf(" ,\n"); i = (int)((char)SCHAR_MIN); dumphb(NTL_toupper_tab, i); printf("#endif /* (!(CHAR_MIN<0)) */\n"); printf(" };\n\n"); /* NTL_char_attrib */ printf("const unsigned int IRCD_CharAttrTab[] = {\n"); printf("#if (CHAR_MIN<0)\n"); i = (int)((char)SCHAR_MIN); dumphw(NTL_char_attrib, i); printf(" ,\n"); printf("#endif /* (CHAR_MIN<0) */\n"); i = 0; dumphw(NTL_char_attrib, i); printf("#if (!(CHAR_MIN<0))\n"); printf(" ,\n"); i = (int)((char)SCHAR_MIN); dumphw(NTL_char_attrib, i); printf("#endif /* (!(CHAR_MIN<0)) */\n"); printf(" };\n\n"); return 0; } /* A few utility functions for makeTables() */ static void zeroTables(void) { int i; for (i = CHAR_MIN; i <= CHAR_MAX; i++) { NTL_tolower_tab[i - CHAR_MIN] = (char)i; /* Unchanged */ NTL_toupper_tab[i - CHAR_MIN] = (char)i; /* Unchanged */ NTL_char_attrib[i - CHAR_MIN] = 0x0000; /* Nothing */ } } static void markString(int macro, const char *s) { while (*s) NTL_char_attrib[*(s++) - CHAR_MIN] |= macro; } static void unMarkString(int macro, const char *s) { while (*s) NTL_char_attrib[*(s++) - CHAR_MIN] &= ~macro; } static void markRange(int macro, char from, char to) { int i; for (i = CHAR_MIN; i <= CHAR_MAX; i++) if (((unsigned char)i >= (unsigned char)from) && ((unsigned char)i <= (unsigned char)to)) NTL_char_attrib[(char)i - CHAR_MIN] |= macro; } static void moveMacro(int from, int to) { int i; for (i = CHAR_MIN; i <= CHAR_MAX; i++) if (NTL_char_attrib[i - CHAR_MIN] & from) NTL_char_attrib[i - CHAR_MIN] |= to; } static void setLowHi(const char firstlow, const char lastlow, const char firsthi) { int i, j; for (i = CHAR_MIN; i <= CHAR_MAX; i++) if (((unsigned char)i >= (unsigned char)firstlow) && ((unsigned char)i <= (unsigned char)lastlow)) { j = ((int)((char)(i + (int)(firsthi - firstlow)))); NTL_tolower_tab[((char)j) - CHAR_MIN] = (char)i; NTL_toupper_tab[((char)i) - CHAR_MIN] = (char)j; } } /* These are used in main() to actually dump the tables, each function dumps half table as hex/char constants... */ #define ROWSIZE 8 static void dumphb(char *tbl, int beg) { int i, j, k; char *p = &tbl[beg - CHAR_MIN]; char c; for (i = 0; i <= SCHAR_MAX; i += ROWSIZE) { k = i + ROWSIZE - 1; if (k > SCHAR_MAX) k = SCHAR_MAX; c = (char)(beg + i); printf("/*"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf(" '%c'", c); else printf(" x%02x", ((int)((unsigned char)c))); c = (char)(beg + k); printf("-"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf("'%c'", c); else printf("x%02x", ((int)((unsigned char)c))); printf(" */"); for (j = i; j <= k; j++) { c = p[j]; if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf(" '%c'", c); else printf(" '\\x%02x'", ((int)((unsigned char)c))); if (j < SCHAR_MAX) printf(","); } printf("\n"); } } static void dumphw(int *tbl, int beg) { int i, j, k; int *p = &tbl[beg - CHAR_MIN]; char c; for (i = 0; i <= SCHAR_MAX; i += ROWSIZE) { k = i + ROWSIZE - 1; if (k > SCHAR_MAX) k = SCHAR_MAX; c = (char)(beg + i); printf("/*"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf(" '%c'", c); else printf(" x%02x", ((int)((unsigned char)c))); c = (char)(beg + k); printf("-"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf("'%c'", c); else printf("x%02x", ((int)((unsigned char)c))); printf(" */"); for (j = i; j <= k; j++) { printf(" 0x%04x", p[j] & 0xffffffff); if (j < SCHAR_MAX) printf(","); } printf("\n"); } } Index: IPcheck.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/IPcheck.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- IPcheck.c 18 Aug 2002 22:59:22 -0000 1.3 +++ IPcheck.c 21 Aug 2002 17:59:40 -0000 1.4 @@ -15,32 +15,39 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id$ + * + * + * This file should be edited in a window with a width of 141 characters + * ick */ +#include "IPcheck.h" +#if 0 +#include "client.h" +#endif +#include "ircd.h" +#include "numnicks.h" /* NumNick, NumServ (GODMODE) */ +#if 0 +#include "ircd_alloc.h" +#endif +#include "s_bsd.h" /* SetIPChecked */ +#include "s_debug.h" /* Debug */ +#include "s_user.h" /* TARGET_DELAY */ +#include "send.h" -/* This file should be edited in a window with a width of 141 characters */ +#include <assert.h> +#include <stdio.h> /* NULL ... bleah */ +/* Provisional */ +#include "h.h" #include "sys.h" #include <netinet/in.h> -#include "h.h" -#include "IPcheck.h" -#include "ircd.h" #include "querycmds.h" #include "struct.h" -#include "s_user.h" -#include "s_bsd.h" -#include "struct.h" -#ifdef GODMODE -#include "numnicks.h" -#endif -#include "send.h" - #if defined(BDD) && defined(BDD_CLONES) #include "s_bdd.h" -#include "support.h" #endif - -RCSTAG_CC("$Id$"); - /* * IP number and last targets of a user that just disconnected. Index: Makefile.in =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.in 18 Aug 2002 22:59:22 -0000 1.5 +++ Makefile.in 21 Aug 2002 17:59:40 -0000 1.6 @@ -74,6 +74,7 @@ ircd_log.c \ ircd_osdep.c \ ircd_signal.c \ + ircd_string.c \ list.c \ map.c \ match.c \ @@ -104,7 +105,6 @@ whowas.c \ m_config.c \ m_watch.c \ - common.c \ bsd.c OBJS = ${SRC:%.c=%.o} @@ -117,7 +117,8 @@ .c.o: ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ -build: ircd chkconf +#build: ircd chkconf +build: ircd ircd: ${OBJS} ../include/patchlevel.h version.o ${PURIFY} ${CC} ${OBJS} version.o ${LDFLAGS} ${IRCDLIBS} -o ircd @@ -145,10 +146,9 @@ chkcrule.o: crule.c ${CC} ${CFLAGS} ${CPPFLAGS} -DCR_CHKCONF -o chkcrule.o -c crule.c -chkconf: chkconf.o match.o common.o chkcrule.o runmalloc.o fileio.o - ${CC} ${CFLAGS} ${CPPFLAGS} \ - chkconf.o match.o common.o chkcrule.o runmalloc.o fileio.o \ - ${LDFLAGS} ${IRCDLIBS} -o chkconf +chkconf: chkconf.o match.o chkcrule.o runmalloc.o fileio.o ircd_string.o + ${CC} chkconf.o match.o chkcrule.o fileio.o runmalloc.o \ + ircd_string.o ${LDFLAGS} ${IRCDLIBS} -o chkconf #chkconf: chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o ircd_string.o # ${CC} chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o \ @@ -176,7 +176,8 @@ ${RM} -f ${SYMLINK}; \ ${LN_S} ircd.`cat /tmp/ircd.tag` ${SYMLINK}; ) @${RM} /tmp/ircd.tag - ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR} +# ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR} + ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} table_gen ${BINDIR} ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ../doc/ejemplo.conf ${DPATH} ( cd ${DPATH}; \ ${TOUCH} ${MPATH}; \ @@ -232,13 +233,6 @@ maintainer-clean: distclean -ctables: common.c - ${CC} -I../include -DMAKETABLES common.c || exit 1 - { ${GREP} -A1 -B1000 ^...NTL_TOK_START common.c ; ./a.out ; \ - ${GREP} -A1000 -B1 ^...NTL_TOK_END common.c ; } > common.temp || exit 1; - ${MV} common.temp common.c - ${RM} a.out - depend: @if [ -f Makefile.in.bak ]; then \ echo "make depend: First remove ircd/Makefile.in.bak"; \ @@ -248,20 +242,6 @@ ${CC} ${CFLAGS} -MM ${CPPFLAGS} ${SRC:hash.c=} >> Makefile.in; ) \ fi -hash.o: hash.c ../include/sys.h ../config/config.h \ - ../config/setup.h ../include/runmalloc.h ../include/h.h \ - ../include/s_debug.h ../include/struct.h ../include/dbuf.h \ - ../include/common.h ../include/match.h ../include/hash.h \ - ../include/channel.h ../include/list.h ../include/send.h \ - ../include/s_serv.h ../include/ircd.h ../include/s_bdd.h \ - ircd.c version.c.SH - @CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" \ - crypt/sums - ${CC} ${CFLAGS} ${CPPFLAGS} -c hash.c -o hash.o - @${RM} -f hash.c - @${MV} -f hash.c.old hash.c - @${TOUCH} hash.o - # Coders: You need GNU make for this to work Makefile: ../config/config.status Makefile.in ../config/gen.ircd.Makefile \ ../config/config.h ../config/.config stamp-m @@ -282,24 +262,24 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -IPcheck.o: IPcheck.c ../include/sys.h ../config/config.h \ - ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ - ../include/h.h ../include/s_debug.h ../include/IPcheck.h \ - ../include/ircd.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/querycmds.h ../include/s_user.h \ - ../include/s_bsd.h ../include/s_conf.h ../include/list.h \ - ../include/send.h ../include/s_bdd.h ../include/support.h +IPcheck.o: IPcheck.c ../include/IPcheck.h ../include/h.h \ + ../include/s_debug.h ../config/config.h ../config/setup.h \ + ../include/ircd_defs.h ../include/ircd.h ../include/struct.h \ + ../include/whowas.h ../include/dbuf.h ../include/runmalloc.h \ + ../include/numnicks.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/list.h ../include/s_user.h ../include/send.h \ + ../include/sys.h ../include/querycmds.h ../include/s_bdd.h channel.o: channel.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ ../include/whowas.h ../include/dbuf.h ../include/channel.h \ ../include/parse.h ../include/send.h ../include/s_err.h \ - ../include/numeric.h ../include/ircd.h ../include/common.h \ - ../include/s_bdd.h ../include/match.h ../include/list.h \ - ../include/hash.h ../include/s_misc.h ../include/s_user.h \ - ../include/s_conf.h ../include/s_bsd.h ../include/msg.h \ - ../include/s_serv.h ../include/support.h ../include/numnicks.h \ - ../include/sprintf_irc.h ../include/querycmds.h + ../include/numeric.h ../include/ircd.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/s_bdd.h ../include/match.h \ + ../include/list.h ../include/hash.h ../include/s_misc.h \ + ../include/s_user.h ../include/s_conf.h ../include/s_bsd.h \ + ../include/msg.h ../include/s_serv.h ../include/support.h \ + ../include/numnicks.h ../include/sprintf_irc.h ../include/querycmds.h class.o: class.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -311,11 +291,13 @@ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_serv.h ../include/ircd.h \ ../include/match.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/list.h ../include/common.h ../include/crule.h + ../include/list.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/crule.h dbuf.o: dbuf.c ../include/h.h ../include/s_debug.h ../config/config.h \ - ../config/setup.h ../include/ircd_defs.h ../include/common.h \ - ../include/sys.h ../include/runmalloc.h ../include/struct.h \ - ../include/whowas.h ../include/dbuf.h ../include/s_serv.h + ../config/setup.h ../include/ircd_defs.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/sys.h ../include/runmalloc.h \ + ../include/struct.h ../include/whowas.h ../include/dbuf.h \ + ../include/s_serv.h fileio.o: fileio.c ../include/fileio.h ../include/runmalloc.h ircd.o: ircd.c ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/whowas.h ../include/h.h \ @@ -337,6 +319,10 @@ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/whowas.h ../include/h.h ../include/s_debug.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/runmalloc.h +ircd_string.o: ircd_string.c ../include/ircd_string.h ../config/config.h \ + ../config/setup.h ../include/ircd_chattr.h ../include/ircd_defs.h \ + ../include/sys.h ../include/runmalloc.h ../include/sprintf_irc.h \ + chattr.tab.c list.o: list.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -344,8 +330,8 @@ ../include/s_conf.h ../include/list.h ../include/class.h \ ../include/match.h ../include/ircd.h ../include/s_serv.h \ ../include/support.h ../include/s_misc.h ../include/s_bsd.h \ - ../include/res.h ../include/common.h ../include/s_user.h \ - ../include/opercmds.h + ../include/res.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/s_user.h ../include/opercmds.h map.o: map.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -354,18 +340,14 @@ ../include/ircd.h ../include/s_bsd.h ../include/s_conf.h \ ../include/s_misc.h ../include/querycmds.h ../include/map.h \ ../include/numnicks.h -match.o: match.c ../include/sys.h ../config/config.h ../config/setup.h \ - ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ - ../include/s_debug.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/common.h ../include/match.h \ - ../include/ircd.h +match.o: match.c ../include/match.h ../include/ircd_chattr.h numnicks.o: numnicks.c ../include/numnicks.h ../include/sys.h \ ../config/config.h ../config/setup.h ../include/ircd_defs.h \ ../include/runmalloc.h ../include/h.h ../include/s_debug.h \ ../include/s_serv.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/common.h ../include/ircd.h \ - ../include/s_misc.h ../include/match.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/list.h + ../include/dbuf.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/ircd.h ../include/s_misc.h ../include/match.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/list.h opercmds.o: opercmds.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/opercmds.h \ @@ -374,10 +356,10 @@ ../include/list.h ../include/send.h ../include/s_err.h \ ../include/numeric.h ../include/match.h ../include/s_misc.h \ ../include/class.h ../include/s_bdd.h ../include/s_user.h \ - ../include/common.h ../include/msg.h ../include/sprintf_irc.h \ - ../include/userload.h ../include/parse.h ../include/numnicks.h \ - ../include/crule.h ../include/version.h ../include/support.h \ - ../include/s_serv.h ../include/hash.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/msg.h \ + ../include/sprintf_irc.h ../include/userload.h ../include/parse.h \ + ../include/numnicks.h ../include/crule.h ../include/version.h \ + ../include/support.h ../include/s_serv.h ../include/hash.h packet.o: packet.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -389,14 +371,14 @@ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_serv.h ../include/send.h \ - ../include/parse.h ../include/common.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/list.h ../include/msg.h \ - ../include/s_user.h ../include/channel.h ../include/s_ping.h \ - ../include/res.h ../include/map.h ../include/s_bdd.h \ - ../include/m_config.h ../include/hash.h ../include/numeric.h \ - ../include/ircd.h ../include/s_misc.h ../include/s_numeric.h \ - ../include/numnicks.h ../include/opercmds.h ../include/querycmds.h \ - ../include/whocmds.h + ../include/parse.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/list.h ../include/msg.h ../include/s_user.h \ + ../include/channel.h ../include/s_ping.h ../include/res.h \ + ../include/map.h ../include/s_bdd.h ../include/m_config.h \ + ../include/hash.h ../include/numeric.h ../include/ircd.h \ + ../include/s_misc.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/s_numeric.h ../include/numnicks.h ../include/opercmds.h \ + ../include/querycmds.h ../include/whocmds.h querycmds.o: querycmds.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ @@ -411,20 +393,20 @@ ../include/ircd_defs.h ../include/runmalloc.h ../include/random.h res.o: res.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ - ../include/s_debug.h ../include/res.h ../include/list.h \ + ../include/s_debug.h ../include/ircd_chattr.h ../include/ircd_string.h \ ../include/struct.h ../include/whowas.h ../include/dbuf.h \ ../include/numeric.h ../include/send.h ../include/s_err.h \ ../include/s_misc.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/ircd.h ../include/s_ping.h ../include/support.h \ - ../include/common.h ../include/sprintf_irc.h + ../include/list.h ../include/ircd.h ../include/s_ping.h \ + ../include/support.h ../include/sprintf_irc.h s_auth.o: s_auth.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/res.h ../include/list.h \ ../include/struct.h ../include/whowas.h ../include/dbuf.h \ - ../include/common.h ../include/send.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_misc.h ../include/s_serv.h \ - ../include/support.h ../include/ircd.h ../include/s_auth.h \ - ../include/sprintf_irc.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/send.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_misc.h \ + ../include/s_serv.h ../include/support.h ../include/ircd.h \ + ../include/s_auth.h ../include/sprintf_irc.h s_bdd.o: s_bdd.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -432,11 +414,11 @@ ../include/s_misc.h ../include/sprintf_irc.h ../include/send.h \ ../include/s_err.h ../include/numeric.h ../include/s_bsd.h \ ../include/s_conf.h ../include/list.h ../include/hash.h \ - ../include/common.h ../include/match.h ../include/crule.h \ - ../include/parse.h ../include/numnicks.h ../include/userload.h \ - ../include/s_user.h ../include/channel.h ../include/querycmds.h \ - ../include/IPcheck.h ../include/s_bdd.h ../include/msg.h \ - ../include/support.h + ../include/match.h ../include/crule.h ../include/parse.h \ + ../include/numnicks.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/userload.h ../include/s_user.h ../include/channel.h \ + ../include/querycmds.h ../include/IPcheck.h ../include/s_bdd.h \ + ../include/msg.h ../include/support.h s_bsd.o: s_bsd.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/res.h ../include/list.h \ @@ -447,20 +429,21 @@ ../include/ircd.h ../include/support.h ../include/s_auth.h \ ../include/class.h ../include/packet.h ../include/s_ping.h \ ../include/channel.h ../include/version.h ../include/parse.h \ - ../include/common.h ../include/bsd.h ../include/numnicks.h \ - ../include/s_user.h ../include/sprintf_irc.h ../include/querycmds.h \ - ../include/IPcheck.h ../include/s_socks.h ../include/msg.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/bsd.h \ + ../include/numnicks.h ../include/s_user.h ../include/sprintf_irc.h \ + ../include/querycmds.h ../include/IPcheck.h ../include/s_socks.h \ + ../include/msg.h s_conf.o: s_conf.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_serv.h ../include/opercmds.h \ ../include/numeric.h ../include/send.h ../include/s_conf.h \ ../include/list.h ../include/class.h ../include/s_misc.h \ - ../include/match.h ../include/common.h ../include/s_err.h \ - ../include/s_bsd.h ../include/ircd.h ../include/crule.h \ - ../include/res.h ../include/support.h ../include/parse.h \ - ../include/numnicks.h ../include/sprintf_irc.h ../include/IPcheck.h \ - ../include/hash.h ../include/fileio.h + ../include/match.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/s_err.h ../include/s_bsd.h ../include/ircd.h \ + ../include/crule.h ../include/res.h ../include/support.h \ + ../include/parse.h ../include/numnicks.h ../include/sprintf_irc.h \ + ../include/IPcheck.h ../include/hash.h ../include/fileio.h s_debug.o: s_debug.c ../include/channel.h ../include/ircd_defs.h \ ../include/h.h ../include/s_debug.h ../config/config.h \ ../config/setup.h ../include/class.h ../include/hash.h \ @@ -478,12 +461,13 @@ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_serv.h ../include/numeric.h \ ../include/send.h ../include/s_conf.h ../include/list.h \ - ../include/s_misc.h ../include/common.h ../include/match.h \ - ../include/hash.h ../include/s_bsd.h ../include/res.h ../include/ircd.h \ - ../include/s_ping.h ../include/channel.h ../include/s_err.h \ - ../include/support.h ../include/userload.h ../include/parse.h \ - ../include/s_user.h ../include/numnicks.h ../include/sprintf_irc.h \ - ../include/querycmds.h ../include/IPcheck.h + ../include/s_misc.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/match.h ../include/hash.h ../include/s_bsd.h \ + ../include/res.h ../include/ircd.h ../include/s_ping.h \ + ../include/channel.h ../include/s_err.h ../include/support.h \ + ../include/userload.h ../include/parse.h ../include/s_user.h \ + ../include/numnicks.h ../include/sprintf_irc.h ../include/querycmds.h \ + ../include/IPcheck.h s_numeric.o: s_numeric.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ @@ -499,8 +483,8 @@ ../include/list.h ../include/match.h ../include/res.h \ ../include/s_bsd.h ../include/s_serv.h ../include/ircd.h \ ../include/s_ping.h ../include/support.h ../include/numeric.h \ - ../include/s_user.h ../include/s_err.h ../include/common.h \ - ../include/numnicks.h + ../include/s_user.h ../include/s_err.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/numnicks.h s_serv.o: s_serv.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -508,49 +492,52 @@ ../include/s_misc.h ../include/sprintf_irc.h ../include/send.h \ ../include/s_err.h ../include/numeric.h ../include/s_bsd.h \ ../include/s_conf.h ../include/list.h ../include/hash.h \ - ../include/common.h ../include/s_bdd.h ../include/msg.h \ - ../include/m_config.h ../include/match.h ../include/crule.h \ - ../include/parse.h ../include/numnicks.h ../include/userload.h \ - ../include/s_user.h ../include/channel.h ../include/querycmds.h \ - ../include/IPcheck.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/s_bdd.h \ + ../include/msg.h ../include/m_config.h ../include/match.h \ + ../include/crule.h ../include/parse.h ../include/numnicks.h \ + ../include/userload.h ../include/s_user.h ../include/channel.h \ + ../include/querycmds.h ../include/IPcheck.h s_socks.o: s_socks.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/res.h ../include/list.h \ ../include/struct.h ../include/whowas.h ../include/dbuf.h \ - ../include/common.h ../include/send.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_misc.h ../include/support.h \ - ../include/ircd.h ../include/s_socks.h ../include/sprintf_irc.h \ - ../include/hash.h ../include/IPcheck.h ../include/s_bdd.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/send.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_misc.h \ + ../include/support.h ../include/ircd.h ../include/s_socks.h \ + ../include/sprintf_irc.h ../include/hash.h ../include/IPcheck.h \ + ../include/s_bdd.h s_user.o: s_user.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/common.h ../include/s_serv.h \ - ../include/numeric.h ../include/send.h ../include/s_conf.h \ - ../include/list.h ../include/s_misc.h ../include/match.h \ - ../include/hash.h ../include/s_bsd.h ../include/s_err.h \ - ../include/parse.h ../include/s_bdd.h ../include/ircd.h \ - ../include/s_user.h ../include/support.h ../include/channel.h \ - ../include/random.h ../include/version.h ../include/msg.h \ - ../include/userload.h ../include/numnicks.h ../include/sprintf_irc.h \ - ../include/querycmds.h ../include/IPcheck.h ../include/class.h + ../include/dbuf.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/s_serv.h ../include/numeric.h ../include/send.h \ + ../include/s_conf.h ../include/list.h ../include/s_misc.h \ + ../include/match.h ../include/hash.h ../include/s_bsd.h \ + ../include/s_err.h ../include/parse.h ../include/s_bdd.h \ + ../include/ircd.h ../include/s_user.h ../include/support.h \ + ../include/channel.h ../include/random.h ../include/version.h \ + ../include/msg.h ../include/userload.h ../include/numnicks.h \ + ../include/sprintf_irc.h ../include/querycmds.h ../include/IPcheck.h \ + ../include/class.h send.o: send.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_bsd.h ../include/s_conf.h \ ../include/list.h ../include/s_serv.h ../include/send.h \ - ../include/s_misc.h ../include/common.h ../include/match.h \ - ../include/ircd.h ../include/channel.h ../include/bsd.h \ - ../include/class.h ../include/s_user.h ../include/sprintf_irc.h + ../include/s_misc.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/match.h ../include/ircd.h ../include/channel.h \ + ../include/bsd.h ../include/class.h ../include/s_user.h \ + ../include/sprintf_irc.h sprintf_irc.o: sprintf_irc.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/sprintf_irc.h -support.o: support.c ../include/sys.h ../config/config.h \ - ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ - ../include/h.h ../include/s_debug.h ../include/send.h ../include/ircd.h \ - ../include/struct.h ../include/whowas.h ../include/dbuf.h \ - ../include/s_bsd.h ../include/s_conf.h ../include/list.h \ - ../include/support.h ../include/sprintf_irc.h ../include/common.h \ - ../include/fileio.h +support.o: support.c ../include/fileio.h ../include/ircd.h \ + ../config/config.h ../config/setup.h ../include/struct.h \ + ../include/whowas.h ../include/h.h ../include/s_debug.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/runmalloc.h \ + ../include/ircd_chattr.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/list.h ../include/send.h ../include/sprintf_irc.h \ + ../include/support.h ../include/sys.h userload.o: userload.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ @@ -560,28 +547,31 @@ whocmds.o: whocmds.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ - ../include/whowas.h ../include/dbuf.h ../include/common.h \ - ../include/s_serv.h ../include/numeric.h ../include/send.h \ - ../include/s_conf.h ../include/list.h ../include/s_misc.h \ - ../include/match.h ../include/hash.h ../include/s_bsd.h \ - ../include/s_err.h ../include/parse.h ../include/ircd.h \ - ../include/s_user.h ../include/support.h ../include/channel.h \ - ../include/random.h ../include/version.h ../include/msg.h \ - ../include/userload.h ../include/numnicks.h ../include/sprintf_irc.h \ - ../include/querycmds.h ../include/IPcheck.h ../include/whocmds.h + ../include/whowas.h ../include/dbuf.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/s_serv.h ../include/numeric.h \ + ../include/send.h ../include/s_conf.h ../include/list.h \ + ../include/s_misc.h ../include/match.h ../include/hash.h \ + ../include/s_bsd.h ../include/s_err.h ../include/parse.h \ + ../include/ircd.h ../include/s_user.h ../include/support.h \ + ../include/channel.h ../include/random.h ../include/version.h \ + ../include/msg.h ../include/userload.h ../include/numnicks.h \ + ../include/sprintf_irc.h ../include/querycmds.h ../include/IPcheck.h \ + ../include/whocmds.h whowas.o: whowas.c ../include/sys.h ../config/config.h ../config/setup.h \ - ../include/ircd_defs.h ../include/runmalloc.h ../include/common.h \ - ../include/h.h ../include/s_debug.h ../include/struct.h \ - ../include/whowas.h ../include/dbuf.h ../include/numeric.h \ - ../include/send.h ../include/s_misc.h ../include/s_err.h \ - ../include/ircd.h ../include/list.h ../include/s_user.h \ - ../include/support.h ../include/s_bsd.h ../include/s_conf.h + ../include/ircd_defs.h ../include/runmalloc.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/h.h ../include/s_debug.h \ + ../include/struct.h ../include/whowas.h ../include/dbuf.h \ + ../include/numeric.h ../include/send.h ../include/s_misc.h \ + ../include/s_err.h ../include/ircd.h ../include/list.h \ + ../include/s_user.h ../include/support.h ../include/s_bsd.h \ + ../include/s_conf.h m_config.o: m_config.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ - ../include/h.h ../include/s_debug.h ../include/common.h \ - ../include/ircd.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/s_serv.h ../include/msg.h \ - ../include/s_conf.h ../include/list.h ../include/m_config.h + ../include/h.h ../include/s_debug.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/ircd.h ../include/struct.h \ + ../include/whowas.h ../include/dbuf.h ../include/s_serv.h \ + ../include/msg.h ../include/s_conf.h ../include/list.h \ + ../include/m_config.h m_watch.o: m_watch.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/hash.h ../include/ircd.h \ @@ -589,9 +579,6 @@ ../include/list.h ../include/msg.h ../include/numeric.h \ ../include/s_bsd.h ../include/s_conf.h ../include/s_err.h \ ../include/s_user.h ../include/send.h ../include/support.h -common.o: common.c ../include/common.h ../include/sys.h \ - ../config/config.h ../config/setup.h ../include/ircd_defs.h \ - ../include/runmalloc.h bsd.o: bsd.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ Index: channel.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/channel.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- channel.c 15 Aug 2002 20:55:23 -0000 1.3 +++ channel.c 21 Aug 2002 17:59:40 -0000 1.4 @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id$ */ #include "sys.h" @@ -29,7 +31,8 @@ #include "s_err.h" #include "numeric.h" #include "ircd.h" -#include "common.h" +#include "ircd_string.h" +#include "ircd_chattr.h" #if defined(BDD) #include "s_bdd.h" #endif @@ -41,7 +44,6 @@ #include "s_conf.h" #include "s_bsd.h" #include "msg.h" -#include "common.h" #include "s_serv.h" #include "channel.h" #include "support.h" @@ -1547,7 +1549,7 @@ */ if (IsServer(sptr)) { - if (parc == 1 && isDigit(*curr)) + if (parc == 1 && IsDigit(*curr)) { newtime = atoi(curr); if (newtime && chptr->creationtime == MAGIC_REMOTE_JOIN_TS) @@ -2384,16 +2386,16 @@ { for (; *cn; cn++) { - if (!isIrcCh(*cn)) + if (!IsChannelChar(*cn)) { *cn = '\0'; return; } - if (isIrcCl(*cn)) + if (IsChannelLower(*cn)) #ifndef FIXME { #endif - *cn = toLower(*cn); + *cn = ToLower(*cn); #ifndef FIXME /* Missed the Icelandic letter ETH last time: */ if ((unsigned char)(*cn) == 0xd0) @@ -2615,7 +2617,7 @@ for (p = parv[1]; *p; p++) /* find the last "JOIN 0" in the line -Kev */ if (*p == '0' - && (*(p + 1) == ',' || *(p + 1) == '\0' || !isIrcCh(*(p + 1)))) + && (*(p + 1) == ',' || *(p + 1) == '\0' || !IsChannelChar(*(p + 1)))) { /* If it's a single "0", remember the place; we will start parsing the channels after the last 0 in the line -Kev */ @@ -2644,7 +2646,7 @@ * Rebuild list of channels joined to be the actual result of the * JOIN. Note that "JOIN 0" is the destructive problem. */ - for (name = strtoken(&p, parv[1], ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, parv[1], ","); name; name = ircd_strtok(&p, NULL, ",")) { size_t len; if (MyConnect(sptr)) @@ -2912,7 +2914,7 @@ if (*jbuf) { /* check for channels that need TS's */ p = NULL; - for (name = strtoken(&p, jbuf, ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, jbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) { chptr = get_channel(sptr, name, !CREATE); if (chptr && chptr->mode.mode & MODE_SENDTS) @@ -2954,7 +2956,7 @@ if (*mbuf) { /* ok, send along modes for creation events to P9 */ p = NULL; - for (name = strtoken(&p, mbuf, ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, mbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) { chptr = get_channel(sptr, name, !CREATE); sendto_lowprot_butone(cptr, 9, ":%s MODE %s +o %s " TIME_T_FMT, @@ -3039,7 +3041,7 @@ *cbuf = '\0'; /* Start with empty buffer */ /* For each channel in the comma seperated list: */ - for (name = strtoken(&p, parv[1], ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, parv[1], ","); name; name = ircd_strtok(&p, NULL, ",")) { badop = 0; /* Default is to accept the op */ if ((chptr = FindChannel(name))) @@ -3125,7 +3127,7 @@ is not needed after all are 2.10 */ sendto_lowprot_butone(cptr, 9, ":%s JOIN %s", parv[0], cbuf); p = NULL; - for (name = strtoken(&p, cbuf, ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, cbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) sendto_lowprot_butone(cptr, 9, ":%s MODE %s +o %s " TIME_T_FMT, sptr->user->server->name, name, parv[0], chanTS); #endif @@ -3615,7 +3617,7 @@ if (netride) break; /* Ignore bans */ /* Run over all bans */ - for (pv = parv[n] + 1; (ban = strtoken(&p, pv, " ")); pv = NULL) + for (pv = parv[n] + 1; (ban = ircd_strtok(&p, pv, " ")); pv = NULL) { int ret; /* @@ -3646,7 +3648,7 @@ /* Default mode: */ int default_mode = CHFL_DEOPPED; /* Run over all nicks */ - for (pv = parv[n]; (nick = strtoken(&p, pv, ",")); pv = NULL) + for (pv = parv[n]; (nick = ircd_strtok(&p, pv, ",")); pv = NULL) { aClient *acptr; if ((ptr = strchr(nick, ':'))) /* New default mode ? */ @@ -4026,7 +4028,7 @@ return 0; } - for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL) + for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = NULL) { chptr = get_channel(sptr, name, !CREATE); if (!chptr) @@ -4350,7 +4352,7 @@ if (parc > 2) topic = parv[parc - 1]; - for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL) + for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = NULL) { chptr = NULL; #if defined(BDD) @@ -4653,7 +4655,7 @@ case '>': { p++; - if (!isDigit(*p)) + if (!IsDigit(*p)) show_usage = 1; else { @@ -4772,7 +4774,7 @@ return 0; } - for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL) + for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = NULL) { chptr = FindChannel(name); if (chptr && ShowChannel(sptr, chptr) && sptr->user) Index: chkconf.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/chkconf.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- chkconf.c 18 Aug 2002 22:49:42 -0000 1.7 +++ chkconf.c 21 Aug 2002 17:59:40 -0000 1.8 @@ -39,7 +39,7 @@ #include "h.h" #include "s_conf.h" #include "class.h" -#include "common.h" +#include "ircd_string.h" #include "ircd.h" #include "fileio.h" #include <errno.h> @@ -477,7 +477,7 @@ { if (flags & aconf->status) fprintf(stderr, "ERROR: multiple %c-lines\n", - toUpper(confchar(aconf->status))); + ToUpper(confchar(aconf->status))); else flags |= aconf->status; } Index: crule.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/crule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- crule.c 15 Aug 2002 20:55:24 -0000 1.2 +++ crule.c 21 Aug 2002 17:59:40 -0000 1.3 @@ -41,7 +41,8 @@ #include "ircd.h" #include "match.h" #include "s_bsd.h" -#include "common.h" +#include "ircd_chattr.h" +#include "ircd_string.h" #include "crule.h" #else /* includes and defines to make the stand-alone test parser */ @@ -343,7 +344,7 @@ *next_tokp = CR_END; break; default: - if ((isAlpha(*(--(*ruleptr)))) || (**ruleptr == '*') || + if ((IsAlpha(*(--(*ruleptr)))) || (**ruleptr == '*') || (**ruleptr == '?') || (**ruleptr == '.') || (**ruleptr == '-')) *next_tokp = CR_WORD; else @@ -360,7 +361,7 @@ word_ptr = word; while ((size_t)(word_ptr - word) < maxlen - && (isAlnum(**ruleptr) + && (IsAlnum(**ruleptr) || **ruleptr == '*' || **ruleptr == '?' || **ruleptr == '.' || **ruleptr == '-')) *word_ptr++ = *(*ruleptr)++; Index: dbuf.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/dbuf.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dbuf.c 15 Aug 2002 20:55:24 -0000 1.2 +++ dbuf.c 21 Aug 2002 17:59:40 -0000 1.3 @@ -18,7 +18,8 @@ */ #include "h.h" -#include "common.h" +#include "ircd_chattr.h" +#include "ircd_string.h" #include "sys.h" #include "struct.h" #include "dbuf.h" @@ -505,7 +506,7 @@ /* * flush extra line terms */ - while (isEol(*db->start)) + while (IsEol(*db->start)) { if (++db->start == db->end) { @@ -559,7 +560,7 @@ while (length > 0) { end = MIN(db->end, (start + length)); - while (start < end && !isEol(*start)) + while (start < end && !IsEol(*start)) *buf++ = *start++; count = start - db->start; Index: hash.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/hash.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- hash.c 18 Aug 2002 22:59:22 -0000 1.3 +++ hash.c 21 Aug 2002 17:59:40 -0000 1.4 @@ -25,7 +25,8 @@ #include <limits.h> #include "h.h" #include "struct.h" -#include "common.h" +#include "ircd_chattr.h" +#include "ircd_string.h" #if defined(BDD) #include "s_bdd.h" #endif @@ -176,7 +177,7 @@ /* This is what the hash function will consider "equal" chars, this function MUST be transitive, if HASHEQ(y,x)&&HASHEQ(y,z) then HASHEQ(y,z), and MUST be symmetric, if HASHEQ(a,b) then HASHEQ(b,a), obvious ok but... :) */ -#define HASHEQ(x,y) (((char) toLower((char) x)) == ((char) toLower((char) y))) +#define HASHEQ(x,y) (((char) ToLower((char) x)) == ((char) ToLower((char) y))) /* hash_init * Initialize the maps used by hash functions and clear the tables */ @@ -497,7 +498,7 @@ strncpy(temp, nicks, 512); temp[512] = '\000'; p = NULL; - for (one = strtoken(&p, temp, ","); one; one = strtoken(&p, NULL, ",")) + for (one = ircd_strtok(&p, temp, ","); one; one = ircd_strtok(&p, NULL, ",")) { if (!*one) continue; Index: list.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/list.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- list.c 18 Aug 2002 22:59:22 -0000 1.4 +++ list.c 21 Aug 2002 17:59:40 -0000 1.5 @@ -33,7 +33,8 @@ #include "s_bsd.h" #include "whowas.h" #include "res.h" -#include "common.h" +#include "ircd_chattr.h" +#include "ircd_string.h" #include "list.h" #include "s_user.h" #include "opercmds.h" Index: m_config.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/m_config.c,v retrieving revision 1.1.1.1 retrieving... [truncated message content] |
From: Zolty <zo...@us...> - 2002-08-21 17:59:43
|
Update of /cvsroot/irc-dev/ircdh/doc/history In directory usw-pr-cvs1:/tmp/cvs-serv10291/ircdh/doc/history Added Files: CAMBIOS2_10_06 CAMBIOS2_10_07 CAMBIOS2_10_H_01 CAMBIOS2_10_H_02 CAMBIOS2_10_H_03 CAMBIOS2_10_H_04 ChangeLog ChangeLog.07 ChangeLog.10 Log Message: 2002-08-21 Toni Garcia <zo...@ir...> * ircd/common.c/.h: Ha sido eliminado. * ircd/table_gen: La tabla de caracteres que estaba en common.c ha sido colocado en este nuevo fichero. * ircd/ircd_string.c/h: Las funciones que estaban en common.c y en support.c han sido movidos al nuevo fichero. Y se sustituyen en el codigo los "strtoken" por el nuevo "ircd_strtok". * Movidos los archivos viejos de "ChangeLog" de Hispano y Undernet al directorio doc/history. A partir de ahora se documentan los cambios en este fichero "ChangeLog". --- NEW FILE: CAMBIOS2_10_06 --- $Id: CAMBIOS2_10_06,v 1.1 2002/08/21 17:59:40 zolty Exp $ * 1999/11/11 sa...@ap... (patch.db51) FIX ----------------------------------------------------------------------- Cambiados todos los 'unsigned long' de s_bdd.c a 'unsigned int', pues en realidad solo necesitamos u_int32_t, y usando 'unsigned long' tenwmos problemas en arquitecturas de 64 bits. Los mismos cambios en las funciones que llamaban a tea() en s_user.c * 1999/11/11 sa...@ap... (patch.vip4) FIX ----------------------------------------------------------------------- Segun lo decidido, se cambia el algoritmo de criptación de direcciones al siguiente modelo: VIRTUAL = TEA( clave, ip<<32 + (clave>>32)&0xffff0000 + n) Siendo 'clave' el valor que contiene el registro '.' de la tabla de direcciones virtuales, que se irá cambiando periodicamente. Este fix permite que los usuarios baneados por dirección virtual no puedan abusar, conectando de nuevo o cambiando el nick, pues hay una relación directa entre la dir virtual y la real. * 1999/10/26 sa...@ap... (patch.dbh15) FEATURE ----------------------------------------------------------------------- Para facilitar la migración a autentificación por server, creamos una tabla 't' (residente), que PERMITE que los usuarios se autentifiquen de la misma forma que los de la tabla 'n'. Si ponen clave, esta ha de ser la correcta. Si no la ponen les molesta con un par de NOTICEs. En VERSION del server aparece como DBH15 * 1999/10/15 sa...@ap... (patch.p9hispano) FIX ----------------------------------------------------------------------- He definido los numeros de nodo P9 para los services en numnicks.c, dado que n2k ha destruido la "autoasignación" de numeros de nodo para los P9. * 1999/10/14 sa...@ap... (patch.dbh14) FIX ----------------------------------------------------------------------- He modificado la respuesta al /STATS B, para hacerla mas corta y le he añadido el soporte de las nuevas BDD. * 1999/10/13 sa...@ap... (patch.xmode2) FIX ----------------------------------------------------------------------- Arreglado un pekeño bug cosmetico, que ocurria cuando mediante XMODE intentabamos por ejemplo dar +o a alguien que ya tiene +o, quedando visible el intento como '+x' sin parametro alguno. * 1999/10/13 sa...@ap... (patch.dbh13) FEATURE ----------------------------------------------------------------------- Implemento comando DBQ sustituyendo el DBH de usuario, con el formato: [<:origen>] DBQ [<server>] <tabla> <clave> Si <server> existe pero no somos nostros, lo rutaremos al server en cuestión para que sea él quien contesta. Se acepta server '*' para broacast y los tipicos comodines 'jupiter.*' * 1999/10/10 sa...@ap... (patch.vip3) FIX ----------------------------------------------------------------------- Las desconexiones (QUIT) involuntarios (Ping timeout / Read error) ya no muestran el hostname del usuario si este tiene el modo +x activo. El /WHO busca sobre la direccion virtual en lugar de la real en los usuarios +x excepto si quien mira es un +X, en cuyo caso mira en ambas. * 1999/10/05 sa...@ap... (patch.vip2) FEATURE ----------------------------------------------------------------------- Se cambia el modo de trabajo de /WHOIS y /WHO para que lo hagan segun sugerencias de jcea. El propio usuario se ve a si mismo como lo haria un +X. Y la primera linea (311) de WHOIS da el host real y en la linea codigo 378 informamos de la dirección virtual. * 1999/10/05 sa...@ap... (patch.dbh12) FIX ----------------------------------------------------------------------- Las nuevas funciones base64toint() que han introducido en el parche de undernet8 necesitan tener completamente rellenado el string, antes se conformaban con tener \0's al final. Lo correcto es tal como lo han dejado en esta versión, pero es incompatible con lo anterior. Solución: a las claves cortas se les añaden tantas 'A' al final como sea preciso. * 1999/10/05 sa...@ap... (patch.dbh11) FIX ----------------------------------------------------------------------- Al introducir el parche de undernet8 y posteriores, se nos pasó cambiar el %c%c%c por %s%s para imprimir el nick numerico extendido en el comando BMODE. Se ha optimizado el modo de delimitar el final de de cadenas en las modificaciones introducidas en la autenticación usuario. Se han cambiado los %c a %s en protocolos DB y DBH para uso correcto de la macro NumServ(). Puestos a arreglar, el make install crea con los permisos adecuados las tablas DBH. * 1999/09/14 sa...@ap... (patch.vip) FEATURE ----------------------------------------------------------------------- Se introducen dos nuevos flags de usuario: +x y +X, el primero oculta la dirección ip(o hostname) del usuario y el segundo (+X) permite ver las direcciónes reales al ejecutar /WHOIS /WHO /USERIP y /USERHOST Solo los usuarios +r acceden, automaticamente, a +x, pudiendo cambiar a -x y +x a voluntad mientras perdure el flag +r Solo los usuarios +o (ircops) y +h (OPERS) pueden activar el flag +X El formato de las direcciones es @GaRaBaTo12Ch.virtual, y este valor se calcula en todos los servers cuando el usuario activa +x, guardandose en un campo especifico: User->virtualhost Si los servers encuentran en la nueva tabla V un registro para el nick en cuestión, instalan el valor del registro en User->virtualhost, permitiendo así definir ips virtuales fijas para ciertos usuarios. El valor del GaRaBaTo12Ch se calcula en make_virtualhost() de s_user.c y es basicamente: garabato = base64(tea(tea(nick,password),ip<<32+xyz<<8)); haciendose imposible crear una relación de ips virtuales a reales, asi como su desencriptación por parte de los usuarios. La unica forma de conseguir averiguar una ip a partir de una virtual sera analizando los logs de los distintos servidores de servicios. he modificado además el codigo refernete a BAN para que acepte ban por virtual, y el ban a real afecte tambien a los +x. he cambiado el antiguo codigo 378 (ke ya movimos en su dia) al 380 he ocupado el codigo 378 para que nos indique la ip/host real del user tal como lo hacen otros daemons de irc. El 379 lo he reservado para que muestre los modos de usn usuario, como enotras redes, pero esto es asunto de otro parche. El comando /TRACE solo será accesible a Opers +o y HelpOps +h, antes era accesible a todos. Este comando no oculta IPs. No puedo considerar el codigo terminado, la version queda reflejada como VIP+, activandose en el configurador dentro de la sección HISPANO, siendo desactivable por si nos da problemas. * 1999/09/14 sa...@ap... (patch.no_whois_secret) UNFEATURE ----------------------------------------------------------------------- Elimina completamente el parche patch.whois_secret * 1999/07/31 sa...@ap... (patch.dbh10) FIX ----------------------------------------------------------------------- Corrección del BMODE, pues se producian algunos desynch. Lo he simplificado, y para ello he tenido que meter un parametro adicional a set_mode(), que se usa en m_botmode (1) y m_mode (0). Si el parametro es 1 (BMODE), se hace badop=0, bounce=0, asi no se queja nadie. Como el arreglo es en la recepción, sera necesario que este activo en todos los servers antes de que sea operativo. Por error, en DBH9 deje abierto a IRCops el comando BMODE, ahora es solo server-server. El BURST de p10 no parsea los modos +R+A+S de canal, tb lo he arreglado. Queda reflejado como DBH10+ * 1999/07/30 sa...@ap... (patch.whois_secret) FEATURE ----------------------------------------------------------------------- Si asi lo pedimos en la configuración (make config), OPERS_SEE_IN_SECRET_CHANNELS, el whois les muestra a los IrcOP o +k la lista de canales secretos (+s) donde esta el usuario Se documenta en /VERSION como W+/W- * 1999/07/29 sa...@ap... (patch.dbh9) FEATURE ----------------------------------------------------------------------- Incorpora el comando SERVER-SERVER BMODE, con formato: :origen BMODE ChanServ #canal +modos :parametros ChanServ se busca en la tabla B, y se nos traduce a 'CHaN!^@^', y es lo que veran los usuarios en los cambios de modos del canal realizados por los servers (autoops, etc). Para mas info ver codigo m_botmode() en chammel.c Modos de usuario: B -> Modo Bot, permite TODO sobre canales, sin estar dentro, limitado a los BOTS, no se puede colocar en modo usuario. Se ha usado un bit de nustro campo Client->hmodes Modos de Canal: r -> Canal Registrado (existe en tabla C, no se puede poner/quitar) R -> Canal Restringido, solo acepta users Registrados A -> Activacion de autoop para los ke salgan en tabla C S -> Modo Secure OP (no implementado de momento) Se han usado 4 bits del campo chptr->modes.modes: #define MODE_REGCHAN 0x020000 #define MODE_REGNICKS 0x040000 #define MODE_AUTOOP 0x080000 #define MODE_SECUREOP 0x100000 * 1999/07/29 sa...@ap... (patch.noproxy4) FIX ----------------------------------------------------------------------- Se corrige el tema caida por timeout si tienes el 1080 cerrado sin aviso mediante firewall. Ahora deja al usuario enganchado 90 segundos antes de dejarle entrar. Queda reflejado como PX4+ o PX4- en el /VERSION * 1999/07/29 sa...@ap... (patch.noproxy3) FIX ----------------------------------------------------------------------- Se elimina el chekeo de Socks y el de Ident sobre puerto de servers Queda reflejado como PX3+ o PX3- en el /VERSION * 1999/07/29 sa...@ap... (patch.dbh8) FEATURE ----------------------------------------------------------------------- Implementa el nuevo modo de usuario -/+h, conocido en otras redes como HelpOperator, que vendrian a ser los Oper del irc-hispano. Este modo (+h) se activa automaticamente si el nick esta registrado y ademas en la tabla O (de OPERS). Los oper se lo pueden quitar o poner a su antojo. La unica finalidad del modo +h es aparecer en el /WHOIS indicando que el usuario es un Operador de Servicios IRC (raw 310) Ademas mejora la implementacion de los modos automaticos al cambiar de nick. * 1999/07/28 sa...@ap... (patch.noproxy2) FIX ----------------------------------------------------------------------- Algunos cambios cosmeticos en los textos enviados al usuario. El patch.noproxy no compila modo DEBUG, este lo arregla. Queda reflejado como PX2+ o PX2- en el /VERSION * 1999/07/28 sa...@ap... (patch.noproxy) FEATURE ----------------------------------------------------------------------- Implemento un checker de Socks4-Proxies (wingates incluido). La implementación esta en s_socks.c y s_socks.h, pero ha sido necesario tocar ligeramente s_bsd.c, ircd.c y s_res.c. En la estructura Client de struct.h he añadido el campo socksfd en la parte extendida de clientes locales. En s_bsd.h he creado las macros y usado un par de bits del campo client->hmodes. Implementacion: - Llega conexion nueva - Se lanzan en paralelo los checkers de DNS, ident y proxy - Se atiende al user cuando los tres han finalizado Cuando lanzamos el cheker de proxy, este se intenta conectar al puerto de socks4 del usuario (1080), si lo consigue, mediante protocolo socks4 le solicita al proxy que habra una conexion a la direccion/puerto del ircd que el usuario ha conectado. Se analiza la respuesta de socks4 y si nos confirma la conexión, es un proxy abiero y lo desconectamos del irc informandole de la causa. Mientras se hace el proceso de checking de Proxy, el server envia unos NOTICE al usuario para que vea lo que le está haciendo. He tenido que usar writes directos al cptr->fd, pk al no estar registrado el usuario en el momento del cheking, no podia usar las colas de salida. Esta opcion se puede activar/desactivar (PROXY_PROTECTION) en el make config, siempre que hayamos seleccionado DB_HISPANO. Queda reflejado en el /VERSION como PX+ o PX- * 1999/07/21 sa...@ap... (patch.DBH6) FIX ----------------------------------------------------------------------- Cambia la forma de trabajo del flag +r, impidiendo que el user se lo quite, y (des)activandose solo ante autentificacion, y no ademas por la llegada de un registro DBH, como hasta ahora. Introduce algunos cambios cosmeticos en la consulta de la BD (comando DBH en modo user). Como estaba mirando la causa de que los DBH2 regalen modos +k a los users, he cambiado a logica positiva la parte del condicional que hace que NO sea aceptado el modo +k cuando: - no lo tenias y no eres server y no eres ircop y no (estas registrado y estas en la DB de OPERS) en lugar de la equivalente pero menos inteligible: - no lo tenias y no eres server y no eres ircop y (no estas registrado o no estas en la DB de OPERS) Aunque el bug quedo solucionado en DBH3. Puestos a arreglar, añado el DBPATH de la DB10 como prefijo a los ficheros usados por la DBH. * 1999/07/06 sa...@ap... (patch.whois_renumber) FIX ----------------------------------------------------------------------- Este patch renumera algunos codigos de respuesta del WHOIS para hacerlos mas universales. Se activa si usamos DB_HISPANO/DB_ESNET. Los codigos renumerados son: 307 (undernet) IP del usuario -> 378 el usado en otras redes 308 (hispano) Nick Registrado -> 307 el usado en otras redes Esto hace ke BitchX se sienta inmensamente feliz :) * 1999/07/06 sa...@ap... (patch.DBH3) FEATURE ----------------------------------------------------------------------- En el fichero struct.h he ampliado con un nuevo campo la estructura Client, es un unsigned int llamado hmodes. Esto nos permitira dispo- ner de 32bits adicionales como flags de usuario. Estos nuevos flags son propagados si se definen en la tabla user_hmodes[] de s_user.c En este parche se hace uso del bit de menor peso de este nuevo campo, en el fichero s_bsd.h: #define HMODES_NICKREGISTERED 0x00000001 Y las macros asocicadas: IsNickRegistered(cptr); SetNickRegistered(cptr); ClearNickRegistered(cptr); Cuando alguien se pone un nick, se hace un Clear, y si acierta la clave se hace un SetNickRegistered. Este flag queda reflejado con la letra 'r' en los modos de usuario, y solo es aceptada si la envia un server (o por la autentificacion). Si un usuario esta conectado y registra su nick en los servicios, este flag se activara cuando llegue su registro DBH/DB. Y le sera borrado cuando se llegue un borrado de su registro. Los cambios son informados al usuario y propagados a la red. El /WHOIS ha sido ampliado (whocmds.c) para mostrar este nuevo 'flag' y he ocupado el ERROR 308 en los fichero s_err.c y numeric.h He cambiado los condicionales que comprueban en tablas si nick registrado por la nueva macro IsNickRegistered() Queda reflejado en el /VERSION como DBH3.Nr+...., cambiando el anterior texto (DBH2.N+....). He decidido cambiar a DBH3, pk las macros son y seran ampliamente usadas en futuras DBH's, y hago desaparecer la opcion de compilacion DBH_NICK_HACK quedando integrado todo su codigo en el que es activado por el #define DB_HISPANO ----------------------------------------------------------------------- * FINAL o INICIO de CAMBIOS, segun se mire :) --- NEW FILE: CAMBIOS2_10_07 --- $Id: CAMBIOS2_10_07,v 1.1 2002/08/21 17:59:40 zolty Exp $ * 2000/10/10 jc...@ar... (---) FIX ----------------------------------------------------------------------- Un "make distclean" tambien elimina los ficheros de la "zlib". Esto es bastante importante si cambiamos de arquitectura. Tambien se eliminan los ficheros de cache del "configure", por la misma razon. * 2000/10/05 jc...@ar... (---) FEATURE ----------------------------------------------------------------------- Un "/map" muestra, adicionalmente a lo normal: - El "numeric" del servidor - El lag con ese servidor (medido a partir de los "create") - El numero de usuario conectados a ese servidor * 2000/10/05 jc...@ar... (---) FEATURE ----------------------------------------------------------------------- Cuando se echa a un usuario con una nueva GLINE, se le informa a el y a los que tengan activada la mascara "s" correspondiente, de la razon del GLINE. * 2000/10/05 jc...@ar... (DB77) FEATURE ----------------------------------------------------------------------- Peticion de Sisco: el mensaje de 'class full' de cuando la clase de usuario se llene, que diga que su clase en este server esta llena, que pruebe /server libres.irc-hispano.org , Es muy efectivo y ya fue probado con exito en la transicion de pulsar a pulsar2.... * 2000/10/05 jc...@ar... (---) FEATURE ----------------------------------------------------------------------- Mostrar en "/stats Y" cuantos usuarios hay conectados en cada clase. Sino la unica opcion es hacer un "/trace", lo que ocasiona FLOOD. * 2000/08/16 jc...@ar... (clones7) FEATURE ----------------------------------------------------------------------- Las conexiones con clones no heredan "targets", para evitar que las sesiones se quiten targets entre si. * 2000/06/20 jc...@ar... (DB76) FEATURE ----------------------------------------------------------------------- Hago que los usuarios locales no puedan ACTIVAR los modos "SAR", aunque el server los acepta si llegan de un usuario remoto. De esta forma los usuarios no juegan con modos que no estan desplegados aun. * 2000/06/13 jc...@ar... (ZLIB10) FIX ----------------------------------------------------------------------- Tras horas de investigacion descubro un fallo en la implementacion de las "microrafagas": cuando trabajamos con microrafagas es perfectamente posible que tengamos que hacer FLUSH varias veces (no solo una), ya que ZLIB puede ir almacenando compresion de forma interna, y no soltarla hasta el final. Por tanto, hay que comprobar este caso especificamente, y no confiar en que un buffer de salida lo bastante grande sea suficiente, ya que antes se usaba ese buffer para un unico comando, y ahora lo usamos para todas las microrafagas que, en el caso de un NETJOIN, pueden ser varios megabytes. Cuando tengo que hacer varios FLUSH, aprovecho para usar "send_queued()". * 2000/06/13 jc...@ar... (Undernet20) SYNC ----------------------------------------------------------------------- Parches Undernet hasta version 12. Oculto la IP de los nodos tambien en el comando "uping". * 2000/06/12 jc...@ar... (ZLIB9) FEATURE ----------------------------------------------------------------------- Para evitar la posible carga de los malloc/free durante las microrafagas, implemente un sistema de cache, de forma que no haga falta pedir/liberar memoria constantemente. La cache se va purgando poco a poco, de forma que si en un momento dado se pidieron muchos recursos, esto se van liberando poco a poco. * 2000/06/12 jc...@ar... (ZLIB8) FIX ----------------------------------------------------------------------- Toda "microrafaga" que se abra, debe ser cerrada. Hay que tener cuidado con posibles "return" entre la apertura y cierre, ya que impiden el correcto cierre de la "microrafaga" si no se programa adecuadamente. Para curarnos en salud, an~ado una rutina nueva que fuerza una inicializacion del modulo de "microrafagas" entre lecturas de las conexiones server<->server. De esta forma cualquier microrafaga "huerfana" sera clausurada correctamente. An~ado tambien otro comando para eliminar "cptr" que se hayan cerrado, del sistema de "microrafagas". De esta forma no nos preocupara que una conexion se cierre mientras esta en una "microrafaga". * 2000/06/12 jc...@ar... (ZLIB7) FEATURE ----------------------------------------------------------------------- Intento realizar el FLUSH de compresion por grupos, no por comandos aislados. Ello supone la deteccion y aprovechamiento de las microrafagas, que son cuando se van a generar varios comandos de salida por una o mas conexiones. El caso mas obvio es un "netjoin", cuando el servidor transfiere al otro extremo todo el BURST. Otro caso bastante evidente es cuando se lee un bloque de otro nodo; cuando ese bloque tiene varios comandos, podemos considerar que hasta su final estamos trabajando con una "microrafaga". Por ultimo, tenemos el caso de la BDD. Cuando se cierra una microrafaga, se hace FLUSH de lo que pudiese haber quedado. * 2000/06/08 jc...@ar... (ZLIB6) CLEANUP ----------------------------------------------------------------------- Introduzco algunos "assert()" para casos que no deberian ocurrir nunca, y verifico todas las llamadas a la libreria ZLIB y de gestion de memoria asociadas, por si alguna falla (no deberia). * 2000/06/08 jc...@ar... (indent6) CLEANUP ----------------------------------------------------------------------- "make indent". * 2000/06/06 jc...@ar... (ZLIB5) FIX ----------------------------------------------------------------------- El servidor no compilaba correctamente si el sistema en el que se va a instalar NO tenia instalado ya la ZLIB (aunque use la local al servidor, no la instalada en el sistema). * 2000/05/23 jc...@ar... (CONFIG5) FEATURE/FIX ----------------------------------------------------------------------- Corregido un bucle infinito cuando se evalua la configuracion. "/stats f" muestra la configuracion de las lineas "F". La negociacion en los enlaces se activa en el "make config". Cambiados los textos de los "DEFINE". * 2000/05/23 jc...@ar... (CONFIG4) FEATURE ----------------------------------------------------------------------- Cambio "NACK" por "REQ", que es mas logico. Hago que las negociaciones entre nodos sean configurables mediante una nueva "F"-line. El primer campo indica el sentido salida, y el segundo el sentido entrada. Las mayusculas indican SIEMPRE, y las minusculas NUNCA. De momento defino "z" como ZLIB. * 2000/05/18 jc...@ar... (ZLIB4) FEATURE/FIX ----------------------------------------------------------------------- Un "stats l" muestra el trafico transferido realmente, y su nivel de compresion. Solo crea las estructuras de datos de compresion cuando se ha negociado afirmativamente la compresion (de forma independiente en cada sentido). Este cambio corrige tambien un grave "memory leak", debido a que se inicializaban unos 300Kbytes por conexion de usuario, para soportar posible compresion, pero no se liberaba si no se habia negociado compresion. * 2000/05/18 jc...@ar... (ZLIB3) FEATURE ----------------------------------------------------------------------- Primera version que se va a probar en la red en produccion. Se ha modificado "stats l" para que indique el porcentaje de compresion en recepcion y en transmision, por cada enlace. * 2000/05/18 jc...@ar... (CONFIG3) FEATURE ----------------------------------------------------------------------- Lo anterior no funciona todo lo bien que debiera, por multiples motivos explicados en mi web. Ahora trabajo considerando que algunas peticiones son "especulativas", y se accede a ellas o se ignoran tras resolverse el tipo de conexion. * 2000/05/18 jc...@ar... (CONFIG2) FEATURE ----------------------------------------------------------------------- Cuando se unen dos servers, se envia un "ping" y toda la negociacion, y solo se manda el BURST cuando llega el "pong" de respuesta. Ello permite negociar ANTES de transmitir el burst. * 2000/05/17 jc...@ar... (CONFIG1) FEATURE ----------------------------------------------------------------------- Primera implementacion del protocolo de negociacion entre servidores. Se basa en el PPP. Un servidor solicita a otro una "feature" mediante un NAK, y este la confirma activa con un ACK. Si no reconoce la feature, devuelve un REJ. * 2000/05/17 jc...@ar... (ZLIB2) FEATURE ---------------------------------------------------------------------- An~ado los flags "ZLIB_ESNET_IN" y "ZLIB_ESNET_OUT" a la estructura de servidor. Tambien an~ado dos estructuras "z_stream". Compilo la libreria ZLIB *ANTES* de compilar el servidor, para que no se enlace con una version anticuada o preinstalada. Compresion de la salida a servidor activada "a pin~on fijo", para verificar que funciona bien. * 2000/05/16 jc...@ar... (ZLIB1) FEATURE ----------------------------------------------------------------------- An~adida la libreria ZLIB de forma interna, para no depender de que se tenga una version instalada y actualizada en el sistema. Se configura y se compila correctamente. Se an~ade una opcion de configuracion para permitir activar o desactivar la "feature" en tiempo de compilacion. * 2000/05/16 jc...@ar... (Undernet19) SYNC ----------------------------------------------------------------------- Parches Undernet hasta version 11. * 2000/04/04 jc...@ar... (DB75) FIX ----------------------------------------------------------------------- Correccion al parche DB71. Si el HUB manda una orden de borrado, no hace falta mandarle nada mas, ni registros ni "B", ya que la orden de borrado sera confirmada y se pedira la base de datos de nuevo. * 2000/04/04 jc...@ar... (DB74) FIX ----------------------------------------------------------------------- El parche db52 es erroneo, porque bajo ciertas condiciones se saltaba "hubs", y es imperativo desconectar de todos ellos. El sintoma es que si una tabla es muy corta, si se corrompe se genera un bucle entre el nodo y el hub. Ver parche DB71. * 2000/04/04 jc...@ar... (---) FIX ----------------------------------------------------------------------- Compila con la opcion de DEBUG activada. * 2000/04/03 jc...@ar... (DB73) FIX? ----------------------------------------------------------------------- En algunas maquinas parece que la compactacisn da problemas, por alguna razon desconocida. En Solaris parece que todo funciona bien, y no he logrado reproducir el problema en mis Linux. He modificado la forma de realizar las compactaciones para verificar si se trata de un bug del Kernel Linux, bajo determinadas condiciones, o no. * 2000/03/28 jc...@ar... (---) FEATURE ----------------------------------------------------------------------- Elimino la opcion "DBH_OPER_HACK_ONLYREG" en la configuracisn, ya que ahora mismo no tiene sentido. No obstante dejo todo el codigo en el servidor, para el futuro. * 2000/03/28 jc...@ar... (---) FEATURE ----------------------------------------------------------------------- Por defecto, los opers deberian poder entrar en cualquier canal usando el comando "join # OPER". Ahora esta puesto que solo puedan entrar en los canales registrados en la base de datos distribuida, lo que es un problema porque no hay ninguno :-) En el futuro se devolvera a este flag a su valor normal. Por lo pronto, la compilacion de servidores nuevos debe realizarse cambiando esta opcion en el "make config". Probablemente, lo mas inteligente seria eliminar esta opcion. * 2000/03/09 jc...@ar... (VIP13) FIX ----------------------------------------------------------------------- Elimina las dependencias big endian/little endian a la hora de calcular las IPs virtuales. Por otra parte, el codigo original de savage era defectuoso y no permitia recuperar una IP cifrada. Cambio el sistema de cifrado. * 2000/03/09 jc...@ar... (VIP12) FIX ----------------------------------------------------------------------- Complemento al parche VIP11: aparte del kill, tampoco muestra en el status de los usuarios conectados al servidor, cuando un IRCop ejecuta el comando "/oper" con exito. Si "/oper" falla, solo se enteran los IRCops, no todos los usuarios. Esto ya estaba de antes. * 2000/03/09 jc...@ar... (db71) FIX ----------------------------------------------------------------------- Cuando un nodo detecta que una de las bases de datos locales esta corrupta, la borra y solicita actualizaciones a su HUB. Habia un problema cuando la base de datos en si era lo bastante pequen~a como para transferirla en una unica rafaga: - El nodo con la BDD corrupta borra la base de datos y emite un "J 0" a su hub, indicandole que le reenvie de nuevo. - Si el HUB tenia ya el grifo abierto, envia una orden de borrado y la base de datos. Si cabe entera en una rafaga, abre el grifo de nuevo. - El nodo original recibe la orden de borrado y la responde con otro "J 0" - Dado que el HUB recibe otro "J 0" con grifo abierto, se vuelve a repetir el proceso. La solucion a este problema es no enviar la base de datos, sino un comando "B num_registro", para que el otro extremo nos la pida. Es decir, no hacemos un "push", sino que tiene que ser el otro extremo quien nos haga el "pull". * 2000/03/09 jc...@ar... (VIP11) FIX ----------------------------------------------------------------------- Cuando un IRCop hace un "kill", en el "path" aparece su IP virtual, si tiene. * 2000/03/08 jc...@ar... (db70) FIX ----------------------------------------------------------------------- Cuando llegaba una orden de compactacion de la base de datos con contenido (por ejemplo, una frase explicativa), se producia una compactacion (correcto) y no se guarda dicho registro en memoria aunque si en disco (correcto). El problema es que si se reinicia el servidor IRC, o se hace un /rehash, se leen todos los registros de disco... incluyendo el registro de compactado... y se almacena en memoria (mal). Lo que hago es leer todo el fichero, como siempre, y al final borrar cualquier posible registro de compactado que hayamos podido capturar en memoria. El problema solo se producia cuando se releia la base de datos de disco (reinicio o rehash) *Y* el registro de compactado tenia algun texto explicativo. * 2000/03/08 jc...@ar... (db69) FEATURE ----------------------------------------------------------------------- En resumen, si un nick registrado cambia a otro nick (independientemente de que este registrado), anula sus flags: r - Nick Registrado h - Operador (helper) x - Ocultacion de IP Adicionalmente, si no es IRCop, anula tambien el flag: X - Poder ver IPs ocultas. 02/Mar/00 Complemento a la entrada siguiente. Cuando se pasa de un nick registrado a otro tambien registrado, deberia haber un estado "intermedio" sin registro, para que se detecte correctamente que se trata de otro usuario tambien registrado. Ejemplo: :pepe mode :-rhx :pepe nick :juan :juan mode :+rhx O eso o, lo logico, ampliar el comando "nick" para que envie tambien los modos. 02/Mar/00 Cuando un usuario con nick registrado pasa a nick sin registrar, el servidor deberia quitar los modos ANTES de cambiar el nick. En realidad, lo bueno seria que justo antes del cambio de nick se enviasen los modos que se PIERDEN y justo despues los modos que se ganan. * 2000/02/15 jc...@ar... (db68) FIX ----------------------------------------------------------------------- Si un "helper" cambia de nick y se pone otro nick registrado, el resto de la red no lo vera como "helper", pero su nodo lo seguira considerando "helper". Problema detectado por {^DaNi^}. Debe propagar modos al resto de la red y ajustar modos en el nodo local. * 2000/01/24 jc...@ar... (NoProxy17) FEATURE ----------------------------------------------------------------------- Si la verificacion SOCKS no llega a conectar, porque por ejemplo la maquina destino tiene un cortafuegos o lo tiene el propio servidor de IRC (no deberia bloquear la salida), almacena en la cache SOCKS que la verificacion tuvo exito. * 2000/01/24 jc...@ar... (undernet18) SYNC ----------------------------------------------------------------------- Parches Undernet. Glines a canales Ocultacion de las IPs de los nodos/HUBs. * 2000/01/21 jc...@ar... (NoProxy16) FIX ----------------------------------------------------------------------- El parche original de SOCKS hace verificacion de SOCKS tambien cuando un servidor se conecta a otro. Y encima el servidor que realiza la verificacion en aquel que inicia la conexion... Lo cual es innecesario. * 2000/01/21 jc...@ar... (undernet17) SYNC ----------------------------------------------------------------------- Sincronizacion con parches Undernet. Un operador puede entrar en un canal local si usa la clave "OVERRIDE". * 2000/01/20 jc...@ar... (NoProxy15) FIX ----------------------------------------------------------------------- En NoProxy14 se leia el canal, pero luego no se hacia nada con el y se seguia enviando a #opers. * 2000/01/20 jc...@ar... (NoProxy14) FEATURE ----------------------------------------------------------------------- Las notificaciones de proxy abierto no se envian a #opers, sino al canal que se indique en la BDD "b" bajo la clave "sockschannel". * 2000/01/20 jc...@ar... (VIP10) FIX ----------------------------------------------------------------------- Si un usuario cambia de nick, hay que regenerar su IP virtual. Sino, nos sigue saliendo la antigua cuando se vuelve a poner el nick. Se nota si la IP virtual del usuario cambia, por ejemplo porque cambie la clave de cifrado o porque cambie su entrada en la BDD "v". Lo sencillo es borrar la IP virtual cuando se cambia el nick. * 2000/01/18 jc...@ar... (NoProxy13) FIX ----------------------------------------------------------------------- A veces, cuando un proxy esta abierto, parece que informa de ello dos veces. La casuistica es sencilla: si se inician dos conexiones desde un proxy abierto, como cuando se inicia la verificacion todavia no sabemos el resultado, haremos dos verificaciones y, por tanto, dos informes. La solucion es sencilla: antes de imprimir el informe, hay que ver si ya tenemos su valor en la cache. Si es asi, no informa en absoluto, porque se acaba de hacer. Lo malo es que la segunda vez suele indicar la IP resuelta, y con esto lo perdemos. * 2000/01/17 jc...@ar... (clones6) FEATURE ----------------------------------------------------------------------- Cuando se dice que el resultado de una verificacion SOCKS esta "cached", debe indicarse tambien cuanto tiempo de vida le queda. * 2000/01/17 jc...@ar... (clones5) FIX ----------------------------------------------------------------------- ?Corrige el problema de core dump?. * 2000/01/17 jc...@ar... (NoProxy12) FEATURE ----------------------------------------------------------------------- Dado que ahora se hace cache tanto del resultado positivo como negativo de la verificacion de proxy, ya no tiene sentido tener una cache separada para no hacer "flood" de mensajes de aviso (NoProxy10). * 2000/01/17 jc...@ar... (indent5) CLEANUP ----------------------------------------------------------------------- "make indent". * 2000/01/17 jc...@ar... (NoProxy11) FEATURE ----------------------------------------------------------------------- Despliego una cache negativa de proxies abiertos. Si un proxy esta abierto, y tiene iline, le doy 30 minutos de cache. Si no tiene iline, le pongo 4 horas. El efecto es comparable a tener una gline local. * 2000/01/17 jc...@ar... (NoProxy10) FEATURE ----------------------------------------------------------------------- No muestra mensajes repetidos de proxy inseguro (NoProxy9) si las conexiones se producen en menos de 10 minutos. * 2000/01/17 jc...@ar... (clones4) FEATURE ----------------------------------------------------------------------- Si una conexion tiene clones reconocidos, no hereda "target". * 2000/01/14 jc...@ar... (NoProxy9) FEATURE ----------------------------------------------------------------------- Cuando se detecta la entrada desde un proxy inseguro, el servidor en cuestion debe anunciarlo en el canal "#opers". * 2000/01/14 jc...@ar... (VIP9) FIX ----------------------------------------------------------------------- Completa VIP8. * 2000/01/14 jc...@ar... (VIP8) FEATURE ----------------------------------------------------------------------- "Lazy Virtual Host". Calcula el Virtual Host solo la primera vez que alguien solicita informacion sobre ese usuario. De esta forma nos ahorramos calcular host virtuales de forma innecesaria, ademas de repartir el cifrado a lo largo del tiempo, en vez de concentrarlo en, por ejemplo, el BURST. La casuistica es: + Activar +x - Cuando se conecta un usuario con nick registrado - Cuando un usuario se pone +x - Cuando nos llega un usuario con +x remoto + Desactivar +x - Cuando un usuario de pone -x - Cuando el nick se desregistra desde la red * 2000/01/14 jc...@ar... (VIP7) FIX ----------------------------------------------------------------------- Si a un usuario se le va a cifrar su IP, pero la clave de cifrado no esta en la base de datos, se pone el host ""no.hay.clave.de.cifrado". Incluyo algunos "Sanity Checks" en el trabajo con la base de datos de IPs virtuales. * 2000/01/11 jc...@ar... (VIP6) FEATURE ----------------------------------------------------------------------- Un "UserIP" sobre un usuario con IP protegida debe mostar "0.0.0.0", no "127.0.0.1". * 2000/01/11 jc...@ar... (VIP5) FEATURE ----------------------------------------------------------------------- No permite que un servidor remoto ponga en un usuario arbitrario los modos +h, +x, o +X. Si un nick no esta registrado (o se desregistra), no tolera +h, +x, +X. * 2000/01/11 jc...@ar... (Undernet16) SYNC ----------------------------------------------------------------------- Sincronizacion con parches Undernet. * 2000/01/10 jc...@ar... (db67) FIX ----------------------------------------------------------------------- Los cambios efectuados no tenian en cuenta que pudiese llegar por la red un registro no normalizado. * 2000/01/10 jc...@ar... (indent4) CLEANUP ----------------------------------------------------------------------- "make indent". * 2000/01/10 jc...@ar... (db66) FEATURE ----------------------------------------------------------------------- Sigo preparando la gestion directa de las BDD a partir de su MMAP. En esta ocasion, paso la responsabilidad de la escritura en disco a "db_alta()". * 2000/01/10 jc...@ar... (db65) FEATURE ----------------------------------------------------------------------- Cuando se busca un registro, devolvemos una copia, y no el registro real. De esta forma vamos preparando el camino para eliminar los registros de memoria y leerlos directamente de MMAP. Como el resto del programa no sabe esto, trabajamos con una pequen~a cache de registros (32 valores), en la que se van copiando los registros que se piden, sobreescribiendo los registros antiguos en un anillo. * 2000/01/10 jc...@ar... (db64) FEATURE ----------------------------------------------------------------------- No almacenamos el destinatario en memoria. * 2000/01/10 jc...@ar... (db63) FEATURE ----------------------------------------------------------------------- Ya no se usan "malloc/free" para trabajar con la memoria temporal necesaria para normalizar datos en la base de datos; cuando se va a realizar una operacion, vemos si el bloque que tenemos es suficiente. Si no lo es, lo libera y pide otro mas grande. De esta forma eliminamos muchas llamadas de gestion de memoria, y reducimos la fragmentacion. Tambien se corrigen un par de BUGS en la gestion de memoria de las BDD. * 2000/01/10 jc...@ar... (clones3) FEATURE ----------------------------------------------------------------------- El mensaje cuando se supera el limite de clones deberia publicitar la pagina web de compra. El mensaje a imprimir se referencia como el registro ".." en BDD - 'i'. * 2000/01/10 jc...@ar... (db62) FEATURE ----------------------------------------------------------------------- Cuando el servidor muere por culpa de la base de datos, se guarda en el SYSLOG el PATH al directorio con la base de datos problematica. * 2000/01/10 jc...@ar... (db61) FIX ----------------------------------------------------------------------- En la instalacion "make install" se usaba IRCDOWN/IRCDGRP para fijar los permisos de la base de datos, cuando deberia utilizarse IRC_UID/IRC_GID. En todo caso, ambos valores deberian ser equivalentes, salvo por el hecho de que uno es informacisn textual y el otro es numerico. * 2000/01/05 jc...@ar... (undernet15) SYNC ----------------------------------------------------------------------- Sincronizacion con parches Undernet. * 2000/01/04 jc...@ar... (db60) CLEANUP ----------------------------------------------------------------------- Mas aislamiento de BDD y borrado de una rutina que ya no se utiliza. * 2000/01/03 jc...@ar... (db59) FIX ----------------------------------------------------------------------- Es importante recordar que cuando se an~ade la gestion de una nueva BDD hay que modificar el "make install", para que no la borre cada vez que se instala una nueva version del servidor. Eso era lo que pasaba con la base de datos "t". * 2000/01/03 jc...@ar... (db58) FIX ----------------------------------------------------------------------- [13:03] <YaW> Si un usuario tiene el nick registrado en la DB y al conectar se identifica (/server servidor puerto nick pass). El servidor primero hace un MODE en P9 y posteriormente un NICK en P10. [13:03] <YaW> solucion: pasarlo todo en la linea NICK JCEA: Cuando se introduce la clave en el nick, se envia inmediatamente el modo sin que se haya propagado aun el nuevo usuario, ya que todavia no se ha registrado contestando al PING Si la clave se introduce como "pass", pasa lo mismo. La solucion es sencilla: cuando se van a propagar los modos por la red, solo lo hace si el USUARIO esta registrado. Es decir, si se ha conectado, ha introducido sus datos y ha respondido al PING. * 2000/01/03 jc...@ar... (db57) FEATURE ----------------------------------------------------------------------- Parche complementario al anterior, verificando tambien las BDD leidas desde disco. Este parche no deberia ser necesario si no fuera porque ya se han propagado bases de datos corruptas, antes de desplegar DB56. * 2000/01/03 jc...@ar... (db56) FEATURE ----------------------------------------------------------------------- Solo acepta un registro nuevo cuando referencia una BDD correcta. Es decir, cuando la BDD referenciada es 'a'-'z' o 'N'. En particular, no acepta registros cuyo campo de base de datos conste de mas de un caracter. De esa forma se pretende limitar el peligro de cometer un error si se utilizan comandos "RAW". * 2000/01/03 jc...@ar... (db55) FEATURE ----------------------------------------------------------------------- Aumenta la informacion que proporciona la respuesta al comando "Q" de las bases de datos distribuidas. Ahora proporciona tambien el numero de registros que contiene. Este cambio es compatible con el protocolo previo, a nivel de servidores. No asi a nivel de SERVICES que implementen "Q". * 2000/01/03 jc...@ar... (db54) CLEANUP ----------------------------------------------------------------------- Concentra todas las operaciones "internas" (menos el hashing) de las bases de datos en el modulo de bases de datos. Entre otras cosas, eso supone exportar menos entorno en el *.h * 2000/01/03 jc...@ar... (undernet14) SYNC ----------------------------------------------------------------------- Fix Y2K proveniente de Undernet. En realidad el problema ocurre todos los an~os, entre el periodo en que la zona local ha cambiado de an~o, pero GMT todavia no lo ha hecho. * 1999/12/21 jc...@ar... (patch.global7) FIX ----------------------------------------------------------------------- Cuando un global se pasaba de nodo en nodo, se perdia el texto del mensaje. * 1999/12/20 jc...@ar... (patch.clones2) FIX ----------------------------------------------------------------------- Si tiene permiso de clones, nunca debe bloquear las conexiones con "Throttled". En la version anterior, solo se eliminaba la posibilidad de throttle cuando se superaba el numero maximo de conexiones, no cuando se entraba y salia repetidamente. * 1999/12/16 jc...@ar... (patch.global6) FIX ----------------------------------------------------------------------- Por alguna extran~a razon, borre un parametro de una funcion con parametros variables, provocando core dump. * 1999/12/16 jc...@ar... (patch.global5) FIX ----------------------------------------------------------------------- Se iban an~adiendo prefijos "Mensaje Global" en cada "hop". * 1999/12/16 jc...@ar... (patch.NoProxy8) FEATURE ----------------------------------------------------------------------- En la cache NoProxy, si la conexion proviene de una IP con clones, se le dan cuatro horas de validez, en lugar de los 30 minutos. * 1999/12/13 jc...@ar... (undernet13.patch) SYNC ----------------------------------------------------------------------- Fix proveniente de Undernet. * 1999/12/13 jc...@ar... (patch.indent3) SYNC ----------------------------------------------------------------------- "make indent". * 1999/12/13 jc...@ar... (patch.global4) FIX ----------------------------------------------------------------------- Soluciona "Target Left IRC". * 1999/12/13 jc...@ar... (patch.global3) FIX ----------------------------------------------------------------------- Corregido Core Dump. * 1999/12/10 jc...@ar... (patch.global2) FEATURE ----------------------------------------------------------------------- Con el cambio anterior, ya no se reconocen los mensajes globales. An~adimos el texto "MENSAJE GLOBAL", asi como el nick del remitente y la mascara de destino. * 1999/12/10 jc...@ar... (patch.global1) FEATURE ----------------------------------------------------------------------- Para evitar que el mIRC meta los globales en la ventana de status, hacemos que cada usuario vea el global como un mensaje privado dirigido a el personalmente. Por cierto, un privado con destino "$..." se distribuye entre los usuarios conectados a los servidores que cumplen la mascara. Si el destino es "#...", el global se distribuye entre los usuarios de la red cuya IP/Hostname cumple la mascara. Si se requiere una personalizacion mayor, se puede recurrir al envio de mensajes personales o, mejor, /privmsg n1,n2,n3,n4,n5... * 1999/12/10 jc...@ar... (patch.NoProxy7) FIX ----------------------------------------------------------------------- Los servidores no tienen entrada en IPcheck, asi que no debemos hacer "SetIPChecked()" de forma indiscriminada en "IPcheck_proxy_cache_set()". * 1999/12/10 sa...@ap... (patch.dbh17) FIX ----------------------------------------------------------------------- El pseudoBot de nicks nos habla por NOTICE en lugar de PRIVMSG, lo hago pensando en no liar mucho la migración de cara a los scripts. * 1999/12/09 jc...@ar... (patch.NoProxy6) FIX ----------------------------------------------------------------------- El parche "NoProxy5" no hacia cache dependiendo del tipo de error en el intento de conexion para verificar. * 1999/12/09 jc...@ar... (patch.NoProxy5) FEATURE ----------------------------------------------------------------------- Mantiene una cache del resultado de las comprobaciones de PROXY abierto. Si el proxy estaba cerrado, le da una validez de 30 minutos. Si el PROXY estaba abierto, realiza la comprobacion de nuevo siempre. * 1999/12/09 jc...@ar... (undernet12.patch) SYNC ----------------------------------------------------------------------- Incluimos los tres primeros parches de Undernet para 2.10.07 Algunos detalles: - Uno de los parches permite que los IRCops no tengan limitado el numero de canales en los que puede entrar simultaneamente. Eso ya estaba implementado en nuestro codigo. - Otros parches conceden numerosos privilegios a los IRCops, dentro de canales locales. Nosotros hacemos lo mismo, pero para todos los canales, no solo los locales. * 1999/11/19 sa...@ap... (patch.db53) FIX ----------------------------------------------------------------------- Linux 2.0/libc5 no contiene algunas definiciones en mman.h, como són MAP_NORESERVE y MAP_FAILED. Digital Unix no contiene MAP_NORESERVE, los he incorporado en s_bdd.h, MAP_NORESERVE=0 y MAP_FAILED=((void*)-1) * 1999/11/18 sa...@ap... (patch.db52) FIX ----------------------------------------------------------------------- Si está corrupta una tabla, al hacer REHASH (o kill -1) muere el daemon al desconectar de los hubs, pk un puntero keda invalidado. Se ha corregido con este patch. * 1999/11/18 sa...@ap... (patch.dbh16) FEATURE ----------------------------------------------------------------------- Los textos referentes a autenticación de usuario se enviaran con origen nombe.de.server y NOTICE , excepto si existe un registro 'nickserv' en la tabla 'b', en cuyo caso se enviaran con origen el contenido de dicho registro mediante PRIVMSG. Resumiendo: :jupiter.irc-hispano.org NOTICE usuario :*** Utiliza /NICK usuari... o bien: :NiCK PRIVMSG usuario :*** Utiliza /NICK usuario:clave para ident... * INICIO de CAMBIOS para "ircu2.10.07" --- NEW FILE: CAMBIOS2_10_H_01 --- $Id: CAMBIOS2_10_H_01,v 1.1 2002/08/21 17:59:40 zolty Exp $ * 2000/11/16 jc...@ar... (VIP18 - u2.10.H.01.28) FIX ----------------------------------------------------------------------- Cuando un usuario cambia de nick registrado a no registrado, y al reves, y el nick registrado tiene IP virtual propia, la IP virtual del usuario no cambia. Ahora se verifican posibles cambios en la IP virtual cuando el usuario gana o pierde el flag "+r". * 2000/11/16 jc...@ar... (u2.10.H.01.27) CLEANUP ----------------------------------------------------------------------- "make indent" * 2000/11/16 jc...@ar... (VIP17 - u2.10.H.01.26) FIX ----------------------------------------------------------------------- Modificamos el servidor para que una red hibrida con nodos con IP virtual para todo el mundo, y nodos con IP virtual solo para registrados puedan convivir sin problemas. Los nodos mas restrictivos no pondran el +x a sus usuarios, pero deben aceptar el +x que les llegue de otro nodo. * 2000/11/16 jc...@ar... (VIP16 - u2.10.H.01.24) FIX ----------------------------------------------------------------------- Aparecian algunos usuarios ajenos con modo "+x" de forma aleatoria. El problema se producia cuando un usuario externo cambiaba de nick, que siempre se le ponia el "+x", aunque el nodo original no enviase dicho modo. * 2000/11/16 jc...@ar... (VIP15 - u2.10.H.01.23) FEATURE ----------------------------------------------------------------------- Solo debe verificar la clave de nick registrado cuando se trata de conexiones locales. Solo acude a la base de datos para ver si un nick esta registrado si se trata de una conexion local. Esto incrementa el rendimiento de forma notable, sobre todo en los "net join". * 2000/11/15 jc...@ar... (u2.10.H.01.22) FEATURE ----------------------------------------------------------------------- Cuando se produce un "connect", solo se informa del mismo a los IRCops y Helpers. * 2000/11/15 jc...@ar... (u2.10.H.01.21) FEATURE ----------------------------------------------------------------------- Cuando un usuario esta siendo bloqueado por "silence", deberia salirle algo en pantalla. Esto afecta a "invite", "message" y "notice". Tambien afecta a "cnotice" y "cprivmsg". Los mensajes cuyo destinatario es un canal, no informan si hay un silence en algunos usuarios de un canal. * 2000/11/15 jc...@ar... (u2.10.H.01.20) FEATURE ----------------------------------------------------------------------- Los Helpers pueden solicitar listados largos "who", y ven los modos "i", "w" y "g" de los usuarios, como se fueran IRCops. * 2000/11/15 jc...@ar... (u2.10.H.01.19) FEATURE ----------------------------------------------------------------------- Los opers deberian tener acceso al flag "x" del comando /who. * 2000/11/15 jc...@ar... (VIP14 - u2.19.H.01.18) FEATURE ----------------------------------------------------------------------- Todos los usuarios tienen IP virtual. * 2000/11/06 jc...@ar... (u2.10.H.01.16) FEATURE ----------------------------------------------------------------------- Define un par de flags nuevos para no mezclar demasiado el tema de los informes de "rename". Documentado en http://www.argo.es/~jcea/irc/modos.htm * 2000/10/19 jc...@ar... (u2.10.H.01.15) FEATURE ----------------------------------------------------------------------- Un "/who" a un Oper (Helper) tambien devuelve el asterisco marcador de IRCop, de forma que algunos scripts te sacan con colorines :-). * 2000/10/19 jc...@ar... (u2.10.H.01.14) FEATURE ----------------------------------------------------------------------- Cuando un usuario hace un "/who 0 o" tambien le salen los Opers, ya que los IRCops son una especie en extencion en IRC-Hispano :-). * 2000/10/19 jc...@ar... (---) FIX ----------------------------------------------------------------------- Solucionado un problema con el comando "LIST", que ocasionaba que solo aparecieran los canales cuyo topic ha cambiado en los ultimos 10 minutos. El problema era debido a un fallo de reconocimiento de la version del servidor, por parte del mIRC. Se ha solucionado cambiando nuestra version de server, de "ircu2.10.H.01.13" a "u2.10.H.01.13". Un sistema de deteccion un tanto precario... * 2000/10/16 jc...@ar... (---) FIX ----------------------------------------------------------------------- Solucionado un problema de compilacion cuando se configura el servidor para que no soporte compresion en los enlaces. Solucionado un problema de dependencias para "m_config.c". * 2000/10/15 jc...@ar... (NICK05) FIX ----------------------------------------------------------------------- El Kill se mandaba dos veces. * 2000/10/15 jc...@ar... (NICK04) FIX ----------------------------------------------------------------------- Problemas cuando se hace un "rename" a un nick al que ya se hizo rename antes. El usuario se mata, porque el nick reasignado esta en uso, pero luego se intentaba hacer cosas con el AUNQUE ya estaba muerto. Ello generaba "core dump" esporadicos. * 2000/10/15 jc...@ar... (NICK03) FIX ----------------------------------------------------------------------- El cliente recibia dos veces su cambio de nick. * 2000/10/15 jc...@ar... (NICK02) FIX ----------------------------------------------------------------------- Solucionado un problema con el "RENAME" si el nick primitivo tie... [truncated message content] |
From: Zolty <zo...@us...> - 2002-08-21 17:59:43
|
Update of /cvsroot/irc-dev/ircdh/include In directory usw-pr-cvs1:/tmp/cvs-serv10291/ircdh/include Modified Files: IPcheck.h support.h Added Files: ircd_chattr.h ircd_string.h Removed Files: common.h Log Message: 2002-08-21 Toni Garcia <zo...@ir...> * ircd/common.c/.h: Ha sido eliminado. * ircd/table_gen: La tabla de caracteres que estaba en common.c ha sido colocado en este nuevo fichero. * ircd/ircd_string.c/h: Las funciones que estaban en common.c y en support.c han sido movidos al nuevo fichero. Y se sustituyen en el codigo los "strtoken" por el nuevo "ircd_strtok". * Movidos los archivos viejos de "ChangeLog" de Hispano y Undernet al directorio doc/history. A partir de ahora se documentan los cambios en este fichero "ChangeLog". --- NEW FILE: ircd_chattr.h --- /* * IRC - Internet Relay Chat, include/ircd_chattr.h * Copyright (C) 1998 Andrea Cocito * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: ircd_chattr.h,v 1.1 2002/08/21 17:59:40 zolty Exp $ */ /* * All the code in common.h/common.c is taken from the NTL * (Nemesi's Tools Library), adapted for ircu's character set * and thereafter released under GNU GPL, from there comes the * NTL_ prefix of all macro and object names. * Removed isXdigit() to leave space to other char sets in the * bitmap, should give the same results as isxdigit() on any * implementation and isn't used in IRC anyway. */ #ifndef INCLUDED_ircd_chattr_h #define INCLUDED_ircd_chattr_h #ifndef INCLUDED_limits_h #include <limits.h> #define INCLUDED_limits_h #endif #ifndef INCLUDED_sys_types_h #include <sys/types.h> #define INCLUDED_sys_types_h #endif /* * Character attribute macros */ #define NTL_ALNUM 0x0001 /* (NTL_ALPHA | NTL_DIGIT) */ #define NTL_ALPHA 0x0002 /* (NTL_LOWER | NTL_UPPER) */ #define NTL_CNTRL 0x0004 /* \000 - \037 == 0x00 - 0x1F */ #define NTL_DIGIT 0x0008 /* 0123456789 */ #define NTL_GRAPH 0x0010 /* (NTL_ALNUM | NTL_PUNCT) */ #define NTL_LOWER 0x0020 /* abcdefghijklmnopqrstuvwxyz{|}~ */ #define NTL_PRINT 0x0040 /* (NTL_GRAPH | ' ') */ #define NTL_PUNCT 0x0080 /* !"#$%&'()*+,-./:;<=>?@_` */ #define NTL_SPACE 0x0100 /* \011\012\013\014\015\040 */ #define NTL_UPPER 0x0200 /* ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ */ #define NTL_IRCCH 0x0400 /* Channel's names charset */ #define NTL_IRCCL 0x0800 /* Force toLower() in ch-name */ #define NTL_IRCNK 0x1000 /* Nick names charset, aka isvalid() */ #define NTL_IRCUI 0x2000 /* UserIDs charset, IRCHN plus tilde */ #define NTL_IRCHN 0x4000 /* Hostnames charset (weak, RFC 1033) */ #define NTL_IRCIP 0x8000 /* Numeric IPs charset (DIGIT and .) */ #define NTL_EOL 0x10000 /* \r\n */ #define NTL_KTIME 0x20000 /* Valid character for a k:line time */ #define NTL_CHPFX 0x40000 /* channel prefix char # & + */ /* * Tables used for translation and classification macros */ extern const char ToLowerTab_8859_1[]; extern const char ToUpperTab_8859_1[]; extern const unsigned int IRCD_CharAttrTab[]; /* * Translation macros for channel name case translation * NOTE: Channel names are supposed to be lower case insensitive for * ISO 8859-1 character sets. */ #define ToLower(c) (ToLowerTab_8859_1[(c) - CHAR_MIN]) #define ToUpper(c) (ToUpperTab_8859_1[(c) - CHAR_MIN]) /* * Character classification macros * NOTE: The IsUpper and IsLower macros do not apply to the complete * ISO 8859-1 character set, unlike the ToUpper and ToLower macros above. * IsUpper and IsLower only apply for comparisons of the US ASCII subset. */ #define IsAlnum(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_ALNUM) #define IsAlpha(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_ALPHA) #define IsDigit(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_DIGIT) #define IsLower(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_LOWER) #define IsSpace(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_SPACE) #define IsUpper(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_UPPER) #define IsCntrl(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_CNTRL) #define IsChannelChar(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_IRCCH) #define IsChannelLower(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_IRCCL) #define IsChannelPrefix(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_CHPFX) #define IsNickChar(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_IRCNK) #define IsUserChar(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_IRCUI) #define IsHostChar(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_IRCHN) #define IsIPChar(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_IRCIP) #define IsEol(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_EOL) #define IsKTimeChar(c) (IRCD_CharAttrTab[(c) - CHAR_MIN] & NTL_KTIME) #endif /* INCLUDED_ircd_chattr_h */ --- NEW FILE: ircd_string.h --- /* * IRC - Internet Relay Chat, ircd/ircd_string.h * Copyright (C) 1999 Thomas Helvey * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: ircd_string.h,v 1.1 2002/08/21 17:59:40 zolty Exp $ */ #ifndef INCLUDED_ircd_string_h #define INCLUDED_ircd_string_h #ifndef INCLUDED_config_h #include "config.h" #endif #ifndef INCLUDED_ircd_chattr_h #include "ircd_chattr.h" #endif #include <netinet/in.h> /* * Macros */ #define EmptyString(x) (!(x) || !(*x)) extern char *ircd_strncpy(char *dest, const char *src, size_t len); extern int ircd_strcmp(const char *a, const char *b); extern int ircd_strncmp(const char *a, const char *b, size_t n); extern int unique_name_vector(char *names, char token, char **vector, int size); extern int token_vector(char *names, char token, char **vector, int size); /* provisional */ extern char *inetntoa(struct in_addr in); extern const char *ircd_ntoa(const char *addr); extern const char *ircd_ntoa_r(char *buf, const char *addr); extern char *host_from_uh(char *buf, const char *userhost, size_t len); extern char *ircd_strtok(char **save, char *str, char *fs); #if 0 extern char *sprintf_irc(char *str, const char *format, ...); #endif extern char *canonize(char *buf); /* #define DupString(x, y) (strcpy((x = (char*) MyMalloc(strlen(y) + 1)), y)) */ #define DupString(x, y) (strcpy((x = (char*) RunMalloc(strlen(y) + 1)), y)) /* String classification pseudo-functions, when others are needed add them, strIsXxxxx(s) is true when IsXxxxx(c) is true for every char in s */ #define strIsAlnum(s) (strChattr(s) & NTL_ALNUM) #define strIsAlpha(s) (strChattr(s) & NTL_ALPHA) #define strIsDigit(s) (strChattr(s) & NTL_DIGIT) #define strIsLower(s) (strChattr(s) & NTL_LOWER) #define strIsSpace(s) (strChattr(s) & NTL_SPACE) #define strIsUpper(s) (strChattr(s) & NTL_UPPER) #define strIsIrcCh(s) (strChattr(s) & NTL_IRCCH) #define strIsIrcCl(s) (strChattr(s) & NTL_IRCCL) #define strIsIrcNk(s) (strChattr(s) & NTL_IRCNK) #define strIsIrcUi(s) (strChattr(s) & NTL_IRCUI) #define strIsIrcHn(s) (strChattr(s) & NTL_IRCHN) #define strIsIrcIp(s) (strChattr(s) & NTL_IRCIP) /* * Critical small functions to inline even in separate compilation * when FORCEINLINE is defined (provided you have a compiler that supports * `inline'). */ #define NTL_HDR_strChattr unsigned int strChattr(const char *s) #define NTL_SRC_strChattr const char *rs = s; \ unsigned int x = ~0; \ while(*rs) \ x &= IRCD_CharAttrTab[*rs++ - CHAR_MIN]; \ return x; /* * XXX - bleah should return 1 if different 0 if the same */ #define NTL_HDR_strCasediff int strCasediff(const char *a, const char *b) #define NTL_SRC_strCasediff const char *ra = a; \ const char *rb = b; \ while(ToLower(*ra) == ToLower(*rb++)) \ if(!*ra++) \ return 0; \ return 1; #ifndef FORCEINLINE extern NTL_HDR_strChattr; extern NTL_HDR_strCasediff; #else /* FORCEINLINE */ #ifdef __cplusplus inline NTL_HDR_strChattr { NTL_SRC_strChattr } inline NTL_HDR_strCasediff { NTL_SRC_strCasediff } #else static __inline__ NTL_HDR_strChattr { NTL_SRC_strChattr } static __inline__ NTL_HDR_strCasediff { NTL_SRC_strCasediff } #endif #endif /* FORCEINLINE */ /* * Proto types of other externally visible functions */ extern int strnChattr(const char *s, const size_t n); #endif /* INCLUDED_ircd_string_h */ Index: IPcheck.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/IPcheck.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- IPcheck.h 18 Aug 2002 22:59:22 -0000 1.3 +++ IPcheck.h 21 Aug 2002 17:59:40 -0000 1.4 @@ -15,7 +15,8 @@ #include <netinet/in.h> /* in_addr */ #define INCLUDED_netinet_in_h #endif - +/* Provisional */ +#include "h.h" /* * Prototypes Index: support.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/support.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- support.h 18 Aug 2002 22:59:22 -0000 1.3 +++ support.h 21 Aug 2002 17:59:40 -0000 1.4 @@ -1,12 +1,12 @@ /* * support.h * - * $Id: + * $Id$ */ #ifndef INCLUDED_support_h #define INCLUDED_support_h #ifndef INCLUDED_config_h -//#include "config.h" +#include "config.h" #define INCLUDED_config_h #endif #if 0 @@ -20,22 +20,9 @@ * Prototypes */ -#include <netinet/in.h> - -/*============================================================================= - * Proto types - */ - -#ifndef HAVE_STRTOKEN -extern char *strtoken(char **save, char *str, char *fs); -#endif -#ifndef HAVE_STRERROR -extern char *strerror(int err_no); -#endif extern void dumpcore(const char *pattern, ...) __attribute__ ((format(printf, 1, 2))); -extern char *inetntoa(struct in_addr in); extern int check_if_ipmask(const char *mask); extern void write_log(const char *filename, const char *pattern, ...); -#endif /* SUPPORT_H */ +#endif /* INCLUDED_support_h */ --- common.h DELETED --- |
From: Zolty <zo...@us...> - 2002-08-21 17:59:43
|
Update of /cvsroot/irc-dev/ircdh In directory usw-pr-cvs1:/tmp/cvs-serv10291/ircdh Modified Files: ChangeLog Removed Files: CAMBIOS.IRCDEV CAMBIOS2_10_06 CAMBIOS2_10_07 CAMBIOS2_10_H_01 CAMBIOS2_10_H_02 CAMBIOS2_10_H_03 CAMBIOS2_10_H_04 ChangeLog.07 ChangeLog.10 Log Message: 2002-08-21 Toni Garcia <zo...@ir...> * ircd/common.c/.h: Ha sido eliminado. * ircd/table_gen: La tabla de caracteres que estaba en common.c ha sido colocado en este nuevo fichero. * ircd/ircd_string.c/h: Las funciones que estaban en common.c y en support.c han sido movidos al nuevo fichero. Y se sustituyen en el codigo los "strtoken" por el nuevo "ircd_strtok". * Movidos los archivos viejos de "ChangeLog" de Hispano y Undernet al directorio doc/history. A partir de ahora se documentan los cambios en este fichero "ChangeLog". Index: ChangeLog =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ChangeLog 18 Aug 2002 22:49:41 -0000 1.2 +++ ChangeLog 21 Aug 2002 17:59:39 -0000 1.3 @@ -1,8 +1,157 @@ -# -# ChangeLog for ircu2.10.10 -# -# $Id$ -# -# Insert new changes at beginning of the change list. -# -* pl6 +2002-08-21 Toni Garcia <zo...@ir...> + * ircd/common.c/.h: Ha sido eliminado. + + * ircd/table_gen: La tabla de caracteres que estaba en common.c ha sido colocado + en este nuevo fichero. + + * ircd/ircd_string.c/h: Las funciones que estaban en common.c y en support.c + han sido movidos al nuevo fichero. Y se sustituyen en el codigo los + "strtoken" por el nuevo "ircd_strtok". + + * Movidos los archivos viejos de "ChangeLog" de Hispano y Undernet al + directorio doc/history. A partir de ahora se documentan los cambios en + este fichero "ChangeLog". + + +2002-08-19 Toni Garcia <zo...@ir...> + * "Make indent": A partir de ahora es obligatorio hacer un make indent + ANTES de hacer un commit. + + * ircd/Makefile.in: Se hace una renovacion del archivo, preparandolo para + agregar nuevos .c de una manera facil. Es conveniente hacer "make depend" + de vez en cuando. + + * ircd/ircd_log.c: Nuevo sistema de logs del ircd. Esta incompleto. Esta + pendiente de ir migrando todos los mensajes. + + * ircd/ircd_signal.c: Se mueve el codigo de gestion de "signals" de POSIX + del ircd.c al nuevo archivo. + + * ircd/os_*.c: Se agregan las librerias de Thomas Helvey para los defines + y funciones segun el sistema operativo. Esto es bueno para el dia que + se haga un port de WIN32/WIN64 que se crea un os_windows.c y asi se permite + hacer el port con minimos cambios. Aun no esta completo del todo. + + * /*: Nuevos ficheros README, TODO, del ircu de undernet, hay que personalizarlo. + Se actualizan los ChangeLog's. + + * config/*: Se actualizan los configures y makefiles. Se agregan 2 preguntas + en el make config nuevas: + KILL_IPMISMATCH: 'Kill connecting clients when forward and reverse DNS mismatch' + OPER_WALLOPS: 'Allow opers to wallop' + Pero aun no estan implementadas. + + +2002-08-16 Toni Garcia <zo...@ir...> + Documentacion de los numericos utilizados en las redes mundiales para ver + los numericos libres y los que estan en conflicto. + + * Se cambia el numerico del USERIP del 307/378 al nuevo 340 que es el que + utiliza en undernet. + + +2002-08-15 Toni Garcia <zo...@ir...> + Comienzo de la ordenacion del codigo. + * Muevo todos los defines del whocmds.c al .h ya que nos hara falta cuando + pongamos cada comando, un *.c. + + * Se hacen cambios en muchos variables globales con el fin de facilitar la + lectura e interpretacion. Son los siguientes: + time_t now; => time_t CurrentTime; + struct Client client; => struct Client *GlobalClientList; + struct lusers_st nrof; => struct UserStatistics UserStats; + struct stats *ircstp; => struct ServerStatistics *ServerStats; + struct ConfItem *conf; => struct ConfItem *GlobalConfList; + struct DSlink; => struct DLink; + + * Empiezo a eliminar los alias de structs, ejempo "aClient" pasa a ser "struct + Client". Y en algunas funciones agrego "const" cuando han de mantener la + variable de forma constante. + + * Se desactivan temporalmente WATCH y ESNET_ZLIB mientras se va ordenando el + codigo, en breves dias estaran activados. + + * En los archivos .h de la carpeta include meto las cabeceras con el $Id: + de control de RCS asi como los nuevos defines al estilo Undernet. + + * Se mueven los defines *LEN y similiares al nuevo fichero ircd_defs.h. + + +2002-08-06 Toni Garcia <zo...@ir...> + Sincronizacion con u2.10.H.05.16 y varios cambios. + * include/{struct.h|channel.h}: Nuevas macros KICKLEN, AWAYLEN y QUITLEN + independientemente del TOPICLEN. + + * ircd/channel.c: En m_kick(), cambiamos TOPICLEN por el nuevo KICKLEN. + + * ircd/s_user.c: En m_quit(), cambiamos TOPICLEN por el nuevo QUITLEN. + Y en m_away(), cambiamos TOPICLEN por el nuevo AWAYLEN. + + * ircd/s_bsd.c: Simplificamos el mensaje de error de "Read Error". + + * ircd/version.c.SH: Agregamos a NiKoLaS en los creditos, y limpieza + estetica del mismo. + + +2002-08-03 Toni Garcia <zo...@ir...> + * {ircd|include}/whowas.{c|h}: Ver ips reales y/o virtuales + segun si tienes +X o no al ejecutar el comando WHOWAS sobre + un nick. + + +2002-08-01 Toni Garcia <zo...@ir...> + Sincronizacion con u2.10.H.05.14. + * doc/ejemplo.conf: Cambios esteticos. + + * ircd/chkconf.c: El rango de numericos es 0-4095, no 1-64. + + +2002-07-27 Toni Garcia <zo...@ir...> + Sincronizacion con u2.10.H.05.11. + * ircd/crypt/tea/*: Soporte Windows para el programa cifranick. + + +2002-07-27 Toni Garcia <zo...@ir...> + Sincronizacion con u2.10.H.05.10. + * doc/ejemplo.conf: Explicacion y ejemplos de E y F lines. + + +2002-07-27 Toni Garcia <zo...@ir...> + Sincronizacion con u2.10.H.05.09. Implementacion de las lineas E. + * ircd/chkconf.c: Parseo de la linea E. + * ircd/s_conf.c: Parseo de la linea E, nueva funcion find_exception() + y modificacion en find_kill() para que si tiene una E-line, no pueda + recibir una K-line. + + * ircd/opercmds.c: Ampliacion del comando STATS con el nuevo parametro + E y solo para ircops/helpers. + + * ircd/s_err.c: Numerico 239 del STATS E. + + * include/s_conf.h: Definicion de la linea E. + + * include/numeric.h: Definicion del numerico de las E-Lines en el + numerico 239. + + +2002-07-27 Toni Garcia <zo...@ir...> + * config/config-in.sh: Nueva pregunta en el "make config" para el + nombre de la red. + + * doc/Configure.help: Ayuda de la nueva pregunta. + + * ircd/s_err.c: Modificacion del raw 001. + + * ircd/s_user.c: Modificar los raw 001 y 005. + + +2002-07-27 Toni Garcia <zo...@ir...> + * config/config-in.sh: Cambios en los valores de por defecto de: + - WATCH: pasa de ser 96 a 128 + - CLIENT_FLOOD: pasa de ser 1024 a 2048 + - UID/GID: Y por defecto ya que es necesario + + +2002-07-27 Toni Garcia <zo...@ir...> + * include/patchlevel.h: Actualizacion de la version en el define PATCH1 + que estaba en H.01. --- CAMBIOS.IRCDEV DELETED --- --- CAMBIOS2_10_06 DELETED --- --- CAMBIOS2_10_07 DELETED --- --- CAMBIOS2_10_H_01 DELETED --- --- CAMBIOS2_10_H_02 DELETED --- --- CAMBIOS2_10_H_03 DELETED --- --- CAMBIOS2_10_H_04 DELETED --- --- ChangeLog.07 DELETED --- --- ChangeLog.10 DELETED --- |