1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-09-23 20:54:02 +00:00

Compare commits

..

35 Commits

Author SHA1 Message Date
Alexander Barton
4726e36efc Changed version string back to "0.6.x-CVS". 2003-03-09 22:33:19 +00:00
Alexander Barton
3105bd9fff Updated documentation. 2003-03-09 20:16:57 +00:00
Alexander Barton
cb8ed9d5da ngIRCd now handles recursive calls to Conn_Close() correctly (from HEAD). 2003-03-09 20:16:46 +00:00
Alexander Barton
a156641afd Updated version number to 0.6.1 :-) 2003-01-21 21:23:34 +00:00
Alexander Barton
78752bbff8 Updated documentation. 2003-01-21 21:20:19 +00:00
Alexander Barton
90e6ec3f89 The server didn't validate weather the target user of a channel user mode
change is a valid channel member or not (from HEAD).
2003-01-21 21:05:19 +00:00
Alexander Barton
9810da343c - Non-memers of a channel could crash the server when trying to change its modes. (HEAD) 2003-01-17 19:08:57 +00:00
Alexander Barton
e8b99f4d3a - Updated documentation. 2003-01-17 19:07:15 +00:00
Alexander Barton
84efd5e969 - Removed strl[cat|cpy]() function calls ... 2003-01-08 23:13:45 +00:00
Alexander Barton
33927ee854 - Fixed up previous CHANINFO patch ... 2003-01-08 23:09:34 +00:00
Alexander Barton
3d46fc6036 - Changed semantics of Client_SetAway() [from HEAD]. 2003-01-08 23:09:04 +00:00
Alexander Barton
ac587adc69 - MODE returns the key and user limit for channel members correctly now. [Head] 2003-01-08 23:08:12 +00:00
Alexander Barton
2688829ddd - Updated documentation. 2003-01-08 23:07:57 +00:00
Alexander Barton
4294dd8043 - Updated documentation. 2003-01-08 20:36:57 +00:00
Alexander Barton
6b9ce1cb72 - Fixed up broken patch (once again -- *ARGL*) ... 2003-01-08 20:32:17 +00:00
Alexander Barton
72a4c0489f - CHANINFO: Fixed up broken fix ... 2003-01-08 20:22:57 +00:00
Alexander Barton
60a4085c38 - fixed up propagation of modes with arguments between servers. 2003-01-08 17:47:48 +00:00
Alexander Barton
5206ab302d - Updated documentation. 2003-01-08 17:47:43 +00:00
Alexander Barton
635afd660d - Updated documentation. 2003-01-05 23:04:12 +00:00
Alexander Barton
5b3d89312e - CVS date is in ISO format now (YYYY-MM-DD) [from HEAD]. 2003-01-04 10:58:15 +00:00
Alexander Barton
f7c1242979 - the server sets a correct default AWAY message when receiving a "MODE +a". 2003-01-02 18:03:05 +00:00
Alexander Barton
822d3d12c8 - Adjusted copyright banner to include 2003 :-) 2003-01-01 13:47:42 +00:00
Alexander Barton
7de53b1903 - Fixed up command forwarding: only to servers! (from CVS-HEAD) 2003-01-01 13:46:37 +00:00
Alexander Barton
9e3def72e0 - Updated documentation. 2003-01-01 13:46:06 +00:00
Alexander Barton
3da58202e6 - Fixed up bad test if we are still connected in KILL. 2002-12-31 15:48:33 +00:00
Alexander Barton
ec016a89e2 - Fixed up KILL once more: it can't kill other clients than valid users now. 2002-12-27 13:37:43 +00:00
Alexander Barton
1bcc64721f - Fixed KILL: you can't crash the server by killing yourself any more;
and ngIRCd no longer sends a QUIT to other servers after the KILL. (HEAD)
2002-12-26 19:01:29 +00:00
Alexander Barton
939ec25f72 - Changed version string to "0.6.x-CVS". 2002-12-26 18:48:44 +00:00
Alexander Barton
1f7024cb36 - Version 0.6.0 2002-12-24 13:54:09 +00:00
Alexander Barton
c2fcc98a55 - Updated Documentation for version 0.6.0 2002-12-24 13:53:54 +00:00
Alexander Barton
fe06c3200e - Dokumentation aktualisiert. 2002-12-22 23:50:59 +00:00
Alexander Barton
dd7ff82b8f - Version 0.6.0-pre2 2002-12-22 23:43:16 +00:00
Alexander Barton
f84cd22fe1 - Backports from CVS-HEAD (005-numeric, extended LUSERS reply). 2002-12-22 23:42:28 +00:00
Alexander Barton
3544d1bc40 - Version 0.6.0-pre1 2002-12-18 16:50:29 +00:00
Alexander Barton
6c88184b58 - Updated documentation. 2002-12-18 16:27:14 +00:00
89 changed files with 2728 additions and 5127 deletions

30
AUTHORS
View File

@@ -1,33 +1,13 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- AUTHORS and CONTRIBUTORS --
-- AUTHORS / Autoren --
Main Authors
~~~~~~~~~~~~
Alexander Barton, <alex@barton.de> (alex)
Contributors
~~~~~~~~~~~~
Goetz Hoffart, <goetz@hoffart.de> (goetz)
Ilja Osthoff, <i.osthoff@gmx.net> (ilja)
Sean Reifschneider, <jafo-rpms@tummy.com>
Code snippets
~~~~~~~~~~~~~
J. Kercheval: pattern matching functions
Patrick Powell, <papowell@astart.com>: snprintf()-function
Andrew Tridgell & Martin Pool: strl{cpy|cat}()-functions
--
$Id: AUTHORS,v 1.5.2.2 2004/02/03 16:01:29 alex Exp $
Alexander Barton, alex@arthur.ath.cx

113
ChangeLog
View File

@@ -1,119 +1,20 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 by Alexander Barton,
(c)2001-2003 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- ChangeLog --
-- ChangeLog / Aenderungen --
ngIRCd 0.7.7 (2004-02-05)
ngIRCd 0.6.x
- The info text ("real name") of users is set to "-" if none has been
specified using the USER command (e. g. "USER user * * :"). Reason:
the original ircd doesn't like empty ones and would KILL such users.
- Fixed (optional) TCP Wrapper test which was broken and could result in
false results. Thanks to Fuminori Tanizaki <tany@mcnet.ad.jp>!
- Removed "USE_" prefixes of configuration #defines.
- Conn_Close() now handles recurisive calls for the same link correctly.
ngIRCd 0.7.6 (2003-12-05)
- Fixed abort() ("server crash") when INVITE'ing users to nonexistent
channels. Bug found by <hiddenx@wp.pl>.
- Extended version numbering of CVS versions (added date).
- Enhanced/fixed doc/Protocol.txt;
ngIRCd 0.7.5 (2003-11-07)
- Fixed ban behavior: users which are banned from a channel can't no
longer send PRIVMSG's to this channel (fixes Bug #47).
- Fixed and enhanced the "penalty handling" of the server: commands that
require more resources block the client for a short time.
- Changed the internal time resolution to one second.
- New configuration variable "MaxConnectionsIP" to limit the number of
simultaneous connections from a single IP that the server will accept.
This configuration options lowers the risk of denial of service attacks
(DoS), the default is 5 connections per client IP.
- Fixed build problems under Mac OS X 10.3.
- Use "-pipe" when compiling with gcc, speeds things up a little :-)
- Added new configuration variable "Listen" to bind all listening
sockets of the server to a single IP address.
- Suppress misleading error message of diff during make run.
- Enhanced test-suite and made it work on GNU/Hurd.
- Fixed minor typo in debug output :-)
ngIRCd 0.7.1 (2003-07-18)
- Included files to build Debian packages (located in "debian/").
- Updated config.guess and config.sub to newer upstream versions.
- NJOIN propagates user channel modes correctly again ... Upsa.
- Made Makefile more compatible with "make -j<n>".
- Added support for GNU/Hurd.
- Fixed a compiler warning related to an unnecessary assert().
- Enhanced VERSION command when using debug versions.
ngIRCd 0.7.0 (2003-05-01)
- "ServerName" is checked better now: a dot (".") is required.
- The KILL command verifies and logs more parameters.
ngIRCd 0.7.0-pre2 (2003-04-27)
- CVS build system fixes (made autogen.sh more portable).
- Fixed compilation and test-suite on Solaris (tested with 2.6).
- New documentation file "doc/Platforms.txt" describing the status of
ngIRCd on the various tested platforms.
- Test for broken GCC on Mac OS X and disable "-pedantic" in this case.
- Disable "-ansi" on Cygwin: system headers are incompatible.
- The server tried to connect to other servers only once when DNS or
socket failures occurred.
- Fixed --configtest: There is no variable "ServerPwd", it's "Password".
ngIRCd 0.7.0-pre1 (2003-04-22)
- New signal handler (more secure, actions are executed outside).
- GCC: the compiler is now called with more warning options enabled.
- Replaced a lot of str[n]cpy(), str[n]cat() and sprintf() calls with the
more secure functions strlcpy(), strlcat() and snprintf(). On systems
that don't support strlcpy() and strlcat(), these functions are included
in the libngportab now (with prototypes in portab.h).
- If the server can't close a socket, it panics now. This is an error that
can't occur during normal operation so there is something broken.
- The order of log messages during disconnects is more "natural" now ;-)
- Cleaned up handling of server configuration structures: modifying and
removing servers during runtime works more reliable now.
- Compression code from "conn.[ch]" is now found in new "conn-zip.[ch]"
- Moved some connection functions from "conn.[ch]" to "conn-func.[ch]".
- New command CONNECT to enable and add server links. The syntax is not
RFC-compatible: use "CONNECT <name> <port>" to enable and connect an
configured server and "CONNECT <name> <port> <host> <mypwd> <peerpwd>"
to add a new server (ngIRCd tries to connect new servers only once!).
- Added DISCONNECT command ("DISCONNECT <name>") to disable servers.
- Restructured the documentation: Now the main language is English. The
german documentation has been removed (until there is a maintainer).
- Enhanced killing of users caused by a nickname collision.
- Better error detection for status code ("numerics") forwarding.
- Moved tool functions to own library: "libngtool".
- New command TRACE (you can trace only servers at the moment).
- New command HELP that lists all understood commands.
- There should no longer remain "unknown connections" (see e.g. LUSERS)
if an outgoing server link can't be established.
- Added AC_PREREQ(2.50) to configure.in for better autoconf compatibility.
- Conn_Close() now handles recursive calls for the same link correctly.
- ngIRCd can register itself with Rendezvous: to enable support pass the
new switch "--with-rendezvous" to configure.
- Added support for TCP Wrappers library: pass "--with-tcp-wrappers" to
configure to enable it.
- Changed some configure options to use "--with"/"--without" as prefix
instead of "--enable"/"--disable": "--without-syslog", "--without-zlib",
"--with-tcp-wrappers", and "--with-rendezvous".
- Better error reporting to clients on connect.
- Enhanced manual pages ngircd(8) and ngircd.conf(5).
- Documentation is now installed in $(datadir)/doc/ngircd.
- Enhanced hanling of NJOIN in case of nick collisions.
ngIRCd 0.6.1, 2003-01-21
ngIRCd 0.6.1, 2002-01-21
- Fixed KILL: you can't crash the server by killing yourself any more,
ngIRCd no longer sends a QUIT to other servers after the KILL, and you
@@ -124,7 +25,7 @@ ngIRCd 0.6.1, 2003-01-21
- The server sets a correct default AWAY message now when propagating
between servers (bug introduced in 0.6.0).
- Fixed up and enhanced CHANINFO command: channel keys and user limits
are synchronized between servers now, too.
are syncronized between servers now, too.
- MODE returns the key and user limit for channel members correctly now.
- Non-members of a channel could crash the server when trying to change
its modes or modes of its members.
@@ -493,4 +394,4 @@ ngIRCd 0.0.1, 31.12.2001
--
$Id: ChangeLog,v 1.188.2.24 2004/02/05 13:33:24 alex Exp $
$Id: ChangeLog,v 1.147.2.14 2003/03/09 20:16:57 alex Exp $

263
INSTALL
View File

@@ -1,161 +1,162 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- INSTALL --
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- INSTALL / Installation --
I. Upgrade Information
~~~~~~~~~~~~~~~~~~~~~~
Differences to version 0.6.x
- Some options of the configure script have been renamed:
--disable-syslog -> --without-syslog
--disable-zlib -> --without-zlib
Please call "./configure --help" to review the full list of options!
Differences to version 0.5.x
- Starting with version 0.6.0, other servers are identified using asynchronous
passwords: therefore the variable "Password" in [Server]-sections has been
replaced by "MyPassword" and "PeerPassword".
- New configuration variables, section [Global]: MaxConnections, MaxJoins
(see example configuration file "doc/sample-ngircd.conf"!).
Ilja Osthoff, <ilja@glide.ath.cx>
II. Standard Installation
~~~~~~~~~~~~~~~~~~~~~~~~~
ngIRCd is developed for UNIX-based systems, which means that the installation
on modern UNIX-like systems that are supported by GNU autoconf and GNU
automake ("configure") should be no problem.
The normal installation procedure after getting (and expanding) the source
files (using a distribution archive or CVS) is as following:
1) ./autogen.sh [only necessary when using CVS]
2) ./configure
3) make
4) make install
+-----------------------------------------------------------------------+
| Please note: English translations of some of the german documentation |
| files can be found in the directory "doc/en" -- please have a look! |
+-----------------------------------------------------------------------+
1): "autogen.sh"
0. Update von frueheren Versionen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first step, autogen.sh, is only necessary if the configure-script isn't
already generated. This never happens in official ("stable") releases in
tar.gz-archives, but when using CVS.
Unterschiede zu Version 0.5.x
This step is therefore only interesting for developers.
- Ab Version 0.6.0 werden asyncrone Passwoerter zur Identifikation anderer
Server, die Variable "Password" in [Server]-Abschnitten wird nicht mehr
unterstuetzt. Passwoerter fuer Server-Server-Links werden nun mit den
Variablen "MyPassword" und "PeerPassword" angegeben.
autogen.sh produces the Makefile.in's, which are necessary for the configure
script itself, and some more files for make. To run autogen.sh you'll need
GNU autoconf and GNU automake (use recent versions! autoconf 2.53 and
automake 1.6.1 are known to work).
Again: "end users" do not need this step!
- Neue Konfigurationsvariablen, Sektion [Global]: MaxConnections, MaxJoins
(vgl. auch Beispiel-Konfiguration "doc/sample-ngircd.conf"!)
2): "./configure"
The configure-script is used to detect local system dependencies.
In the perfect case, configure should recognise all needed libraries, header
files and so on. If this shouldn't work, "./configure --help" shows all
possible options.
In addition, you can pass some command line options to "configure" to enable
and/or disable some features of ngIRCd. All these options are shown using
"./configure --help", too.
3): "make"
The make command uses the Makefiles produced by configure and compiles the
ngIRCd daemon.
4): "make install"
Use "make install" to install the server and a sample configuration file on
the local system. Normally, root privileges are necessary to complete this
step. If there is already an older configuration file present, it won't be
overwritten.
This files will be installed by default:
- /usr/local/sbin/ngircd: executable server
- /usr/local/etc/ngircd.conf: sample configuration (if not already present)
- /usr/local/share/doc/ngircd/: documentation
II. Useful make-targets
~~~~~~~~~~~~~~~~~~~~~~~
The Makefile produced by the configure-script contains always these useful
targets:
- clean: delete every product from the compiler/linker
next step: -> make
- distclean: the above plus erase all generated Makefiles
next step: -> ./configure
- maintainer-clean: erase all automatic generated files
next step: -> ./autogen.sh
III. Sample configuration file ngircd.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the sample configuration file, there are comments beginning with "#" OR
";" -- this is only for the better understanding of the file.
The file is separated in four blocks: [Global], [Operator], [Server], and
[Channel].
In the [Global] section, there is the main configuration like the server
name and the ports, on which the server should be listening. IRC operators
of this server are defined in [Operator] blocks. [Server] is the section
where server links are configured. And [Channel] blocks are used to
configure pre-defined ("persistent") IRC channels.
The meaning of the variables in the configuration file is explained in the
"doc/sample-ngircd.conf", which is used as sample configuration file in
/usr/local/etc after running "make install" (if you don't already have one)
and in the "ngircd.conf" manual page.
IV. Command line options
I. Standard-Installation
~~~~~~~~~~~~~~~~~~~~~~~~
These parameters could be passed to the ngIRCd:
ngIRCd ist fuer UNIXoide-Systeme konzipiert worden, das bedeutet, dass die
Installation auf einem modernen UNIX-aehnlichen System kein Problem dar-
stellen sollte. Das System muss nur von GNU automake und GNU autoconf
("configure") unterstuetzt werden.
Die Standard-Installation sieht so aus:
1) tar xzf ngircd-<Version>.tar.gz
2) cd ngircd-<Version>
3) ./autogen.sh [nur erforderlich, wenn ueber CVS bezogen]
4) ./configure
5) make
6) make install
zu 3): "autogen.sh"
Der erste Schritt, autogen.sh, ist nur notwendig, wenn das configure-Script
noch nicht vorhanden ist. Dies ist nie bei offiziellen ("stabilen") Versionen
in tar.gz-Archiven der Fall, jedoch immer, wenn der Source-Code ueber CVS
bezogen wurde.
Dieser Absatz ist also eigentlich ausschliesslich fuer Entwickler interessant.
autogen.sh erzeugt die fuer das configure-Script notwendigen Makefile.in's
sowie das configure-Script selber und weitere fuer den make-Lauf erforderliche
Dateien. Dazu wird sowohl GNU automake als auch GNU autoconf (in aktuellen
Versionen!) benoetigt.
(nochmal: "Endanwender" mussen diesen Schritt i.d.R. nicht ausfuehren!)
zu 4): "./configure"
Mit dem configure-Script wird ngIRCd, wie GNU Software meistens, an das
lokale System angepasst und die erforderlichen Makefile's erzeugt.
Im Optimalfall sollte configure alle benoetigten Libraries, Header etc. selber
erkennen und entsprechend reagieren. Sollte dies einmal nicht der Fall sein,
so zeigt "./configure --help" moegliche Optionen.
zu 5): "make"
Der make-Befehl bearbeitet die vom configure-Script erzeugten Makefile's und
uebersetzt den ngIRCd.
zu 6): "make install"
Mit "make install" wird der Server und ggf. eine Beispiels-Konfiguration
im System installiert; hierzu sind in der Regel root-Rechte erforderlich.
Eine bereits vorhandene Konfigurationsdatei wird nie ueberschrieben.
Folgende Dateien werden installiert:
- /usr/local/sbin/ngircd: ausfuehrbarer Server
- /usr/local/etc/ngircd.conf: Beispiel-Konfiguration, wenn nicht vorhanden
II. Nuetzliche make-Targets
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Die vom configure-Script erzeugten Makefile's enthalten immer die folgenden
nuetzlichen Targets:
- clean: alle Erzeugnisse des Compilers/Linkers loeschen.
Naechster Schritt: -> make
- distclean: zusaetzliche alle Makefile's loeschen.
Naechster Schritt: -> ./configure
- maintainer-clean: alle automat. erzeugten Dateien loeschen.
Naechster Schritt: -> ./autogen.sh
III. Konfigurationsdatei ngircd.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In der Konfigurationsdatei werden Kommentare durch "#" oder durch ";"
eingeleitet. Dieses dient nur der besseren Lesbarkeit.
Die Datei ist in drei Abschnitte unterteilt: [Global], [Operator] und
[Server]. Im [Global]-Teil werden die grundlegenden Einstellungen vor-
genommen, z.B. der Server-Name und die Ports, auf denen er Verbindungen
annehmen soll. In [Operator]-Abschnitten werden Server-Operatoren fest-
gelegt und unter [Server] werden die Einstellungen fuer die Verbindung
mit anderen Servern konfiguriert.
Die Bedeutung der einzelnen Variablen ist in der Beispiel-Konfiguration
"doc/sample-ngircd.conf" erklaert, die bei "make install" auch als
"ngircd.conf" in /usr/local/etc installiert wird, wenn dort noch keine
Konfigurationsdatei vorhanden ist.
IV. Kommandozeilen-Optionen
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Folgende Parameter koennen dem ngIRCd u.a. uebergeben werden:
-f, --config <file>
The daemon uses the file <file> as configuration file rather than
the standard configuration /usr/local/etc/ngircd.conf.
Der Daemon wird angewiesen, statt der Standard-Konfigurationsdatei
/usr/local/etc/ngircd.conf die Datei <file> einzulesen.
-n, --nodaemon
ngIRCd should be running as a foreground process.
ngIRCd soll im Fordergrund laufen; alle Meldungen werden zusaetzlich
zum Syslog auch auf der Konsole ausgegeben.
-p, --passive
Server-links won't be automatically established.
Verbindungen zu anderen Servern (wie in der Konfigurationsdatei in
[Server]-Abschnitten definiert) werden nicht automatisch hergestellt.
--configtest
Reads, validates and dumps the configuration file as interpreted
by the server. Then exits.
Die Konfigurationsdatei wird eingelesen, ueberprueft und so aus-
gegeben, wie sie vom ngIRCd interpretiert wurde. Danach beendet
sich der Server wieder.
Use "--help" to see a short help text describing all available parameters
the server understands, with "--version" the ngIRCd shows its version
number. In both cases the server exits after the output.
Mit dem Parameter "--help" werden alle unterstuetzten Parameter angezeigt,
mit "--version" die Versionsnummer. Bei beiden Parametern beendet sich der
Server nach der Ausgabe wieder.
--
$Id: INSTALL,v 1.15.2.2 2004/02/03 16:01:29 alex Exp $
$Id: INSTALL,v 1.9 2002/12/18 12:19:07 alex Exp $

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +1,20 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
#
# 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.
# Please read the file COPYING, README and AUTHORS for more information.
# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
# der GNU General Public License (GPL), wie von der Free Software Foundation
# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
#
# $Id: Makefile.am,v 1.10.4.2 2003/07/09 21:14:08 alex Exp $
# $Id: Makefile.am,v 1.10 2002/10/01 09:57:08 alex Exp $
#
AUTOMAKE_OPTIONS = gnu
SUBDIRS = doc MacOSX src man contrib debian
SUBDIRS = doc MacOSX src man contrib
maintainer-clean-local:
rm -rf autom4te.cache
@@ -27,7 +28,4 @@ lint:
rpm: distcheck
rpm -ta ngircd-*.tar.gz
deb:
dpkg-buildpackage -rfakeroot
# -eof-

45
NEWS
View File

@@ -1,50 +1,15 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- NEWS --
-- NEWS / Neuigkeiten --
ngIRCd 0.7.5 (2003-07-11)
- New configuration variable "MaxConnectionsIP" to limit the number of
simultaneous connections from a single IP that the server will accept.
This configuration options lowers the risk of denial of service attacks
(DoS), the default is 5 connections per client IP.
- Added new configuration variable "Listen" to bind all listening
sockets of the server to a single IP address.
ngIRCd 0.7.1 (2003-07-18)
- Added support for GNU/Hurd.
ngIRCd 0.7.0 (2003-05-01)
- New command CONNECT to enable and add server links. The syntax is not
RFC-compatible: use "CONNECT <name> <port>" to enable and connect an
configured server and "CONNECT <name> <port> <host> <mypwd> <peerpwd>"
to add a new server (ngIRCd tries to connect new servers only once!).
- Added DISCONNECT command ("DISCONNECT <name>") to disable servers.
- New command TRACE (you can trace only servers at the moment).
- New command HELP that lists all understood commands.
- ngIRCd can register itself with Rendezvous: to enable support pass the
new switch "--with-rendezvous" to configure.
- Added support for TCP Wrappers library: pass "--with-tcp-wrappers" to
configure to enable it.
- Changed some configure options to use "--with"/"--without" as prefix
insetead of "--enable"/"--disable": "--without-syslog", "--without-zlib",
"--with-tcp-wrappers", and "--with-rendezvous".
- Enhanced manual pages ngircd(8) and ngircd.conf(5).
- Documentation is now installed in $(datadir)/doc/ngircd.
Older news (sorry, only available in german language):
ngIRCd 0.6.0, 2002-12-24
- beim Schliessen einer Verbindung zeigt der Server nun vor dem ERROR
@@ -174,4 +139,4 @@ ngIRCd 0.0.1, 31.12.2001
--
$Id: NEWS,v 1.53.2.6 2004/02/03 16:01:29 alex Exp $
$Id: NEWS,v 1.45.2.2 2002/12/24 13:53:54 alex Exp $

111
README
View File

@@ -1,86 +1,105 @@
ngIRCd - Next Generation IRC Server
(c)2001-2004 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- README --
-- README / Liesmich --
Ilja Osthoff, <ilja@glide.ath.cx>
I. Introduction
~~~~~~~~~~~~~~~
+-----------------------------------------------------------------------+
| Please note: English translations of some of the german documentation |
| files can be found in the directory "doc/en" -- please have a look! |
+-----------------------------------------------------------------------+
ngIRCd is an Open-Source server for the Internet Relay Chat (IRC), which
is developed and published under the terms of the GNU General Public
Licence (URL: http://www.gnu.org/licenses/gpl.html). ngIRCd means "next
generation IRC daemon", it's written from scratch and not deduced from the
"grandfather of IRC daemons", the daemon of the IRCNet.
I. Einfuehrung
~~~~~~~~~~~~~~
ngIRCd ist ein Open-Source-Server fuer den Internet Relay Chat (IRC), der
unter der GNU General Public License (http://www.gnu.org/licenses/gpl.html)
entwickelt wird. ngIRCd steht fuer "next generation IRC daemon", er ist von
Grund auf neu geschrieben, also nicht wie die meisten anderen IRCd's vom
Urvater, dem Daemon des IRCNet abgeleitet.
II. Status
~~~~~~~~~~~
At present, the ngIRCd is under active development, some features are not
implemented, some only partly.
Zur Zeit befindet sich der ngIRCd noch in Entwicklung, manche Features sind
noch nicht implementiert, andere nur teilweise.
Till today (more or less complete) implemented IRC-commands:
Bisher (mehr oder wenig vollstaendig) implementierte IRC-Befehle:
ADMIN, AWAY, CHANINFO, CONNECT, DIE, DISCONNECT, ERROR, HELP, INVITE, ISON,
JOIN, KICK, KILL, LINKS, LIST, LUSERS, MODE, MOTD, NAMES, NICK, NJOIN,
NOTICE, OPER, PART, PASS, PING, PONG, PRIVMSG, QUIT, REHASH, RESTART, SERVER,
SQUIT, STATS, TIME, TOPIC, TRACE, USER, USERHOST, VERSION, WHO, WHOIS.
ADMIN, AWAY, CHANINFO, CONNECT, DIE, ERROR, INVITE, ISON, JOIN, KICK, KILL,
LINKS, LIST, LUSERS, MODE, MOTD, NAMES, NICK, NJOIN, NOTICE, OPER, PART,
PASS, PING, PONG, PRIVMSG, QUIT, RESTART, SERVER, SQUIT, TIME, TOPIC,
USERHOST, USER, VERSION, WHO, WHOIS.
III. Features (or: why use ngIRCd?)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
III. Features (oder: warum gerade ngIRCd?)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- no problems with servers which have dynamic IP addresses
- simple, easy understandable configuration file,
- freely published open-source C source code,
- ngIRCd will be developed on in the future.
- supported platforms (tested versions): AIX (3.2.5), A/UX (3.0.1), FreeBSD
(4.5), HP-UX (10.20), IRIX (6.5), Linux (2.x), Mac OS X (10.x), NetBSD
(1.5.2/i386, 1.5.3/m68k), Solaris (2.5.1, 2.6), and Windows with Cygwin.
- keine Probleme mit Servern, deren IP-Adresse dynamisch ist,
- einfache, uebersichtliche Konfigurationsdatei,
- frei verfuegbarer C-Quellcode.
- ngIRCd wird aktiv weiterentwickelt.
- unterstuetzte Plattformen (getestete Version): AIX (3.2.5), A/UX (3.0.1),
FreeBSD/i386 (4.5), HP-UX (10.20), IRIX (6.5), Linux (2.x), Mac OS X (10.x),
NetBSD (1.5.2/i386, 1.5.3/m68k), Solaris (2.5.1, 2.6), Windows mit Cygwin.
IV. Documentation
IV. Dokumentation
~~~~~~~~~~~~~~~~~
More documentation can be found in the "doc/" directory and the homepage of
the ngIRCd: <http://arthur.ath.cx/~alex/ngircd/>.
Im Paket enthalten ist u.a.:
- README: das Dokument, das Du gerade liest :-)
- INSTALL: Hinweise zur Installation des ngIRCd
- NEWS: sagt der Name schon :-)
- ChangeLog: die komplette History des ngIRCd
- doc/FAQ.txt: haeufige Fragen und Antworten zum ngIRCd
- doc/CVS.txt: Hinweise zum CVS-System
- doc/RFC.txt: Infos ueber die RFC's
- doc/sample-ngircd.conf: Beispiel-Konfigurationsdatei
- doc/README-AUX.txt: Installationshinweise fuer A/UX
- doc/README-BeOS.txt: dito fuer BeOS
- doc/en/: englischsprachige Dokumentation
V. Download
~~~~~~~~~~~
V. Bezugsquellen
~~~~~~~~~~~~~~~~
The homepage of the ngIRCd is: <http://arthur.ath.cx/~alex/ngircd>; you
will find the newest information about the ngIRCd and the most recent
("stable") releases there.
Die Homepage des ngIRCd ist: <http://arthur.ath.cx/~alex/ngircd>; dort
findest du immer die neusten Informationen ueber den ngIRCd und die aktuellen
freigegebenen ("stabilen") Releases.
If you are interested in the latest development versions (which are not
always stable), then please read the section "CVS" on the homepage and
the file "doc/CVS.txt" which describes the use of CVS, the "Concurrent
Versioning System".
Falls du dich fuer die aktuellen Entwicklungs-Versionen (die jedoch nicht
immer "stabil" sind) interessierst, dann lese bitte den Punkt "CVS" auf der
Homepage und die Datei "doc/CVS.txt", die die Verwendung des "Concurrent
Versioning System" (CVS) beschreibt.
VI. Bugs
~~~~~~~~
If you find bugs in the ngIRCd (which might be there :-), please report
them at the following URL:
Wenn du im ngIRCd Bugs finden solltest (so was soll ja auch vorkommen :-),
dann lege bitte einen Bug-Report ueber diese URL an:
<http://arthur.ath.cx/~alex/ngircd/#bugs>
There you can read about known bugs and limitations, too.
Dort kannst du dich auch ueber bekannte Fehler informieren.
If you have critics, patches or something else, please feel free to post a
mail to: <alex@barton.de> or <alex@arthur.ath.cx>
Falls du noch Anregungen, Kritik, Patches etc. pp. zum ngIRCd hast, dann
bitte einfach eine Mail an <alex@barton.de> oder <alex@arthur.ath.cx>
schreiben.
--
$Id: README,v 1.17.2.1 2004/02/03 16:01:29 alex Exp $
$Id: README,v 1.14 2002/11/24 18:48:59 alex Exp $

View File

@@ -1,15 +1,16 @@
#!/bin/sh
#
# $Id: autogen.sh,v 1.6.2.1 2003/04/22 10:18:41 alex Exp $
# $Id: autogen.sh,v 1.3 2002/03/12 14:37:51 alex Exp $
#
WANT_AUTOMAKE=1.6
export WANT_AUTOMAKE
if [ -f configure ]; then
echo "autogen.sh: configure-Skript existiert bereits ..."
fi
aclocal && \
autoheader && \
automake --add-missing && \
autoconf && \
echo "Okay, autogen.sh done."
echo "Okay, autogen.sh war erfolgreich."
# -eof-

340
config.guess vendored
View File

@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# 2000, 2001, 2002 Free Software Foundation, Inc.
timestamp='2003-10-07'
timestamp='2002-03-04'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -88,42 +88,30 @@ if test $# != 0; then
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int dummy(){}" > $dummy.c ;
for c in cc gcc c89 ; do
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
if test $? = 0 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
rm -f $dummy.c $dummy.o $dummy.rel ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ;'
esac'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -154,7 +142,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
@@ -180,18 +167,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
@@ -240,52 +216,65 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
eval $set_cc_for_build
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
1-0)
UNAME_MACHINE="alphaev5"
;;
1-1)
UNAME_MACHINE="alphaev56"
;;
1-101)
UNAME_MACHINE="alphapca56"
;;
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
2-1307)
UNAME_MACHINE="alphaev68"
;;
esac
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha*:OpenVMS:*:*)
echo alpha-hp-vms
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -324,13 +313,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit 0 ;;
DRS?6000:UNIX_SV:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
@@ -437,20 +419,15 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c \
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& exit 0
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit 0 ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
@@ -523,7 +500,8 @@ EOF
exit(0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -621,21 +599,11 @@ EOF
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
# avoid double evaluation of $set_cc_for_build
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
@@ -669,7 +637,8 @@ EOF
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -727,15 +696,15 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
*:UNICOS/mp:*:*)
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
@@ -752,21 +721,7 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
# Determine whether the default compiler uses glibc.
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#if __GLIBC__ >= 2
LIBC=gnu
#else
LIBC=
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
# FreeBSD's kernel, but not the complete OS.
case ${LIBC} in gnu) kernel_only='k' ;; esac
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
@@ -777,17 +732,14 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
x86:Interix*:[34]*)
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
exit 0 ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
x86:Interix*:3*)
echo i386-pc-interix3
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
echo i386-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
@@ -799,24 +751,16 @@ EOF
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -827,37 +771,19 @@ EOF
#undef CPU
#undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
;;
mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips64
#undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips64
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
rm -f $dummy.c
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
@@ -893,9 +819,6 @@ EOF
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
@@ -922,7 +845,7 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0 ;;
exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;;
@@ -953,11 +876,9 @@ EOF
LIBC=gnuaout
#endif
#endif
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
rm -f $dummy.c
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
@@ -975,23 +896,6 @@ EOF
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1013,19 +917,22 @@ EOF
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -1049,15 +956,9 @@ EOF
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit 0 ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -1074,6 +975,9 @@ EOF
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
@@ -1145,9 +1049,6 @@ EOF
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
@@ -1155,24 +1056,20 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
case `uname -p` in
*86) UNAME_PROCESSOR=i686 ;;
powerpc) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
echo `uname -p`-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
if test "${UNAME_MACHINE}" = "x86pc"; then
UNAME_MACHINE=pc
echo i386-${UNAME_MACHINE}-nto-qnx
else
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
@@ -1195,6 +1092,11 @@ EOF
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
@@ -1213,8 +1115,11 @@ EOF
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
esac
@@ -1336,7 +1241,8 @@ main ()
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.

191
config.sub vendored
View File

@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# 2000, 2001, 2002 Free Software Foundation, Inc.
timestamp='2003-10-07'
timestamp='2002-03-04'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -118,7 +118,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -228,42 +228,28 @@ case $basic_machine in
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| d10v | d30v | dsp16xx \
| fr30 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32r | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64vr | mips64vrel \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
| mipsisa32 \
| mn10200 | mn10300 \
| msp430 \
| ns16k | ns32k \
| openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| tahoe | thumb | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
@@ -295,50 +281,34 @@ case $basic_machine in
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| arm-* | armbe-* | armle-* | armv*-* \
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \
| clipper-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| d10v-* | d30v-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| f30[01]-* | f700-* | fr30-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32r-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64vr-* | mips64vrel-* \
| mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
@@ -376,9 +346,6 @@ case $basic_machine in
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -728,10 +695,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -765,55 +728,49 @@ case $basic_machine in
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
pentiumii | pentium2)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
pentiumii-* | pentium2-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
@@ -844,16 +801,6 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
@@ -861,9 +808,6 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
@@ -922,7 +866,7 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
sv1)
basic_machine=sv1-cray
os=-unicos
;;
@@ -930,6 +874,10 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
t3d)
basic_machine=alpha-cray
os=-unicos
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
@@ -942,14 +890,6 @@ case $basic_machine in
basic_machine=tic54x-unknown
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -984,8 +924,8 @@ case $basic_machine in
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
@@ -1006,7 +946,11 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
xps | xps100)
windows32)
basic_machine=i386-pc
os=-windows32-msvcrt
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
ymp)
@@ -1052,7 +996,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
sh3 | sh4 | sh3eb | sh4eb)
basic_machine=sh-unknown
;;
sh64)
@@ -1061,7 +1005,7 @@ case $basic_machine in
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
cydra)
basic_machine=cydra-cydrome
;;
orion)
@@ -1076,6 +1020,10 @@ case $basic_machine in
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
@@ -1131,19 +1079,18 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
| -morphos* | -superux* | -rtmk* | -rtmk-nova*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1155,10 +1102,8 @@ case $os in
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
os=-nto-qnx
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@@ -1167,9 +1112,6 @@ case $os in
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -1213,7 +1155,7 @@ case $os in
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
os=-nextstep2
;;
-nsk*)
os=-nsk
@@ -1252,14 +1194,8 @@ case $os in
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-none)
;;
@@ -1292,14 +1228,11 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
pdp11-*)
os=-none
;;
*-dec | vax-*)
@@ -1392,19 +1325,19 @@ case $basic_machine in
*-next)
os=-nextstep3
;;
*-gould)
*-gould)
os=-sysv
;;
*-highlevel)
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
*-sgi)
os=-irix
;;
*-siemens)
*-siemens)
os=-sysv4
;;
*-masscomp)
@@ -1476,7 +1409,7 @@ case $basic_machine in
-ptx*)
vendor=sequent
;;
-vxsim* | -vxworks* | -windiss*)
-vxsim* | -vxworks*)
vendor=wrs
;;
-aux*)

View File

@@ -8,16 +8,16 @@
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: configure.in,v 1.89.2.16 2004/02/05 13:33:24 alex Exp $
# $Id: configure.in,v 1.69.2.6 2003/03/09 22:33:19 alex Exp $
#
# -- Initialisierung --
AC_INIT
AC_PREREQ(2.50)
AC_INIT(ngircd, 0.7.7)
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.6)
AC_CONFIG_SRCDIR(src/config.h.in)
AM_INIT_AUTOMAKE(ngircd,0.6.x-CVS)
AM_CONFIG_HEADER(src/config.h)
# -- Templates fuer config.h --
@@ -26,11 +26,9 @@ AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
AH_TEMPLATE([SYSLOG], [Define if syslog should be used for logging])
AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled])
AH_TEMPLATE([TCPWRAP], [Define if TCP wrappers should be used])
AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging])
AH_TEMPLATE([USE_ZLIB], [Define if zlib compression should be enabled])
AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
AH_TEMPLATE([RENDEZVOUS], [Define if Rendezvous support should be included])
AH_TEMPLATE([TARGET_OS], [Target operating system name])
AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
@@ -57,32 +55,16 @@ AC_C_CONST
# -- Defines --
os=`uname`
if test "$os" = "Linux" -o $os = "GNU"; then
# define _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE when compiling
# on Linux or Hurd (glibc-based systems):
AC_MSG_RESULT([detected ${os}, defining _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE])
add_DEFINES="-D_POSIX_SOURCE -D_GNU_SOURCE -D_BSD_SOURCE $add_DEFINES"
fi
if test "$os" = "A/UX"; then
# define _POSIX_SOURCE when compiling on A/UX:
if test `uname` = "A/UX"; then
# unter A/UX sollte _POSIX_SOURCE definiert sein.
AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
add_DEFINES="-D_POSIX_SOURCE $add_DEFINES"
CFLAGS="$CFLAGS -D_POSIX_SOURCE"
fi
if test "$os" = "HP-UX"; then
# define _XOPEN_SOURCE_EXTENDED when compiling on HP-UX (11.11):
if test `uname` = "HP-UX"; then
# unter HP-UX 11.11 muss _XOPEN_SOURCE_EXTENDED definiert sein.
AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
add_DEFINES="-D_XOPEN_SOURCE_EXTENDED $add_DEFINES"
fi
if test "$os" = "SunOS"; then
# define _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED=1 and __EXTENSIONS__
# when compiling on SunOS (tested with 5.6):
AC_MSG_RESULT([detected SunOS, defining _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED=1 and __EXTENSIONS__])
add_DEFINES="-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ $add_DEFINES"
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
fi
# -- Header --
@@ -98,7 +80,7 @@ AC_CHECK_HEADERS([ \
strings.h sys/socket.h sys/time.h unistd.h \
],,AC_MSG_ERROR([required C header missing!]))
AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
AC_CHECK_HEADERS(arpa/inet.h ctype.h malloc.h stdint.h sys/select.h varargs.h)
# -- Datentypen --
@@ -135,92 +117,44 @@ AC_FUNC_STRFTIME
AC_CHECK_FUNCS([ \
bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
memset setsockopt socket strcasecmp strchr strerror strstr waitpid \
memset select setsockopt socket strcasecmp strchr strerror \
strstr waitpid \
],,AC_MSG_ERROR([required function missing!]))
AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf strlcpy strlcat)
AC_CHECK_FUNCS(select,[AC_CHECK_HEADERS(sys/select.h)],
AC_MSG_ERROR([required function select() is missing!])
)
AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf)
# -- Konfigurationsoptionen --
x_syslog_on=no
AC_ARG_WITH(syslog,
[ --without-syslog disable syslog (autodetected by default)],
[ if test "$withval" = "yes"; then
AC_CHECK_LIB(be, syslog)
AC_CHECK_FUNCS(syslog, x_syslog_on=yes,
AC_MSG_ERROR([Can't enable syslog!])
AC_ARG_ENABLE(syslog,
[ --disable-syslog disable syslog (autodetected by default)],
[ if test "$enableval" = "yes"; then
AC_CHECK_HEADER(syslog.h, x_syslog_on=yes,
AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
)
fi
],
[
AC_CHECK_LIB(be, syslog)
AC_CHECK_FUNCS(syslog, x_syslog_on=yes)
]
[ AC_CHECK_HEADER(syslog.h, x_syslog_on=yes) ]
)
if test "$x_syslog_on" = "yes"; then
AC_DEFINE(SYSLOG, 1)
AC_CHECK_HEADERS(syslog.h)
AC_DEFINE(USE_SYSLOG, 1)
AC_CHECK_LIB(be,syslog)
fi
x_zlib_on=no
AC_ARG_WITH(zlib,
[ --without-zlib disable zlib compression (autodetected by default)],
[ if test "$withval" = "yes"; then
AC_CHECK_LIB(z, deflate)
AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
AC_MSG_ERROR([Can't enable zlib!])
AC_ARG_ENABLE(zlib,
[ --disable-zlib disable zlib compression (autodetected by default)],
[ if test "$enableval" = "yes"; then
AC_CHECK_HEADER(zlib.h, x_zlib_on=yes,
AC_MSG_ERROR([Can't enable zlib: zlib.h not found!])
)
fi
],
[ AC_CHECK_LIB(z, deflate)
AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
]
[ AC_CHECK_HEADER(zlib.h, x_zlib_on=yes) ]
)
if test "$x_zlib_on" = "yes"; then
AC_DEFINE(ZLIB, 1)
AC_CHECK_HEADERS(zlib.h)
fi
x_tcpwrap_on=no
AC_ARG_WITH(tcp-wrappers,
[ --with-tcp-wrappers enable TCP wrappers support],
[ if test "$withval" = "yes"; then
AC_CHECK_LIB(wrap, tcpd_warn)
AC_MSG_CHECKING(for hosts_access)
AC_TRY_LINK([
#include <tcpd.h>
],[
void *ptr;
ptr = hosts_access;
],[
AC_MSG_RESULT(yes)
AC_DEFINE(TCPWRAP, 1)
x_tcpwrap_on=yes
],[
AC_MSG_RESULT(no)
AC_MSG_ERROR([Can't enable TCP wrappers!])
])
fi
]
)
x_rendezvous_on=no
AC_ARG_WITH(rendezvous,
[ --with-rendezvous enable support for "Rendezvous"],
[ if test "$withval" = "yes"; then
AC_CHECK_FUNCS(DNSServiceRegistrationCreate, x_rendezvous_on=yes,
AC_MSG_ERROR([Can't enable Rendezvous!])
)
fi
]
)
if test "$x_rendezvous_on" = "yes"; then
AC_DEFINE(RENDEZVOUS, 1)
AC_CHECK_HEADERS(DNSServiceDiscovery/DNSServiceDiscovery.h mach/port.h)
AC_DEFINE(USE_ZLIB, 1)
AC_CHECK_LIB(z,deflate)
fi
x_ircplus_on=yes
@@ -232,7 +166,6 @@ if test "$x_ircplus_on" = "yes"; then
AC_DEFINE(IRCPLUS, 1)
fi
x_sniffer_on=no; x_debug_on=no
AC_ARG_ENABLE(sniffer,
[ --enable-sniffer enable IRC traffic sniffer (enables debug mode)],
if test "$enableval" = "yes"; then
@@ -249,7 +182,6 @@ if test "$x_debug_on" = "yes"; then
AC_DEFINE(DEBUG, 1)
fi
x_strict_rfc_on=no
AC_ARG_ENABLE(strict-rfc,
[ --enable-strict-rfc strict RFC conformance -- may break clients!],
if test "$enableval" = "yes"; then
@@ -258,6 +190,7 @@ AC_ARG_ENABLE(strict-rfc,
fi
)
# -- Definitionen --
AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
@@ -267,64 +200,31 @@ AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
# -- Variablen --
if test "$GCC" = "yes"; then
the_CFLAGS="-Wmissing-declarations -Wpointer-arith -Wstrict-prototypes"
ansi=" -ansi"
pedantic=" -pedantic"
$CC --version | grep 20020420 >/dev/null 2>&1
if test $? -eq 0; then
# Mac OS X (and Darwin?) ship with a slightly broken
# prerelease of GCC 3.1 which don't like -pedantic:
AC_MSG_RESULT([detected broken GNU C compiler, disabling "-pedantic"])
pedantic=""
fi
$CC --version | grep 20030304 >/dev/null 2>&1
if test $? -eq 0; then
# Mac OS X 10.3 (and Darwin 7.0?) have a strange gcc (or
# system header files?) which produces lots of errors when
# using -ansi; so we don't =:-)
AC_MSG_RESULT([detected broken GNU C compiler, disabling "-ansi"])
ansi=""
fi
uname | grep "CYGWIN" >/dev/null 2>&1
if test $? -eq 0; then
# The include files of Cygwin don't like -ansi,
# so we disable it:
AC_MSG_RESULT([detected Cygwin, disabling "-ansi"])
ansi=""
fi
add_CFLAGS="-pipe -Wall -W${ansi}${pedantic} $CFLAGS $CFLAGS_ADD"
else
the_CFLAGS="$CFLAGS"
add_CFLAGS="$CFLAGS_ADD"
CFLAGS="-Wall $CFLAGS"
fi
CFLAGS="$the_CFLAGS $add_CFLAGS $add_DEFINES -DSYSCONFDIR='\"\$(sysconfdir)\"'"
the_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
# -- Ausgabe der Dateien --
AC_OUTPUT([ \
Makefile \
doc/Makefile \
doc/en/Makefile \
MacOSX/Makefile \
MacOSX/ngircd.pbproj/Makefile \
src/Makefile \
src/portab/Makefile \
src/tool/Makefile \
src/ngircd/Makefile \
src/testsuite/Makefile \
man/Makefile \
contrib/Makefile \
debian/Makefile \
])
# -- Result --
# -- Ergebnis --
echo
echo "ngIRCd has been configured with the following options:"
echo
# Someone please show me a better way :) [borrowed by OpenSSH]
@@ -332,58 +232,26 @@ B=`eval echo ${bindir}` ; B=`eval echo ${B}`
S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
M=`eval echo ${mandir}` ; M=`eval echo ${M}`
D=`eval echo ${datadir}/doc/${PACKAGE}` ; D=`eval echo ${D}`
echo " Host: ${host}"
echo " Compiler: ${CC}"
echo " Compiler flags: ${the_CFLAGS}"
test -n "$add_CFLAGS" && echo " ${add_CFLAGS}"
test -n "$add_DEFINES" && echo " ${add_DEFINES}"
test -n "$CPPFLAGS" && echo " Preprocessor flags: ${CPPFLAGS}"
test -n "$LDFLAGS" && echo " Linker flags: ${LDFLAGS}"
test -n "$LIBS" && echo " Libraries: ${LIBS}"
echo " host: ${host}"
echo " compiler: ${CC}"
echo " compiler flags: ${the_CFLAGS}"
echo " preprocessor flags: ${CPPFLAGS}"
echo " linker flags: ${LDFLAGS}"
echo " libraries: ${LIBS}"
echo
echo " 'ngircd' binary: $S"
echo " Configuration file: $C"
echo " Manual pages: $M"
echo " Documentation: $D"
echo " 'ngircd' binary: $S"
echo " configuration file: $C"
echo " manual pages: $M"
echo
echo $ECHO_N " Syslog support: $ECHO_C"
test "$x_syslog_on" = "yes" \
&& echo $ECHO_N "yes $ECHO_C" \
|| echo $ECHO_N "no $ECHO_C"
echo $ECHO_N " Enable debug code: $ECHO_C"
test "$x_debug_on" = "yes" \
&& echo "yes" \
|| echo "no"
echo $ECHO_N " zlib compression: $ECHO_C"
test "$x_zlib_on" = "yes" \
&& echo $ECHO_N "yes $ECHO_C" \
|| echo $ECHO_N "no $ECHO_C"
echo $ECHO_N " IRC sniffer: $ECHO_C"
test "$x_sniffer_on" = "yes" \
&& echo "yes" \
|| echo "no"
echo $ECHO_N " Use TCP Wrappers: $ECHO_C"
test "$x_tcpwrap_on" = "yes" \
&& echo $ECHO_N "yes $ECHO_C" \
|| echo $ECHO_N "no $ECHO_C"
echo $ECHO_N " Strict RFC mode: $ECHO_C"
test "$x_strict_rfc_on" = "yes" \
&& echo "yes" \
|| echo "no"
echo $ECHO_N " Rendezvous support: $ECHO_C"
test "$x_rendezvous_on" = "yes" \
&& echo $ECHO_N "yes $ECHO_C" \
|| echo $ECHO_N "no $ECHO_C"
echo $ECHO_N " IRC+ protocol: $ECHO_C"
test "$x_ircplus_on" = "yes" \
&& echo "yes" \
|| echo "no"
echo
echo $ECHO_N " active options: $ECHO_C"
test "$x_syslog_on" = "yes" && echo $ECHO_N "Syslog $ECHO_C"
test "$x_zlib_on" = "yes" && echo $ECHO_N "zLib $ECHO_C"
test "$x_debug_on" = "yes" && echo $ECHO_N "Debug $ECHO_C"
test "$x_sniffer_on" = "yes" && echo $ECHO_N "Sniffer $ECHO_C"
test "$x_strict_rfc_on" = "yes" && echo $ECHO_N "Strict-RFC $ECHO_C"
test "$x_ircplus_on" = "yes" && echo $ECHO_N "IRC+ $ECHO_C"
echo; echo
# -eof-

View File

@@ -1,9 +1,9 @@
%define name ngircd
%define version 0.7.7
%define version 0.6.1
%define release 1
%define prefix %{_prefix}
Summary: A lightweight daemon for the Internet Relay Chat (IRC)
Summary: Next Generation Internet Relay Chat Daemon
Name: %{name}
Version: %{version}
Release: %{release}
@@ -15,18 +15,17 @@ Packager: Sean Reifschneider <jafo-rpms@tummy.com>
BuildRoot: /var/tmp/%{name}-root
%description
ngIRCd is a free open source daemon for the Internet Relay Chat (IRC),
ngIRCd is a free open source daemon for Internet Relay Chat (IRC),
developed under the GNU General Public License (GPL). It's written from
scratch and is not based upon the original IRCd like many others.
Advantages:
- no problems with servers using changing/non-static IP addresses.
- small and lean configuration file.
- free, modern and open source C code.
- still under active development.
Why should you use ngIRCd? Because ...
ngIRCd is compatible to the "original" ircd 2.10.3p3, so you can run
mixed networks.
* ... there are no problems with servers on changing or non-static IP
addresses.
* ... there is a small and lean configuration file.
* ... there is a free, modern and open source C source code.
* ... it is still under active development.
%prep
%setup

20
debian/Makefile.am vendored
View File

@@ -1,20 +0,0 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
#
# 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.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: Makefile.am,v 1.1.2.2 2003/12/05 13:31:22 alex Exp $
#
EXTRA_DIST = rules changelog compat control copyright \
ngircd.init ngircd.postinst
maintainer-clean-local:
rm -f Makefile Makefile.in
# -eof-

78
debian/changelog vendored
View File

@@ -1,78 +0,0 @@
ngircd (0.7.7-0ab1) unstable; urgency=low
* New upstream version.
-- Alexander Barton <alex@Arthur.Ath.CX> Thu, 5 Feb 2004 14:11:08 +0100
ngircd (0.7.6-0ab1) unstable; urgency=medium
* New upstream version.
* Changed version numvering scheme of debian package.
-- Alexander Barton <alex@Arthur.Ath.CX> Fri, 5 Dec 2003 14:26:41 +0100
ngircd (0.7.5-0.2ab) unstable; urgency=low
* Updated RPM and Debian package description and configuration.
-- Alexander Barton <alex@Arthur.Ath.CX> Sat, 29 Nov 2003 21:24:32 +0100
ngircd (0.7.5-0.1ab) unstable; urgency=low
* New upstream version.
-- Alexander Barton <alex@Arthur.Ath.CX> Fri, 7 Nov 2003 21:59:58 +0100
ngircd (0.7.1-0.1ab) unstable; urgency=low
* New upstream version :-)
-- Alexander Barton <alex@Arthur.Ath.CX> Fri, 18 Jul 2003 22:53:02 +0200
ngircd (0.7.0-0.7ab) unstable; urgency=low
* Fixed up post installation script (added interpreter, fixed chmod call).
-- Alexander Barton <alex@Arthur.Ath.CX> Sun, 13 Jul 2003 00:52:38 +0200
ngircd (0.7.0-0.6ab) unstable; urgency=low
* Added /etc/default/ngircd.
* Included own post installation script.
-- Alexander Barton <alex@Arthur.Ath.CX> Sat, 12 Jul 2003 20:31:09 +0200
ngircd (0.7.0-0.5ab) unstable; urgency=low
* Enhanced init script.
* Included NJOIN fix from actual CVS "HEAD" branch.
-- Alexander Barton <alex@Arthur.Ath.CX> Wed, 9 Jul 2003 22:40:49 +0200
ngircd (0.7.0-0.4ab) unstable; urgency=low
* Reverted use of dh_installexamples.
-- Alexander Barton <alex@Arthur.Ath.CX> Thu, 22 May 2003 00:15:03 +0200
ngircd (0.7.0-0.3ab) unstable; urgency=low
* Removed "debian/docs" and "debian/conffiles"; debhelper takes care of
this for us automagically.
* Excluded "etc/ngircd.conf" from dh_fixperms.
-- Alexander Barton <alex@Arthur.Ath.CX> Wed, 21 May 2003 23:25:05 +0200
ngircd (0.7.0-0.2ab) unstable; urgency=low
* Fixed wrong variable substitution in init script.
* Added some CVS "Id-Tags" (but not checked in, yet).
* Removed own "Provides:" from control file.
-- Alexander Barton <alex@barton.de> Wed, 21 May 2003 12:32:34 +0200
ngircd (0.7.0-0.1ab) unstable; urgency=low
* Initial Release.
-- Alexander Barton <alex@barton.de> Wed, 21 May 2003 02:36:52 +0200

1
debian/compat vendored
View File

@@ -1 +0,0 @@
4

23
debian/control vendored
View File

@@ -1,23 +0,0 @@
Source: ngircd
Section: net
Priority: optional
Maintainer: Alexander Barton <alex@barton.de>
Build-Depends: debhelper (>> 4.0.0), libz-dev
Standards-Version: 3.5.8
Package: ngircd
Architecture: any
Depends: ${shlibs:Depends} ${misc:Depends}
Description: A lightweight daemon for the Internet Relay Chat (IRC)
ngIRCd is a free open source daemon for the Internet Relay Chat (IRC)
network. It is written from scratch and is not based upon the original
IRCd like many others.
.
Advantages:
- no problems with servers using changing/non-static IP addresses.
- small and lean configuration file.
- free, modern and open source C code.
- still under active development.
.
ngIRCd is compatible to the "original" ircd 2.10.3p3, so you can run
mixed networks.

13
debian/copyright vendored
View File

@@ -1,13 +0,0 @@
This package was debianized by Alexander Barton <alex@barton.de> on
Tue, 20 May 2003 15:47:40 +0200.
It was downloaded from ftp://Arthur.Ath.CX/pub/Users/alex/ngircd/
Upstream Author: Alexander Barton <alex@barton.de>
This software is copyright (c) 1999-2003 by Alexander Barton.
You are free to distribute this software under the terms of the
GNU General Public License.
On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL file.

12
debian/ngircd.default vendored
View File

@@ -1,12 +0,0 @@
#
# Defaults for ngIRCd start and stop script
#
# $Id: ngircd.default,v 1.1.2.1 2003/07/12 18:23:24 alex Exp $
#
# Parameters to pass to the ngircd daemon on startup, see ngircd(8) for
# possible options (default: empty).
PARAMS=""
# -eof-

71
debian/ngircd.init vendored
View File

@@ -1,71 +0,0 @@
#!/bin/sh
#
# ngIRCd start and stop script for Debian-based systems
#
# $Id: ngircd.init,v 1.1.2.1 2003/07/09 21:12:00 alex Exp $
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/ngircd
NAME=ngIRCd
DESC="IRC daemon"
PARAMS=""
test -x $DAEMON || exit 0
test -f /etc/default/ngircd && . /etc/default/ngircd
Check_Config()
{
$DAEMON --configtest >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Configuration of $NAME is not valide, won't (re)start!"
echo "Please run \"$DAEMON --configtest\" manually and fix it up ..."
exit 1
fi
}
Try_Start()
{
start-stop-daemon --start --quiet --exec $DAEMON -- $PARAMS
if [ $? -ne 0 ]; then
echo "$NAME failed!"
exit 1
fi
echo "$NAME."
}
case "$1" in
start)
Check_Config
echo -n "Starting $DESC: "
Try_Start
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --exec $DAEMON \
&& echo "$NAME." \
|| echo "(none running)"
;;
reload|force-reload)
Check_Config
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
;;
restart)
Check_Config
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
sleep 1
Try_Start
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
# -eof-

View File

@@ -1,14 +0,0 @@
#!/bin/sh
#
# Debian post-installation script
# $Id: ngircd.postinst,v 1.1.2.4 2003/11/29 20:29:02 alex Exp $
#
if [ -f /etc/ngircd/ngircd.conf ]; then
# make sure that configuration file is not world readable
chmod o= /etc/ngircd/ngircd.conf
fi
#DEBHELPER#
# -eof-

110
debian/rules vendored
View File

@@ -1,110 +0,0 @@
#!/usr/bin/make -f
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
#
# 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.
# Please read the file COPYING, README and AUTHORS for more information.
#
# debian/rules for ngIRCd
#
# $Id: rules,v 1.1.2.2 2003/11/29 20:29:02 alex Exp $
#
# Based on the sample debian/rules that uses debhelper,
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
config.status: configure
dh_testdir
# Add here commands to configure the package.
./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--sysconfdir=/etc/ngircd \
--mandir=\$${prefix}/share/man \
--with-syslog --with-zlib
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/ngircd.
$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd
rm -f $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL*
rm -f $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING*
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installinit
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
# -eof-

View File

@@ -1,56 +1,64 @@
ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- CVS.txt --
The source code of ngIRCd is maintained using the "Concurrent Versions
System" (CVS). Thereby several developers can work with the source tree at
the same time.
Die Sourcen des ngIRCd werden mit dem "Concurrent Versions System" (CVS)
verwaltet. Somit koennen ohne Probleme mehrere Leute gleichzeitig die Sourcen
bearbeitet.
I. Anonymous read-only Access
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To access the source tree anonymously in read-only mode, follow these steps:
I. Anonymer "Nur-Lesen"-Zugang
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anonymer Zugriff auf die CVS-Repository von ngIRCd ist im "nur-lesen"-Modus
moeglich. Dazu sind folgende Schritte noetig:
Login to the CVS server:
Beim CVS-Server anmelden
$ cvs -d:pserver:anonymous@arthur.ath.cx:/usr/local/CVS/ngircd login
Use "anonymous" as user name and no password (just hit Return). Now you can
check out the sources:
Als Benutzername wird "anonymous" mit einem leeren Passwort verwendet.
Nun ein "Check-Out" der Quellcodes durchfuehren:
$ cvs -d:pserver:anonymous@arthur.ath.cx:/usr/local/CVS/ngircd checkout ngircd
Thereby a new folder "ngircd" will be created containing all the individual
source files.
Dadurch wird im aktuellen Verzeichnis der neue Ordner "ngircd" mit allen
Quell-Dateien des ngIRCd erzeugt.
This is the "working folder", all CVS commands will be executed from within
this folder in the future.
Dieses ist der "Arbeitsordner", alle CVS-Befehle werden in Zukunft aus
diesem Ordner bzw. einem Unterordner davon ausgefuehrt.
Please note: When checking out a fresh copy of ngIRCd from CVS, the
configure script doesn't exist; you have to run the autogen.sh shell script
(which is included in the source tree) to generate it. This requires you to
have GNU automake and GNU autoconf installed on your system.
Wichtig: wenn ngIRCd "frisch" aus dem CVS compiliert werden soll, so
existiert das configure-Script noch nicht. Dieses muss zunaechst mit dem
Script "autogen.sh" erzeugt werden. Letzteres setzt ein installiertes GNU
automake und GNU autoconf voraus!
Updating the CVS tree:
CVS-Tree aktualisieren:
$ cvs update -d -P [<filename>]
$ cvs update
You can update a single file or the complete source tree.
Dieser Befehl aktualisiert alle Dateien im aktuellen Verzeichnis sowie allen
Unterverzeichnissen.
$ cvs update <filename>
So kann eine einzelne Datei aktualisiert werden (auch dann, wenn sie lokal
z.B. geloescht wurde -- praktisch, um eigene "Experimente" rueckgaengig zu
machen ;-))
III. Write Access
~~~~~~~~~~~~~~~~~
If you want to contribute a couple of patches and write access to the CVS
repository would be handy, please contact Alex Barton, <alex@barton.de>.
III. Schreibzugriff
~~~~~~~~~~~~~~~~~~~
Wer Schreibzugriff auf die CVS-Repository wuenscht, der moege sich bitte
mit Alex Barton, <alex@barton.de> in Verbindung setzen.
--
$Id: CVS.txt,v 1.7 2003/03/26 22:34:33 alex Exp $
$Id: CVS.txt,v 1.5 2002/02/15 15:15:22 alex Exp $

View File

@@ -1,67 +1,61 @@
ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- FAQ: Frequently Asked Questions --
I. General
~~~~~~~~~~
Q: Is it possible to link the ngIRCd with non-ngIRCd servers?
A: Yes. ngIRCd is compatible to the original ircd used by IRCNet. Actually
this is being tested with version 2.10.3p3.
I. Allgemein
~~~~~~~~~~~~
Q: Kann der ngIRCd im Netz zusammen mit "normalen" Servern betrieben werden?
A: Ja. ngIRCd ist zum Original kompatibel, getestet wird dies zur Zeit mit
der Version 2.10.3p3 des ircd.
Q: Is there a homepage with further information and downloads?
A: Yes. Please visit <http://arthur.ath.cx/~alex/ngircd/>.
Q: Why should I use ngIRCd instead of the original one?
A: ngIRCd offers several benefits: no problems with dynamic IPs, easy to
configure, open source (GPL), under active development.
Q: Gibt es eine Homepage mit Informationen und Downloads?
A: Ja. Die URL ist <http://arthur.ath.cx/~alex/ngircd/>.
II. Compilation
II. Compilieren
~~~~~~~~~~~~~~~
Q: I did a "CVS checkout" but can't execute ./configure because the script
is missing in the generated directory!?
A: When using development versions via CVS, the configure script as well as
the Makefile.in templates must be generated using GNU automake and GNU
autoconf. To simplify this task run the ./autogen.sh script which will
execute the required tools for you; then continue with executing the
./configure script as usual.
Q: Ich habe die Sourcen von ngIRCd ueber CVS installiert. Nun kann ich
./configure nicht ausfuehren, da es nicht existiert!?
A: Bei Builds direkt aus dem CVS-Tree muss das configure-Script zunaechst
durch GNU autoconf sowie die Makefile.in's durch GNU automake generiert
werden. Um dies zu vereinfachen existiert das Script "./autogen.sh".
GNU automake und GNU autoconf werden -- im Gegensatz zu Builds aus den
Sourcen eines .tar.gz-Archivs -- hierbei benoetigt!
Q: The ./autogen.sh script complains "aclocal: command not found".
A: GNU automake is missing on your system but required for building CVS
versions of ngIRCd. Install GNU automake 1.6 or later and try again.
Q: ./autogen.sh bricht mit der Meldung "autoheader: command not found" ab.
A: GNU autoconf ist nicht installiert, wird jedoch bei Builds direkt aus
dem CVS-Tree benoetigt.
Q: The ./autogen.sh script stops with "autoheader: command not found".
A: GNU autoconf is missing on your system but required for building CVS
versions of ngIRCd. Install GNU autoconf 2.52 or later and try again.
Q: The ./autogen.sh script fails and the message "automake: configure.in:
AM_INIT_AUTOMAKE must be used" is displayed.
A: Most probably you are using version 1.5 of GNU automake which seems to be
incompatible to the build system of ngIRCd. Solution: upgrade to at least
version 1.6 of GNU automake.
(If you are using Debian 3.0 "Woody" you can try to downgrade to version
1.4 of GNU automake shipped with this distribution; it should work, too.)
Q: ./autogen.sh bricht mit der Meldung "autoconf: Undefined macros:
AC_FUNC_MALLOC" bzw. "AC_CONFIG_SRCDIR" ab.
A: Auf dem System ist eine zu alte Version von GNU autoconf installiert.
Ein Update auf z.B. Version 2.52 loest dieses Problem (eine installiete
alte Version sollte ggf. zunaechst entfernt werden, bei RPM-Paketen z.B.
mit dem Befehl "rpm -e autoconf").
III. Bugs!?
~~~~~~~~~~~
Q: Is there a list of known bugs and desired feature enhancements?
A: Yes. Have a look at the bug tracking system (Bugzilla) for ngIRCd located
at <http://arthur.ath.cx/bugzilla/ngircd/>. There you can file bug reports
and feature requests as well as search the bug database.
Q: Gibt es eine Liste der bekannten Bugs bzw. Feature-Wuensche?
A: Ja. Es existiert ein Bug-Tracking-System fuer den ngIRCd (Bugzilla):
URL: <http://arthur.ath.cx/bugzilla/ngircd/>. Dort koennen Bugs ge-
meldet und Feature-Wunsche kundgetan werden. Bekannte Bugs koennen in
der Datenbank gesucht und aufgelistet werden.
Einen Account zum Suchen und Melden von Bugs bzw. Feature-Wuenschen
kannst du dir dort selber anlegen.
Q: What should I do if I found a bug?
A: Please file a bug report at <http://arthur.ath.cx/bugzilla/ngircd/>!
The author of the particular component will be notified automagically :-)
Q: Was mache ich, wenn ich einen Bug gefunden habe?
A: Am besten traegst du ihn in das Bug-Tracking-System des ngIRCd ein:
URL: <http://arthur.ath.cx/bugzilla/ngircd/>
--
$Id: FAQ.txt,v 1.5.2.1 2003/04/29 13:45:09 alex Exp $
$Id: FAQ.txt,v 1.2 2002/02/19 20:05:02 alex Exp $

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
#
# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
# der GNU General Public License (GPL), wie von der Free Software Foundation
@@ -9,31 +9,21 @@
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
#
# $Id: Makefile.am,v 1.16.2.1 2003/04/22 23:52:48 alex Exp $
# $Id: Makefile.am,v 1.10 2002/09/16 10:35:06 alex Exp $
#
EXTRA_DIST = CVS.txt FAQ.txt Protocol.txt Platforms.txt \
README-AUX.txt README-BeOS.txt RFC.txt sample-ngircd.conf
SUBDIRS = en
EXTRA_DIST = CVS.txt FAQ.txt Protocol.txt README-AUX.txt \
README-BeOS.txt RFC.txt sample-ngircd.conf
maintainer-clean-local:
rm -f Makefile Makefile.in
docdir = $(datadir)/doc/$(PACKAGE)
documents = $(EXTRA_DIST) ../AUTHORS ../COPYING ../ChangeLog ../INSTALL \
../NEWS ../README
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \
$(INSTALL) -m 600 -c $(srcdir)/sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
fi
$(mkinstalldirs) $(DESTDIR)$(docdir)
for f in $(documents); do \
$(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/; \
done
uninstall-hook:
rm -rf $(DESTDIR)$(docdir)
fi
# -eof-

View File

@@ -1,56 +0,0 @@
ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- Platforms.txt --
This file lists the status of all platforms on which the ngIRCd has been
tested. Included is the date and version of the last "official" test and
the name of the tester/maintainer.
If you successfully compiled and tested ngIRCd on a platform that isn't
listed here, please contact Alexander Barton, <alex@barton.de>, so that this
list can be updated. Thanks for your help!
the executable works ("runs") as expected --+
tests run successfully ("make check") --+ |
ngIRCd compiles ("make") --+ | |
./configure works --+ | | |
| | | |
Platform Compiler ngIRCd Date Tester C M T R See
--------------------------- ------------ ---------- -------- ------ - - - - ---
i386/pc/solaris2.9 gcc 3.2.2 0.7.x-CVS 03-04-28 alex Y Y Y Y
i386/unknown/freebsd5.0 gcc 3.2.1 0.7.0 03-05-15 alex Y Y Y Y
i386/unknown/gnu0.3 gcc 3.2.3 CVSHEAD 03-05-05 alex Y Y n Y
i386/unknown/netbsdelf1.6.1 gcc 2.95.3 0.7.x-CVS 03-04-23 alex Y Y Y Y
i686/pc/cygwin gcc 3.2 0.7.x-CVS 03-04-24 alex Y Y n Y
i686/pc/linux-gnu gcc 2.95/3.x 0.7.0 03-05-15 alex Y Y Y Y (1)
m68k/apple/aux3.1.1 Orig. A/UX 0.7.x-CVS 03-04-22 alex Y Y Y Y (2)
m68k/hp/hp-ux9.10 Orig. HPUX 0.7.x-CVS 03-04-30 goetz Y Y Y Y
powerpc/apple/darwin6.5 gcc 3.1 0.7.x-CVS 03-04-23 alex Y Y Y Y
sparc/sun/solaris2.6 gcc 2.95.3 0.7.x-CVS 03-04-22 alex Y Y Y Y
sparc/sun/solaris2.7 gcc 3.3 CVSHEAD 03-07-06 alex Y Y Y Y
Notes
~~~~~
(1) i686/pc/linux-gnu:
ngIRCd has been tested with various Linux distributions, such as SuSE,
RedHat, Debian, and Gentoo using Kernels 2.2.x or 2.4.x and various
versions of the GNU C compiler (2.95.3, 3.0, 3.2 and 3.3). The eldest
glibc used was glibc-2.0.7. ngIRCd compiled and run on all these systems
without problems.
(2) This compiler is an pre-ANSI C compiler, therefore the source code is
automatically converted using the included ansi2knr tool while building.
--
$Id: Platforms.txt,v 1.1.2.5 2003/07/18 20:48:20 alex Exp $

View File

@@ -1,114 +1,115 @@
ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- Protocol.txt --
I. Compatibility
~~~~~~~~~~~~~~~~
I. Kompatibilitaet
~~~~~~~~~~~~~~~~~~
The ngIRCd implements the Internet Relay Chat (IRC) protocol version 2.10
as defined in RFC ("request for comment") 1459 and 2810-2813. These (and
probably further relevant RFCs) are listed in doc/RFC.txt.
Der ngIRCd haelt sich an das IRC-Protokoll Version 2.10, wie es in den RFCs
1459 und 2810-2813 beschrieben ist. Diese (und ggf. weitere fuer den ngIRCd
relevante) RFCs sind in RFC.txt aufgefuehrt.
Unfortunately, even the "original" ircd doesn't follow these specifications
in all details. But because the ngIRCd should be a fully compatible
replacement for this server ("ircd") it tries to emulate these differences.
Leider verhaelt sich aber schon der "Originalserver" nicht immer genau so,
wie es in den RFCs beschrieben ist. Da der ngIRCd aber ein Ersatz fuer
eben diesen Server sein soll, werden diese Abweichungen in der Regel vom
ngIRCd emuliert um die Kompatibilitaet zu wahren.
If you don't like this behavior please ./configure the ngIRCd using the
"--enable-strict-rfc" command line option. But keep in mind: not all IRC
clients are compatible with a server configured that way, some can't even
connect at all! Therefore this option usually isn't desired for "normal
server operation".
Sollte dieses Verhalten nicht erwuenscht sein, so kann mit der configure-
Option "--enable-strict-rfc" der ngIRCd so compiliert werden, dass er sich
strikt an die entsprechenden RFCs haelt.
ACHTUNG: an einem so compilierten Server koennen sich andere Server und
Clients, die sich nicht genau an das Protokoll halten, u.U. nicht mehr
anmelden oder alle Funktionen nutzen! In der Regel ist diese Option daher
nicht erwuenscht.
II. The IRC+ Protocol
~~~~~~~~~~~~~~~~~~~~~
II. Das IRC+-Protokoll
~~~~~~~~~~~~~~~~~~~~~~
Starting with version 0.5.0, the ngIRCd extends the original IRC protocol
as defined in RFC 2810-2813. This enhanced protocol is named "IRC+". It is
backwards compatible to the "plain" IRC protocol and will only be used by
the ngIRCd if it detects that the peer supports it as well.
Der ngIRCd unterstuetzt als Erweiterung zum IRC-Protokoll wie es in den RFCs
2810-2813 beschrieben ist, das IRC+-Protokoll. Dieses Protokoll ist dabei
kompatibel zum IRC-Protokoll und wird nur verwendet, wenn der ngIRCd fest-
stellt, dass ein connectierter Server ebenfalls dieses erweiterte Protokoll
unterstuetzt.
The "PASS" command is used to detect the protocol and peer versions see
RFC 2813 (section 4.1.1) and below.
Die Protokoll- und Server-Erkennung wird mit dem "PASS"-Befehl durchgefuehrt
(vgl. RFC 2813, Sektion 4.1.1):
II.1 Register new server link
II.1 neuen Server-Link registrieren
Command: PASS
Parameters: <password> <version> <flags> [<options>]
Used by: servers only (with these parameters)
Befehl: PASS
Parameter: <password> <version> <flags> [<options>]
Fuer: mit dieser Syntax nur Server
<password> is the password for this new server link as defined in the server
configuration which is sent to the peer or received from it.
<password> enthaelt das Passwort fur den neu aufzubauenden Server-Link,
so wie es in der Konfigurationsdatei definiert wurde.
<version> consists of two parts and is at least 4, at most 14 characters
long: the first four bytes contain the IRC protocol version number, whereas
the first two bytes represent the major version, the last two bytes the
minor version (the string "0210" indicates version 2.10, e.g.).
<version> setzt sich aus zwei Teilen zusammen und ist mindestens 4, maximal
14 Zeichen lang: die ersten vier Bytes enthalten die Versionsnummer des
unterstuetzten IRC-Protokolls, wobei die ersten zwei Bytes die Major-, die
letzten beiden die Minor-Revision angeben. Der String "0210" steht also
fuer Protokollversion 2.10.
Die folgenden (optionalen!) 10 Bytes enthalten eine von der jeweiligen
Implementation abhaengige Versionsnummer. Server, die das IRC+-Protokoll
unterstuetzen, liefern hier "-IRC+".
The following optional(!) 10 bytes contain an implementation-dependent
version number. Servers supporting the IRC+ protocol as defined in this
document provide the string "-IRC+" here.
<flags> setzt sich ebenfalls aus zwei Bestandteilen zusammen und ist
maximal 100 Bytes lang. Getrennt werden die beiden Teile mit dem Zeichen
"|". Der erste Teil enthaelt den Namen der Implementation, der ngIRCd
liefert hier z.B. "ngIRCd", der Originalserver "IRC". Anhand dieser "ID"
kann zwischen Serverimplementationen unterschieden werden. Der zweite Teil
(nach dem "|") ist implementationsabhaengig und wird nur ausgewertet,
wenn die Gegenseite das IRC+-Protokoll unterstuetzt. In diesem Fall wird
folgende Syntax erwartet: "<serverversion>[:<serverflags>]".
Example for <version>: "0210-IRC+".
<serverversion> ist hier eine ASCII-Klartext-Darstellung der Versionsnummer,
<serverflags> zeigt die vom Server unterstuetzten Erweiterungen an (und
kann die leere Menge sein).
<flags> consists of two parts separated with the character "|" and is at
most 100 bytes long. The first part contains the name of the implementation
(ngIRCd sets this to "ngircd", the original ircd to "IRC", e.g.). The second
part is implementation-dependent and should only be parsed if the peer
supports the IRC+ protocol as well. In this case the following syntax is
used: "<serverversion>[:<serverflags>]".
Mit dem optionalen Parameter <options> werden Server-Optionen uebermittelt,
wie sie in RFC 2813, Sektion 4.1.1 definiert sind.
<serverversion> is an ASCII representation of the clear-text server version
number, <serverflags> indicates the supported IRC+ protocol extensions (and
may be empty!).
Folgende <serverflags> sind zur Zeit definiert:
The following <serverflags> are defined at the moment:
- o: IRC-Operatoren duerfen auch dann Channel- und Channel-User-Modes
aendern, wenn sie kein Channel-Operator im betroffenen Channel sind.
- C: The server supports the CHANINFO command.
- o: IRC operators are allowed to change channel- and channel-user-modes
even if they aren't channel-operator of the affected channel.
- Z: Compressed server links are supported by the server.
Example for a complete <flags> string: "ngircd|0.7.5:CZ".
The optional parameter <options> is used to propagate server options as
defined in RFC 2813, section 4.1.1.
- C: der Server unterstuetzt den CHANINFO-Befehl.
II.2 Exchange channel-modes, topics, and persistent channels
II.2 Channel-Modes, persistente Channel und Topic austauschen
Command: CHANINFO
Parameters: <channel> +<modes> <key> <maxusers> [<topic>]
Used by: servers only
Befehl: CHANINFO
Parameter: <channel> +<modes> [[<key> <maxusers>] <topic>]
Fuer: Server
CHANINFO is used by servers to inform each other about a channel: its
modes, channel key, user limits and its topic. <topic> is optional.
Mit CHANINFO Informiert ein Server den anderen ueber einen Channel: dessen
Modes, Channel-Key, User-Limit und dessen Topic. <topic> ist optional.
If the channel already exists on the server receiving the CHANINFO command,
it only adopts the <modes> (or the <topic>) if there are no modes (or topic)
already set. It there are already values set the server ignores the
corresponding parameter.
Existiert auf dem Server, der das CHANINFO empfaengt, der Channel bereits,
so uebernimmt er die Werte jeweils nur dann, wenn er selber noch keine
Modes bzw. kein Topic definiert hat. Ansonsten wird der jeweilige Parameter
ignoriert.
If the channel doesn't exists at all it will be created.
Existiert der Channel noch nicht, so wird er mit den entsprechenden Angaben
erzeugt.
The parameter <key> must be ignored if a channel has no key (the parameter
<modes> doesn't list the "k" channel mode). In this case <key> should
contain "*" because the parameter <key> is required by the CHANINFO syntax
and therefore can't be omitted. The parameter <limit> must be ignored when
a channel has no user limit (the parameter <modes> doesn't list the "l"
channel mode). In this case <limit> should be "0".
Hat ein Channel keinen Key (in <modes> ist der Mode "k" nicht vorhanden),
so muss der Parameter <key> ignoriert werden (da <key> vorhanden sein muss,
sollte in diesem Fall "*" uebergeben werden). Hat er kein User-Limit (kein
"l" in <modes>), so muss <limit> ignoriert werden (<limit> sollte hierbei
als "0" uebergeben werden).
--
$Id: Protocol.txt,v 1.9.2.2 2003/12/08 14:24:13 alex Exp $
$Id: Protocol.txt,v 1.5.4.1 2003/01/08 20:36:57 alex Exp $

View File

@@ -1,67 +1,68 @@
ngIRCd - Next Generation IRC Server
ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- README-AUX.txt --
-- README-AUX.txt --
Seit Version 0.2.2-pre gehoert Apple A/UX zu den offiziell unterstuetzten
Plattformen. Er ist im vollen Funktionsumfang nutzbar.
Ab Version 0.5.0 compiliert zudem der ngIRCd mit dem nativen A/UX-Compiler,
d.h. GNU C wird nicht mehr zwingend vorausgesetzt.
Folgende Software wird jedoch benoetigt:
- GNU sed
Bezugsquellen:
http://www.rezepte-im-web.de/appleux/sed-3.02.tar.gz
ftp://arthur.ath.cx/pub/AUX/Software/Tools/sed-3.02.tar.gz
A/UX beinhaltet ein /bin/sed, dieses unterstuetzt jedoch leider nicht
alle Funktionen, die GNU automake/autoconf nutzen.
Achtung: bitte bei der Installation von GNU sed sicherstellen, dass
immer dieses und nie das von A/UX verwendet wird (also $PATH entsprechend
anpassen bzw. die A/UX-Version komplett ersetzen)!
- libUTIL.a
Bezugsquellen:
http://ftp.mayn.de/pub/apple/apple_unix/Sys_stuff/libUTIL-2.1.tar.gz
ftp://arthur.ath.cx/pub/AUX/Software/Libraries/libUTIL-2.1.tar.gz
Diese Library beinhaltet Systemfunktionen, die auf UNIXoiden Systemen
gaengig, unter A/UX jedoch leider nicht verfuegbar sind. Dazu gehoert
u.a. memmove(), strerror() und strdup().
Nachdem diese Pakete entsprechend installiert sind, reicht ein ganz normales
"./configure" und "make" aus, um den ngIRCd unter A/UX zu compilieren.
Since version 0.2.2-pre Apple's A/UX belongs to the officially supported
platforms. It is not restricted in any way.
Noch ein paar Hinweise, wenn es doch (noch) nicht klappt:
Since version 0.5.0 ngIRCd's source compiles with the native A/UX c
compiler. GNU C isn't a must-have anymore.
- auf dem System muss entweder ein install vorhanden sein, welches so
"broken" ist, dass configure das eigene Shell-Skript waehlt, oder eben
eines, welches funktioniert. Leider ist mindestens ein Binary im Um-
lauf, welches Probleme verursacht. Das Binary aus folgenden GNU
fileutils funktioniert hier aber z.B.:
ftp://arthur.ath.cx/pub/UNIX/AUX/Software/Tools/fileutils-4.0.tar.gz
The following software packages are needed:
- das sich im Umlauf befindende vorcompilierte Binary der alten Bash sollte
unbedingt ausserhalb von /bin (z.B. unter /usr/local/bin) installiert
werden. Ansonsten waehlt es das configure-Script als Shell aus, leider
funktioniert das aber nicht.
- GNU sed
Source:
http://www.rezepte-im-web.de/appleux/sed-3.02.tar.gz
ftp://arthur.ath.cx/pub/AUX/Software/Tools/sed-3.02.tar.gz
- da die /bin/sh von A/UX recht limitiert ist, kann sie u.a. nicht zum
Erzeugen des "config.status"-Scripts verwendet werden.
Abhilfe: /bin/sh umbenennen (z.B. in "/bin/sh.AUX") und durch einen (am
besten symbolischen) Link auf /bin/ksh ersetzen.
Dieser Schritt sollte keine Probleme nach sich ziehen und ist daher immer,
auch unabhaengig vom ngIRCd, empfehlenswert.
A/UX comes with /bin/sed which isn't supporting all functions needed
by GNU automake/autoconf.
Warning: When installing GNU sed please make sure that A/UX doesn't
use the old one anymore which means set the $PATH or replace /bin/sed
at all.
- libUTIL.a
Source:
http://ftp.mayn.de/pub/apple/apple_unix/Sys_stuff/libUTIL-2.1.tar.gz
ftp://arthur.ath.cx/pub/AUX/Software/Libraries/libUTIL-2.1.tar.gz
This library contains functions that are common on other UNIX
systems but not on A/UX e.g. memmove(), strerror() und strdup().
After installation of these packages just do a "./configure" and "make" to
compile ngIRCd on A/UX.
A few hints in case of errors:
- Either there's an 'install' on your system which is completely broken
(so 'configure' uses its own shell script) or use a fully functionable one.
There's at least one binary "out there" causing problems. The one
of the GNU fileutils works fine:
ftp://arthur.ath.cx/pub/UNIX/AUX/Software/Tools/fileutils-4.0.tar.gz
- The precompiled binary of the old 'bash' shouldn't be installed within
/bin (better do this in /usr/local/bin) because 'configure' would
choose it as its shell which wouldn't work.
- Because of limitations of /bin/sh on A/UX it can't be used to create
the 'config.status' script. Better rename /bin/sh to /bin/sh.AUX and
replace it by a symbolic link to /bin/ksh (ln -s /bin/ksh /bin/sh as
root).
These procedure should'nt cause you into problems and is recommended
even if you don't use ngIRCd.
--
$Id: README-AUX.txt,v 1.8 2003/04/21 21:59:34 goetz Exp $
$Id: README-AUX.txt,v 1.4 2002/11/11 00:59:11 alex Exp $

View File

@@ -1,21 +1,15 @@
ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- README-BeOS.txt --
+-------------------------------------------------------------+
| This text is only available in german at the moment, sorry! |
| Contributors for this text or the BeOS port are welcome :-) |
+-------------------------------------------------------------+
BeOS gehoert im Moment (noch?) nicht zu den offiziell unterstuetzten Plat-
formen: der ngIRCd enthaelt zwar bereits einige Anpassungen an BeOS und
compiliert auch, jedoch bricht er bei jedem Connect-Versuch eines Clients
@@ -50,4 +44,4 @@ mir in Verbindung setzen (alex@barton.de), ich maile gerne meine Patches zu.
Fuer eine Aenderung im CVS ist es aber meiner Meinung nach noch zu frueh ...
--
$Id: README-BeOS.txt,v 1.6.2.1 2003/07/18 20:48:20 alex Exp $
$Id: README-BeOS.txt,v 1.3 2002/05/19 13:10:26 alex Exp $

View File

@@ -1,17 +1,16 @@
ngIRCd - Next Generation IRC Server
(c)2001-2003 by Alexander Barton,
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- RFC.txt --
The Internet Relay Chat (IRC) protocol is documented in these Request for
Comments (RFC), which you can get e.g. via <http://www.faqs.org/>:
Das IRC-Protokoll ist in diesen RFC's (Request For Comments) dokumentiert:
1459 Oikarinen, J. & D. Reed, "Internet Relay Chat Protocol",
May 1993, [IRC].
@@ -30,4 +29,4 @@ Comments (RFC), which you can get e.g. via <http://www.faqs.org/>:
--
$Id: RFC.txt,v 1.6 2003/03/07 20:42:20 alex Exp $
$Id: RFC.txt,v 1.4 2002/01/23 18:20:04 alex Exp $

139
doc/en/INSTALL Normal file
View File

@@ -0,0 +1,139 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- INSTALL --
0. Upgrade Information
~~~~~~~~~~~~~~~~~~~~~~
Differences to version 0.5.x
- Starting with version 0.6.0, other servers are identified using asyncronous
passwords: therefore the variable "Password" in [Server]-sections has been
replaced by "MyPassword" and "PeerPassword".
- New configuration variables, section [Global]: MaxConnections, MaxJoins
(see example configuration file "doc/en/sample-ngircd.conf"!).
I. Standard-Installation
~~~~~~~~~~~~~~~~~~~~~~~~
ngIRCd is developed for UNIX-like systems, which means, that the installation
on a modern UNIX-like system should be no problem. The only thing is, that
the system should be supported by GNU automake and GNU autoconf ("configure").
The normal installation is like that:
1) tar xzf ngircd-<Version>.tar.gz
2) cd ngircd-<Version>
3) ./autogen.sh [only necessary when using CVS]
4) ./configure
5) make
6) make install
3): "autogen.sh"
The first step, autogen.sh, is only necessary if the configure-script isn't
already generated. This never happens in official ("stable") releases in
tar.gz-archieves, but when using the CVS system.
The next is therefore only interesting for developpers.
autogen.sh produces the makefile.in's, which are necessary for the configure
script it self, and some more files for make. For this step, there must be
GNU automake and GNU autoconf (in recent versions).
(again: "end users" do not need this step!)
to 4): "./configure"
The configure-script is used to detect local system dependancies.
In the perfect case, configure should recognize all needed libraries, header
and so on. If this shouldn't work, "./configure --help" shows more options.
to 5): "make"
The make command uses the Makefiles produced by configure and compiles the
ngIRCd daemon.
to 6): "make install"
Use "make install" to install the server and a sample configuration file on
the local system. For this step, root privileges are necessary. If there is
already an older configuration file present, it won't be overwritten.
This are the files that are installed:
- /usr/local/sbin/ngircd: exectable server
- /usr/local/etc/ngircd.conf: sample configuration, if not there
II. Useful make-targets
~~~~~~~~~~~~~~~~~~~~~~~
The Makefile produced by the configure-script contain always these useful
targets:
- clean: delete every product from the compiler/linker
next step: -> make
- distclean: plus erase all generated Makefiles
next step: -> ./configure
- maintainer-clean: erease all automatic generated files
next step: -> ./autogen.sh
III. Sample configuration file ngircd.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the sample configuration file, there are comments beginning with "#" OR
";" -- this is only for the better understanding of the code.
The file is seperated in three blocks: [Global], [Operator], [Server]. In
the [Gobal] part, there is the main configuration, like the server-name
and the ports, on which the server should be listening. In the [Operator]
section, the server-operators are defined and [Server] is the section,
where the server-links are configured.
The meaning of the variables in the configuration file is explained in the
"doc/sample-ngircd.conf", which is also the sample configuration file in
/usr/local/etc after running "make install" (if you don't already have one).
IV. Command line options
~~~~~~~~~~~~~~~~~~~~~~~~
These parameters could be passed to the ngIRCd:
-f, --config <file>
The daemon uses the file <file> as configuration file rather than
the standard configuration /usr/local/etc/ngircd.conf.
-n, --nodaemon
ngIRCd should be running as a foreground process.
-p, --passive
Server-links won't be automatically established.
--configtest
Reads, validates and dumps the configuration file as interpreted
by the server. Then exits.
Use "--help" to see a short help text describing all available parameters
the server understands, with "--version" the ngIRCd shows its version
number. In both cases the server exits after the output.
--
$Id: INSTALL,v 1.3 2002/12/18 12:19:07 alex Exp $

20
doc/en/Makefile.am Normal file
View File

@@ -0,0 +1,20 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
#
# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
# der GNU General Public License (GPL), wie von der Free Software Foundation
# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
#
# $Id: Makefile.am,v 1.2 2002/11/18 14:06:29 alex Exp $
#
EXTRA_DIST = INSTALL README sample-ngircd.conf
maintainer-clean-local:
rm -f Makefile Makefile.in
# -eof-

101
doc/en/README Normal file
View File

@@ -0,0 +1,101 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- README --
Ilja Osthoff, <ilja@glide.ath.cx>
I. Introduction
~~~~~~~~~~~~~~~
ngIRCd is an Open-Source server for the Internet Realy Chat (IRC), which
is developped and published under the terms of the GNU General Public
Licence (URL: http://www.gnu.org/licenses/gpl.html). ngIRCd means "next
generation IRC daemon", it's written from scratch and not deduced from the
"grandfather of IRC daemons", the daemon of the IRCNet.
II. Status
~~~~~~~~~~~
At present, the ngIRCd is under active development, some features are not
implemented, some only partly.
Till today (more or less complete) implemented IRC-commands:
ADMIN, AWAY, CHANINFO, CONNECT, DIE, ERROR, INVITE, ISON, JOIN, KICK, KILL,
LINKS, LIST, LUSERS, MODE, MOTD, NAMES, NICK, NJOIN, NOTICE, OPER, PART,
PASS, PING, PONG, PRIVMSG, QUIT, RESTART, SERVER, SQUIT, TIME, TOPIC,
USERHOST, USER, VERSION, WHO, WHOIS.
III. Features (or: why use ngIRCd?)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- no problems with servers which have dynamic ip-adresses
- simple, easy understandable configuration file,
- freely published C-Sourcecode,
- ngIRCd will be developed on in the future.
- supported platforms (tested versions): AIX (3.2.5), A/UX (3.0.1), FreeBSD
(4.5), HP-UX (10.20), IRIX (6.5), Linux (2.x), Mac OS X (10.x), NetBSD
(1.5.2/i386, 1.5.3/m68k), Solaris (2.5.1, 2.6), and Windows with Cygwin.
IV. Documentation
~~~~~~~~~~~~~~~~~
English documentation:
- doc/en/README: the file that you are reading :-)
- doc/en/INSTALL: hints for the installation of the ngIRCd
German documentation:
- README: readme text in german
- INSTALL: german installation instructions
- NEWS: what do you think? :-)
- Changelog: the complete history of the ngIRCd
- doc/FAQ.txt: frequently asked questions and answers
- doc/CVS.txt: hints for the CVS-system
- doc/RFC.txt: information about the RFC's
- doc/sample-ngircd.conf: sample configuration file
- doc/README-AUX.txt: installation hints for A/UX
- doc/README-BeOS.txt: the same for BeOS
V. Download
~~~~~~~~~~~
The homepage of the ngIRCd is: <http://arthur.ath.cx/~alex/ngircd>; you
will find the newest information about the ngIRCd and the most recent
("stable") releases there.
If you are interested in the newest developper-versions (which are not
always stable), then please read the section "CVS" on the homepage and
the file "doc/CVS.txt" which describes the use of CVS, the "Concurrent
Versioning System".
VI. Bugs
~~~~~~~~
If you find bugs in the ngIRCd (which might be there :-), please report
them at the following URL:
<http://arthur.ath.cx/~alex/ngircd/#bugs>
There you can read about kown bugs, too.
If you have critics, patches or something else, please feel yourself free
to post a mail to: <alex@barton.de> or <alex@arthur.ath.cx>
--
$Id: README,v 1.7 2002/11/24 18:48:59 alex Exp $

138
doc/en/sample-ngircd.conf Normal file
View File

@@ -0,0 +1,138 @@
# $Id: sample-ngircd.conf,v 1.4 2002/12/18 12:19:07 alex Exp $
#
# This is a sample configuration for the ngIRCd, which must adept to the
# local preferences and needs.
#
# Comments are started with "#" or ";".
#
# Author: Alexander Barton, <alex@barton.de>
# Translation by Ilja Osthoff, <ilja@glide.ath.cx>
#
[Global]
# In the [global] section of this file, there is the place of the
# main server configuration. Needed is only the variable "Name",
# Info you can adjust, if you like to. For all the others variables,
# you can use the defaults, this means you can leave it by default.
# Server name in the IRC-network
Name = irc.the.net
# Info-text of the server. This will be shown i.e. by a WHOIS- or
# LINKS-request.
Info = Server Info Text
# Information about the server and administrator in the ADMIN-request
;AdminInfo1 = Description
;AdminInfo2 = Location
;AdminEMail = admin@irc.server
# Ports, on which the server will listen. There may be more than
# one port, separated with ";". (Default: 6667)
;Ports = 6667, 6668, 66694
# Textfile with the "message of the day" (MOTD). This will be shown
# on a user connection with the server.
;MotdFile = /usr/local/etc/ngircd.motd
# User-ID, under which the server is started (for that the server
# must be started with root-rights). You can use the name of the
# user or the numerical ID.
# ATTENTION: the configuration and the MOTD file must be readable
# by this user, otherwise RESTART won't work!
;ServerUID = 65534
# Group-ID, under which the server is running (for that the server
# must be started with root-rights). You can use the name of the
# group or the numerical ID.
;ServerGID = 65534
# After <PingTimeout> seconds, the server will send a ping after
# inactivity of this client.
;PingTimeout = 120
# If there is an answer of a client, to which the ping was sended,
# not after <PongTimeout> seconds, it will be disconnected.
;PongTimeout = 20
# The server tries every <ConnectRetry> seconds, not yet connected
# or not anymore connected servers to connect.
;ConnectRetry = 60
# Should IRC-operators be allowed to use the MODE command even if
# they are not(!) channel-operators?
;OperCanUseMode = no
# Maximum number of simultanous connection the server is allowed
# to accept (<=0: unlimited):
;MaxConnections = -1
# Maximum number of channels a user can be member of (<=0: no limit):
;MaxJoins = 10
[Operator]
# In this [operator]-section, there will be the configuration of
# the name and password of an IRC operator. There may be more than
# one operator-block (for each operator one).
# ID of the operator (may be different of the nick)
;Name = TheOper
# Password of the operator
;Password = ThePwd
[Server]
# In this [Server] section, there is the configuration of the
# servers, which are allowed to connect to your own server.
# There may be more than one server-block.
# If you configured a port for the connection, then the ngIRCd
# tries to connect to this port. If not, it waits for the other
# server.
#
# Server-groups:
# The ngIRCd allows "server-groups": that means, that you can assign
# server-groups for every server, to which you want the ngIRCd to
# connect to. If one server of a server-group won't answer, the
# ngIRCd tries the next one of this group.
# ATTENTION: Server-groups will only work if you defined a port!
# IRC-name of the server
;Name = irc2.the.net
# Hostname of the server
;Host = connect-to-host.the.net
# Port of the server, to which the ngIRCd should connect. If you
# assign no port, the ngIRCd waits for an answer of that server.
;Port = 6666
# Own password for the connection. This password has to be configured
# as "PeerPassword" on the other server.
;MyPassword = MySecret
# Foreign password for this connection. This password has to be
# configured as "MyPassword" on the other server.
;PeerPassword = PeerSecret
# Group of that server (optional)
;Group = 123
[Channel]
# In the [Channel] there can be defined "persistent channels". This
# means, that the server creates the channel and even if all users
# left this channel, it will persist. There may be more than one
# block. Signed with the mode "P", which can be set or unset, like
# normal modes.
# Name of the channel
;Name = #TheName
# Topic for the channel
;Topic = a great topic
# Channel-modes
;Modes = tn
# -eof-

View File

@@ -1,149 +1,164 @@
# $Id: sample-ngircd.conf,v 1.20.2.4 2003/12/19 14:30:49 alex Exp $
# $Id: sample-ngircd.conf,v 1.17 2002/12/18 12:19:07 alex Exp $
#
# This is a sample configuration file for the ngIRCd, which must be adepted
# to the local preferences and needs.
# Das ist eine Beispiel-Konfiguration fuer den ngIRCd, die an die
# jeweiligen Beduerfnisse angepasst werden kann/muss.
#
# Comments are started with "#" or ";".
# Kommentare werden mit "#" oder ";" eingeleitet.
#
# Use "ngircd --configtest" (see manual page ngircd(8)) to validate that the
# server interpreted the configuration file as expected!
# +-----------------------------------------------------------------------+
# | Please note: English translations of some of the german documentation |
# | files can be found in the directory "doc/en" -- please have a look! |
# +-----------------------------------------------------------------------+
#
# Autor: Alexander Barton, <alex@barton.de>
# Erweiterungen von Ilja Osthoff, <ilja@glide.ath.cx>
#
[Global]
# The [Global] section of this file is used to define the main
# configuration of the server, like the server name and the ports
# on which the server should be listening.
# Server name in the IRC network, must contain at least one dot
# (".") and be unique in the IRC network. Required!
#
# Im [Global]-Abschnitt der Konfigurationsdatei wird der Server
# "an sich" konfiguriert. Notwendig ist nur die Variable "Name",
# Info ist in der Regel ebengalls anzupassen. Fuer alle uebrigen
# Variablen koennen oft die Defaults benutzt werden, d.h. hier
# muss die Variable nicht angegeben werden.
#
# Servername im IRC-Netz
Name = irc.the.net
# Info text of the server. This will be shown by WHOIS and
# LINKS requests for example.
# Info-Text des Servers. Dieser wird z.B. bei WHOIS- oder LINKS-
# Abfragen entsprechend mit ausgegeben.
Info = Server Info Text
# Global password for all users needed to connect to the server
;Password = abc
# Information about the server and the administrator, used by the
# ADMIN command. Not required by server but by RFC!
;AdminInfo1 = Description
;AdminInfo2 = Location
# Informationen ueber den Server und Administrator fuer den
# ADMIN-Befehl:
;AdminInfo1 = Beschreibung
;AdminInfo2 = Standort
;AdminEMail = admin@irc.server
# Ports on which the server should listen. There may be more than
# one port, separated with ";". (Default: 6667)
;Ports = 6667, 6668, 66694
# IP address on which the server should listen. (Default: empty,
# so the server listens on all IP addresses of the system)
;Listen = 1.2.3.4
# Text file with the "message of the day" (MOTD). This message will
# be shown to all users connecting to the server:
# Ports, auf denen Verbindungen angenommen werden sollen. Es koennen
# mehrere Ports mit "," getrennt angegeben werden. (Default: 6667)
;Ports = 6667, 6668, 6669
# Textdatei mit der "Message of the Day" (MOTD). Diese wird aus-
# gegeben, wenn sich ein User mit dem Server verbindet.
;MotdFile = /usr/local/etc/ngircd.motd
# User ID under which the server should run; you can use the name
# of the user or the numerical ID. ATTENTION: For this to work the
# server must have been started with root privileges! In addition,
# the configuration and MOTD files must be readable by this user,
# otherwise RESTART and REHASH won't work!
;ServerUID = 65534
# User-ID, unter der der Daemon laufen soll (dazu muss der Server
# jedoch mit root-Rechten gestartet werden). Es kann der Name oder
# die numerische ID angegeben werden.
# ACHTUNG: Die Konfigurations- und MOTD-Datei muessen fuer diesen
# Benutzer lesbar sein, ansonsten schlaegt ein RESTART fehl!
;ServerUID = ircd
# Group ID under which the ngircd should run; you can use the name
# of the group or the numerical ID. ATTENTION: For this to work the
# server must have been started with root privileges!
;ServerGID = 65534
# Group-ID, zu der der Daemon wechseln soll (hierzu muss der Server
# jedoch mit root-Rechten gestartet werden). Es kann der Name oder
# die numerische ID angegeben werden.
;ServerGID = daemon
# After <PingTimeout> seconds of inactivity the server will send a
# PING to the peer to test whether it is alive or not.
# Nach <PingTimeout> Sekunden verschickt der Server bei Inaktivitaet
# von einem Client diesem ein PING.
;PingTimeout = 120
# If a client fails to answer a PING with a PONG within <PongTimeout>
# seconds, it will be disconnected by the server.
# Antwortet ein Client, der ein PING bekam, nicht innerhalb von
# <PongTimeout> Sekunden mit einem PONG, so wird er disconnectiert.
;PongTimeout = 20
# The server tries every <ConnectRetry> seconds to establish a link
# to not yet (or no longer) connected servers.
# Der Server versucht alle <ConnectRetry> Sekunden, noch nicht bzw.
# nicht mehr connectierte Server-Links aufzubauen.
;ConnectRetry = 60
# Should IRC Operators be allowed to use the MODE command even if
# they are not(!) channel-operators?
# Sollen IRC-Operatoren immer den MODE-Befehl in Channel benutzen
# koennen, auch wenn sie kein(!) Channel-Operator sind?
;OperCanUseMode = no
# Maximum number of simultaneous connection the server is allowed
# to accept (<=0: unlimited):
# Maximale Anzahl von gleichzeitigen Verbindungen, die dieser
# Server annehmen darf (<=0: unlimitiert).
;MaxConnections = -1
# Maximum number of simultaneous connections from a single IP address
# the server will accept (<=0: unlimited):
;MaxConnectionsIP = 5
# Maximum number of channels a user can be member of (<=0: no limit):
# Maximale Anzahl von Channels, in denen ein User zeitgleich
# Mitglied sein kann (<=0: unlimitiert).
;MaxJoins = 10
[Operator]
# [Operator] sections are used to define IRC Operators. There may be
# more than one [Operator] block, one for each local operator.
# ID of the operator (may be different of the nick name)
#
# Mit einem [Operator]-Block wird der Name und das Passwort eines
# IRC-Operators konfiguriert. Es darf mehrere [Operator]-Bloecke
# geben (fuer jeden Operator einen).
#
# ID des IRC-Operators (muss nicht mit dem Nick identisch sein).
;Name = TheOper
# Password of the IRC operator
# Passwort des IRC-Operators
;Password = ThePwd
[Server]
# Other servers are configured in [Server] sections. If you
# configure a port for the connection, then this ngircd tries to
# connect to to the other server on the given port; if not it waits
# for the other server to connect.
# There may be more than one server block.
#
# Server Groups:
# The ngIRCd allows "server groups": You can assign an "ID" to every
# server with which you want this ngIRCd to link. If a server of a
# group won't answer, the ngIRCd tries to connect to the next server
# in the given group. But the ngircd never tries to connect to two
# servers with the same group ID.
# IRC name of the server
# In [Server]-Bloecken werden Server konfiguriert, zu denen sich
# dieser ngIRCd verbinden soll bzw. von denen Verbindungen angekommen
# werden duerfen.
# Es koennen mehrere Server konfiguriert werden, d.h. [Server]-
# Bloecke koennen mehrfach vorkommen.
# Wenn man fuer einen Server einen Port angegeben hat, dann versucht
# sich der ngIRCd mit der Gegenseite zu verbinden. Hat man keinen
# Port konfiguriert, dann wartet der ngIRCd darauf, dass sich die
# Gegenseite mit ihm verbindet.
#
# Server-Gruppen:
# Der ngIRCd unterstuetzt "Server-Gruppen": das bedeutet, man kann
# jedem Server, mit dem man sich verbinden will, einer Gruppe zu-
# ordnen. Wenn der ngIRCd sich dann mit einem Server aus der Gruppe
# verbinden will und keine Antwort erhaelt, dann wird der naechste
# Server aus der Gruppe versucht.
# Achtung: Gruppen werden nur beachtet, wenn man einen Port fur
# die Gegenseite angegeben hat!
#
# IRC-Name des Servers
;Name = irc2.the.net
# Internet host name of the peer
# DNS-Hostname des Servers
;Host = connect-to-host.the.net
# Port of the server to which the ngIRCd should connect. If you
# assign no port the ngIRCd waits for incoming connections.
# Port, zu dem dieser Server eine Verbindung herstellen soll. Wird
# kein Port angegeben, so wird auf eine Verbindung der Gegenseite
# gewartet.
;Port = 6666
# Own password for the connection. This password has to be configured
# as "PeerPassword" on the other server.
# Eigenes Passwort fuer diese Verbindung. Dieses Passwort muss auf
# dem anderen Server als "PeerPassword" konfiguriert werden.
;MyPassword = MySecret
# Foreign password for this connection. This password has to be
# configured as "MyPassword" on the other server.
# Passwort des Peer-Servers fuer diese Verbindung. Dieses Passwort
# muss auf dem anderen Server als "MyPassword" konfiguriert sein.
;PeerPassword = PeerSecret
# Group of this server (optional)
# Gruppe, zu der dieser Server gehoert (optional).
;Group = 123
[Channel]
# Pre-defined channels can be configured in [Channel] sections.
# Such channels are created by the server when starting up and even
# persist when there are no more members left.
# Persistent channels are marked with the mode 'P', which can be set
# and unset by IRC operators like other modes on the fly.
# There may be more than one [Channel] block.
# Name of the channel
#
# Mit [Channel]-Bloecken werden "persistente Channels" definiert,
# die nach dem Start des Servers automatisch erzeugt werden und auch
# dann erhalten bleiben, wenn keine User mehr im Channel sind. Es
# koennen mehrere solcher Bloecke hier konfiguriert werden.
# Gekennzeichnet werden solche Channels mit dem Mode "P", der ganz
# normal gesetzt und geloescht werden kann.
#
# Name des Channels
;Name = #TheName
# Topic for this channel
;Topic = a great topic
# Initial channel modes
# Topic, das gesetzt werden soll
;Topic = Ein tolles Topic
# Channel-Modes
;Modes = tn
# -eof-

View File

@@ -1,7 +1,7 @@
.\"
.\" $Id: ngircd.8,v 1.8 2003/03/10 00:58:06 alex Exp $
.\" $Id: ngircd.8,v 1.5 2002/11/18 18:49:34 alex Exp $
.\"
.TH ngircd 8 "March 2003" ngircd "ngIRCd Manual"
.TH ngircd 8 "September 2002" ngircd "ngIRCd Manual"
.SH NAME
ngircd \- the next generation IRC daemon
.SH SYNOPSIS
@@ -9,63 +9,32 @@ ngircd \- the next generation IRC daemon
.I Options
.B ]
.SH DESCRIPTION
.BR ngircd
is a free open source daemon for the Internet Relay Chat (IRC),
developed under the GNU General Public License (GPL).
.PP
It's written from scratch and is not based upon the original IRCd like
many others. It is easy to configure, supports server links (even with
original ircd's) and runs on hosts with changing IP addresses (such as
dial-in networks).
.PP
Currently supported platforms (tested versions) are: AIX (3.2.5 with IBM XL
C Compiler), A/UX (3.x, Apple pre-ANSI C Compiler and GNU C), FreeBSD
(4.5/i386, GNU C), HP-UX (10.20, GNU C), IRIX (6.5, SGI MIPSpro C 7.30),
Linux (2.2.x/i386, 2.4.x/i386 and 2.4.x/hppa, GNU C), Mac OS X (10.x, GNU C),
NetBSD (1.5.2/i386 and 1.5.3/m68k, GNU C), Solaris (2.5.1 and 2.6, GNU C),
and Windows with Cygwin (GNU C).
.PP
As ngIRCd relies on UNIX standards and uses GNU automake and GNU autoconf
there are good chances that it also supports other UNIX-based operating
systems.
.B ngircd
is a portable IRC daemon written from scratch. It is easy to configure,
supports server links (even with original ircds) and runs on hosts with
changing IP addresses (such as dial-in networks). Currently supported
platforms (tested versions) are: AIX (3.2.5), A/UX (3.0.1), FreeBSD
(4.5), HP-UX (10.20), IRIX (6.5), Linux (2.x), Mac OS X (10.x), NetBSD
(1.5.2/i386, 1.5.3/m68k), Solaris (2.5.1, 2.6), and Windows with Cygwin.
.SH OPTIONS
The default behaviour of
.BR ngircd
is to read its standard configuration file (see below), to detach from the
controlling terminal and to wait for clients.
.PP
You can use these options to modify this default:
.TP
\fB\-\-configtest\fR
Read, validate and display the configuration; then exit.
.TP
\fB\-f\fR \fIfile\fR, \fB\-\-config\fR \fIfile\fR
Use
.IP --configtest
read, validate and display configuration; then exit.
.IP "-f file, --config file"
use
.I file
as configuration file.
.TP
\fB\-n\fR, \fB\-\-nodaemon\fR
Don't fork a child and don't detach from controlling terminal.
All log messages go to the console.
.TP
\fB\-p\fR, \fB\-\-passive\fR
Disable automatic connections to other servers. You can use the IRC command
CONNECT later on as IRC Operator to link this ngIRCd to other servers.
.TP
\fB\-\-version\fR
Output version information and exit.
.TP
\fB\-\-help\fR
Display a brief help text and exit.
.IP "-n, --nodaemon"
don't fork and don't detach from controlling terminal.
.IP "-p, --passive"
disable automatic connections to other servers.
.IP --version
output version information and exit.
.IP --help
display brief help text and exit.
.SH FILES
.I /usr/local/etc/ngircd.conf
.RS
The system wide default configuration file.
.RE
.I /usr/local/etc/ngircd.motd
.RS
Default "message of the day" (MOTD).
.RE
.SH AUTHOR
Alexander Barton,
.UR mailto:alex@barton.de

View File

@@ -1,204 +1,14 @@
.\"
.\" $Id: ngircd.conf.5,v 1.9.2.2 2003/11/07 20:51:10 alex Exp $
.\" $Id: ngircd.conf.5,v 1.6 2002/09/16 11:11:21 alex Exp $
.\"
.TH ngircd.conf 5 "Mai 2003" ngircd "ngIRCd Manual"
.TH ngircd.conf 5 "September 2002" ngircd "ngIRCd Manual"
.SH NAME
ngircd.conf \- configuration file of ngIRCd
ngircd.conf \- configuration file of ngircd
.SH SYNOPSIS
.B /usr/local/etc/ngircd.conf
.SH DESCRIPTION
.BR ngircd.conf
is the configuration file for
.BR ngircd (8)
which you should adept to your local preferences and needs.
.SH "FILE FORMAT"
The file consists of sections and parameters. A section begins with the name
of the section in square brackets and continues until the next section
begins.
.PP
Sections contain parameters of the form
.PP
.RS
.I name
=
.I value
.RE
.PP
Any line beginning with a semicolon (';') or a hash ('#') character is
treated as a comment and ignored.
.PP
The file format is line-based - that means, each newline-terminated line
represents either a comment, a section name or a parameter.
.PP
Section and parameter names are not case sensitive.
.SH "SECTION OVERVIEW"
The file is separated in four blocks: [Global], [Operator], [Server],
and [Channel].
.PP
In the
.I [Global]
section, there is the main configuration like the server name and the
ports, on which the server should be listening. IRC operators of this
server are defined in
.I [Operator]
blocks.
.I [Server]
is the section where server links are configured. And
.I [Channel]
blocks are used to configure pre-defined ("persistent") IRC channels.
.SH [GLOBAL]
The
.I [Global]
section is used to define the server main configuration, like the server
name and the ports on which the server should be listening.
.TP
\fBName\fR
Server name in the IRC network
.TP
\fBInfo\fR
Info text of the server. This will be shown by WHOIS and LINKS requests for
example.
.TP
\fBAdminInfo1\fR, \fBAdminInfo2\fR, \fBAdminEMail\fR
Information about the server and the administrator, used by the ADMIN
command.
.TP
\fBPorts\fR
Ports on which the server should listen. There may be more than one port,
separated with ';'. Default: 6667.
.TP
\fBListen\fR
The ip address on which the server should listen. Default is empty, so
the server listens on all configured ip addresses and interfaces.
.TP
\fBMotdFile\fR
Text file with the "message of the day" (MOTD). This message will be shown
to all users connecting to the server.
.TP
\fBServerUID\fR
User ID under which the server should run; you can use the name of the user
or the numerical ID.
.PP
.RS
.B Attention:
.br
For this to work the server must have been
started with root privileges! In addition, the configuration and MOTD files
must be readable by this user, otherwise RESTART and REHASH won't work!
.RE
.TP
\fBServerGID\fR
Group ID under which the ngIRCd should run; you can use the name of the
group or the numerical ID.
.PP
.RS
.B Attention:
.br
For this to work the server must have
been started with root privileges!
.RE
.TP
\fBPingTimeout\fR
After <PingTimeout> seconds of inactivity the server will send a PING to
the peer to test whether it is alive or not. Default: 120.
.TP
\fBPongTimeout\fR
If a client fails to answer a PING with a PONG within <PongTimeout>
seconds, it will be disconnected by the server. Default: 20.
.TP
\fBConnectRetry\fR
The server tries every <ConnectRetry> seconds to establish a link to not yet
(or no longer) connected servers. Default: 60.
.TP
\fBOperCanUseMode\fR
Should IRC Operators be allowed to use the MODE command even if they are
not(!) channel-operators? Default: no.
.TP
\fBMaxConnections\fR
Maximum number of simultaneous connection the server is allowed to accept
(<=0: unlimited). Default: -1.
.TP
\fBMaxConnectionsIP\fR
Maximum number of simultaneous connections from a single IP address that
the server will accept (<=0: unlimited). This configuration options lowers
the risk of denial of service attacks (DoS). Default: 5.
.TP
\fBMaxJoins\fR
Maximum number of channels a user can be member of (<=0: no limit).
Default: 10.
.SH [OPERATOR]
.I [Operator]
sections are used to define IRC Operators. There may be more than one
.I [Operator]
block, one for each local operator.
.TP
\fBName\fR
ID of the operator (may be different of the nick name).
.TP
\fBPassword\fR
Password of the IRC operator.
.SH [SERVER]
Other servers are configured in
.I [Server]
sections. If you configure a port for the connection, then this ngIRCd
tries to connect to to the other server on the given port; if not, it waits
for the other server to connect.
.PP
The ngIRCd allows "server groups": You can assign an "ID" to every server
with which you want this ngIRCd to link. If a server of a group won't
answer, the ngIRCd tries to connect to the next server in the given group.
But ngIRCd never tries to connect to two servers with the same group ID.
.PP
There may be more than one
.I [Server]
block.
.TP
\fBName\fR
IRC name of the server
.TP
\fBHost\fR
Internet host name of the peer
.TP
\fBPort\fR
Port of the server to which the ngIRCd should connect. If you assign no port
the ngIRCd waits for incoming connections.
.TP
\fBMyPassword\fR
Own password for this connection. This password has to be configured as
"PeerPassword" on the other server.
.TP
\fBPeerPassword\fR
Foreign password for this connection. This password has to be configured as
"MyPassword" on the other server.
.TP
\fBGroup\fR
Group of this server (optional).
.SH [CHANNEL]
Pre-defined channels can be configured in
.I [Channel]
sections. Such channels are created by the server when starting up and even
persist when there are no more members left.
.PP
Persistent channels are marked with the mode 'P', which can be set and unset
by IRC operators like other modes on the fly.
.PP
There may be more than one
.I [Channel]
block.
.TP
\fBName\fR
Name of the channel
.TP
\fBTopic\fR
Topic for this channel
.TP
\fBModes\fR
Initial channel modes.
.SH HINTS
It's wise to use "ngircd --configtest" to validate the configuration file
after changing it. See
.BR ngircd (8)
for details.
(coming soon, please have a look at the sample configuration
file "doc/sample-ngircd.conf" -- Thank you!)
.SH AUTHOR
Alexander Barton,
.UR mailto:alex@barton.de
@@ -211,5 +21,6 @@ http://arthur.ath.cx/~alex/ngircd/
.UE
.SH "SEE ALSO"
.BR ngircd (8)
.BR ircd (8)
.\"
.\" -eof-

View File

@@ -2,16 +2,17 @@
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
#
# 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.
# Please read the file COPYING, README and AUTHORS for more information.
# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
# der GNU General Public License (GPL), wie von der Free Software Foundation
# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
#
# $Id: Makefile.am,v 1.5 2003/01/13 12:20:16 alex Exp $
# $Id: Makefile.am,v 1.4 2002/09/09 10:00:15 alex Exp $
#
SUBDIRS = portab tool ngircd testsuite
SUBDIRS = portab ngircd testsuite
maintainer-clean-local:
rm -f Makefile Makefile.in config.h config.h.in stamp-h.in

View File

@@ -1,37 +1,36 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
#
# 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.
# Please read the file COPYING, README and AUTHORS for more information.
# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
# der GNU General Public License (GPL), wie von der Free Software Foundation
# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
#
# $Id: Makefile.am,v 1.39.2.3 2003/12/04 14:13:42 alex Exp $
# $Id: Makefile.am,v 1.31.2.1 2003/01/04 10:58:15 alex Exp $
#
AUTOMAKE_OPTIONS = ../portab/ansi2knr
INCLUDES = -I$(srcdir)/../portab -I$(srcdir)/../tool
INCLUDES = -I$(srcdir)/../portab
LINTARGS = -weak -warnunixlib +unixlib -booltype BOOLEAN
sbin_PROGRAMS = ngircd
ngircd_SOURCES = ngircd.c channel.c client.c conf.c conn.c conn-zip.c conn-func.c \
hash.c irc.c irc-channel.c irc-info.c irc-login.c irc-mode.c irc-op.c \
irc-oper.c irc-server.c irc-write.c lists.c log.c match.c parse.c \
rendezvous.c resolve.c
ngircd_SOURCES = ngircd.c channel.c client.c conf.c conn.c hash.c irc.c \
irc-channel.c irc-info.c irc-login.c irc-mode.c irc-op.c irc-oper.c \
irc-server.c irc-write.c lists.c log.c match.c parse.c resolve.c tool.c
ngircd_LDFLAGS = -L../portab -L../tool
ngircd_LDFLAGS = -L../portab
ngircd_LDADD = -lngportab -lngtool
ngircd_LDADD = -lngportab
noinst_HEADERS = ngircd.h channel.h client.h conf.h conn.h conn-zip.h conn-func.h \
hash.h irc.h irc-channel.h irc-info.h irc-login.h irc-mode.h irc-op.h \
irc-oper.h irc-server.h irc-write.h lists.h log.h match.h parse.h \
rendezvous.h resolve.h \
noinst_HEADERS = ngircd.h channel.h client.h conf.h conn.h hash.h irc.h \
irc-channel.h irc-info.h irc-login.h irc-mode.h irc-op.h irc-oper.h \
irc-server.h irc-write.h lists.h log.h match.h parse.h resolve.h tool.h \
messages.h defines.h
clean-local:
@@ -61,13 +60,7 @@ lint:
fi; \
done;
ngircd.c: cvs-version.h
irc-login.c: cvs-version.h
irc-info.c: cvs-version.h
cvs-version.h: cvs-date
ngircd.c: cvs-date cvs-version.h
cvs-date:
grep VERSION ../config.h | grep "CVS" \
@@ -75,8 +68,7 @@ cvs-date:
| $(AWK) "{ print \$$9 }" | sort | tail -1 \
| sed -e "s/\//-/g" )\"" > cvs-version.new \
|| echo "" > cvs-version.new
diff cvs-version.h cvs-version.new 2>/dev/null \
|| cp cvs-version.new cvs-version.h
diff cvs-version.h cvs-version.new || cp cvs-version.new cvs-version.h
TESTS = check-version check-help

View File

@@ -17,14 +17,14 @@
#include "portab.h"
static char UNUSED id[] = "$Id: channel.c,v 1.42.2.1 2003/11/07 20:51:10 alex Exp $";
static char UNUSED id[] = "$Id: channel.c,v 1.38 2002/12/16 23:05:24 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "conn-func.h"
#include "conn.h"
#include "client.h"
#include "exp.h"
@@ -468,7 +468,7 @@ Channel_IsValidName( CHAR *Name )
if(( Name[0] != '#' ) || ( strlen( Name ) >= CHANNEL_NAME_LEN )) return FALSE;
ptr = Name;
strcpy( badchars, " ,:\007" );
strcpy( badchars, " ,:\x07" );
while( *ptr )
{
if( strchr( badchars, *ptr )) return FALSE;
@@ -494,7 +494,7 @@ Channel_ModeAdd( CHANNEL *Chan, CHAR Mode )
if( ! strchr( Chan->modes, x[0] ))
{
/* Client hat den Mode noch nicht -> setzen */
strlcat( Chan->modes, x, sizeof( Chan->modes ));
strcat( Chan->modes, x );
return TRUE;
}
else return FALSE;
@@ -547,7 +547,7 @@ Channel_UserModeAdd( CHANNEL *Chan, CLIENT *Client, CHAR Mode )
if( ! strchr( cl2chan->modes, x[0] ))
{
/* Client hat den Mode noch nicht -> setzen */
strlcat( cl2chan->modes, x, sizeof( cl2chan->modes ));
strcat( cl2chan->modes, x );
return TRUE;
}
else return FALSE;
@@ -629,7 +629,8 @@ Channel_SetTopic( CHANNEL *Chan, CHAR *Topic )
assert( Chan != NULL );
assert( Topic != NULL );
strlcpy( Chan->topic, Topic, sizeof( Chan->topic ));
strncpy( Chan->topic, Topic, CHANNEL_TOPIC_LEN - 1 );
Chan->topic[CHANNEL_TOPIC_LEN - 1] = '\0';
} /* Channel_SetTopic */
@@ -639,7 +640,8 @@ Channel_SetModes( CHANNEL *Chan, CHAR *Modes )
assert( Chan != NULL );
assert( Modes != NULL );
strlcpy( Chan->modes, Modes, sizeof( Chan->modes ));
strncpy( Chan->modes, Modes, CHANNEL_MODE_LEN - 1 );
Chan->topic[CHANNEL_MODE_LEN - 1] = '\0';
} /* Channel_SetModes */
@@ -649,7 +651,8 @@ Channel_SetKey( CHANNEL *Chan, CHAR *Key )
assert( Chan != NULL );
assert( Key != NULL );
strlcpy( Chan->key, Key, sizeof( Chan->key ));
strncpy( Chan->key, Key, CLIENT_PASS_LEN - 1 );
Chan->key[CLIENT_PASS_LEN - 1] = '\0';
Log( LOG_DEBUG, "Channel %s: Key is now \"%s\".", Chan->name, Chan->key );
} /* Channel_SetKey */
@@ -669,7 +672,7 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
{
BOOLEAN is_member, has_voice, is_op, ok;
/* Okay, target is a channel */
/* Okay, Ziel ist ein Channel */
is_member = has_voice = is_op = FALSE;
if( Channel_IsMemberOf( Chan, From ))
{
@@ -678,21 +681,14 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
if( strchr( Channel_UserModes( Chan, From ), 'o' )) is_op = TRUE;
}
/* Check weather client is allowed to write to channel */
/* pruefen, ob Client in Channel schreiben darf */
ok = TRUE;
if( strchr( Channel_Modes( Chan ), 'n' ) && ( ! is_member )) ok = FALSE;
if( strchr( Channel_Modes( Chan ), 'm' ) && ( ! is_op ) && ( ! has_voice )) ok = FALSE;
/* Is the client banned? */
if( Lists_CheckBanned( From, Chan ))
{
/* Client is banned, bus is he channel operator or has voice? */
if(( ! has_voice ) && ( ! is_op )) ok = FALSE;
}
if( ! ok ) return IRC_WriteStrClient( From, ERR_CANNOTSENDTOCHAN_MSG, Client_ID( From ), Channel_Name( Chan ));
/* Send text */
/* Text senden */
if( Client_Conn( From ) > NONE ) Conn_UpdateIdle( Client_Conn( From ));
return IRC_WriteStrChannelPrefix( Client, Chan, From, TRUE, "PRIVMSG %s :%s", Channel_Name( Chan ), Text );
} /* Channel_Write */
@@ -714,7 +710,7 @@ Channel_Create( CHAR *Name )
return NULL;
}
c->next = NULL;
strlcpy( c->name, Name, sizeof( c->name ));
strncpy( c->name, Name, CHANNEL_NAME_LEN - 1 );
c->name[CHANNEL_NAME_LEN - 1] = '\0';
strcpy( c->modes, "" );
strcpy( c->topic, "" );

View File

@@ -17,7 +17,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: client.c,v 1.74 2003/03/31 15:54:21 alex Exp $";
static char UNUSED id[] = "$Id: client.c,v 1.65.2.3 2003/01/08 23:13:45 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -59,10 +59,6 @@ LOCAL CLIENT *New_Client_Struct PARAMS(( VOID ));
LOCAL VOID Generate_MyToken PARAMS(( CLIENT *Client ));
LOCAL VOID Adjust_Counters PARAMS(( CLIENT *Client ));
#ifndef Client_DestroyNow
GLOBAL VOID Client_DestroyNow PARAMS((CLIENT *Client ));
#endif
LONG Max_Users = 0, My_Max_Users = 0;
@@ -76,7 +72,7 @@ Client_Init( VOID )
if( ! This_Server )
{
Log( LOG_EMERG, "Can't allocate client structure for server! Going down." );
Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
exit( 1 );
}
@@ -90,7 +86,7 @@ Client_Init( VOID )
gethostname( This_Server->host, CLIENT_HOST_LEN );
h = gethostbyname( This_Server->host );
if( h ) strlcpy( This_Server->host, h->h_name, sizeof( This_Server->host ));
if( h ) strcpy( This_Server->host, h->h_name );
Client_SetID( This_Server, Conf_ServerName );
Client_SetInfo( This_Server, Conf_ServerInfo );
@@ -105,7 +101,7 @@ Client_Exit( VOID )
CLIENT *c, *next;
INT cnt;
if( NGIRCd_SignalRestart ) Client_Destroy( This_Server, "Server going down (restarting).", NULL, FALSE );
if( NGIRCd_Restart ) Client_Destroy( This_Server, "Server going down (restarting).", NULL, FALSE );
else Client_Destroy( This_Server, "Server going down.", NULL, FALSE );
cnt = 0;
@@ -179,7 +175,7 @@ Client_New( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, INT Type, CHAR *
if( Type == CLIENT_SERVER ) Generate_MyToken( client );
/* ist der User away? */
if( strchr( client->modes, 'a' )) strlcpy( client->away, DEFAULT_AWAY_MSG, sizeof( client->away ));
if( strchr( client->modes, 'a' )) strcpy( client->away, DEFAULT_AWAY_MSG );
/* Verketten */
client->next = (POINTER *)My_Clients;
@@ -207,7 +203,7 @@ Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit )
if( ! txt ) txt = "Reason unknown.";
/* Netz-Split-Nachricht vorbereiten (noch nicht optimal) */
if( Client->type == CLIENT_SERVER ) snprintf( msg, sizeof( msg ), "%s: lost server %s", This_Server->id, Client->id );
if( Client->type == CLIENT_SERVER ) sprintf( msg, "%s: lost server %s", This_Server->id, Client->id );
last = NULL;
c = My_Clients;
@@ -267,7 +263,7 @@ Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit )
}
/* andere Server informieren */
if( ! NGIRCd_SignalQuit )
if( ! NGIRCd_Quit )
{
if( FwdMsg ) IRC_WriteStrServersPrefix( Client_NextHop( c ), c, "SQUIT %s :%s", c->id, FwdMsg );
else IRC_WriteStrServersPrefix( Client_NextHop( c ), c, "SQUIT %s :", c->id );
@@ -296,35 +292,6 @@ Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit )
} /* Client_Destroy */
GLOBAL VOID
Client_DestroyNow( CLIENT *Client )
{
/* Destroy client structure immediately. This function is only
* intended for the connection layer to remove client structures
* of connections that can't be established! */
CLIENT *last, *c;
assert( Client != NULL );
last = NULL;
c = My_Clients;
while( c )
{
if( c == Client )
{
/* Wir haben den Client gefunden: entfernen */
if( last ) last->next = c->next;
else My_Clients = (CLIENT *)c->next;
free( c );
break;
}
last = c;
c = (CLIENT *)c->next;
}
} /* Client_DestroyNow */
GLOBAL VOID
Client_SetHostname( CLIENT *Client, CHAR *Hostname )
{
@@ -333,7 +300,8 @@ Client_SetHostname( CLIENT *Client, CHAR *Hostname )
assert( Client != NULL );
assert( Hostname != NULL );
strlcpy( Client->host, Hostname, sizeof( Client->host ));
strncpy( Client->host, Hostname, CLIENT_HOST_LEN - 1 );
Client->host[CLIENT_HOST_LEN - 1] = '\0';
} /* Client_SetHostname */
@@ -345,7 +313,8 @@ Client_SetID( CLIENT *Client, CHAR *ID )
assert( Client != NULL );
assert( ID != NULL );
strlcpy( Client->id, ID, sizeof( Client->id ));
strncpy( Client->id, ID, CLIENT_ID_LEN - 1 );
Client->id[CLIENT_ID_LEN - 1] = '\0';
/* Hash */
Client->hash = Hash( Client->id );
@@ -360,12 +329,13 @@ Client_SetUser( CLIENT *Client, CHAR *User, BOOLEAN Idented )
assert( Client != NULL );
assert( User != NULL );
if( Idented ) strlcpy( Client->user, User, sizeof( Client->user ));
if( Idented ) strncpy( Client->user, User, CLIENT_USER_LEN - 1 );
else
{
Client->user[0] = '~';
strlcpy( Client->user + 1, User, sizeof( Client->user ) - 1 );
strncpy( Client->user + 1, User, CLIENT_USER_LEN - 2 );
}
Client->user[CLIENT_USER_LEN - 1] = '\0';
} /* Client_SetUser */
@@ -377,7 +347,8 @@ Client_SetInfo( CLIENT *Client, CHAR *Info )
assert( Client != NULL );
assert( Info != NULL );
strlcpy( Client->info, Info, sizeof( Client->info ));
strncpy( Client->info, Info, CLIENT_INFO_LEN - 1 );
Client->info[CLIENT_INFO_LEN - 1] = '\0';
} /* Client_SetInfo */
@@ -389,7 +360,8 @@ Client_SetModes( CLIENT *Client, CHAR *Modes )
assert( Client != NULL );
assert( Modes != NULL );
strlcpy( Client->modes, Modes, sizeof( Client->modes ));
strncpy( Client->modes, Modes, CLIENT_MODE_LEN - 1 );
Client->modes[CLIENT_MODE_LEN - 1] = '\0';
} /* Client_SetModes */
@@ -401,7 +373,8 @@ Client_SetFlags( CLIENT *Client, CHAR *Flags )
assert( Client != NULL );
assert( Flags != NULL );
strlcpy( Client->flags, Flags, sizeof( Client->flags ));
strncpy( Client->flags, Flags, CLIENT_FLAGS_LEN - 1 );
Client->flags[CLIENT_FLAGS_LEN - 1] = '\0';
} /* Client_SetFlags */
@@ -413,7 +386,8 @@ Client_SetPassword( CLIENT *Client, CHAR *Pwd )
assert( Client != NULL );
assert( Pwd != NULL );
strlcpy( Client->pwd, Pwd, sizeof( Client->pwd ));
strncpy( Client->pwd, Pwd, CLIENT_PASS_LEN - 1 );
Client->pwd[CLIENT_PASS_LEN - 1] = '\0';
} /* Client_SetPassword */
@@ -421,11 +395,12 @@ GLOBAL VOID
Client_SetAway( CLIENT *Client, CHAR *Txt )
{
/* Set AWAY reason of client */
assert( Client != NULL );
assert( Txt != NULL );
strlcpy( Client->away, Txt, sizeof( Client->away ));
strncpy( Client->away, Txt, CLIENT_AWAY_LEN - 1 );
Client->away[CLIENT_AWAY_LEN - 1] = '\0';
Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt );
} /* Client_SetAway */
@@ -488,7 +463,7 @@ Client_ModeAdd( CLIENT *Client, CHAR Mode )
if( ! strchr( Client->modes, x[0] ))
{
/* Client hat den Mode noch nicht -> setzen */
strlcat( Client->modes, x, sizeof( Client->modes ));
strcat( Client->modes, x );
return TRUE;
}
else return FALSE;
@@ -554,7 +529,8 @@ Client_Search( CHAR *Nick )
assert( Nick != NULL );
/* Nick kopieren und ggf. Host-Mask abschneiden */
strlcpy( search_id, Nick, sizeof( search_id ));
strncpy( search_id, Nick, CLIENT_ID_LEN - 1 );
search_id[CLIENT_ID_LEN - 1] = '\0';
ptr = strchr( search_id, '!' );
if( ptr ) *ptr = '\0';
@@ -822,7 +798,7 @@ Client_CheckID( CLIENT *Client, CHAR *ID )
if( strcasecmp( c->id, ID ) == 0 )
{
/* die Server-ID gibt es bereits */
snprintf( str, sizeof( str ), "ID \"%s\" already registered", ID );
sprintf( str, "ID \"%s\" already registered", ID );
if( Client->conn_id != c->conn_id ) Log( LOG_ERR, "%s (on connection %d)!", str, c->conn_id );
else Log( LOG_ERR, "%s (via network)!", str );
Conn_Close( Client->conn_id, str, str, TRUE );

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: client.h,v 1.34 2003/01/15 14:28:25 alex Exp $
* $Id: client.h,v 1.32.2.1 2002/12/22 23:42:28 alex Exp $
*
* Client management (header)
*/
@@ -62,81 +62,78 @@ typedef POINTER CLIENT;
#endif
GLOBAL VOID Client_Init PARAMS(( VOID ));
GLOBAL VOID Client_Exit PARAMS(( VOID ));
GLOBAL VOID Client_Init PARAMS((VOID ));
GLOBAL VOID Client_Exit PARAMS((VOID ));
GLOBAL CLIENT *Client_NewLocal PARAMS(( CONN_ID Idx, CHAR *Hostname, INT Type, BOOLEAN Idented ));
GLOBAL CLIENT *Client_NewRemoteServer PARAMS(( CLIENT *Introducer, CHAR *Hostname, CLIENT *TopServer, INT Hops, INT Token, CHAR *Info, BOOLEAN Idented ));
GLOBAL CLIENT *Client_NewRemoteUser PARAMS(( CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info, BOOLEAN Idented ));
GLOBAL CLIENT *Client_New PARAMS(( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented ));
GLOBAL CLIENT *Client_NewLocal PARAMS((CONN_ID Idx, CHAR *Hostname, INT Type, BOOLEAN Idented ));
GLOBAL CLIENT *Client_NewRemoteServer PARAMS((CLIENT *Introducer, CHAR *Hostname, CLIENT *TopServer, INT Hops, INT Token, CHAR *Info, BOOLEAN Idented ));
GLOBAL CLIENT *Client_NewRemoteUser PARAMS((CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info, BOOLEAN Idented ));
GLOBAL CLIENT *Client_New PARAMS((CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented ));
GLOBAL VOID Client_Destroy PARAMS(( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit ));
#ifdef CONN_MODULE
GLOBAL VOID Client_DestroyNow PARAMS(( CLIENT *Client ));
#endif
GLOBAL VOID Client_Destroy PARAMS((CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit ));
GLOBAL CLIENT *Client_ThisServer PARAMS(( VOID ));
GLOBAL CLIENT *Client_ThisServer PARAMS((VOID ));
GLOBAL CLIENT *Client_GetFromConn PARAMS(( CONN_ID Idx ));
GLOBAL CLIENT *Client_GetFromToken PARAMS(( CLIENT *Client, INT Token ));
GLOBAL CLIENT *Client_GetFromConn PARAMS((CONN_ID Idx ));
GLOBAL CLIENT *Client_GetFromToken PARAMS((CLIENT *Client, INT Token ));
GLOBAL CLIENT *Client_Search PARAMS(( CHAR *ID ));
GLOBAL CLIENT *Client_First PARAMS(( VOID ));
GLOBAL CLIENT *Client_Next PARAMS(( CLIENT *c ));
GLOBAL CLIENT *Client_Search PARAMS((CHAR *ID ));
GLOBAL CLIENT *Client_First PARAMS((VOID ));
GLOBAL CLIENT *Client_Next PARAMS((CLIENT *c ));
GLOBAL INT Client_Type PARAMS(( CLIENT *Client ));
GLOBAL CONN_ID Client_Conn PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_ID PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_Mask PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_Info PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_User PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_Hostname PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_Password PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_Modes PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_Flags PARAMS(( CLIENT *Client ));
GLOBAL CLIENT *Client_Introducer PARAMS(( CLIENT *Client ));
GLOBAL BOOLEAN Client_OperByMe PARAMS(( CLIENT *Client ));
GLOBAL INT Client_Hops PARAMS(( CLIENT *Client ));
GLOBAL INT Client_Token PARAMS(( CLIENT *Client ));
GLOBAL INT Client_MyToken PARAMS(( CLIENT *Client ));
GLOBAL CLIENT *Client_TopServer PARAMS(( CLIENT *Client ));
GLOBAL CLIENT *Client_NextHop PARAMS(( CLIENT *Client ));
GLOBAL CHAR *Client_Away PARAMS(( CLIENT *Client ));
GLOBAL INT Client_Type PARAMS((CLIENT *Client ));
GLOBAL CONN_ID Client_Conn PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_ID PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_Mask PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_Info PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_User PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_Hostname PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_Password PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_Modes PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_Flags PARAMS((CLIENT *Client ));
GLOBAL CLIENT *Client_Introducer PARAMS((CLIENT *Client ));
GLOBAL BOOLEAN Client_OperByMe PARAMS((CLIENT *Client ));
GLOBAL INT Client_Hops PARAMS((CLIENT *Client ));
GLOBAL INT Client_Token PARAMS((CLIENT *Client ));
GLOBAL INT Client_MyToken PARAMS((CLIENT *Client ));
GLOBAL CLIENT *Client_TopServer PARAMS((CLIENT *Client ));
GLOBAL CLIENT *Client_NextHop PARAMS((CLIENT *Client ));
GLOBAL CHAR *Client_Away PARAMS((CLIENT *Client ));
GLOBAL BOOLEAN Client_HasMode PARAMS(( CLIENT *Client, CHAR Mode ));
GLOBAL BOOLEAN Client_HasMode PARAMS((CLIENT *Client, CHAR Mode ));
GLOBAL VOID Client_SetHostname PARAMS(( CLIENT *Client, CHAR *Hostname ));
GLOBAL VOID Client_SetID PARAMS(( CLIENT *Client, CHAR *Nick ));
GLOBAL VOID Client_SetUser PARAMS(( CLIENT *Client, CHAR *User, BOOLEAN Idented ));
GLOBAL VOID Client_SetInfo PARAMS(( CLIENT *Client, CHAR *Info ));
GLOBAL VOID Client_SetPassword PARAMS(( CLIENT *Client, CHAR *Pwd ));
GLOBAL VOID Client_SetType PARAMS(( CLIENT *Client, INT Type ));
GLOBAL VOID Client_SetHops PARAMS(( CLIENT *Client, INT Hops ));
GLOBAL VOID Client_SetToken PARAMS(( CLIENT *Client, INT Token ));
GLOBAL VOID Client_SetOperByMe PARAMS(( CLIENT *Client, BOOLEAN OperByMe ));
GLOBAL VOID Client_SetModes PARAMS(( CLIENT *Client, CHAR *Modes ));
GLOBAL VOID Client_SetFlags PARAMS(( CLIENT *Client, CHAR *Flags ));
GLOBAL VOID Client_SetIntroducer PARAMS(( CLIENT *Client, CLIENT *Introducer ));
GLOBAL VOID Client_SetAway PARAMS(( CLIENT *Client, CHAR *Txt ));
GLOBAL VOID Client_SetHostname PARAMS((CLIENT *Client, CHAR *Hostname ));
GLOBAL VOID Client_SetID PARAMS((CLIENT *Client, CHAR *Nick ));
GLOBAL VOID Client_SetUser PARAMS((CLIENT *Client, CHAR *User, BOOLEAN Idented ));
GLOBAL VOID Client_SetInfo PARAMS((CLIENT *Client, CHAR *Info ));
GLOBAL VOID Client_SetPassword PARAMS((CLIENT *Client, CHAR *Pwd ));
GLOBAL VOID Client_SetType PARAMS((CLIENT *Client, INT Type ));
GLOBAL VOID Client_SetHops PARAMS((CLIENT *Client, INT Hops ));
GLOBAL VOID Client_SetToken PARAMS((CLIENT *Client, INT Token ));
GLOBAL VOID Client_SetOperByMe PARAMS((CLIENT *Client, BOOLEAN OperByMe ));
GLOBAL VOID Client_SetModes PARAMS((CLIENT *Client, CHAR *Modes ));
GLOBAL VOID Client_SetFlags PARAMS((CLIENT *Client, CHAR *Flags ));
GLOBAL VOID Client_SetIntroducer PARAMS((CLIENT *Client, CLIENT *Introducer ));
GLOBAL VOID Client_SetAway PARAMS((CLIENT *Client, CHAR *Txt ));
GLOBAL BOOLEAN Client_ModeAdd PARAMS(( CLIENT *Client, CHAR Mode ));
GLOBAL BOOLEAN Client_ModeDel PARAMS(( CLIENT *Client, CHAR Mode ));
GLOBAL BOOLEAN Client_ModeAdd PARAMS((CLIENT *Client, CHAR Mode ));
GLOBAL BOOLEAN Client_ModeDel PARAMS((CLIENT *Client, CHAR Mode ));
GLOBAL BOOLEAN Client_CheckNick PARAMS(( CLIENT *Client, CHAR *Nick ));
GLOBAL BOOLEAN Client_CheckID PARAMS(( CLIENT *Client, CHAR *ID ));
GLOBAL BOOLEAN Client_CheckNick PARAMS((CLIENT *Client, CHAR *Nick ));
GLOBAL BOOLEAN Client_CheckID PARAMS((CLIENT *Client, CHAR *ID ));
GLOBAL LONG Client_UserCount PARAMS(( VOID ));
GLOBAL LONG Client_ServiceCount PARAMS(( VOID ));
GLOBAL LONG Client_ServerCount PARAMS(( VOID ));
GLOBAL LONG Client_OperCount PARAMS(( VOID ));
GLOBAL LONG Client_UnknownCount PARAMS(( VOID ));
GLOBAL LONG Client_MyUserCount PARAMS(( VOID ));
GLOBAL LONG Client_MyServiceCount PARAMS(( VOID ));
GLOBAL LONG Client_MyServerCount PARAMS(( VOID ));
GLOBAL LONG Client_MaxUserCount PARAMS(( VOID ));
GLOBAL LONG Client_MyMaxUserCount PARAMS(( VOID ));
GLOBAL LONG Client_UserCount PARAMS((VOID ));
GLOBAL LONG Client_ServiceCount PARAMS((VOID ));
GLOBAL LONG Client_ServerCount PARAMS((VOID ));
GLOBAL LONG Client_OperCount PARAMS((VOID ));
GLOBAL LONG Client_UnknownCount PARAMS((VOID ));
GLOBAL LONG Client_MyUserCount PARAMS((VOID ));
GLOBAL LONG Client_MyServiceCount PARAMS((VOID ));
GLOBAL LONG Client_MyServerCount PARAMS((VOID ));
GLOBAL LONG Client_MaxUserCount PARAMS(( VOID ));
GLOBAL LONG Client_MyMaxUserCount PARAMS(( VOID ));
GLOBAL BOOLEAN Client_IsValidNick PARAMS(( CHAR *Nick ));
GLOBAL BOOLEAN Client_IsValidNick PARAMS((CHAR *Nick ));
#endif

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: conf.c,v 1.57.2.4 2003/12/19 14:30:49 alex Exp $";
static char UNUSED id[] = "$Id: conf.c,v 1.47 2002/12/18 02:53:36 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -46,11 +46,9 @@ static char UNUSED id[] = "$Id: conf.c,v 1.57.2.4 2003/12/19 14:30:49 alex Exp $
LOCAL BOOLEAN Use_Log = TRUE;
LOCAL CONF_SERVER New_Server;
LOCAL INT New_Server_Idx;
LOCAL VOID Set_Defaults PARAMS(( BOOLEAN InitServers ));
LOCAL VOID Set_Defaults PARAMS(( VOID ));
LOCAL VOID Read_Config PARAMS(( VOID ));
LOCAL VOID Validate_Config PARAMS(( BOOLEAN TestOnly ));
@@ -61,27 +59,16 @@ LOCAL VOID Handle_CHANNEL PARAMS(( INT Line, CHAR *Var, CHAR *Arg ));
LOCAL VOID Config_Error PARAMS(( CONST INT Level, CONST CHAR *Format, ... ));
LOCAL VOID Init_Server_Struct PARAMS(( CONF_SERVER *Server ));
GLOBAL VOID
Conf_Init( VOID )
{
Set_Defaults( TRUE );
Set_Defaults( );
Read_Config( );
Validate_Config( FALSE );
} /* Config_Init */
GLOBAL VOID
Conf_Rehash( VOID )
{
Set_Defaults( FALSE );
Read_Config( );
Validate_Config( FALSE );
} /* Config_Rehash */
GLOBAL INT
Conf_Test( VOID )
{
@@ -92,7 +79,7 @@ Conf_Test( VOID )
INT i;
Use_Log = FALSE;
Set_Defaults( TRUE );
Set_Defaults( );
Read_Config( );
Validate_Config( TRUE );
@@ -108,7 +95,7 @@ Conf_Test( VOID )
puts( "[GLOBAL]" );
printf( " ServerName = %s\n", Conf_ServerName );
printf( " ServerInfo = %s\n", Conf_ServerInfo );
printf( " Password = %s\n", Conf_ServerPwd );
printf( " ServerPwd = %s\n", Conf_ServerPwd );
printf( " AdminInfo1 = %s\n", Conf_ServerAdmin1 );
printf( " AdminInfo2 = %s\n", Conf_ServerAdmin2 );
printf( " AdminEMail = %s\n", Conf_ServerAdminMail );
@@ -120,7 +107,6 @@ Conf_Test( VOID )
printf( "%u", Conf_ListenPorts[i] );
}
puts( "" );
printf( " Listen = %s\n", Conf_ListenAddress );
pwd = getpwuid( Conf_UID );
if( pwd ) printf( " ServerUID = %s\n", pwd->pw_name );
else printf( " ServerUID = %ld\n", (LONG)Conf_UID );
@@ -133,8 +119,6 @@ Conf_Test( VOID )
printf( " OperCanUseMode = %s\n", Conf_OperCanMode == TRUE ? "yes" : "no" );
if( Conf_MaxConnections > 0 ) printf( " MaxConnections = %ld\n", Conf_MaxConnections );
else printf( " MaxConnections = -1\n" );
if( Conf_MaxConnectionsIP > 0 ) printf( " MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP );
else printf( " MaxConnectionsIP = -1\n" );
if( Conf_MaxJoins > 0 ) printf( " MaxJoins = %d\n", Conf_MaxJoins );
else printf( " MaxJoins = -1\n" );
puts( "" );
@@ -150,7 +134,7 @@ Conf_Test( VOID )
puts( "" );
}
for( i = 0; i < MAX_SERVERS; i++ )
for( i = 0; i < Conf_Server_Count; i++ )
{
if( ! Conf_Server[i].name[0] ) continue;
@@ -181,169 +165,22 @@ Conf_Test( VOID )
} /* Conf_Test */
GLOBAL VOID
Conf_UnsetServer( CONN_ID Idx )
{
/* Set next time for next connection attempt, if this is a server
* link that is (still) configured here. If the server is set as
* "once", delete it from our configuration.
* Non-Server-Connections will be silently ignored. */
INT i;
/* Check all our configured servers */
for( i = 0; i < MAX_SERVERS; i++ )
{
if( Conf_Server[i].conn_id != Idx ) continue;
/* Gotcha! Mark server configuration as "unused": */
Conf_Server[i].conn_id = NONE;
if( Conf_Server[i].flags & CONF_SFLAG_ONCE )
{
/* Delete configuration here */
Init_Server_Struct( &Conf_Server[i] );
}
else
{
/* Set time for next connect attempt */
if( Conf_Server[i].lasttry < time( NULL ) - Conf_ConnectRetry )
{
/* Okay, the connection was established "long enough": */
Conf_Server[i].lasttry = time( NULL ) - Conf_ConnectRetry + RECONNECT_DELAY;
}
}
}
} /* Conf_UnsetServer */
GLOBAL VOID
Conf_SetServer( INT ConfServer, CONN_ID Idx )
{
/* Set connection for specified configured server */
assert( ConfServer > NONE );
assert( Idx > NONE );
Conf_Server[ConfServer].conn_id = Idx;
} /* Conf_SetServer */
GLOBAL INT
Conf_GetServer( CONN_ID Idx )
{
/* Get index of server in configuration structure */
INT i = 0;
assert( Idx > NONE );
for( i = 0; i < MAX_SERVERS; i++ )
{
if( Conf_Server[i].conn_id == Idx ) return i;
}
return NONE;
} /* Conf_GetServer */
GLOBAL BOOLEAN
Conf_EnableServer( CHAR *Name, INT Port )
{
/* Enable specified server and adjust port */
INT i;
assert( Name != NULL );
for( i = 0; i < MAX_SERVERS; i++ )
{
if( strcasecmp( Conf_Server[i].name, Name ) == 0 )
{
/* Gotcha! Set port and enable server: */
Conf_Server[i].port = Port;
Conf_Server[i].flags &= ~CONF_SFLAG_DISABLED;
return TRUE;
}
}
return FALSE;
} /* Conf_EnableServer */
GLOBAL BOOLEAN
Conf_DisableServer( CHAR *Name )
{
/* Enable specified server and adjust port */
INT i;
assert( Name != NULL );
for( i = 0; i < MAX_SERVERS; i++ )
{
if( strcasecmp( Conf_Server[i].name, Name ) == 0 )
{
/* Gotcha! Disable and disconnect server: */
Conf_Server[i].flags |= CONF_SFLAG_DISABLED;
if( Conf_Server[i].conn_id > NONE ) Conn_Close( Conf_Server[i].conn_id, NULL, "Server link terminated on operator request", TRUE );
return TRUE;
}
}
return FALSE;
} /* Conf_DisableServer */
GLOBAL BOOLEAN
Conf_AddServer( CHAR *Name, INT Port, CHAR *Host, CHAR *MyPwd, CHAR *PeerPwd )
{
/* Add new server to configuration */
INT i;
assert( Name != NULL );
assert( Host != NULL );
assert( MyPwd != NULL );
assert( PeerPwd != NULL );
/* Search unused item in server configuration structure */
for( i = 0; i < MAX_SERVERS; i++ )
{
/* Is this item used? */
if( ! Conf_Server[i].name[0] ) break;
}
if( i >= MAX_SERVERS ) return FALSE;
Init_Server_Struct( &Conf_Server[i] );
strlcpy( Conf_Server[i].name, Name, sizeof( Conf_Server[i].name ));
strlcpy( Conf_Server[i].host, Host, sizeof( Conf_Server[i].host ));
strlcpy( Conf_Server[i].pwd_out, MyPwd, sizeof( Conf_Server[i].pwd_out ));
strlcpy( Conf_Server[i].pwd_in, PeerPwd, sizeof( Conf_Server[i].pwd_in ));
Conf_Server[i].port = Port;
Conf_Server[i].flags = CONF_SFLAG_ONCE;
return TRUE;
} /* Conf_AddServer */
LOCAL VOID
Set_Defaults( BOOLEAN InitServers )
Set_Defaults( VOID )
{
/* Initialize configuration variables with default values. */
INT i;
strcpy( Conf_ServerName, "" );
sprintf( Conf_ServerInfo, "%s %s", PACKAGE_NAME, PACKAGE_VERSION );
sprintf( Conf_ServerInfo, "%s %s", PACKAGE, VERSION );
strcpy( Conf_ServerPwd, "" );
strcpy( Conf_ServerAdmin1, "" );
strcpy( Conf_ServerAdmin2, "" );
strcpy( Conf_ServerAdminMail, "" );
strlcpy( Conf_MotdFile, SYSCONFDIR, sizeof( Conf_MotdFile ));
strlcat( Conf_MotdFile, MOTD_FILE, sizeof( Conf_MotdFile ));
strcpy( Conf_MotdFile, MOTD_FILE );
Conf_ListenPorts_Count = 0;
strcpy( Conf_ListenAddress, "" );
Conf_UID = Conf_GID = 0;
@@ -353,16 +190,13 @@ Set_Defaults( BOOLEAN InitServers )
Conf_ConnectRetry = 60;
Conf_Oper_Count = 0;
Conf_Server_Count = 0;
Conf_Channel_Count = 0;
Conf_OperCanMode = FALSE;
Conf_MaxConnections = -1;
Conf_MaxConnectionsIP = 5;
Conf_MaxJoins = 10;
/* Initialize server configuration structures */
if( InitServers ) for( i = 0; i < MAX_SERVERS; Init_Server_Struct( &Conf_Server[i++] ));
} /* Set_Defaults */
@@ -372,63 +206,22 @@ Read_Config( VOID )
/* Read configuration file. */
CHAR section[LINE_LEN], str[LINE_LEN], *var, *arg, *ptr;
INT line, i, n;
INT line;
FILE *fd;
/* Open configuration file */
fd = fopen( NGIRCd_ConfFile, "r" );
if( ! fd )
{
/* No configuration file found! */
Config_Error( LOG_ALERT, "Can't read configuration \"%s\": %s", NGIRCd_ConfFile, strerror( errno ));
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
exit( 1 );
}
Config_Error( LOG_INFO, "Reading configuration from \"%s\" ...", NGIRCd_ConfFile );
/* Clean up server configuration structure: mark all already
* configured servers as "once" so that they are deleted
* after the next disconnect and delete all unused servers.
* And delete all servers which are "duplicates" of servers
* that are already marked as "once" (such servers have been
* created by the last rehash but are now useless). */
for( i = 0; i < MAX_SERVERS; i++ )
{
if( Conf_Server[i].conn_id == NONE ) Init_Server_Struct( &Conf_Server[i] );
else
{
/* This structure is in use ... */
if( Conf_Server[i].flags & CONF_SFLAG_ONCE )
{
/* Check for duplicates */
for( n = 0; n < MAX_SERVERS; n++ )
{
if( n == i ) continue;
if( Conf_Server[i].conn_id == Conf_Server[n].conn_id )
{
Init_Server_Struct( &Conf_Server[n] );
Log( LOG_DEBUG, "Deleted unused duplicate server %d (kept %d).", n, i );
}
}
}
else
{
/* Mark server as "once" */
Conf_Server[i].flags |= CONF_SFLAG_ONCE;
Log( LOG_DEBUG, "Marked server %d as \"once\"", i );
}
}
}
/* Initialize variables */
line = 0;
strcpy( section, "" );
Init_Server_Struct( &New_Server );
New_Server_Idx = NONE;
/* Read configuration file */
while( TRUE )
{
if( ! fgets( str, LINE_LEN, fd )) break;
@@ -441,7 +234,7 @@ Read_Config( VOID )
/* Is this the beginning of a new section? */
if(( str[0] == '[' ) && ( str[strlen( str ) - 1] == ']' ))
{
strlcpy( section, str, sizeof( section ));
strcpy( section, str );
if( strcasecmp( section, "[GLOBAL]" ) == 0 ) continue;
if( strcasecmp( section, "[OPERATOR]" ) == 0 )
{
@@ -457,30 +250,21 @@ Read_Config( VOID )
}
if( strcasecmp( section, "[SERVER]" ) == 0 )
{
/* Check if there is already a server to add */
if( New_Server.name[0] )
if( Conf_Server_Count + 1 > MAX_SERVERS ) Config_Error( LOG_ERR, "Too many servers configured." );
else
{
/* Copy data to "real" server structure */
assert( New_Server_Idx > NONE );
Conf_Server[New_Server_Idx] = New_Server;
/* Initialize new server structure */
strcpy( Conf_Server[Conf_Server_Count].host, "" );
strcpy( Conf_Server[Conf_Server_Count].ip, "" );
strcpy( Conf_Server[Conf_Server_Count].name, "" );
strcpy( Conf_Server[Conf_Server_Count].pwd_in, "" );
strcpy( Conf_Server[Conf_Server_Count].pwd_out, "" );
Conf_Server[Conf_Server_Count].port = 0;
Conf_Server[Conf_Server_Count].group = -1;
Conf_Server[Conf_Server_Count].lasttry = time( NULL ) - Conf_ConnectRetry + STARTUP_DELAY;
Conf_Server[Conf_Server_Count].res_stat = NULL;
Conf_Server_Count++;
}
/* Re-init structure for new server */
Init_Server_Struct( &New_Server );
/* Search unused item in server configuration structure */
for( i = 0; i < MAX_SERVERS; i++ )
{
/* Is this item used? */
if( ! Conf_Server[i].name[0] ) break;
}
if( i >= MAX_SERVERS )
{
/* Oops, no free item found! */
Config_Error( LOG_ERR, "Too many servers configured." );
New_Server_Idx = NONE;
}
else New_Server_Idx = i;
continue;
}
if( strcasecmp( section, "[CHANNEL]" ) == 0 )
@@ -518,17 +302,8 @@ Read_Config( VOID )
else if( strcasecmp( section, "[CHANNEL]" ) == 0 ) Handle_CHANNEL( line, var, arg );
else Config_Error( LOG_ERR, "%s, line %d: Variable \"%s\" outside section!", NGIRCd_ConfFile, line, var );
}
/* Close configuration file */
fclose( fd );
/* Check if there is still a server to add */
if( New_Server.name[0] )
{
/* Copy data to "real" server structure */
assert( New_Server_Idx > NONE );
Conf_Server[New_Server_Idx] = New_Server;
}
/* If there are no ports configured use the default: 6667 */
if( Conf_ListenPorts_Count < 1 )
@@ -554,37 +329,49 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
if( strcasecmp( Var, "Name" ) == 0 )
{
/* Server name */
if( strlcpy( Conf_ServerName, Arg, sizeof( Conf_ServerName )) >= sizeof( Conf_ServerName )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Name\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_ServerName, Arg, CLIENT_ID_LEN - 1 );
Conf_ServerName[CLIENT_ID_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_ID_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Name\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "Info" ) == 0 )
{
/* Info text of server */
if( strlcpy( Conf_ServerInfo, Arg, sizeof( Conf_ServerInfo )) >= sizeof( Conf_ServerInfo )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Info\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_ServerInfo, Arg, CLIENT_INFO_LEN - 1 );
Conf_ServerInfo[CLIENT_INFO_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_INFO_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Info\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "Password" ) == 0 )
{
/* Global server password */
if( strlcpy( Conf_ServerPwd, Arg, sizeof( Conf_ServerPwd )) >= sizeof( Conf_ServerPwd )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Password\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_ServerPwd, Arg, CLIENT_PASS_LEN - 1 );
Conf_ServerPwd[CLIENT_PASS_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_PASS_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Password\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "AdminInfo1" ) == 0 )
{
/* Administrative info #1 */
if( strlcpy( Conf_ServerAdmin1, Arg, sizeof( Conf_ServerAdmin1 )) >= sizeof( Conf_ServerAdmin1 )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"AdminInfo1\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_ServerAdmin1, Arg, CLIENT_INFO_LEN - 1 );
Conf_ServerAdmin1[CLIENT_INFO_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_INFO_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"AdminInfo1\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "AdminInfo2" ) == 0 )
{
/* Administrative info #2 */
if( strlcpy( Conf_ServerAdmin2, Arg, sizeof( Conf_ServerAdmin2 )) >= sizeof( Conf_ServerAdmin2 )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"AdminInfo2\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_ServerAdmin2, Arg, CLIENT_INFO_LEN - 1 );
Conf_ServerAdmin2[CLIENT_INFO_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_INFO_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"AdminInfo2\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "AdminEMail" ) == 0 )
{
/* Administrative email contact */
if( strlcpy( Conf_ServerAdminMail, Arg, sizeof( Conf_ServerAdminMail )) >= sizeof( Conf_ServerAdminMail )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"AdminEMail\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_ServerAdminMail, Arg, CLIENT_INFO_LEN - 1 );
Conf_ServerAdminMail[CLIENT_INFO_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_INFO_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"AdminEMail\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "Ports" ) == 0 )
@@ -609,7 +396,9 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
if( strcasecmp( Var, "MotdFile" ) == 0 )
{
/* "Message of the day" (MOTD) file */
if( strlcpy( Conf_MotdFile, Arg, sizeof( Conf_MotdFile )) >= sizeof( Conf_MotdFile )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"MotdFile\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_MotdFile, Arg, FNAME_LEN - 1 );
Conf_MotdFile[FNAME_LEN - 1] = '\0';
if( strlen( Arg ) > FNAME_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"MotdFile\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "ServerUID" ) == 0 )
@@ -694,16 +483,6 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
Conf_MaxConnections = atol( Arg );
return;
}
if( strcasecmp( Var, "MaxConnectionsIP" ) == 0 )
{
/* Maximum number of simoultanous connections from one IP. Values <= 0 are equal to "no limit". */
#ifdef HAVE_ISDIGIT
if( ! isdigit( *Arg )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"MaxConnectionsIP\" is not a number!", NGIRCd_ConfFile, Line );
else
#endif
Conf_MaxConnectionsIP = atoi( Arg );
return;
}
if( strcasecmp( Var, "MaxJoins" ) == 0 )
{
/* Maximum number of channels a user can join. Values <= 0 are equal to "no limit". */
@@ -714,15 +493,6 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
Conf_MaxJoins = atoi( Arg );
return;
}
if( strcasecmp( Var, "Listen" ) == 0 )
{
/* IP-Address to bind sockets */
if( strlcpy( Conf_ListenAddress, Arg, sizeof( Conf_ListenAddress )) >= sizeof( Conf_ListenAddress ))
{
Config_Error( LOG_WARNING, "%s, line %d: Value of \"Listen\" too long!", NGIRCd_ConfFile, Line );
}
return;
}
Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Unknown variable \"%s\"!", NGIRCd_ConfFile, Line, Var );
} /* Handle_GLOBAL */
@@ -739,13 +509,17 @@ Handle_OPERATOR( INT Line, CHAR *Var, CHAR *Arg )
if( strcasecmp( Var, "Name" ) == 0 )
{
/* Name of IRC operator */
if( strlcpy( Conf_Oper[Conf_Oper_Count - 1].name, Arg, sizeof( Conf_Oper[Conf_Oper_Count - 1].name )) >= sizeof( Conf_Oper[Conf_Oper_Count - 1].name )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Name\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Oper[Conf_Oper_Count - 1].name, Arg, CLIENT_PASS_LEN - 1 );
Conf_Oper[Conf_Oper_Count - 1].name[CLIENT_PASS_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_PASS_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Name\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "Password" ) == 0 )
{
/* Password of IRC operator */
if( strlcpy( Conf_Oper[Conf_Oper_Count - 1].pwd, Arg, sizeof( Conf_Oper[Conf_Oper_Count - 1].pwd )) >= sizeof( Conf_Oper[Conf_Oper_Count - 1].pwd )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Password\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Oper[Conf_Oper_Count - 1].pwd, Arg, CLIENT_PASS_LEN - 1 );
Conf_Oper[Conf_Oper_Count - 1].pwd[CLIENT_PASS_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_PASS_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Password\" too long!", NGIRCd_ConfFile, Line );
return;
}
@@ -762,38 +536,43 @@ Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
assert( Var != NULL );
assert( Arg != NULL );
/* Ignore server block if no space is left in server configuration structure */
if( New_Server_Idx <= NONE ) return;
if( strcasecmp( Var, "Host" ) == 0 )
{
/* Hostname of the server */
if( strlcpy( New_Server.host, Arg, sizeof( New_Server.host )) >= sizeof( New_Server.host )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Host\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Server[Conf_Server_Count - 1].host, Arg, HOST_LEN - 1 );
Conf_Server[Conf_Server_Count - 1].host[HOST_LEN - 1] = '\0';
if( strlen( Arg ) > HOST_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Host\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "Name" ) == 0 )
{
/* Name of the server ("Nick"/"ID") */
if( strlcpy( New_Server.name, Arg, sizeof( New_Server.name )) >= sizeof( New_Server.name )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Name\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Server[Conf_Server_Count - 1].name, Arg, CLIENT_ID_LEN - 1 );
Conf_Server[Conf_Server_Count - 1].name[CLIENT_ID_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_ID_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Name\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "MyPassword" ) == 0 )
{
/* Password of this server which is sent to the peer */
if( strlcpy( New_Server.pwd_in, Arg, sizeof( New_Server.pwd_in )) >= sizeof( New_Server.pwd_in )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"MyPassword\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Server[Conf_Server_Count - 1].pwd_in, Arg, CLIENT_PASS_LEN - 1 );
Conf_Server[Conf_Server_Count - 1].pwd_in[CLIENT_PASS_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_PASS_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"MyPassword\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "PeerPassword" ) == 0 )
{
/* Passwort of the peer which must be received */
if( strlcpy( New_Server.pwd_out, Arg, sizeof( New_Server.pwd_out )) >= sizeof( New_Server.pwd_out )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"PeerPassword\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Server[Conf_Server_Count - 1].pwd_out, Arg, CLIENT_PASS_LEN - 1 );
Conf_Server[Conf_Server_Count - 1].pwd_out[CLIENT_PASS_LEN - 1] = '\0';
if( strlen( Arg ) > CLIENT_PASS_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"PeerPassword\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "Port" ) == 0 )
{
/* Port to which this server should connect */
port = atol( Arg );
if( port > 0 && port < 0xFFFF ) New_Server.port = (INT)port;
if( port > 0 && port < 0xFFFF ) Conf_Server[Conf_Server_Count - 1].port = (INT)port;
else Config_Error( LOG_ERR, "%s, line %d (section \"Server\"): Illegal port number %ld!", NGIRCd_ConfFile, Line, port );
return;
}
@@ -804,7 +583,7 @@ Handle_SERVER( INT Line, CHAR *Var, CHAR *Arg )
if( ! isdigit( *Arg )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Group\" is not a number!", NGIRCd_ConfFile, Line );
else
#endif
New_Server.group = atoi( Arg );
Conf_Server[Conf_Server_Count - 1].group = atoi( Arg );
return;
}
@@ -822,19 +601,25 @@ Handle_CHANNEL( INT Line, CHAR *Var, CHAR *Arg )
if( strcasecmp( Var, "Name" ) == 0 )
{
/* Name of the channel */
if( strlcpy( Conf_Channel[Conf_Channel_Count - 1].name, Arg, sizeof( Conf_Channel[Conf_Channel_Count - 1].name )) >= sizeof( Conf_Channel[Conf_Channel_Count - 1].name )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Name\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Channel[Conf_Channel_Count - 1].name, Arg, CHANNEL_NAME_LEN - 1 );
Conf_Channel[Conf_Channel_Count - 1].name[CHANNEL_NAME_LEN - 1] = '\0';
if( strlen( Arg ) > CHANNEL_NAME_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Name\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "Modes" ) == 0 )
{
/* Initial modes */
if( strlcpy( Conf_Channel[Conf_Channel_Count - 1].modes, Arg, sizeof( Conf_Channel[Conf_Channel_Count - 1].modes )) >= sizeof( Conf_Channel[Conf_Channel_Count - 1].modes )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Modes\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Channel[Conf_Channel_Count - 1].modes, Arg, CHANNEL_MODE_LEN - 1 );
Conf_Channel[Conf_Channel_Count - 1].modes[CHANNEL_MODE_LEN - 1] = '\0';
if( strlen( Arg ) > CHANNEL_MODE_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Modes\" too long!", NGIRCd_ConfFile, Line );
return;
}
if( strcasecmp( Var, "Topic" ) == 0 )
{
/* Initial topic */
if( strlcpy( Conf_Channel[Conf_Channel_Count - 1].topic, Arg, sizeof( Conf_Channel[Conf_Channel_Count - 1].topic )) >= sizeof( Conf_Channel[Conf_Channel_Count - 1].topic )) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Topic\" too long!", NGIRCd_ConfFile, Line );
strncpy( Conf_Channel[Conf_Channel_Count - 1].topic, Arg, CHANNEL_TOPIC_LEN - 1 );
Conf_Channel[Conf_Channel_Count - 1].topic[CHANNEL_TOPIC_LEN - 1] = '\0';
if( strlen( Arg ) > CHANNEL_TOPIC_LEN - 1 ) Config_Error( LOG_WARNING, "%s, line %d: Value of \"Topic\" too long!", NGIRCd_ConfFile, Line );
return;
}
@@ -846,29 +631,14 @@ LOCAL VOID
Validate_Config( BOOLEAN Configtest )
{
/* Validate configuration settings. */
#ifdef DEBUG
INT i, servers, servers_once;
#endif
if( ! Conf_ServerName[0] )
{
/* No server name configured! */
Config_Error( LOG_ALERT, "No server name configured in \"%s\" (section 'Global': 'Name')!", NGIRCd_ConfFile );
Config_Error( LOG_ALERT, "No server name configured in \"%s\" ('ServerName')!", NGIRCd_ConfFile );
if( ! Configtest )
{
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
exit( 1 );
}
}
if( Conf_ServerName[0] && ! strchr( Conf_ServerName, '.' ))
{
/* No dot in server name! */
Config_Error( LOG_ALERT, "Invalid server name configured in \"%s\" (section 'Global': 'Name'): Dot missing!", NGIRCd_ConfFile );
if( ! Configtest )
{
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
exit( 1 );
}
}
@@ -880,7 +650,7 @@ Validate_Config( BOOLEAN Configtest )
Config_Error( LOG_ALERT, "No administrator email address configured in \"%s\" ('AdminEMail')!", NGIRCd_ConfFile );
if( ! Configtest )
{
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
exit( 1 );
}
}
@@ -900,19 +670,6 @@ Validate_Config( BOOLEAN Configtest )
#else
Config_Error( LOG_WARN, "Don't know how many file descriptors select() can handle on this system, don't set MaxConnections too high!" );
#endif
#ifdef DEBUG
servers = servers_once = 0;
for( i = 0; i < MAX_SERVERS; i++ )
{
if( Conf_Server[i].name[0] )
{
servers++;
if( Conf_Server[i].flags & CONF_SFLAG_ONCE ) servers_once++;
}
}
Log( LOG_DEBUG, "Configuration: Operators=%d, Servers=%d[%d], Channels=%d", Conf_Oper_Count, servers, servers_once, Conf_Channel_Count );
#endif
} /* Validate_Config */
@@ -948,26 +705,4 @@ va_dcl
} /* Config_Error */
LOCAL VOID
Init_Server_Struct( CONF_SERVER *Server )
{
/* Initialize server configuration structur to default values */
assert( Server != NULL );
strcpy( Server->host, "" );
strcpy( Server->ip, "" );
strcpy( Server->name, "" );
strcpy( Server->pwd_in, "" );
strcpy( Server->pwd_out, "" );
Server->port = 0;
Server->group = NONE;
Server->lasttry = time( NULL ) - Conf_ConnectRetry + STARTUP_DELAY;
Server->res_stat = NULL;
if( NGIRCd_Passive ) Server->flags = CONF_SFLAG_DISABLED;
else Server->flags = 0;
Server->conn_id = NONE;
} /* Init_Server_Struct */
/* -eof- */

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: conf.h,v 1.26.2.1 2003/11/07 20:51:11 alex Exp $
* $Id: conf.h,v 1.24 2002/12/14 13:36:19 alex Exp $
*
* Configuration management (header)
*/
@@ -39,8 +39,6 @@ typedef struct _Conf_Server
INT group; /* Group of server */
time_t lasttry; /* Last connect attempt */
RES_STAT *res_stat; /* Status of the resolver */
INT flags; /* Flags */
CONN_ID conn_id; /* ID of server connection or NONE */
} CONF_SERVER;
typedef struct _Conf_Channel
@@ -51,10 +49,6 @@ typedef struct _Conf_Channel
} CONF_CHANNEL;
#define CONF_SFLAG_ONCE 1 /* Delete this entry after next disconnect */
#define CONF_SFLAG_DISABLED 2 /* This server configuration entry is disabled */
/* Name ("Nick") of the servers */
GLOBAL CHAR Conf_ServerName[CLIENT_ID_LEN];
@@ -76,9 +70,6 @@ GLOBAL CHAR Conf_MotdFile[FNAME_LEN];
GLOBAL UINT Conf_ListenPorts[MAX_LISTEN_PORTS];
GLOBAL INT Conf_ListenPorts_Count;
/* Address to which the socket should be bound or empty (=all) */
GLOBAL CHAR Conf_ListenAddress[16];
/* User and group ID the server should run with */
GLOBAL UINT Conf_UID;
GLOBAL UINT Conf_GID;
@@ -96,6 +87,7 @@ GLOBAL INT Conf_Oper_Count;
/* Servers */
GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS];
GLOBAL INT Conf_Server_Count;
/* Pre-defined channels */
GLOBAL CONF_CHANNEL Conf_Channel[MAX_DEFCHANNELS];
@@ -110,22 +102,10 @@ GLOBAL LONG Conf_MaxConnections;
/* Maximum number of channels a user can join */
GLOBAL INT Conf_MaxJoins;
/* Maximum number of connections per IP address */
GLOBAL INT Conf_MaxConnectionsIP;
GLOBAL VOID Conf_Init PARAMS((VOID ));
GLOBAL VOID Conf_Rehash PARAMS((VOID ));
GLOBAL INT Conf_Test PARAMS((VOID ));
GLOBAL VOID Conf_UnsetServer PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conf_SetServer PARAMS(( INT ConfServer, CONN_ID Idx ));
GLOBAL INT Conf_GetServer PARAMS(( CONN_ID Idx ));
GLOBAL BOOLEAN Conf_EnableServer PARAMS(( CHAR *Name, INT Port ));
GLOBAL BOOLEAN Conf_DisableServer PARAMS(( CHAR *Name ));
GLOBAL BOOLEAN Conf_AddServer PARAMS(( CHAR *Name, INT Port, CHAR *Host, CHAR *MyPwd, CHAR *PeerPwd ));
#endif

View File

@@ -1,277 +0,0 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Connection management: Global functions
*/
#define CONN_MODULE
#include "portab.h"
static char UNUSED id[] = "$Id: conn-func.c,v 1.1.2.2 2003/12/26 16:16:48 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <log.h>
#include "conn.h"
#include "exp.h"
#include "conn-func.h"
GLOBAL VOID
Conn_UpdateIdle( CONN_ID Idx )
{
/* Idle-Timer zuruecksetzen */
assert( Idx > NONE );
My_Connections[Idx].lastprivmsg = time( NULL );
}
GLOBAL time_t
Conn_GetIdle( CONN_ID Idx )
{
/* Idle-Time einer Verbindung liefern (in Sekunden) */
assert( Idx > NONE );
return time( NULL ) - My_Connections[Idx].lastprivmsg;
} /* Conn_GetIdle */
GLOBAL time_t
Conn_LastPing( CONN_ID Idx )
{
/* Zeitpunkt des letzten PING liefern */
assert( Idx > NONE );
return My_Connections[Idx].lastping;
} /* Conn_LastPing */
GLOBAL VOID
Conn_SetPenalty( CONN_ID Idx, time_t Seconds )
{
/* Penalty-Delay fuer eine Verbindung (in Sekunden) setzen;
* waehrend dieser Zeit wird der entsprechende Socket vom Server
* bei Lese-Operationen komplett ignoriert. Der Delay kann mit
* dieser Funktion nur erhoeht, nicht aber verringert werden. */
time_t t;
assert( Idx > NONE );
assert( Seconds >= 0 );
t = time( NULL ) + Seconds;
if( t > My_Connections[Idx].delaytime ) My_Connections[Idx].delaytime = t;
} /* Conn_SetPenalty */
GLOBAL VOID
Conn_ResetPenalty( CONN_ID Idx )
{
assert( Idx > NONE );
My_Connections[Idx].delaytime = 0;
} /* Conn_ResetPenalty */
GLOBAL VOID
Conn_ClearFlags( VOID )
{
/* Alle Connection auf "nicht-markiert" setzen */
CONN_ID i;
for( i = 0; i < Pool_Size; i++ ) My_Connections[i].flag = 0;
} /* Conn_ClearFlags */
GLOBAL INT
Conn_Flag( CONN_ID Idx )
{
/* Ist eine Connection markiert (TRUE) oder nicht? */
assert( Idx > NONE );
return My_Connections[Idx].flag;
} /* Conn_Flag */
GLOBAL VOID
Conn_SetFlag( CONN_ID Idx, INT Flag )
{
/* Connection markieren */
assert( Idx > NONE );
My_Connections[Idx].flag = Flag;
} /* Conn_SetFlag */
GLOBAL CONN_ID
Conn_First( VOID )
{
/* Connection-Struktur der ersten Verbindung liefern;
* Ist keine Verbindung vorhanden, wird NONE geliefert. */
CONN_ID i;
for( i = 0; i < Pool_Size; i++ )
{
if( My_Connections[i].sock != NONE ) return i;
}
return NONE;
} /* Conn_First */
GLOBAL CONN_ID
Conn_Next( CONN_ID Idx )
{
/* Naechste Verbindungs-Struktur liefern; existiert keine
* weitere, so wird NONE geliefert. */
CONN_ID i = NONE;
assert( Idx > NONE );
for( i = Idx + 1; i < Pool_Size; i++ )
{
if( My_Connections[i].sock != NONE ) return i;
}
return NONE;
} /* Conn_Next */
GLOBAL VOID
Conn_SetOption( CONN_ID Idx, INT Option )
{
/* Option fuer Verbindung setzen.
* Initial sind alle Optionen _nicht_ gesetzt. */
assert( Idx > NONE );
assert( Option != 0 );
My_Connections[Idx].options |= Option;
} /* Conn_SetOption */
GLOBAL VOID
Conn_UnsetOption( CONN_ID Idx, INT Option )
{
/* Option fuer Verbindung loeschen */
assert( Idx > NONE );
assert( Option != 0 );
My_Connections[Idx].options &= ~Option;
} /* Conn_UnsetOption */
GLOBAL INT
Conn_Options( CONN_ID Idx )
{
assert( Idx > NONE );
return My_Connections[Idx].options;
} /* Conn_Options */
GLOBAL time_t
Conn_StartTime( CONN_ID Idx )
{
/* Zeitpunkt des Link-Starts liefern (in Sekunden) */
assert( Idx > NONE );
return My_Connections[Idx].starttime;
} /* Conn_Uptime */
GLOBAL INT
Conn_SendQ( CONN_ID Idx )
{
/* Laenge der Daten im Schreibbuffer liefern */
assert( Idx > NONE );
#ifdef ZLIB
if( My_Connections[Idx].options & CONN_ZIP ) return My_Connections[Idx].zip.wdatalen;
else
#endif
return My_Connections[Idx].wdatalen;
} /* Conn_SendQ */
GLOBAL LONG
Conn_SendMsg( CONN_ID Idx )
{
/* Anzahl gesendeter Nachrichten liefern */
assert( Idx > NONE );
return My_Connections[Idx].msg_out;
} /* Conn_SendMsg */
GLOBAL LONG
Conn_SendBytes( CONN_ID Idx )
{
/* Anzahl gesendeter Bytes (unkomprimiert) liefern */
assert( Idx > NONE );
return My_Connections[Idx].bytes_out;
} /* Conn_SendBytes */
GLOBAL INT
Conn_RecvQ( CONN_ID Idx )
{
/* Laenge der Daten im Lesebuffer liefern */
assert( Idx > NONE );
#ifdef ZLIB
if( My_Connections[Idx].options & CONN_ZIP ) return My_Connections[Idx].zip.rdatalen;
else
#endif
return My_Connections[Idx].rdatalen;
} /* Conn_RecvQ */
GLOBAL LONG
Conn_RecvMsg( CONN_ID Idx )
{
/* Anzahl empfangener Nachrichten liefern */
assert( Idx > NONE );
return My_Connections[Idx].msg_in;
} /* Conn_RecvMsg */
GLOBAL LONG
Conn_RecvBytes( CONN_ID Idx )
{
/* Anzahl empfangener Bytes (unkomprimiert) liefern */
assert( Idx > NONE );
return My_Connections[Idx].bytes_in;
} /* Conn_RecvBytes */
GLOBAL VOID
Conn_ResetWCounter( VOID )
{
WCounter = 0;
} /* Conn_ResetWCounter */
GLOBAL LONG
Conn_WCounter( VOID )
{
return WCounter;
} /* Conn_WCounter */
/* -eof- */

View File

@@ -1,61 +0,0 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: conn-func.h,v 1.1 2002/12/30 17:14:28 alex Exp $
*
* Connection management: Global functions (header)
*/
#ifndef __conn_func_h__
#define __conn_func_h__
/* Include the header conn.h if this header is _not_ included by any module
* containing connection handling functions. So other modules must only
* include this conn-func.h header. */
#ifndef CONN_MODULE
# include "conn.h"
#endif
GLOBAL VOID Conn_UpdateIdle PARAMS(( CONN_ID Idx ));
GLOBAL time_t Conn_GetIdle PARAMS(( CONN_ID Idx ));
GLOBAL time_t Conn_LastPing PARAMS(( CONN_ID Idx ));
GLOBAL time_t Conn_StartTime PARAMS(( CONN_ID Idx ));
GLOBAL INT Conn_SendQ PARAMS(( CONN_ID Idx ));
GLOBAL INT Conn_RecvQ PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_SendMsg PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_RecvMsg PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_SendBytes PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_RecvBytes PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds ));
GLOBAL VOID Conn_ResetPenalty PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_ClearFlags PARAMS(( VOID ));
GLOBAL INT Conn_Flag PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_SetFlag PARAMS(( CONN_ID Idx, INT Flag ));
GLOBAL CONN_ID Conn_First PARAMS(( VOID ));
GLOBAL CONN_ID Conn_Next PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_SetOption PARAMS(( CONN_ID Idx, INT Option ));
GLOBAL VOID Conn_UnsetOption PARAMS(( CONN_ID Idx, INT Option ));
GLOBAL INT Conn_Options PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_ResetWCounter PARAMS(( VOID ));
GLOBAL LONG Conn_WCounter PARAMS(( VOID ));
#endif
/* -eof- */

View File

@@ -1,210 +0,0 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Connection compression using ZLIB
*/
#include "portab.h"
#define CONN_MODULE
#ifdef ZLIB
static char UNUSED id[] = "$Id: conn-zip.c,v 1.3.2.1 2003/12/26 16:16:48 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <string.h>
#include <zlib.h>
#include "conn.h"
#include "conn-func.h"
#include "log.h"
#include "exp.h"
#include "conn-zip.h"
GLOBAL BOOLEAN
Zip_InitConn( CONN_ID Idx )
{
/* Kompression fuer Link initialisieren */
assert( Idx > NONE );
My_Connections[Idx].zip.in.avail_in = 0;
My_Connections[Idx].zip.in.total_in = 0;
My_Connections[Idx].zip.in.total_out = 0;
My_Connections[Idx].zip.in.zalloc = NULL;
My_Connections[Idx].zip.in.zfree = NULL;
My_Connections[Idx].zip.in.data_type = Z_ASCII;
if( inflateInit( &My_Connections[Idx].zip.in ) != Z_OK )
{
/* Fehler! */
Log( LOG_ALERT, "Can't initialize compression on connection %d (zlib inflate)!", Idx );
return FALSE;
}
My_Connections[Idx].zip.out.total_in = 0;
My_Connections[Idx].zip.out.total_in = 0;
My_Connections[Idx].zip.out.zalloc = NULL;
My_Connections[Idx].zip.out.zfree = NULL;
My_Connections[Idx].zip.out.data_type = Z_ASCII;
if( deflateInit( &My_Connections[Idx].zip.out, Z_DEFAULT_COMPRESSION ) != Z_OK )
{
/* Fehler! */
Log( LOG_ALERT, "Can't initialize compression on connection %d (zlib deflate)!", Idx );
return FALSE;
}
My_Connections[Idx].zip.bytes_in = My_Connections[Idx].bytes_in;
My_Connections[Idx].zip.bytes_out = My_Connections[Idx].bytes_out;
Log( LOG_INFO, "Enabled link compression (zlib) on connection %d.", Idx );
Conn_SetOption( Idx, CONN_ZIP );
return TRUE;
} /* Zip_InitConn */
GLOBAL BOOLEAN
Zip_Buffer( CONN_ID Idx, CHAR *Data, INT Len )
{
/* Daten zum Komprimieren im "Kompressions-Puffer" sammeln.
* Es wird TRUE bei Erfolg, sonst FALSE geliefert. */
assert( Idx > NONE );
assert( Data != NULL );
assert( Len > 0 );
/* Ist noch Platz im Kompressions-Puffer? */
if( ZWRITEBUFFER_LEN - My_Connections[Idx].zip.wdatalen < Len + 50 )
{
/* Nein! Puffer zunaechst leeren ...*/
if( ! Zip_Flush( Idx )) return FALSE;
}
/* Daten kopieren */
memmove( My_Connections[Idx].zip.wbuf + My_Connections[Idx].zip.wdatalen, Data, Len );
My_Connections[Idx].zip.wdatalen += Len;
return TRUE;
} /* Zip_Buffer */
GLOBAL BOOLEAN
Zip_Flush( CONN_ID Idx )
{
/* Daten komprimieren und in Schreibpuffer kopieren.
* Es wird TRUE bei Erfolg, sonst FALSE geliefert. */
INT result, out_len;
z_stream *out;
out = &My_Connections[Idx].zip.out;
out->next_in = (VOID *)My_Connections[Idx].zip.wbuf;
out->avail_in = My_Connections[Idx].zip.wdatalen;
out->next_out = (VOID *)(My_Connections[Idx].wbuf + My_Connections[Idx].wdatalen);
out->avail_out = WRITEBUFFER_LEN - My_Connections[Idx].wdatalen;
result = deflate( out, Z_SYNC_FLUSH );
if(( result != Z_OK ) || ( out->avail_in > 0 ))
{
Log( LOG_ALERT, "Compression error: code %d!?", result );
Conn_Close( Idx, "Compression error!", NULL, FALSE );
return FALSE;
}
out_len = WRITEBUFFER_LEN - My_Connections[Idx].wdatalen - out->avail_out;
My_Connections[Idx].wdatalen += out_len;
My_Connections[Idx].bytes_out += out_len;
My_Connections[Idx].zip.bytes_out += My_Connections[Idx].zip.wdatalen;
My_Connections[Idx].zip.wdatalen = 0;
return TRUE;
} /* Zip_Flush */
GLOBAL BOOLEAN
Unzip_Buffer( CONN_ID Idx )
{
/* Daten entpacken und in Lesepuffer kopieren. Bei Fehlern
* wird FALSE geliefert, ansonsten TRUE. Der Fall, dass keine
* Daten mehr zu entpacken sind, ist _kein_ Fehler! */
INT result, in_len, out_len;
z_stream *in;
assert( Idx > NONE );
if( My_Connections[Idx].zip.rdatalen <= 0 ) return TRUE;
in = &My_Connections[Idx].zip.in;
in->next_in = (VOID *)My_Connections[Idx].zip.rbuf;
in->avail_in = My_Connections[Idx].zip.rdatalen;
in->next_out = (VOID *)(My_Connections[Idx].rbuf + My_Connections[Idx].rdatalen);
in->avail_out = READBUFFER_LEN - My_Connections[Idx].rdatalen - 1;
result = inflate( in, Z_SYNC_FLUSH );
if( result != Z_OK )
{
Log( LOG_ALERT, "Decompression error: code %d (ni=%d, ai=%d, no=%d, ao=%d)!?", result, in->next_in, in->avail_in, in->next_out, in->avail_out );
Conn_Close( Idx, "Decompression error!", NULL, FALSE );
return FALSE;
}
in_len = My_Connections[Idx].zip.rdatalen - in->avail_in;
out_len = READBUFFER_LEN - My_Connections[Idx].rdatalen - 1 - in->avail_out;
My_Connections[Idx].rdatalen += out_len;
if( in->avail_in > 0 )
{
/* es konnten nicht alle Daten entpackt werden, vermutlich war
* im Ziel-Puffer kein Platz mehr. Umkopieren ... */
My_Connections[Idx].zip.rdatalen -= in_len;
memmove( My_Connections[Idx].zip.rbuf, My_Connections[Idx].zip.rbuf + in_len, My_Connections[Idx].zip.rdatalen );
}
else My_Connections[Idx].zip.rdatalen = 0;
My_Connections[Idx].zip.bytes_in += out_len;
return TRUE;
} /* Unzip_Buffer */
GLOBAL LONG
Zip_SendBytes( CONN_ID Idx )
{
/* Anzahl gesendeter Bytes (komprimiert!) liefern */
assert( Idx > NONE );
return My_Connections[Idx].zip.bytes_out;
} /* Zip_SendBytes */
GLOBAL LONG
Zip_RecvBytes( CONN_ID Idx )
{
/* Anzahl gesendeter Bytes (komprimiert!) liefern */
assert( Idx > NONE );
return My_Connections[Idx].zip.bytes_in;
} /* Zip_RecvBytes */
#endif
/* -eof- */

View File

@@ -1,38 +0,0 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: conn-zip.h,v 1.1.2.1 2003/12/26 16:16:48 alex Exp $
*
* Connection compression using ZLIB (header)
*/
#ifdef ZLIB
#ifndef __conn_zip_h__
#define __conn_zip_h__
GLOBAL BOOLEAN Zip_InitConn PARAMS(( CONN_ID Idx ));
GLOBAL BOOLEAN Zip_Buffer PARAMS(( CONN_ID Idx, CHAR *Data, INT Len ));
GLOBAL BOOLEAN Zip_Flush PARAMS(( CONN_ID Idx ));
GLOBAL BOOLEAN Unzip_Buffer PARAMS(( CONN_ID Idx ));
GLOBAL LONG Zip_SendBytes PARAMS(( CONN_ID Idx ));
GLOBAL LONG Zip_RecvBytes PARAMS(( CONN_ID Idx ));
#endif /* __conn_zip_h__ */
#endif /* ZLIB */
/* -eof- */

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: conn.h,v 1.31.2.1 2003/12/26 16:16:48 alex Exp $
* $Id: conn.h,v 1.26.2.1 2003/03/09 20:16:46 alex Exp $
*
* Connection management (header)
*/
@@ -23,7 +23,7 @@
#define CONN_ISCLOSING 1 /* Conn_Close() already called */
#ifdef ZLIB
#ifdef USE_ZLIB
#define CONN_ZIP 2 /* zlib compressed link */
#endif
@@ -31,56 +31,6 @@
typedef INT CONN_ID;
#ifdef CONN_MODULE
#include "defines.h"
#include "resolve.h"
#ifdef ZLIB
#include <zlib.h>
typedef struct _ZipData
{
z_stream in; /* "Handle" for input stream */
z_stream out; /* "Handle" for output stream */
CHAR rbuf[READBUFFER_LEN]; /* Read buffer */
INT rdatalen; /* Length of data in read buffer (compressed) */
CHAR wbuf[WRITEBUFFER_LEN]; /* Write buffer */
INT wdatalen; /* Length of data in write buffer (uncompressed) */
LONG bytes_in, bytes_out; /* Counter for statistics (uncompressed!) */
} ZIPDATA;
#endif /* ZLIB */
typedef struct _Connection
{
INT sock; /* Socket handle */
struct sockaddr_in addr; /* Client address */
RES_STAT *res_stat; /* Status of resolver process, if any */
CHAR host[HOST_LEN]; /* Hostname */
CHAR rbuf[READBUFFER_LEN]; /* Read buffer */
INT rdatalen; /* Length of data in read buffer */
CHAR wbuf[WRITEBUFFER_LEN]; /* Write buffer */
INT wdatalen; /* Length of data in write buffer */
time_t starttime; /* Start time of link */
time_t lastdata; /* Last activity */
time_t lastping; /* Last PING */
time_t lastprivmsg; /* Last PRIVMSG */
time_t delaytime; /* Ignore link ("penalty") */
LONG bytes_in, bytes_out; /* Received and sent bytes */
LONG msg_in, msg_out; /* Received and sent IRC messages */
INT flag; /* Flag (see "irc-write" module) */
INT options; /* Link options */
#ifdef ZLIB
ZIPDATA zip; /* Compression information */
#endif /* ZLIB */
} CONNECTION;
GLOBAL CONNECTION *My_Connections;
GLOBAL CONN_ID Pool_Size;
GLOBAL LONG WCounter;
#endif /* CONN_MODULE */
GLOBAL VOID Conn_Init PARAMS((VOID ));
GLOBAL VOID Conn_Exit PARAMS(( VOID ));
@@ -96,7 +46,42 @@ GLOBAL BOOLEAN Conn_WriteStr PARAMS(( CONN_ID Idx, CHAR *Format, ... ));
GLOBAL VOID Conn_Close PARAMS(( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient ));
GLOBAL VOID Conn_SyncServerStruct PARAMS(( VOID ));
GLOBAL VOID Conn_UpdateIdle PARAMS(( CONN_ID Idx ));
GLOBAL time_t Conn_GetIdle PARAMS(( CONN_ID Idx ));
GLOBAL time_t Conn_LastPing PARAMS(( CONN_ID Idx ));
GLOBAL time_t Conn_StartTime PARAMS(( CONN_ID Idx ));
GLOBAL INT Conn_SendQ PARAMS(( CONN_ID Idx ));
GLOBAL INT Conn_RecvQ PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_SendMsg PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_RecvMsg PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_SendBytes PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_RecvBytes PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds ));
GLOBAL VOID Conn_ResetPenalty PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_ClearFlags PARAMS(( VOID ));
GLOBAL INT Conn_Flag PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_SetFlag PARAMS(( CONN_ID Idx, INT Flag ));
GLOBAL VOID Conn_SetServer PARAMS(( CONN_ID Idx, INT ConfServer ));
GLOBAL CONN_ID Conn_First PARAMS(( VOID ));
GLOBAL CONN_ID Conn_Next PARAMS(( CONN_ID Idx ));
GLOBAL VOID Conn_SetOption PARAMS(( CONN_ID Idx, INT Option ));
GLOBAL VOID Conn_UnsetOption PARAMS(( CONN_ID Idx, INT Option ));
GLOBAL INT Conn_Options PARAMS(( CONN_ID Idx ));
#ifdef USE_ZLIB
GLOBAL BOOLEAN Conn_InitZip PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_SendBytesZip PARAMS(( CONN_ID Idx ));
GLOBAL LONG Conn_RecvBytesZip PARAMS(( CONN_ID Idx ));
#endif
GLOBAL VOID Conn_ResetWCounter PARAMS(( VOID ));
GLOBAL LONG Conn_WCounter PARAMS(( VOID ));
GLOBAL INT Conn_MaxFD;

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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
@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: defines.h,v 1.42.2.2 2003/12/26 16:16:48 alex Exp $
* $Id: defines.h,v 1.40 2002/12/16 23:10:56 alex Exp $
*
* Global defines of ngIRCd.
*/
@@ -19,6 +19,8 @@
#define NONE -1
#define TIME_RES 2 /* Zeit-Aufloesung des Servers in Sekunden */
#define FNAME_LEN 256 /* max. Laenge eines Dateinamen */
#define LINE_LEN 256 /* max. Laenge einer Konfigurationszeile */
@@ -57,7 +59,7 @@
#define READBUFFER_LEN 2048 /* Laenge des Lesepuffers je Verbindung (Bytes) */
#define WRITEBUFFER_LEN 4096 /* Laenge des Schreibpuffers je Verbindung (Bytes) */
#ifdef ZLIB
#ifdef USE_ZLIB
#define ZREADBUFFER_LEN 1024 /* Laenge des Lesepuffers je Verbindung (Bytes) */
#define ZWRITEBUFFER_LEN 4096 /* Laenge des Schreibpuffers fuer Kompression (Bytes) */
#endif
@@ -81,9 +83,13 @@
#define DEFAULT_AWAY_MSG "Away" /* Away-Meldung fuer User von anderen Servern */
#define CONFIG_FILE "/ngircd.conf"
#define MOTD_FILE "/ngircd.motd"
#ifdef PROTOTYPES
# define CONFIG_FILE SYSCONFDIR"/ngircd.conf"
# define MOTD_FILE SYSCONFDIR"/ngircd.motd"
#else
# define CONFIG_FILE "ngircd.conf"
# define MOTD_FILE "ngircd.motd"
#endif
#define ERROR_DIR "/tmp"
#define MAX_LOG_MSG_LEN 256 /* max. Laenge einer Log-Meldung */
@@ -92,10 +98,6 @@
#define NOTICE_TXTPREFIX "" /* Kennzeichnung fuer Server-NOTICEs an User */
#ifdef RENDEZVOUS
#define RENDEZVOUS_TYPE "_ircu._tcp." /* Service type to register with Rendezvous */
#endif
#endif

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: hash.c,v 1.9 2002/12/26 16:25:43 alex Exp $";
static char UNUSED id[] = "$Id: hash.c,v 1.6 2002/12/12 12:24:18 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -38,7 +38,9 @@ Hash( CHAR *String )
CHAR buffer[LINE_LEN];
strlcpy( buffer, String, sizeof( buffer ));
strncpy( buffer, String, LINE_LEN - 1 );
buffer[LINE_LEN - 1] = '\0';
return jenkins_hash( (UINT8 *)ngt_LowerStr( buffer ), strlen( buffer ), 42 );
} /* Hash */
@@ -100,7 +102,7 @@ jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval
/* handle the last 11 bytes */
c += length;
switch( (INT)len ) /* all the case statements fall through */
switch(len) /* all the case statements fall through */
{
case 11: c+=((UINT32)k[10]<<24);
case 10: c+=((UINT32)k[9]<<16);

View File

@@ -14,12 +14,10 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-channel.c,v 1.25 2003/01/08 22:04:05 alex Exp $";
static char UNUSED id[] = "$Id: irc-channel.c,v 1.21.2.5 2003/01/08 23:09:34 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "defines.h"
@@ -181,7 +179,7 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
if(( strchr( Channel_Modes( chan ), 'P' )) && ( strchr( Client_Modes( target ), 'o' ))) Channel_UserModeAdd( chan, target, 'o' );
/* Muessen Modes an andere Server gemeldet werden? */
strlcpy( &modes[1], Channel_UserModes( chan, target ), sizeof( modes ) - 1 );
strcpy( &modes[1], Channel_UserModes( chan, target ));
if( modes[1] ) modes[0] = 0x7;
else modes[0] = '\0';
@@ -364,9 +362,9 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
{
CHAR modes_add[COMMAND_LEN], l[16], *ptr;
CLIENT *from;
CHANNEL *chan;
CHAR *ptr;
INT arg_topic;
assert( Client != NULL );
@@ -397,40 +395,15 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
/* OK, this channel doesn't have modes jet, set the received ones: */
Channel_SetModes( chan, &Req->argv[1][1] );
if( Req->argc == 5 )
{
if( strchr( Channel_Modes( chan ), 'k' )) Channel_SetKey( chan, Req->argv[2] );
if( strchr( Channel_Modes( chan ), 'l' )) Channel_SetMaxUsers( chan, atol( Req->argv[3] ));
}
else
{
/* Delete modes which we never want to inherit */
Channel_ModeDel( chan, 'l' );
Channel_ModeDel( chan, 'k' );
}
/* Delete modes which we never want to inherit */
Channel_ModeDel( chan, 'l' );
Channel_ModeDel( chan, 'k' );
strcpy( modes_add, "" );
ptr = Channel_Modes( chan );
while( *ptr )
{
if( *ptr == 'l' )
{
snprintf( l, sizeof( l ), " %ld", Channel_MaxUsers( chan ));
strlcat( modes_add, l, sizeof( modes_add ));
}
if( *ptr == 'k' )
{
strlcat( modes_add, " ", sizeof( modes_add ));
strlcat( modes_add, Channel_Key( chan ), sizeof( modes_add ));
}
ptr++;
}
/* Inform members of this channel */
IRC_WriteStrChannelPrefix( Client, chan, from, FALSE, "MODE %s +%s%s", Req->argv[0], Channel_Modes( chan ), modes_add );
IRC_WriteStrChannelPrefix( Client, chan, from, FALSE, "MODE %s +%s", Req->argv[0], Channel_Modes( chan ));
}
}
else Log( LOG_WARNING, "CHANINFO: invalid MODE format ignored!" );
else Log( LOG_WARNING, "CHANNELINFO: invalid MODE format ignored!" );
if( arg_topic > 0 )
{

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-info.c,v 1.16.2.4 2003/12/26 16:16:48 alex Exp $";
static char UNUSED id[] = "$Id: irc-info.c,v 1.8.2.2 2003/01/01 13:46:37 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -23,9 +23,7 @@ static char UNUSED id[] = "$Id: irc-info.c,v 1.16.2.4 2003/12/26 16:16:48 alex E
#include <string.h>
#include "ngircd.h"
#include "cvs-version.h"
#include "conn-func.h"
#include "conn-zip.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "resolve.h"
@@ -77,7 +75,6 @@ IRC_ADMIN(CLIENT *Client, REQUEST *Req )
if( ! IRC_WriteStrClient( Client, RPL_ADMINLOC2_MSG, Client_ID( prefix ), Conf_ServerAdmin2 )) return DISCONNECTED;
if( ! IRC_WriteStrClient( Client, RPL_ADMINEMAIL_MSG, Client_ID( prefix ), Conf_ServerAdminMail )) return DISCONNECTED;
IRC_SetPenalty( Client, 1 );
return CONNECTED;
} /* IRC_ADMIN */
@@ -107,8 +104,8 @@ IRC_ISON( CLIENT *Client, REQUEST *Req )
if( c && ( Client_Type( c ) == CLIENT_USER ))
{
/* Dieser Nick ist "online" */
strlcat( rpl, ptr, sizeof( rpl ));
strlcat( rpl, " ", sizeof( rpl ));
strcat( rpl, ptr );
strcat( rpl, " " );
}
ptr = strtok( NULL, " " );
}
@@ -162,8 +159,7 @@ IRC_LINKS( CLIENT *Client, REQUEST *Req )
}
c = Client_Next( c );
}
IRC_SetPenalty( target, 1 );
return IRC_WriteStrClient( target, RPL_ENDOFLINKS_MSG, Client_ID( target ), mask );
} /* IRC_LINKS */
@@ -199,7 +195,6 @@ IRC_LUSERS( CLIENT *Client, REQUEST *Req )
IRC_Send_LUSERS( target );
IRC_SetPenalty( target, 1 );
return CONNECTED;
} /* IRC_LUSERS */
@@ -233,7 +228,6 @@ IRC_MOTD( CLIENT *Client, REQUEST *Req )
}
}
IRC_SetPenalty( from, 3 );
return IRC_Show_MOTD( from );
} /* IRC_MOTD */
@@ -302,20 +296,20 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
/* Nun noch alle Clients ausgeben, die in keinem Channel sind */
c = Client_First( );
snprintf( rpl, sizeof( rpl ), RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
sprintf( rpl, RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
while( c )
{
if(( Client_Type( c ) == CLIENT_USER ) && ( Channel_FirstChannelOf( c ) == NULL ) && ( ! strchr( Client_Modes( c ), 'i' )))
{
/* Okay, das ist ein User: anhaengen */
if( rpl[strlen( rpl ) - 1] != ':' ) strlcat( rpl, " ", sizeof( rpl ));
strlcat( rpl, Client_ID( c ), sizeof( rpl ));
if( rpl[strlen( rpl ) - 1] != ':' ) strcat( rpl, " " );
strcat( rpl, Client_ID( c ));
if( strlen( rpl ) > ( LINE_LEN - CLIENT_NICK_LEN - 4 ))
{
/* Zeile wird zu lang: senden! */
if( ! IRC_WriteStrClient( from, "%s", rpl )) return DISCONNECTED;
snprintf( rpl, sizeof( rpl ), RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
sprintf( rpl, RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
}
}
@@ -328,7 +322,6 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
if( ! IRC_WriteStrClient( from, "%s", rpl )) return DISCONNECTED;
}
IRC_SetPenalty( from, 1 );
return IRC_WriteStrClient( from, RPL_ENDOFNAMES_MSG, Client_ID( from ), "*" );
} /* IRC_NAMES */
@@ -379,10 +372,10 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
if( cl && (( Client_Type( cl ) == CLIENT_SERVER ) || ( cl == Client )))
{
/* Server link or our own connection */
#ifdef ZLIB
#ifdef USE_ZLIB
if( Conn_Options( con ) & CONN_ZIP )
{
if( ! IRC_WriteStrClient( from, RPL_STATSLINKINFOZIP_MSG, Client_ID( from ), Client_Mask( cl ), Conn_SendQ( con ), Conn_SendMsg( con ), Zip_SendBytes( con ), Conn_SendBytes( con ), Conn_RecvMsg( con ), Zip_RecvBytes( con ), Conn_RecvBytes( con ), (LONG)( time( NULL ) - Conn_StartTime( con )))) return DISCONNECTED;
if( ! IRC_WriteStrClient( from, RPL_STATSLINKINFOZIP_MSG, Client_ID( from ), Client_Mask( cl ), Conn_SendQ( con ), Conn_SendMsg( con ), Conn_SendBytesZip( con ), Conn_SendBytes( con ), Conn_RecvMsg( con ), Conn_RecvBytesZip( con ), Conn_RecvBytes( con ), (LONG)( time( NULL ) - Conn_StartTime( con )))) return DISCONNECTED;
}
else
#endif
@@ -407,7 +400,6 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
break;
}
IRC_SetPenalty( from, 2 );
return IRC_WriteStrClient( from, RPL_ENDOFSTATS_MSG, Client_ID( from ), query );
} /* IRC_STATS */
@@ -444,7 +436,7 @@ IRC_TIME( CLIENT *Client, REQUEST *Req )
}
t = time( NULL );
(VOID)strftime( t_str, 60, "%A %B %d %Y -- %H:%M %Z", localtime( &t ));
(VOID)strftime( t_str, 60, "%A %B %d %Y -- %H:%M %z", localtime( &t ));
return IRC_WriteStrClient( from, RPL_TIME_MSG, Client_ID( from ), Client_ID( Client_ThisServer( )), t_str );
} /* IRC_TIME */
@@ -472,15 +464,15 @@ IRC_USERHOST( CLIENT *Client, REQUEST *Req )
if( c && ( Client_Type( c ) == CLIENT_USER ))
{
/* Dieser Nick ist "online" */
strlcat( rpl, Client_ID( c ), sizeof( rpl ));
if( Client_HasMode( c, 'o' )) strlcat( rpl, "*", sizeof( rpl ));
strlcat( rpl, "=", sizeof( rpl ));
if( Client_HasMode( c, 'a' )) strlcat( rpl, "-", sizeof( rpl ));
else strlcat( rpl, "+", sizeof( rpl ));
strlcat( rpl, Client_User( c ), sizeof( rpl ));
strlcat( rpl, "@", sizeof( rpl ));
strlcat( rpl, Client_Hostname( c ), sizeof( rpl ));
strlcat( rpl, " ", sizeof( rpl ));
strcat( rpl, Client_ID( c ));
if( Client_HasMode( c, 'o' )) strcat( rpl, "*" );
strcat( rpl, "=" );
if( Client_HasMode( c, 'a' )) strcat( rpl, "-" );
else strcat( rpl, "+" );
strcat( rpl, Client_User( c ));
strcat( rpl, "@" );
strcat( rpl, Client_Hostname( c ));
strcat( rpl, " " );
}
}
if( rpl[strlen( rpl ) - 1] == ' ' ) rpl[strlen( rpl ) - 1] = '\0';
@@ -493,9 +485,6 @@ GLOBAL BOOLEAN
IRC_VERSION( CLIENT *Client, REQUEST *Req )
{
CLIENT *target, *prefix;
#ifdef CVSDATE
CHAR ver[12], vertxt[30];
#endif
assert( Client != NULL );
assert( Req != NULL );
@@ -523,16 +512,7 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
}
/* mit Versionsinfo antworten */
IRC_SetPenalty( Client, 1 );
#ifdef CVSDATE
strlcpy( ver, CVSDATE, sizeof( ver ));
strncpy( ver + 4, ver + 5, 2 );
strncpy( ver + 6, ver + 8, 3 );
snprintf( vertxt, sizeof( vertxt ), "%s(%s)", PACKAGE_VERSION, ver );
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, vertxt, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( ));
#else
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( ));
#endif
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE, VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( ));
} /* IRC_VERSION */
@@ -592,7 +572,7 @@ IRC_WHO( CLIENT *Client, REQUEST *Req )
{
/* Flags zusammenbasteln */
strcpy( flags, "H" );
if( strchr( Client_Modes( c ), 'o' )) strlcat( flags, "*", sizeof( flags ));
if( strchr( Client_Modes( c ), 'o' )) strcat( flags, "*" );
/* ausgeben */
cl2chan = Channel_FirstChannelOf( c );
@@ -655,7 +635,7 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
if( ! IRC_WriteStrClient( from, RPL_WHOISSERVER_MSG, Client_ID( from ), Client_ID( c ), Client_ID( Client_Introducer( c )), Client_Info( Client_Introducer( c )))) return DISCONNECTED;
/* Channels */
snprintf( str, sizeof( str ), RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
sprintf( str, RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
cl2chan = Channel_FirstChannelOf( c );
while( cl2chan )
{
@@ -663,16 +643,16 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
assert( chan != NULL );
/* Concatenate channel names */
if( str[strlen( str ) - 1] != ':' ) strlcat( str, " ", sizeof( str ));
if( strchr( Channel_UserModes( chan, c ), 'o' )) strlcat( str, "@", sizeof( str ));
else if( strchr( Channel_UserModes( chan, c ), 'v' )) strlcat( str, "+", sizeof( str ));
strlcat( str, Channel_Name( chan ), sizeof( str ));
if( str[strlen( str ) - 1] != ':' ) strcat( str, " " );
if( strchr( Channel_UserModes( chan, c ), 'o' )) strcat( str, "@" );
else if( strchr( Channel_UserModes( chan, c ), 'v' )) strcat( str, "+" );
strcat( str, Channel_Name( chan ));
if( strlen( str ) > ( LINE_LEN - CHANNEL_NAME_LEN - 4 ))
{
/* Line becomes too long: send it! */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
snprintf( str, sizeof( str ), RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
sprintf( str, RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
}
/* next */
@@ -813,7 +793,7 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
else is_member = FALSE;
/* Alle Mitglieder suchen */
snprintf( str, sizeof( str ), RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
sprintf( str, RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
cl2chan = Channel_FirstMember( Chan );
while( cl2chan )
{
@@ -825,16 +805,16 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
if( is_member || is_visible )
{
/* Nick anhaengen */
if( str[strlen( str ) - 1] != ':' ) strlcat( str, " ", sizeof( str ));
if( strchr( Channel_UserModes( Chan, cl ), 'o' )) strlcat( str, "@", sizeof( str ));
else if( strchr( Channel_UserModes( Chan, cl ), 'v' )) strlcat( str, "+", sizeof( str ));
strlcat( str, Client_ID( cl ), sizeof( str ));
if( str[strlen( str ) - 1] != ':' ) strcat( str, " " );
if( strchr( Channel_UserModes( Chan, cl ), 'o' )) strcat( str, "@" );
else if( strchr( Channel_UserModes( Chan, cl ), 'v' )) strcat( str, "+" );
strcat( str, Client_ID( cl ));
if( strlen( str ) > ( LINE_LEN - CLIENT_NICK_LEN - 4 ))
{
/* Zeile wird zu lang: senden! */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
snprintf( str, sizeof( str ), RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
sprintf( str, RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
}
}
@@ -878,9 +858,9 @@ IRC_Send_WHO( CLIENT *Client, CHANNEL *Chan, BOOLEAN OnlyOps )
{
/* Flags zusammenbasteln */
strcpy( flags, "H" );
if( strchr( Client_Modes( c ), 'o' )) strlcat( flags, "*", sizeof( flags ));
if( strchr( Channel_UserModes( Chan, c ), 'o' )) strlcat( flags, "@", sizeof( flags ));
else if( strchr( Channel_UserModes( Chan, c ), 'v' )) strlcat( flags, "+", sizeof( flags ));
if( strchr( Client_Modes( c ), 'o' )) strcat( flags, "*" );
if( strchr( Channel_UserModes( Chan, c ), 'o' )) strcat( flags, "@" );
else if( strchr( Channel_UserModes( Chan, c ), 'v' )) strcat( flags, "+" );
/* ausgeben */
if(( ! OnlyOps ) || ( strchr( Client_Modes( c ), 'o' )))

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-login.c,v 1.34.2.3 2004/02/04 20:04:54 alex Exp $";
static char UNUSED id[] = "$Id: irc-login.c,v 1.27.2.2 2003/01/01 13:46:37 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -24,17 +24,15 @@ static char UNUSED id[] = "$Id: irc-login.c,v 1.34.2.3 2004/02/04 20:04:54 alex
#include "ngircd.h"
#include "resolve.h"
#include "conn-func.h"
#include "conf.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "log.h"
#include "messages.h"
#include "parse.h"
#include "irc.h"
#include "irc-info.h"
#include "irc-write.h"
#include "cvs-version.h"
#include "exp.h"
#include "irc-login.h"
@@ -224,7 +222,6 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
/* neuen Client-Nick speichern */
Client_SetID( target, Req->argv[0] );
IRC_SetPenalty( target, 2 );
}
return CONNECTED;
@@ -294,17 +291,11 @@ IRC_USER( CLIENT *Client, REQUEST *Req )
if( Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_GOTPASS )
#endif
{
/* Wrong number of parameters? */
/* Falsche Anzahl Parameter? */
if( Req->argc != 4 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* User name */
Client_SetUser( Client, Req->argv[0], FALSE );
/* "Real name" or user info text: Don't set it to the empty
* string, the original ircd can't deal with such "real names"
* (e. g. "USER user * * :") ... */
if( *Req->argv[3] ) Client_SetInfo( Client, Req->argv[3] );
else Client_SetInfo( Client, "-" );
Client_SetInfo( Client, Req->argv[3] );
Log( LOG_DEBUG, "Connection %d: got valid USER command ...", Client_Conn( Client ));
if( Client_Type( Client ) == CLIENT_GOTNICK ) return Hello_User( Client );
@@ -436,16 +427,12 @@ IRC_PONG( CLIENT *Client, REQUEST *Req )
LOCAL BOOLEAN
Hello_User( CLIENT *Client )
{
#ifdef CVSDATE
CHAR ver[12], vertxt[30];
#endif
assert( Client != NULL );
/* Check password ... */
/* Passwort ueberpruefen */
if( strcmp( Client_Password( Client ), Conf_ServerPwd ) != 0 )
{
/* Bad password! */
/* Falsches Passwort */
Log( LOG_ERR, "User \"%s\" rejected (connection %d): Bad password!", Client_Mask( Client ), Client_Conn( Client ));
Conn_Close( Client_Conn( Client ), NULL, "Bad password", TRUE );
return DISCONNECTED;
@@ -453,41 +440,22 @@ Hello_User( CLIENT *Client )
Log( LOG_NOTICE, "User \"%s\" registered (connection %d).", Client_Mask( Client ), Client_Conn( Client ));
/* Inform other servers */
/* Andere Server informieren */
IRC_WriteStrServers( NULL, "NICK %s 1 %s %s 1 +%s :%s", Client_ID( Client ), Client_User( Client ), Client_Hostname( Client ), Client_Modes( Client ), Client_Info( Client ));
/* Welcome :-) */
if( ! IRC_WriteStrClient( Client, RPL_WELCOME_MSG, Client_ID( Client ), Client_Mask( Client ))) return FALSE;
/* Version and system type */
#ifdef CVSDATE
strlcpy( ver, CVSDATE, sizeof( ver ));
strncpy( ver + 4, ver + 5, 2 );
strncpy( ver + 6, ver + 8, 3 );
snprintf( vertxt, sizeof( vertxt ), "%s(%s)", PACKAGE_VERSION, ver );
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), vertxt, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return FALSE;
#else
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return FALSE;
#endif
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) return FALSE;
if( ! IRC_WriteStrClient( Client, RPL_CREATED_MSG, Client_ID( Client ), NGIRCd_StartStr )) return FALSE;
#ifdef CVSDATE
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), vertxt, USERMODES, CHANMODES )) return FALSE;
#else
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), PACKAGE_VERSION, USERMODES, CHANMODES )) return FALSE;
#endif
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, USERMODES, CHANMODES )) return FALSE;
/* Features */
if( ! IRC_WriteStrClient( Client, RPL_ISUPPORT_MSG, Client_ID( Client ), CLIENT_NICK_LEN - 1, CHANNEL_TOPIC_LEN - 1, CLIENT_AWAY_LEN - 1, Conf_MaxJoins )) return DISCONNECTED;
if( ! IRC_WriteStrClient( Client, RPL_FEATURE_MSG, Client_ID( Client ), CLIENT_NICK_LEN - 1, CHANNEL_TOPIC_LEN - 1, CLIENT_AWAY_LEN - 1, Conf_MaxJoins )) return DISCONNECTED;
Client_SetType( Client, CLIENT_USER );
if( ! IRC_Send_LUSERS( Client )) return DISCONNECTED;
if( ! IRC_Show_MOTD( Client )) return DISCONNECTED;
/* Suspend the client for a second ... */
IRC_SetPenalty( Client, 1 );
return CONNECTED;
} /* Hello_User */
@@ -495,18 +463,19 @@ Hello_User( CLIENT *Client )
LOCAL VOID
Kill_Nick( CHAR *Nick, CHAR *Reason )
{
REQUEST r;
CLIENT *c;
assert( Nick != NULL );
assert( Reason != NULL );
r.prefix = Client_ThisServer( );
r.argv[0] = Nick;
r.argv[1] = Reason;
r.argc = 2;
Log( LOG_ERR, "User(s) with nick \"%s\" will be disconnected: %s", Nick, Reason );
IRC_KILL( Client_ThisServer( ), &r );
/* andere Server benachrichtigen */
IRC_WriteStrServers( NULL, "KILL %s :%s", Nick, Reason );
/* Ggf. einen eigenen Client toeten */
c = Client_Search( Nick );
if( c && ( Client_Conn( c ) != NONE )) Conn_Close( Client_Conn( c ), NULL, Reason, TRUE );
} /* Kill_Nick */

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-mode.c,v 1.31.2.1 2003/11/07 20:51:11 alex Exp $";
static char UNUSED id[] = "$Id: irc-mode.c,v 1.24.2.5 2003/01/21 21:05:19 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -142,8 +142,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
else
{
/* Append modifier character to result string */
x[0] = *mode_ptr;
strlcat( the_modes, x, sizeof( the_modes ));
x[0] = *mode_ptr; strcat( the_modes, x );
}
if( *mode_ptr == '+' ) set = TRUE;
else set = FALSE;
@@ -200,13 +199,13 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
if( set )
{
/* Set mode */
if( Client_ModeAdd( Target, x[0] )) strlcat( the_modes, x, sizeof( the_modes ));
if( Client_ModeAdd( Target, x[0] )) strcat( the_modes, x );
}
else
{
/* Unset mode */
if( Client_ModeDel( Target, x[0] )) strlcat( the_modes, x, sizeof( the_modes ));
if( Client_ModeDel( Target, x[0] )) strcat( the_modes, x );
}
}
client_exit:
@@ -230,8 +229,7 @@ client_exit:
}
Log( LOG_DEBUG, "User \"%s\": Mode change, now \"%s\".", Client_Mask( Target ), Client_Modes( Target ));
}
IRC_SetPenalty( Client, 1 );
return ok;
} /* Client_Mode */
@@ -254,7 +252,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
if( ! Channel_IsMemberOf( Channel, Origin )) return IRC_WriteStrClient( Origin, RPL_CHANNELMODEIS_MSG, Client_ID( Origin ), Channel_Name( Channel ), Channel_Modes( Channel ));
/* The sender is a member: generate extended reply */
strlcpy( the_modes, Channel_Modes( Channel ), sizeof( the_modes ));
strcpy( the_modes, Channel_Modes( Channel ));
mode_ptr = the_modes;
strcpy( the_args, "" );
while( *mode_ptr )
@@ -263,16 +261,16 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
{
case 'l':
snprintf( argadd, sizeof( argadd ), " %ld", Channel_MaxUsers( Channel ));
strlcat( the_args, argadd, sizeof( the_args ));
strcat( the_args, argadd );
break;
case 'k':
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_args, Channel_Key( Channel ), sizeof( the_args ));
strcat( the_args, " " );
strcat( the_args, Channel_Key( Channel ));
break;
}
mode_ptr++;
}
if( the_args[0] ) strlcat( the_modes, the_args, sizeof( the_modes ));
if( the_args[0] ) strcat( the_modes, the_args );
return IRC_WriteStrClient( Origin, RPL_CHANNELMODEIS_MSG, Client_ID( Origin ), Channel_Name( Channel ), the_modes );
}
@@ -342,8 +340,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
else
{
/* Append modifier character to result string */
x[0] = *mode_ptr;
strlcat( the_modes, x, sizeof( the_modes ));
x[0] = *mode_ptr; strcat( the_modes, x );
}
if( *mode_ptr == '+' ) set = TRUE;
else set = FALSE;
@@ -428,7 +425,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
{
Channel_ModeDel( Channel, 'k' );
Channel_SetKey( Channel, Req->argv[arg_arg] );
strlcpy( argadd, Channel_Key( Channel ), sizeof( argadd ));
strcpy( argadd, Channel_Key( Channel ));
x[0] = *mode_ptr;
}
else ok = IRC_WriteStrClient( Origin, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( Origin ), Channel_Name( Channel ));
@@ -454,7 +451,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
{
Channel_ModeDel( Channel, 'l' );
Channel_SetMaxUsers( Channel, l );
snprintf( argadd, sizeof( argadd ), "%ld", l );
sprintf( argadd, "%ld", l );
x[0] = *mode_ptr;
}
}
@@ -525,9 +522,8 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-User-Mode */
if( Channel_UserModeAdd( Channel, client, x[0] ))
{
strlcat( the_args, Client_ID( client ), sizeof( the_args ));
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_modes, x, sizeof( the_modes ));
strcat( the_args, Client_ID( client ));
strcat( the_args, " " ); strcat( the_modes, x );
Log( LOG_DEBUG, "User \"%s\": Mode change on %s, now \"%s\"", Client_Mask( client ), Channel_Name( Channel ), Channel_UserModes( Channel, client ));
}
}
@@ -536,7 +532,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-Mode */
if( Channel_ModeAdd( Channel, x[0] ))
{
strlcat( the_modes, x, sizeof( the_modes ));
strcat( the_modes, x );
Log( LOG_DEBUG, "Channel %s: Mode change, now \"%s\".", Channel_Name( Channel ), Channel_Modes( Channel ));
}
}
@@ -549,9 +545,8 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-User-Mode */
if( Channel_UserModeDel( Channel, client, x[0] ))
{
strlcat( the_args, Client_ID( client ), sizeof( the_args ));
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_modes, x, sizeof( the_modes ));
strcat( the_args, Client_ID( client ));
strcat( the_args, " " ); strcat( the_modes, x );
Log( LOG_DEBUG, "User \"%s\": Mode change on %s, now \"%s\"", Client_Mask( client ), Channel_Name( Channel ), Channel_UserModes( Channel, client ));
}
}
@@ -560,7 +555,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-Mode */
if( Channel_ModeDel( Channel, x[0] ))
{
strlcat( the_modes, x, sizeof( the_modes ));
strcat( the_modes, x );
Log( LOG_DEBUG, "Channel %s: Mode change, now \"%s\".", Channel_Name( Channel ), Channel_Modes( Channel ));
}
}
@@ -569,8 +564,8 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Are there additional arguments to add? */
if( argadd[0] )
{
if( the_args[strlen( the_args ) - 1] != ' ' ) strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_args, argadd, sizeof( the_args ));
if( the_args[strlen( the_args ) - 1] != ' ' ) strcat( the_args, " " );
strcat( the_args, argadd );
}
}
chan_exit:
@@ -599,7 +594,6 @@ chan_exit:
}
}
IRC_SetPenalty( Client, 1 );
return CONNECTED;
} /* Channel_Mode */

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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
@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-op.c,v 1.11.4.1 2003/12/05 13:33:12 alex Exp $";
static char UNUSED id[] = "$Id: irc-op.c,v 1.11 2002/12/12 12:24:18 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -69,14 +69,14 @@ IRC_INVITE( CLIENT *Client, REQUEST *Req )
assert( Client != NULL );
assert( Req != NULL );
/* Wrong number of parameters? */
/* Falsche Anzahl Parameter? */
if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
else from = Client;
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
/* Search user */
/* User suchen */
target = Client_Search( Req->argv[0] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_USER )) return IRC_WriteStrClient( from, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[0] );
@@ -84,38 +84,36 @@ IRC_INVITE( CLIENT *Client, REQUEST *Req )
if( chan )
{
/* Channel exists. Is the user a valid member of the channel? */
/* Der Channel existiert bereits; ist der User Mitglied? */
if( ! Channel_IsMemberOf( chan, from )) return IRC_WriteStrClient( from, ERR_NOTONCHANNEL_MSG, Client_ID( Client ), Req->argv[1] );
/* Is the channel "invite-only"? */
/* Ist der Channel "invite-only"? */
if( strchr( Channel_Modes( chan ), 'i' ))
{
/* Yes. The user must be channel operator! */
/* Ja. Der User muss Channel-Operator sein! */
if( ! strchr( Channel_UserModes( chan, from ), 'o' )) return IRC_WriteStrClient( from, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( from ), Channel_Name( chan ));
remember = TRUE;
}
/* Is the target user already member of the channel? */
/* Ist der Ziel-User bereits Mitglied? */
if( Channel_IsMemberOf( chan, target )) return IRC_WriteStrClient( from, ERR_USERONCHANNEL_MSG, Client_ID( from ), Req->argv[0], Req->argv[1] );
/* If the target user is banned on that channel: remember invite */
if( Lists_CheckBanned( target, chan )) remember = TRUE;
if( remember )
{
/* We must memember this invite */
if( ! Lists_AddInvited( from, Client_Mask( target ), chan, TRUE )) return CONNECTED;
}
}
/* Wenn der User gebanned ist, so muss das Invite auch gespeichert werden */
if( Lists_CheckBanned( target, chan )) remember = TRUE;
Log( LOG_DEBUG, "User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask( from ), Req->argv[0], Req->argv[1] );
if( remember )
{
if( ! Lists_AddInvited( from, Client_Mask( target ), chan, TRUE )) return CONNECTED;
}
/* Inform target client */
/* an Ziel-Client forwarden ... */
IRC_WriteStrClientPrefix( target, from, "INVITE %s %s", Req->argv[0], Req->argv[1] );
if( Client_Conn( target ) > NONE )
{
/* The target user is local, so we have to send the status code */
/* lokaler Ziel-Client, Status-Code melden */
if( ! IRC_WriteStrClientPrefix( from, target, RPL_INVITING_MSG, Client_ID( from ), Req->argv[0], Req->argv[1] )) return DISCONNECTED;
}

View File

@@ -14,17 +14,16 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-oper.c,v 1.17 2002/12/31 16:10:55 alex Exp $";
static char UNUSED id[] = "$Id: irc-oper.c,v 1.13 2002/12/12 12:33:14 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "ngircd.h"
#include "resolve.h"
#include "conn.h"
#include "conf.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
@@ -83,19 +82,16 @@ IRC_OPER( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_DIE( CLIENT *Client, REQUEST *Req )
{
/* Shut down server */
assert( Client != NULL );
assert( Req != NULL );
/* Not a local IRC operator? */
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
/* Bad number of parameters? */
/* Falsche Anzahl Parameter? */
if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
Log( LOG_NOTICE|LOG_snotice, "Got DIE command from \"%s\" ...", Client_Mask( Client ));
NGIRCd_SignalQuit = TRUE;
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
Log( LOG_NOTICE|LOG_snotice, "Got DIE command from \"%s\", going down!", Client_Mask( Client ));
NGIRCd_Quit = TRUE;
return CONNECTED;
} /* IRC_DIE */
@@ -103,19 +99,16 @@ IRC_DIE( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_REHASH( CLIENT *Client, REQUEST *Req )
{
/* Reload configuration file */
assert( Client != NULL );
assert( Req != NULL );
/* Not a local IRC operator? */
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
/* Bad number of parameters? */
/* Falsche Anzahl Parameter? */
if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
Log( LOG_NOTICE|LOG_snotice, "Got REHASH command from \"%s\" ...", Client_Mask( Client ));
NGIRCd_SignalRehash = TRUE;
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
Log( LOG_NOTICE|LOG_snotice, "Got REHASH command from \"%s\", re-reading configuration ...", Client_Mask( Client ));
NGIRCd_Rehash( );
return CONNECTED;
} /* IRC_REHASH */
@@ -124,19 +117,16 @@ IRC_REHASH( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_RESTART( CLIENT *Client, REQUEST *Req )
{
/* Restart IRC server (fork a new process) */
assert( Client != NULL );
assert( Req != NULL );
/* Not a local IRC operator? */
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
/* Bad number of parameters? */
/* Falsche Anzahl Parameter? */
if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
Log( LOG_NOTICE|LOG_snotice, "Got RESTART command from \"%s\" ...", Client_Mask( Client ));
NGIRCd_SignalRestart = TRUE;
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
Log( LOG_NOTICE|LOG_snotice, "Got RESTART command from \"%s\", going down!", Client_Mask( Client ));
NGIRCd_Restart = TRUE;
return CONNECTED;
} /* IRC_RESTART */
@@ -144,64 +134,20 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_CONNECT(CLIENT *Client, REQUEST *Req )
{
/* Connect configured or new server */
/* Vorlaeufige Version zu Debug-Zwecken: es wird einfach
* der "passive mode" aufgehoben, mehr passiert nicht ... */
assert( Client != NULL );
assert( Req != NULL );
/* Not a local IRC operator? */
/* Falsche Anzahl Parameter? */
if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
/* Bad number of parameters? */
if(( Req->argc != 2 ) && ( Req->argc != 5 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Invalid port number? */
if( atoi( Req->argv[1] ) < 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
Log( LOG_NOTICE|LOG_snotice, "Got CONNECT command from \"%s\" for \"%s\".", Client_Mask( Client ), Req->argv[0]);
if( Req->argc == 2 )
{
/* Connect configured server */
if( ! Conf_EnableServer( Req->argv[0], atoi( Req->argv[1] ))) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] );
}
else
{
/* Add server */
if( ! Conf_AddServer( Req->argv[0], atoi( Req->argv[1] ), Req->argv[2], Req->argv[3], Req->argv[4] )) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] );
}
Log( LOG_NOTICE|LOG_snotice, "Got CONNECT command from \"%s\".", Client_Mask( Client ));
NGIRCd_Passive = FALSE;
return CONNECTED;
} /* IRC_CONNECT */
GLOBAL BOOLEAN
IRC_DISCONNECT(CLIENT *Client, REQUEST *Req )
{
/* Disconnect and disable configured server */
CONN_ID my_conn;
assert( Client != NULL );
assert( Req != NULL );
/* Not a local IRC operator? */
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
/* Bad number of parameters? */
if( Req->argc != 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
Log( LOG_NOTICE|LOG_snotice, "Got DISCONNECT command from \"%s\" for0 \"%s\".", Client_Mask( Client ), Req->argv[0]);
/* Save ID of this connection */
my_conn = Client_Conn( Client );
/* Connect configured server */
if( ! Conf_DisableServer( Req->argv[0] )) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] );
/* Are we still connected or were we killed, too? */
if( Client_GetFromConn( my_conn )) return CONNECTED;
else return DISCONNECTED;
} /* IRC_CONNECT */
/* -eof- */

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc-oper.h,v 1.10 2002/12/31 16:11:06 alex Exp $
* $Id: irc-oper.h,v 1.9 2002/12/12 12:23:43 alex Exp $
*
* IRC operator commands (header)
*/
@@ -23,7 +23,6 @@ GLOBAL BOOLEAN IRC_DIE PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_REHASH PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_RESTART PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_CONNECT PARAMS((CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_DISCONNECT PARAMS((CLIENT *Client, REQUEST *Req ));
#endif

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-server.c,v 1.32.2.2 2003/12/26 16:16:48 alex Exp $";
static char UNUSED id[] = "$Id: irc-server.c,v 1.24 2002/12/12 12:24:18 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -23,9 +23,8 @@ static char UNUSED id[] = "$Id: irc-server.c,v 1.32.2.2 2003/12/26 16:16:48 alex
#include <string.h>
#include "resolve.h"
#include "conn.h"
#include "conn-zip.h"
#include "conf.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
@@ -41,7 +40,7 @@ static char UNUSED id[] = "$Id: irc-server.c,v 1.32.2.2 2003/12/26 16:16:48 alex
GLOBAL BOOLEAN
IRC_SERVER( CLIENT *Client, REQUEST *Req )
{
CHAR str[LINE_LEN], *ptr, *modes, *topic;
CHAR str[LINE_LEN], *ptr;
CLIENT *from, *c, *cl;
CL2CHAN *cl2chan;
INT max_hops, i;
@@ -64,8 +63,8 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
if(( Req->argc != 2 ) && ( Req->argc != 3 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Ist dieser Server bei uns konfiguriert? */
for( i = 0; i < MAX_SERVERS; i++ ) if( strcasecmp( Req->argv[0], Conf_Server[i].name ) == 0 ) break;
if( i >= MAX_SERVERS )
for( i = 0; i < Conf_Server_Count; i++ ) if( strcasecmp( Req->argv[0], Conf_Server[i].name ) == 0 ) break;
if( i >= Conf_Server_Count )
{
/* Server ist nicht konfiguriert! */
Log( LOG_ERR, "Connection %d: Server \"%s\" not configured here!", Client_Conn( Client ), Req->argv[0] );
@@ -115,13 +114,13 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" registered (connection %d, 1 hop - direct link).", Client_ID( Client ), con );
Client_SetType( Client, CLIENT_SERVER );
Conf_SetServer( i, con );
Conn_SetServer( con, i );
#ifdef ZLIB
#ifdef USE_ZLIB
/* Kompression initialisieren, wenn erforderlich */
if( strchr( Client_Flags( Client ), 'Z' ))
{
if( ! Zip_InitConn( con ))
if( ! Conn_InitZip( con ))
{
/* Fehler! */
Conn_Close( con, "Can't inizialize compression (zlib)!", NULL, FALSE );
@@ -179,53 +178,33 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
while( chan )
{
#ifdef IRCPLUS
/* Send CHANINFO if the peer supports it */
/* Wenn unterstuetzt, CHANINFO senden */
if( strchr( Client_Flags( Client ), 'C' ))
{
modes = Channel_Modes( chan );
topic = Channel_Topic( chan );
if( *modes || *topic )
{
/* send CHANINFO */
if(( ! strchr( Channel_Modes( chan ), 'k' )) && ( ! strchr( Channel_Modes( chan ), 'l' )) && ( ! *topic ))
{
/* "CHANINFO <chan> +<modes>" */
if( ! IRC_WriteStrClient( Client, "CHANINFO %s +%s", Channel_Name( chan ), modes )) return DISCONNECTED;
}
else if(( ! strchr( Channel_Modes( chan ), 'k' )) && ( ! strchr( Channel_Modes( chan ), 'l' )))
{
/* "CHANINFO <chan> +<modes> :<topic>" */
if( ! IRC_WriteStrClient( Client, "CHANINFO %s +%s :%s", Channel_Name( chan ), modes, topic )) return DISCONNECTED;
}
else
{
/* "CHANINFO <chan> +<modes> <key> <limit> :<topic>" */
if( ! IRC_WriteStrClient( Client, "CHANINFO %s +%s %s %ld :%s", Channel_Name( chan ), modes, strchr( Channel_Modes( chan ), 'k' ) ? Channel_Key( chan ) : "*", strchr( Channel_Modes( chan ), 'l' ) ? Channel_MaxUsers( chan ) : 0L, topic )) return DISCONNECTED;
}
}
/* CHANINFO senden */
if( ! IRC_WriteStrClient( Client, "CHANINFO %s +%s :%s", Channel_Name( chan ), Channel_Modes( chan ), Channel_Topic( chan ))) return DISCONNECTED;
}
#endif
/* alle Member suchen */
cl2chan = Channel_FirstMember( chan );
snprintf( str, sizeof( str ), "NJOIN %s :", Channel_Name( chan ));
sprintf( str, "NJOIN %s :", Channel_Name( chan ));
while( cl2chan )
{
cl = Channel_GetClient( cl2chan );
assert( cl != NULL );
/* Nick, ggf. mit Modes, anhaengen */
if( str[strlen( str ) - 1] != ':' ) strlcat( str, ",", sizeof( str ));
if( strchr( Channel_UserModes( chan, cl ), 'v' )) strlcat( str, "+", sizeof( str ));
if( strchr( Channel_UserModes( chan, cl ), 'o' )) strlcat( str, "@", sizeof( str ));
strlcat( str, Client_ID( cl ), sizeof( str ));
if( str[strlen( str ) - 1] != ':' ) strcat( str, "," );
if( strchr( Channel_UserModes( chan, cl ), 'v' )) strcat( str, "+" );
if( strchr( Channel_UserModes( chan, cl ), 'o' )) strcat( str, "@" );
strcat( str, Client_ID( cl ));
if( strlen( str ) > ( LINE_LEN - CLIENT_NICK_LEN - 8 ))
{
/* Zeile senden */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
snprintf( str, sizeof( str ), "NJOIN %s :", Channel_Name( chan ));
sprintf( str, "NJOIN %s :", Channel_Name( chan ));
}
cl2chan = Channel_NextMember( chan, cl2chan );
@@ -278,7 +257,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
}
/* Log-Meldung zusammenbauen und ausgeben */
if(( Client_Hops( c ) > 1 ) && ( Req->prefix[0] )) snprintf( str, sizeof( str ), "connected to %s, ", Client_ID( from ));
if(( Client_Hops( c ) > 1 ) && ( Req->prefix[0] )) sprintf( str, "connected to %s, ", Client_ID( from ));
else strcpy( str, "" );
Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" registered (via %s, %s%d hop%s).", Client_ID( c ), Client_ID( Client ), str, Client_Hops( c ), Client_Hops( c ) > 1 ? "s": "" );
@@ -294,7 +273,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_NJOIN( CLIENT *Client, REQUEST *Req )
{
CHAR nick_in[COMMAND_LEN], nick_out[COMMAND_LEN], *channame, *ptr, modes[8];
CHAR str[COMMAND_LEN], *channame, *ptr, modes[8];
BOOLEAN is_op, is_voiced;
CHANNEL *chan;
CLIENT *c;
@@ -305,11 +284,11 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
/* Falsche Anzahl Parameter? */
if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
strlcpy( nick_in, Req->argv[1], sizeof( nick_in ));
strcpy( nick_out, "" );
strncpy( str, Req->argv[1], COMMAND_LEN - 1 );
str[COMMAND_LEN - 1] = '\0';
channame = Req->argv[0];
ptr = strtok( nick_in, "," );
ptr = strtok( str, "," );
while( ptr )
{
is_op = is_voiced = FALSE;
@@ -336,17 +315,12 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
IRC_WriteStrChannelPrefix( Client, chan, c, FALSE, "JOIN :%s", channame );
/* Channel-User-Modes setzen */
strlcpy( modes, Channel_UserModes( chan, c ), sizeof( modes ));
strcpy( modes, Channel_UserModes( chan, c ));
if( modes[0] )
{
/* Modes im Channel bekannt machen */
IRC_WriteStrChannelPrefix( Client, chan, Client, FALSE, "MODE %s +%s %s", channame, modes, Client_ID( c ));
}
if( nick_out[0] != '\0' ) strlcat( nick_out, ",", sizeof( nick_out ));
if( is_op ) strlcat( nick_out, "@", sizeof( nick_out ));
if( is_voiced ) strlcat( nick_out, "+", sizeof( nick_out ));
strlcat( nick_out, ptr, sizeof( nick_out ));
}
else Log( LOG_ERR, "Got NJOIN for unknown nick \"%s\" for channel \"%s\"!", ptr, channame );
@@ -355,7 +329,7 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
}
/* an andere Server weiterleiten */
if( nick_out[0] != '\0' ) IRC_WriteStrServersPrefix( Client, Client_ThisServer( ), "NJOIN %s :%s", Req->argv[0], nick_out );
IRC_WriteStrServersPrefix( Client, Client_ThisServer( ), "NJOIN %s :%s", Req->argv[0], Req->argv[1] );
return CONNECTED;
} /* IRC_NJOIN */
@@ -386,9 +360,9 @@ IRC_SQUIT( CLIENT *Client, REQUEST *Req )
if( Req->argv[1][0] )
{
if( strlen( Req->argv[1] ) > LINE_LEN ) Req->argv[1][LINE_LEN] = '\0';
snprintf( msg, sizeof( msg ), "%s (SQUIT from %s).", Req->argv[1], Client_ID( Client ));
sprintf( msg, "%s (SQUIT from %s).", Req->argv[1], Client_ID( Client ));
}
else snprintf( msg, sizeof( msg ), "Got SQUIT from %s.", Client_ID( Client ));
else sprintf( msg, "Got SQUIT from %s.", Client_ID( Client ));
if( Client_Conn( target ) > NONE )
{

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-write.c,v 1.14.2.1 2003/11/07 20:51:11 alex Exp $";
static char UNUSED id[] = "$Id: irc-write.c,v 1.13 2002/12/12 12:24:18 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -22,7 +22,7 @@ static char UNUSED id[] = "$Id: irc-write.c,v 1.14.2.1 2003/11/07 20:51:11 alex
#include <stdio.h>
#include <string.h>
#include "conn-func.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "defines.h"
@@ -395,21 +395,6 @@ va_dcl
} /* IRC_WriteStrRelatedPrefix */
GLOBAL VOID
IRC_SetPenalty( CLIENT *Client, INT Seconds )
{
CONN_ID c;
assert( Client != NULL );
assert( Seconds > 0 );
if( Client_Type( Client ) == CLIENT_SERVER ) return;
c = Client_Conn( Client );
if( c > NONE ) Conn_SetPenalty( c, Seconds );
} /* IRC_SetPenalty */
LOCAL CHAR *
Get_Prefix( CLIENT *Target, CLIENT *Client )
{

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc-write.h,v 1.5.4.1 2003/11/07 20:51:11 alex Exp $
* $Id: irc-write.h,v 1.5 2002/12/12 12:23:43 alex Exp $
*
* Sending IRC commands over the network (header)
*/
@@ -18,19 +18,17 @@
#define __irc_write_h__
GLOBAL BOOLEAN IRC_WriteStrClient PARAMS(( CLIENT *Client, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrClientPrefix PARAMS(( CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrClient PARAMS((CLIENT *Client, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrClientPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrChannel PARAMS(( CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrChannelPrefix PARAMS(( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrChannel PARAMS((CLIENT *Client, CHANNEL *Chan, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrChannelPrefix PARAMS((CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServers PARAMS(( CLIENT *ExceptOf, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServersPrefix PARAMS(( CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServersPrefixFlag PARAMS(( CLIENT *ExceptOf, CLIENT *Prefix, CHAR Flag, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServers PARAMS((CLIENT *ExceptOf, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServersPrefix PARAMS((CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... ));
GLOBAL VOID IRC_WriteStrServersPrefixFlag PARAMS((CLIENT *ExceptOf, CLIENT *Prefix, CHAR Flag, CHAR *Format, ... ));
GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix PARAMS(( CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL VOID IRC_SetPenalty PARAMS(( CLIENT *Client, INT Seconds ));
GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
#endif

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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
@@ -14,18 +14,14 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc.c,v 1.120.2.3 2003/12/26 16:16:48 alex Exp $";
static char UNUSED id[] = "$Id: irc.c,v 1.107.2.3 2002/12/31 15:48:33 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "ngircd.h"
#include "conn.h"
#include "resolve.h"
#include "conf.h"
#include "conn-func.h"
#include "client.h"
#include "channel.h"
#include "defines.h"
@@ -38,9 +34,6 @@ static char UNUSED id[] = "$Id: irc.c,v 1.120.2.3 2003/12/26 16:16:48 alex Exp $
#include "irc.h"
LOCAL CHAR *Option_String PARAMS(( CONN_ID Idx ));
GLOBAL BOOLEAN
IRC_ERROR( CLIENT *Client, REQUEST *Req )
{
@@ -78,59 +71,31 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
prefix = Client_ThisServer( );
}
if( Client != Client_ThisServer( )) Log( LOG_NOTICE|LOG_snotice, "Got KILL command from \"%s\" for \"%s\": %s", Client_Mask( prefix ), Req->argv[0], Req->argv[1] );
Log( LOG_NOTICE|LOG_snotice, "Got KILL command from \"%s\" for \"%s\": %s", Client_Mask( prefix ), Req->argv[0], Req->argv[1] );
/* Build reason string */
if( Client_Type( Client ) == CLIENT_USER ) snprintf( reason, sizeof( reason ), "KILLed by %s: %s", Client_ID( Client ), Req->argv[1] );
else strlcpy( reason, Req->argv[1], sizeof( reason ));
if( Client_Type( Client ) == CLIENT_USER ) sprintf( reason, "KILLed by %s: %s", Client_ID( Client ), Req->argv[1] );
else strcpy( reason, Req->argv[1] );
/* Inform other servers */
IRC_WriteStrServersPrefix( Client, prefix, "KILL %s :%s", Req->argv[0], reason );
/* Save ID of this connection */
my_conn = Client_Conn( Client );
/* Do we host such a client? */
c = Client_Search( Req->argv[0] );
if( c )
if( c && Client_Type( c ) == CLIENT_USER )
{
/* Yes, there is such a client -- but is it a valid user? */
if( Client_Type( c ) == CLIENT_SERVER )
{
if( Client != Client_ThisServer( )) IRC_WriteStrClient( Client, ERR_CANTKILLSERVER_MSG, Client_ID( Client ));
else
{
/* Oops, I should kill another server!? */
Log( LOG_ERR, "Can't KILL server \"%s\"!", Req->argv[0] );
conn = Client_Conn( Client_NextHop( c ));
assert( conn > NONE );
Conn_Close( conn, NULL, "Nick collision for server!?", TRUE );
}
}
else if( Client_Type( c ) != CLIENT_USER )
{
if( Client != Client_ThisServer( )) IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
else
{
/* Oops, what sould I close?? */
Log( LOG_ERR, "Can't KILL \"%s\": invalid client type!", Req->argv[0] );
conn = Client_Conn( Client_NextHop( c ));
assert( conn > NONE );
Conn_Close( conn, NULL, "Collision for invalid client type!?", TRUE );
}
}
else
{
/* Kill user NOW! */
conn = Client_Conn( c );
Client_Destroy( c, NULL, reason, FALSE );
if( conn != NONE ) Conn_Close( conn, NULL, reason, TRUE );
}
/* Yes, I found it! */
conn = Client_Conn( c );
Client_Destroy( c, NULL, reason, FALSE );
if( conn != NONE ) Conn_Close( Client_Conn( c ), NULL, reason, TRUE );
}
else Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
/* Are we still connected or were we killed, too? */
if(( my_conn > NONE ) && ( Client_GetFromConn( my_conn ))) return CONNECTED;
if( Client_GetFromConn( my_conn )) return CONNECTED;
else return DISCONNECTED;
} /* IRC_KILL */
@@ -205,109 +170,4 @@ IRC_PRIVMSG( CLIENT *Client, REQUEST *Req )
} /* IRC_PRIVMSG */
GLOBAL BOOLEAN
IRC_TRACE( CLIENT *Client, REQUEST *Req )
{
CLIENT *from, *target, *c;
CONN_ID idx, idx2;
assert( Client != NULL );
assert( Req != NULL );
/* Bad number of arguments? */
if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
/* Search sender */
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
else from = Client;
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
/* Search target */
if( Req->argc == 1 ) target = Client_Search( Req->argv[0] );
else target = Client_ThisServer( );
/* Forward command to other server? */
if( target != Client_ThisServer( ))
{
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
/* Send RPL_TRACELINK back to initiator */
idx = Client_Conn( Client ); assert( idx > NONE );
idx2 = Client_Conn( Client_NextHop( target )); assert( idx2 > NONE );
if( ! IRC_WriteStrClient( from, RPL_TRACELINK_MSG, Client_ID( from ), PACKAGE_NAME, PACKAGE_VERSION, Client_ID( target ), Client_ID( Client_NextHop( target )), Option_String( idx2 ), time( NULL ) - Conn_StartTime( idx2 ), Conn_SendQ( idx ), Conn_SendQ( idx2 ))) return DISCONNECTED;
/* Forward command */
IRC_WriteStrClientPrefix( target, from, "TRACE %s", Req->argv[0] );
return CONNECTED;
}
/* Infos about all connected servers */
c = Client_First( );
while( c )
{
if( Client_Conn( c ) > NONE )
{
/* Local client */
if( Client_Type( c ) == CLIENT_SERVER )
{
/* Server link */
if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Client_ID( c ), Client_Mask( c ), Option_String( Client_Conn( c )))) return DISCONNECTED;
}
if(( Client_Type( c ) == CLIENT_USER ) && ( strchr( Client_Modes( c ), 'o' )))
{
/* IRC Operator */
if( ! IRC_WriteStrClient( from, RPL_TRACEOPERATOR_MSG, Client_ID( from ), Client_ID( c ))) return DISCONNECTED;
}
}
c = Client_Next( c );
}
/* Some information about us */
if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Conf_ServerName, Client_Mask( Client_ThisServer( )), Option_String( Client_Conn( Client )))) return DISCONNECTED;
IRC_SetPenalty( Client, 3 );
return IRC_WriteStrClient( from, RPL_TRACEEND_MSG, Client_ID( from ), Conf_ServerName, PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel );
} /* IRC_TRACE */
GLOBAL BOOLEAN
IRC_HELP( CLIENT *Client, REQUEST *Req )
{
COMMAND *cmd;
assert( Client != NULL );
assert( Req != NULL );
/* Bad number of arguments? */
if( Req->argc > 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
cmd = Parse_GetCommandStruct( );
while( cmd->name )
{
if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED;
cmd++;
}
IRC_SetPenalty( Client, 2 );
return CONNECTED;
} /* IRC_HELP */
LOCAL CHAR *
Option_String( CONN_ID Idx )
{
STATIC CHAR option_txt[8];
INT options;
options = Conn_Options( Idx );
strcpy( option_txt, "F" ); /* No idea what this means but the original ircd sends it ... */
#ifdef ZLIB
if( options & CONN_ZIP ) strcat( option_txt, "z" );
#endif
return option_txt;
} /* Option_String */
/* -eof- */

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: irc.h,v 1.38 2003/01/15 13:49:20 alex Exp $
* $Id: irc.h,v 1.36 2002/12/12 12:23:43 alex Exp $
*
* IRC commands (header)
*/
@@ -22,8 +22,6 @@ GLOBAL BOOLEAN IRC_ERROR PARAMS(( CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_KILL PARAMS(( CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_NOTICE PARAMS(( CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_PRIVMSG PARAMS(( CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_TRACE PARAMS(( CLIENT *Client, REQUEST *Req ));
GLOBAL BOOLEAN IRC_HELP PARAMS(( CLIENT *Client, REQUEST *Req ));
#endif

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: lists.c,v 1.11 2002/12/26 16:25:43 alex Exp $";
static char UNUSED id[] = "$Id: lists.c,v 1.10 2002/12/12 12:24:18 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -331,17 +331,19 @@ Lists_MakeMask( CHAR *Pattern )
if(( ! at ) && ( ! excl ))
{
/* weder ! noch @ vorhanden: als Nick annehmen */
strlcpy( TheMask, Pattern, sizeof( TheMask ) - 5 );
strlcat( TheMask, "!*@*", sizeof( TheMask ));
/* weder ! noch @<EFBFBD>vorhanden: als Nick annehmen */
strncpy( TheMask, Pattern, MASK_LEN - 5 );
TheMask[MASK_LEN - 5] = '\0';
strcat( TheMask, "!*@*" );
return TheMask;
}
if(( ! at ) && ( excl ))
{
/* Domain fehlt */
strlcpy( TheMask, Pattern, sizeof( TheMask ) - 3 );
strlcat( TheMask, "@*", sizeof( TheMask ));
strncpy( TheMask, Pattern, MASK_LEN - 3 );
TheMask[MASK_LEN - 3] = '\0';
strcat( TheMask, "@*" );
return TheMask;
}
@@ -349,14 +351,17 @@ Lists_MakeMask( CHAR *Pattern )
{
/* User fehlt */
*at = '\0'; at++;
strlcpy( TheMask, Pattern, sizeof( TheMask ) - strlen( at ) - 4 );
strlcat( TheMask, "!*@", sizeof( TheMask ));
strlcat( TheMask, at, sizeof( TheMask ));
strncpy( TheMask, Pattern, MASK_LEN - 4 );
TheMask[MASK_LEN - 4] = '\0';
strcat( TheMask, "!*@" );
strncat( TheMask, at, strlen( TheMask ) - MASK_LEN - 1 );
TheMask[MASK_LEN - 1] = '\0';
return TheMask;
}
/* alle Teile vorhanden */
strlcpy( TheMask, Pattern, sizeof( TheMask ));
strncpy( TheMask, Pattern, MASK_LEN - 1 );
TheMask[MASK_LEN - 1] = '\0';
return TheMask;
} /* Lists_MakeMask */
@@ -377,7 +382,7 @@ New_C2C( CHAR *Mask, CHANNEL *Chan, BOOLEAN OnlyOnce )
return NULL;
}
strlcpy( c2c->mask, Mask, sizeof( c2c->mask ));
strncpy( c2c->mask, Mask, MASK_LEN );
c2c->channel = Chan;
c2c->onlyonce = OnlyOnce;

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: log.c,v 1.43.2.1 2003/12/26 16:16:48 alex Exp $";
static char UNUSED id[] = "$Id: log.c,v 1.41 2002/12/12 12:24:18 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -25,7 +25,7 @@ static char UNUSED id[] = "$Id: log.c,v 1.43.2.1 2003/12/26 16:16:48 alex Exp $"
#include <sys/types.h>
#include <unistd.h>
#ifdef SYSLOG
#ifdef USE_SYSLOG
#include <syslog.h>
#endif
@@ -50,9 +50,9 @@ LOCAL VOID Wall_ServerNotice PARAMS(( CHAR *Msg ));
GLOBAL VOID
Log_Init( VOID )
{
#ifdef SYSLOG
#ifdef USE_SYSLOG
/* Syslog initialisieren */
openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
openlog( PACKAGE, LOG_CONS|LOG_PID, LOG_LOCAL5 );
#endif
/* Hello World! */
@@ -95,7 +95,7 @@ Log_InitErrorfile( VOID )
* landen z.B. alle Ausgaben von assert()-Aufrufen. */
/* Dateiname zusammen bauen */
sprintf( Error_File, "%s/%s-%ld.err", ERROR_DIR, PACKAGE_NAME, (LONG)getpid( ));
sprintf( Error_File, "%s/%s-%ld.err", ERROR_DIR, PACKAGE, (LONG)getpid( ));
/* stderr umlenken */
fflush( stderr );
@@ -119,13 +119,13 @@ GLOBAL VOID
Log_Exit( VOID )
{
/* Good Bye! */
if( NGIRCd_SignalRestart ) Log( LOG_NOTICE, "%s done (restarting).", PACKAGE_NAME );
else Log( LOG_NOTICE, "%s done.", PACKAGE_NAME );
if( NGIRCd_Restart ) Log( LOG_NOTICE, "%s done (restarting).", PACKAGE );
else Log( LOG_NOTICE, "%s done.", PACKAGE );
/* Error-File (stderr) loeschen */
if( unlink( Error_File ) != 0 ) Log( LOG_ERR, "Can't delete \"%s\": %s", Error_File, strerror( errno ));
#ifdef SYSLOG
#ifdef USE_SYSLOG
/* syslog abmelden */
closelog( );
#endif
@@ -180,7 +180,7 @@ va_dcl
fprintf( stdout, "[%d] %s\n", Level, msg );
fflush( stdout );
}
#ifdef SYSLOG
#ifdef USE_SYSLOG
else
{
/* Syslog */
@@ -206,8 +206,8 @@ va_dcl
GLOBAL VOID
Log_Init_Resolver( VOID )
{
#ifdef SYSLOG
openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
#ifdef USE_SYSLOG
openlog( PACKAGE, LOG_CONS|LOG_PID, LOG_LOCAL5 );
#endif
} /* Log_Init_Resolver */
@@ -215,7 +215,7 @@ Log_Init_Resolver( VOID )
GLOBAL VOID
Log_Exit_Resolver( VOID )
{
#ifdef SYSLOG
#ifdef USE_SYSLOG
closelog( );
#endif
} /* Log_Exit_Resolver */
@@ -234,7 +234,7 @@ va_dcl
{
/* Eintrag des Resolver in Logfile(s) schreiben */
#ifndef SYSLOG
#ifndef USE_SYSLOG
return;
#else

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: log.h,v 1.13.4.1 2003/12/26 16:16:48 alex Exp $
* $Id: log.h,v 1.13 2002/12/12 12:23:43 alex Exp $
*
* Logging functions (header)
*/
@@ -18,7 +18,7 @@
#define __log_h__
#ifdef SYSLOG
#ifdef USE_SYSLOG
# include <syslog.h>
#else
# define LOG_EMERG 0

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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
@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: messages.h,v 1.64.2.1 2003/12/26 16:16:48 alex Exp $
* $Id: messages.h,v 1.59.2.1 2002/12/22 23:42:28 alex Exp $
*
* IRC numerics (Header)
*/
@@ -22,11 +22,7 @@
#define RPL_YOURHOST_MSG "002 %s :Your host is %s, running version ngircd-%s (%s/%s/%s)"
#define RPL_CREATED_MSG "003 %s :This server has been started %s"
#define RPL_MYINFO_MSG "004 %s %s ngircd-%s %s %s"
#define RPL_ISUPPORT_MSG "005 %s NICKLEN=%d TOPICLEN=%d AWAYLEN=%d MAXCHANNELS=%d :are supported on this server"
#define RPL_TRACELINK_MSG "200 %s Link %s-%s %s %s V%s %ld %d %d"
#define RPL_TRACEOPERATOR_MSG "204 %s Oper 2 :%s"
#define RPL_TRACESERVER_MSG "206 %s Serv 1 0S 0C %s *!*@%s :V%s"
#define RPL_FEATURE_MSG "005 %s NICKLEN=%d TOPICLEN=%d AWAYLEN=%d MAXCHANNELS=%d :are supported on this server"
#define RPL_STATSLINKINFO_MSG "211 %s %s %d %ld %ld %ld %ld :%ld"
#define RPL_STATSCOMMANDS_MSG "212 %s %s %ld %ld %ld"
#define RPL_ENDOFSTATS_MSG "219 %s %c :End of STATS report"
@@ -40,7 +36,6 @@
#define RPL_ADMINLOC1_MSG "257 %s :%s"
#define RPL_ADMINLOC2_MSG "258 %s :%s"
#define RPL_ADMINEMAIL_MSG "259 %s :%s"
#define RPL_TRACEEND_MSG "262 %s %s %s-%s.%s :End of TRACE"
#define RPL_LOCALUSERS_MSG "265 %s :Current local users: %ld, Max: %ld"
#define RPL_NETUSERS_MSG "266 %s :Current global users: %ld, Max: %ld"
@@ -109,7 +104,6 @@
#define ERR_BADCHANNELKEY_MSG "475 %s %s :Cannot join channel (+k)"
#define ERR_NOPRIVILEGES_MSG "481 %s :Permission denied"
#define ERR_CHANOPRIVSNEEDED_MSG "482 %s %s :You are not channel operator"
#define ERR_CANTKILLSERVER_MSG "483 %s :You can't kill a server!"
#define ERR_RESTRICTED_MSG "484 %s :Your connection is restricted"
#define ERR_NOOPERHOST_MSG "491 %s :Not configured for your host"
@@ -117,7 +111,7 @@
#define ERR_UMODEUNKNOWNFLAG2_MSG "501 %s :Unknown mode \"%c%c\""
#define ERR_USERSDONTMATCH_MSG "502 %s :Can't set/get mode for other users"
#ifdef ZLIB
#ifdef USE_ZLIB
#define RPL_STATSLINKINFOZIP_MSG "211 %s %s %d %ld %ld/%ld %ld %ld/%ld :%ld"
#endif

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2004 by Alexander Barton (alex@barton.de)
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
*
* 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
@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: ngircd.c,v 1.76.2.3 2004/01/02 19:24:46 alex Exp $";
static char UNUSED id[] = "$Id: ngircd.c,v 1.64.2.1 2003/01/01 13:47:42 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -43,10 +43,6 @@ static char UNUSED id[] = "$Id: ngircd.c,v 1.76.2.3 2004/01/02 19:24:46 alex Exp
#include "parse.h"
#include "irc.h"
#ifdef RENDEZVOUS
#include "rendezvous.h"
#endif
#include "exp.h"
#include "ngircd.h"
@@ -69,16 +65,17 @@ main( int argc, const char *argv[] )
umask( 0077 );
NGIRCd_SignalQuit = NGIRCd_SignalRestart = NGIRCd_SignalRehash = FALSE;
NGIRCd_NoDaemon = NGIRCd_Passive = FALSE;
NGIRCd_Restart = FALSE;
NGIRCd_Quit = FALSE;
NGIRCd_NoDaemon = FALSE;
NGIRCd_Passive = FALSE;
#ifdef DEBUG
NGIRCd_Debug = FALSE;
#endif
#ifdef SNIFFER
NGIRCd_Sniffer = FALSE;
#endif
strlcpy( NGIRCd_ConfFile, SYSCONFDIR, sizeof( NGIRCd_ConfFile ));
strlcat( NGIRCd_ConfFile, CONFIG_FILE, sizeof( NGIRCd_ConfFile ));
strcpy( NGIRCd_ConfFile, CONFIG_FILE );
/* Kommandozeile parsen */
for( i = 1; i < argc; i++ )
@@ -92,10 +89,11 @@ main( int argc, const char *argv[] )
{
if( i + 1 < argc )
{
/* Ok, there's an parameter left */
strlcpy( NGIRCd_ConfFile, argv[i + 1], sizeof( NGIRCd_ConfFile ));
/* Ok, danach kommt noch ein Parameter */
strncpy( NGIRCd_ConfFile, argv[i + 1], FNAME_LEN - 1 );
NGIRCd_ConfFile[FNAME_LEN - 1] = '\0';
/* next parameter */
/* zum uebernaechsten Parameter */
i++; ok = TRUE;
}
}
@@ -158,10 +156,11 @@ main( int argc, const char *argv[] )
{
if(( ! argv[i][n + 1] ) && ( i + 1 < argc ))
{
/* Ok, next character is a blank */
strlcpy( NGIRCd_ConfFile, argv[i + 1], sizeof( NGIRCd_ConfFile ));
/* Ok, danach kommt ein Leerzeichen */
strncpy( NGIRCd_ConfFile, argv[i + 1], FNAME_LEN - 1 );
NGIRCd_ConfFile[FNAME_LEN - 1] = '\0';
/* go to the following parameter */
/* zum uebernaechsten Parameter */
i++; n = (LONG)strlen( argv[i] );
ok = TRUE;
}
@@ -186,8 +185,8 @@ main( int argc, const char *argv[] )
if( ! ok )
{
printf( "%s: invalid option \"-%c\"!\n", PACKAGE_NAME, argv[i][n] );
printf( "Try \"%s --help\" for more information.\n", PACKAGE_NAME );
printf( "%s: invalid option \"-%c\"!\n", PACKAGE, argv[i][n] );
printf( "Try \"%s --help\" for more information.\n", PACKAGE );
exit( 1 );
}
}
@@ -195,8 +194,8 @@ main( int argc, const char *argv[] )
}
if( ! ok )
{
printf( "%s: invalid option \"%s\"!\n", PACKAGE_NAME, argv[i] );
printf( "Try \"%s --help\" for more information.\n", PACKAGE_NAME );
printf( "%s: invalid option \"%s\"!\n", PACKAGE, argv[i] );
printf( "Try \"%s --help\" for more information.\n", PACKAGE );
exit( 1 );
}
}
@@ -221,7 +220,7 @@ main( int argc, const char *argv[] )
exit( Conf_Test( ));
}
while( ! NGIRCd_SignalQuit )
while( ! NGIRCd_Quit )
{
/* In der Regel wird ein Sub-Prozess ge-fork()'t, der
* nicht mehr mit dem Terminal verbunden ist. Mit der
@@ -239,7 +238,7 @@ main( int argc, const char *argv[] )
if( pid < 0 )
{
/* Fehler */
printf( "%s: Can't fork: %s!\nFatal error, exiting now ...\n", PACKAGE_NAME, strerror( errno ));
printf( "%s: Can't fork: %s!\nFatal error, exiting now ...\n", PACKAGE, strerror( errno ));
exit( 1 );
}
@@ -251,9 +250,8 @@ main( int argc, const char *argv[] )
/* Globale Variablen initialisieren */
NGIRCd_Start = time( NULL );
(VOID)strftime( NGIRCd_StartStr, 64, "%a %b %d %Y at %H:%M:%S (%Z)", localtime( &NGIRCd_Start ));
NGIRCd_SignalRehash = FALSE;
NGIRCd_SignalRestart = FALSE;
NGIRCd_SignalQuit = FALSE;
NGIRCd_Restart = FALSE;
NGIRCd_Quit = FALSE;
/* Module initialisieren */
Log_Init( );
@@ -262,9 +260,6 @@ main( int argc, const char *argv[] )
Lists_Init( );
Channel_Init( );
Client_Init( );
#ifdef RENDEZVOUS
Rendezvous_Init( );
#endif
Conn_Init( );
/* Wenn als root ausgefuehrt und eine andere UID
@@ -297,16 +292,16 @@ main( int argc, const char *argv[] )
* beim PASS-Befehl verwendete Syntax sowie die erweiterten Flags
* sind in doc/Protocol.txt beschrieben. */
#ifdef IRCPLUS
sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION, IRCPLUSFLAGS );
#ifdef ZLIB
sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGE, VERSION, IRCPLUSFLAGS );
#ifdef USE_ZLIB
strcat( NGIRCd_ProtoID, "Z" );
#endif
if( Conf_OperCanMode ) strcat( NGIRCd_ProtoID, "o" );
#else
sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGE_NAME, PACKAGE_VERSION );
sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGE, VERSION );
#endif
strcat( NGIRCd_ProtoID, " P" );
#ifdef ZLIB
#ifdef USE_ZLIB
strcat( NGIRCd_ProtoID, "Z" );
#endif
Log( LOG_DEBUG, "Protocol and server ID is \"%s\".", NGIRCd_ProtoID );
@@ -318,7 +313,7 @@ main( int argc, const char *argv[] )
if( Conn_InitListeners( ) < 1 )
{
Log( LOG_ALERT, "Server isn't listening on a single port!" );
Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
exit( 1 );
}
@@ -327,9 +322,6 @@ main( int argc, const char *argv[] )
/* Alles abmelden */
Conn_Exit( );
#ifdef RENDEZVOUS
Rendezvous_Exit( );
#endif
Client_Exit( );
Channel_Exit( );
Lists_Exit( );
@@ -346,9 +338,9 @@ NGIRCd_Version( VOID )
STATIC CHAR version[126];
#ifdef CVSDATE
sprintf( version, "%s %s(%s)-%s", PACKAGE_NAME, PACKAGE_VERSION, CVSDATE, NGIRCd_VersionAddition( ));
sprintf( version, "%s %s(%s)-%s", PACKAGE, VERSION, CVSDATE, NGIRCd_VersionAddition( ));
#else
sprintf( version, "%s %s-%s", PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_VersionAddition( ));
sprintf( version, "%s %s-%s", PACKAGE, VERSION, NGIRCd_VersionAddition( ));
#endif
return version;
} /* NGIRCd_Version */
@@ -357,26 +349,18 @@ NGIRCd_Version( VOID )
GLOBAL CHAR *
NGIRCd_VersionAddition( VOID )
{
STATIC CHAR txt[200];
STATIC CHAR txt[64];
strcpy( txt, "" );
#ifdef SYSLOG
#ifdef USE_SYSLOG
if( txt[0] ) strcat( txt, "+" );
strcat( txt, "SYSLOG" );
#endif
#ifdef ZLIB
#ifdef USE_ZLIB
if( txt[0] ) strcat( txt, "+" );
strcat( txt, "ZLIB" );
#endif
#ifdef TCPWRAP
if( txt[0] ) strcat( txt, "+" );
strcat( txt, "TCPWRAP" );
#endif
#ifdef RENDEZVOUS
if( txt[0] ) strcat( txt, "+" );
strcat( txt, "RENDEZVOUS" );
#endif
#ifdef DEBUG
if( txt[0] ) strcat( txt, "+" );
strcat( txt, "DEBUG" );
@@ -394,12 +378,12 @@ NGIRCd_VersionAddition( VOID )
strcat( txt, "IRCPLUS" );
#endif
if( txt[0] ) strlcat( txt, "-", sizeof( txt ));
strlcat( txt, TARGET_CPU, sizeof( txt ));
strlcat( txt, "/", sizeof( txt ));
strlcat( txt, TARGET_VENDOR, sizeof( txt ));
strlcat( txt, "/", sizeof( txt ));
strlcat( txt, TARGET_OS, sizeof( txt ));
if( txt[0] ) strcat( txt, "-" );
strcat( txt, TARGET_CPU );
strcat( txt, "/" );
strcat( txt, TARGET_VENDOR );
strcat( txt, "/" );
strcat( txt, TARGET_OS );
return txt;
} /* NGIRCd_VersionAddition */
@@ -409,21 +393,15 @@ GLOBAL VOID
NGIRCd_Rehash( VOID )
{
CHAR old_name[CLIENT_ID_LEN];
Log( LOG_NOTICE|LOG_snotice, "Re-reading configuration NOW!" );
NGIRCd_SignalRehash = FALSE;
/* Alle Listen-Sockets schliessen */
Conn_ExitListeners( );
/* Alten Server-Namen merken */
#ifdef DEBUG
assert( sizeof( old_name ) == sizeof( Conf_ServerName ));
#endif
strcpy( old_name, Conf_ServerName );
/* Konfiguration neu lesen ... */
Conf_Rehash( );
Conf_Init( );
/* Alten Server-Namen wiederherstellen: dieser
* kann nicht zur Laufzeit geaendert werden ... */
@@ -439,10 +417,7 @@ NGIRCd_Rehash( VOID )
/* Listen-Sockets neu anlegen: */
Conn_InitListeners( );
/* Sync configuration with established connections */
Conn_SyncServerStruct( );
Log( LOG_NOTICE|LOG_snotice, "Re-reading of configuration done." );
Log( LOG_INFO, "Re-reading of configuration done." );
} /* NGIRCd_Rehash */
@@ -506,21 +481,23 @@ Signal_Handler( INT Signal )
case SIGINT:
case SIGQUIT:
/* wir soll(t)en uns wohl beenden ... */
NGIRCd_SignalQuit = TRUE;
if( Signal == SIGTERM ) Log( LOG_WARNING|LOG_snotice, "Got TERM signal, terminating now ..." );
else if( Signal == SIGINT ) Log( LOG_WARNING|LOG_snotice, "Got INT signal, terminating now ..." );
else if( Signal == SIGQUIT ) Log( LOG_WARNING|LOG_snotice, "Got QUIT signal, terminating now ..." );
NGIRCd_Quit = TRUE;
break;
case SIGHUP:
/* Konfiguration neu einlesen: */
NGIRCd_SignalRehash = TRUE;
Log( LOG_WARNING|LOG_snotice, "Got HUP signal, re-reading configuration ..." );
NGIRCd_Rehash( );
break;
case SIGCHLD:
/* Child-Prozess wurde beendet. Zombies vermeiden: */
while( waitpid( -1, NULL, WNOHANG ) > 0);
break;
#ifdef DEBUG
default:
/* unbekanntes bzw. unbehandeltes Signal */
Log( LOG_DEBUG, "Got signal %d! Ignored.", Signal );
#endif
Log( LOG_NOTICE, "Got signal %d! Ignored.", Signal );
}
} /* Signal_Handler */
@@ -529,7 +506,7 @@ LOCAL VOID
Show_Version( VOID )
{
puts( NGIRCd_Version( ));
puts( "Copyright (c)2001-2004 by Alexander Barton (<alex@barton.de>)." );
puts( "Copyright (c)2001-2003 by Alexander Barton (<alex@barton.de>)." );
puts( "Homepage: <http://arthur.ath.cx/~alex/ngircd/>\n" );
puts( "This is free software; see the source for copying conditions. There is NO" );
puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." );

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: ngircd.h,v 1.19 2002/12/26 16:48:14 alex Exp $
* $Id: ngircd.h,v 1.17 2002/12/12 11:30:23 alex Exp $
*
* Prototypes of the "main module".
*/
@@ -37,15 +37,14 @@ GLOBAL BOOLEAN NGIRCd_NoDaemon; /* nicht im Hintergrund laufen */
GLOBAL BOOLEAN NGIRCd_Passive; /* nicht zu anderen Servern connecten */
GLOBAL BOOLEAN NGIRCd_SignalQuit; /* TRUE: quit server*/
GLOBAL BOOLEAN NGIRCd_SignalRestart; /* TRUE: restart server */
GLOBAL BOOLEAN NGIRCd_SignalRehash; /* TRUE: reload configuration */
GLOBAL BOOLEAN NGIRCd_Quit; /* TRUE: ngIRCd beenden */
GLOBAL BOOLEAN NGIRCd_Restart; /* TRUE: neu starten */
GLOBAL CHAR NGIRCd_DebugLevel[2]; /* Debug-Level fuer IRC_VERSION() */
GLOBAL CHAR NGIRCd_ConfFile[FNAME_LEN]; /* Konfigurationsdatei */
GLOBAL CHAR NGIRCd_ProtoID[COMMAND_LEN];/* Protokoll- und Server-Identifikation */
GLOBAL CHAR NGIRCd_ProtoID[1024]; /* Protokoll- und Server-Identifikation */
GLOBAL CHAR *NGIRCd_Version PARAMS((VOID ));

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: parse.c,v 1.59 2003/01/15 13:49:20 alex Exp $";
static char UNUSED id[] = "$Id: parse.c,v 1.52 2002/12/18 13:53:20 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -24,7 +24,7 @@ static char UNUSED id[] = "$Id: parse.c,v 1.59 2003/01/15 13:49:20 alex Exp $";
#include "ngircd.h"
#include "defines.h"
#include "conn-func.h"
#include "conn.h"
#include "client.h"
#include "channel.h"
#include "log.h"
@@ -54,9 +54,7 @@ COMMAND My_Commands[] =
{ "AWAY", IRC_AWAY, CLIENT_USER, 0, 0, 0 },
{ "CONNECT", IRC_CONNECT, CLIENT_USER, 0, 0, 0 },
{ "DIE", IRC_DIE, CLIENT_USER, 0, 0, 0 },
{ "DISCONNECT", IRC_DISCONNECT, CLIENT_USER, 0, 0, 0 },
{ "ERROR", IRC_ERROR, 0xFFFF, 0, 0, 0 },
{ "HELP", IRC_HELP, CLIENT_USER, 0, 0, 0 },
{ "INVITE", IRC_INVITE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
{ "ISON", IRC_ISON, CLIENT_USER, 0, 0, 0 },
{ "JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
@@ -85,7 +83,6 @@ COMMAND My_Commands[] =
{ "STATS", IRC_STATS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
{ "TIME", IRC_TIME, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
{ "TOPIC", IRC_TOPIC, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
{ "TRACE", IRC_TRACE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
{ "USER", IRC_USER, 0xFFFF, 0, 0, 0 },
{ "USERHOST", IRC_USERHOST, CLIENT_USER, 0, 0, 0 },
{ "VERSION", IRC_VERSION, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
@@ -166,7 +163,7 @@ Parse_Request( CONN_ID Idx, CHAR *Request )
*ptr = '\0';
#ifndef STRICT_RFC
/* multiple Leerzeichen als Trenner vor
* Parametern ignorieren */
*Parametertrennern ignorieren */
while( *(ptr + 1) == ' ' ) ptr++;
#endif
}
@@ -329,50 +326,46 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
client = Client_GetFromConn( Idx );
assert( client != NULL );
/* Statuscode? */
if(( Client_Type( client ) == CLIENT_SERVER ) && ( strlen( Req->command ) == 3 ) && ( atoi( Req->command ) > 100 ))
/* Statuscode, der geforwarded werden muss? */
if(( strlen( Req->command ) == 3 ) && ( atoi( Req->command ) > 100 ))
{
/* Command is a status code from an other server */
/* Befehl ist ein Statuscode */
/* Determine target */
if( Req->argc > 0 ) target = Client_Search( Req->argv[0] );
/* Zielserver ermitteln */
if(( Client_Type( client ) == CLIENT_SERVER ) && ( Req->argc > 0 )) target = Client_Search( Req->argv[0] );
else target = NULL;
if( ! target )
{
/* Status code without target!? */
if( Req->argc > 0 ) Log( LOG_WARNING, "Unknown target for status code %s: \"%s\"", Req->command, Req->argv[0] );
else Log( LOG_WARNING, "Unknown target for status code %s!", Req->command );
return TRUE;
}
if( target == Client_ThisServer( ))
{
/* This server is the target, ignore it */
Log( LOG_DEBUG, "Ignored status code %s from \"%s\".", Req->command, Client_ID( client ));
return TRUE;
}
/* Determine source */
/* Quell-Client ermitteln */
if( ! Req->prefix[0] )
{
/* Oops, no prefix!? */
Log( LOG_WARNING, "Got status code %s from \"%s\" without prefix!?", Req->command, Client_ID( client ));
Log( LOG_WARNING, "Got status code without prefix!?" );
return TRUE;
}
else prefix = Client_Search( Req->prefix );
if( ! prefix )
{
/* Oops, unknown prefix!? */
Log( LOG_WARNING, "Got status code %s from unknown source: \"%s\"", Req->command, Req->prefix );
Log( LOG_WARNING, "Got status code from unknown source: \"%s\"", Req->prefix );
return TRUE;
}
/* Forward status code */
strlcpy( str, Req->command, sizeof( str ));
/* Statuscode weiterleiten */
strcpy( str, Req->command );
for( i = 0; i < Req->argc; i++ )
{
if( i < Req->argc - 1 ) strlcat( str, " ", sizeof( str ));
else strlcat( str, " :", sizeof( str ));
strlcat( str, Req->argv[i], sizeof( str ));
if( i < Req->argc - 1 ) strcat( str, " " );
else strcat( str, " :" );
strcat( str, Req->argv[i] );
}
return IRC_WriteStrClientPrefix( target, prefix, "%s", str );
}

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: parse.h,v 1.10 2003/01/03 22:03:51 alex Exp $
* $Id: parse.h,v 1.9 2002/12/18 13:53:20 alex Exp $
*
* IRC command parser and validator (header)
*/
@@ -30,7 +30,7 @@ typedef struct _REQUEST /* vgl. RFC 2812, 2.3 */
typedef struct _COMMAND
{
CHAR *name; /* command name */
BOOLEAN (*function) PARAMS(( CLIENT *Client, REQUEST *Request ));
BOOLEAN (*function)( CLIENT *Client, REQUEST *Request );
CLIENT_TYPE type; /* valid client types (bit mask) */
LONG lcount, rcount; /* number of local and remote calls */
LONG bytes; /* number of bytes created */

View File

@@ -1,229 +0,0 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
*
* 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.
* Please read the file COPYING, README and AUTHORS for more information.
*
* Rendezvous service registration (using Mach Ports, e.g. Mac OS X)
*/
#include "portab.h"
#ifdef RENDEZVOUS
static char UNUSED id[] = "$Id: rendezvous.c,v 1.2 2003/03/27 01:24:32 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_MACH_PORT_H
#include "mach/port.h"
#include "mach/message.h"
#endif
#ifdef HAVE_DNSSERVICEDISCOVERY_DNSSERVICEDISCOVERY_H
#include <DNSServiceDiscovery/DNSServiceDiscovery.h>
#endif
#include "defines.h"
#include "log.h"
#include "exp.h"
#include "rendezvous.h"
typedef struct _service
{
dns_service_discovery_ref Discovery_Ref;
mach_port_t Mach_Port;
CHAR Desc[CLIENT_ID_LEN];
} SERVICE;
LOCAL VOID Registration_Reply_Handler( DNSServiceRegistrationReplyErrorType ErrCode, VOID *Context );
LOCAL VOID Unregister( INT Idx );
#define MAX_RENDEZVOUS 1000
#define MAX_MACH_MSG_SIZE 512
LOCAL SERVICE My_Rendezvous[MAX_RENDEZVOUS];
GLOBAL VOID Rendezvous_Init( VOID )
{
/* Initialize structures */
INT i;
for( i = 0; i < MAX_RENDEZVOUS; i++ )
{
My_Rendezvous[i].Discovery_Ref = 0;
My_Rendezvous[i].Mach_Port = 0;
}
} /* Rendezvous_Init */
GLOBAL VOID Rendezvous_Exit( VOID )
{
/* Clean up & exit module */
INT i;
for( i = 0; i < MAX_RENDEZVOUS; i++ )
{
if( My_Rendezvous[i].Discovery_Ref ) Unregister( i );
}
} /* Rendezvous_Exit */
GLOBAL BOOLEAN Rendezvous_Register( CHAR *Name, CHAR *Type, UINT Port )
{
/* Register new service */
INT i;
/* Search free port structure */
for( i = 0; i < MAX_RENDEZVOUS; i++ ) if( ! My_Rendezvous[i].Discovery_Ref ) break;
if( i >= MAX_RENDEZVOUS )
{
Log( LOG_ERR, "Can't register \"%s\" with Rendezvous: limit (%d) reached!", Name, MAX_RENDEZVOUS );
return FALSE;
}
strlcpy( My_Rendezvous[i].Desc, Name, sizeof( My_Rendezvous[i].Desc ));
/* Register new service */
My_Rendezvous[i].Discovery_Ref = DNSServiceRegistrationCreate( Name, Type, "", htonl( Port ), "", Registration_Reply_Handler, My_Rendezvous[i].Desc );
if( ! My_Rendezvous[i].Discovery_Ref )
{
Log( LOG_ERR, "Can't register \"%s\" with Rendezvous: can't register service!", My_Rendezvous[i].Desc );
return FALSE;
}
/* Get and save the corresponding Mach Port */
My_Rendezvous[i].Mach_Port = DNSServiceDiscoveryMachPort( My_Rendezvous[i].Discovery_Ref );
if( ! My_Rendezvous[i].Mach_Port )
{
Log( LOG_ERR, "Can't register \"%s\" with Rendezvous: got no Mach Port!", My_Rendezvous[i].Desc );
/* Here we actually leek a descriptor :-( */
My_Rendezvous[i].Discovery_Ref = 0;
return FALSE;
}
Log( LOG_DEBUG, "Rendezvous: Registering \"%s\" ...", My_Rendezvous[i].Desc );
return TRUE;
} /* Rendezvous_Register */
GLOBAL BOOLEAN Rendezvous_Unregister( CHAR *Name )
{
/* Unregister service from rendezvous */
INT i;
BOOLEAN ok;
ok = FALSE;
for( i = 0; i < MAX_RENDEZVOUS; i++ )
{
if( strcmp( Name, My_Rendezvous[i].Desc ) == 0 )
{
Unregister( i );
ok = TRUE;
}
}
return ok;
} /* Rendezvous_Unregister */
GLOBAL VOID Rendezvous_UnregisterListeners( VOID )
{
/* Unregister all our listening sockets from Rendezvous */
INT i;
for( i = 0; i < MAX_RENDEZVOUS; i++ )
{
if( My_Rendezvous[i].Discovery_Ref ) Unregister( i );
}
} /* Rendezvous_UnregisterListeners */
GLOBAL VOID Rendezvous_Handler( VOID )
{
/* Handle all Rendezvous stuff; this function must be called
* periodically from the run loop of the main program */
INT i;
CHAR buffer[MAX_MACH_MSG_SIZE];
mach_msg_return_t result;
mach_msg_header_t *msg;
for( i = 0; i < MAX_RENDEZVOUS; i++ )
{
if( ! My_Rendezvous[i].Discovery_Ref ) continue;
/* Read message from Mach Port */
msg = (mach_msg_header_t *)buffer;
result = mach_msg( msg, MACH_RCV_MSG|MACH_RCV_TIMEOUT, 0, MAX_MACH_MSG_SIZE, My_Rendezvous[i].Mach_Port, 1, 0 );
/* Handle message */
if( result == MACH_MSG_SUCCESS ) DNSServiceDiscovery_handleReply( msg );
#ifdef DEBUG
else if( result != MACH_RCV_TIMED_OUT ) Log( LOG_DEBUG, "mach_msg(): %ld", (LONG)result );
#endif
}
} /* Rendezvous_Handler */
LOCAL VOID Registration_Reply_Handler( DNSServiceRegistrationReplyErrorType ErrCode, VOID *Context )
{
CHAR txt[50];
if( ErrCode == kDNSServiceDiscoveryNoError )
{
/* Success! */
Log( LOG_INFO, "Successfully registered \"%s\" with Rendezvous.", Context ? Context : "NULL" );
return;
}
switch( ErrCode )
{
case kDNSServiceDiscoveryAlreadyRegistered:
strcpy( txt, "name already registered!" );
break;
case kDNSServiceDiscoveryNameConflict:
strcpy( txt, "name conflict!" );
break;
default:
sprintf( txt, "error code %ld!", (LONG)ErrCode );
}
Log( LOG_INFO, "Can't register \"%s\" with Rendezvous: %s", Context ? Context : "NULL", txt );
} /* Registration_Reply_Handler */
LOCAL VOID Unregister( INT Idx )
{
/* Unregister service */
DNSServiceDiscoveryDeallocate( My_Rendezvous[Idx].Discovery_Ref );
Log( LOG_INFO, "Unregistered \"%s\" from Rendezvous.", My_Rendezvous[Idx].Desc );
My_Rendezvous[Idx].Discovery_Ref = 0;
} /* Unregister */
#endif /* RENDEZVOUS */
/* -eof- */

View File

@@ -1,39 +0,0 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
*
* 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.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: rendezvous.h,v 1.1 2003/02/23 12:02:26 alex Exp $
*
* "Rendezvous" functions (Header)
*/
#ifdef RENDEZVOUS
#ifndef __rdezvous_h__
#define __rdezvous_h__
GLOBAL VOID Rendezvous_Init( VOID );
GLOBAL VOID Rendezvous_Exit( VOID );
GLOBAL BOOLEAN Rendezvous_Register( CHAR *Name, CHAR *Type, UINT Port );
GLOBAL BOOLEAN Rendezvous_Unregister( CHAR *Name );
GLOBAL VOID Rendezvous_UnregisterListeners( VOID );
GLOBAL VOID Rendezvous_Handler( VOID );
#endif /* __rdezvous_h__ */
#endif /* RENDEZVOUS */
/* -eof- */

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: resolve.c,v 1.6 2003/04/21 10:52:51 alex Exp $";
static char UNUSED id[] = "$Id: resolve.c,v 1.4 2002/12/12 12:24:18 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -174,7 +174,7 @@ Do_ResolveAddr( struct sockaddr_in *Addr, INT w_fd )
/* Namen aufloesen */
h = gethostbyaddr( (CHAR *)&Addr->sin_addr, sizeof( Addr->sin_addr ), AF_INET );
if( h ) strlcpy( hostname, h->h_name, sizeof( hostname ));
if( h ) strcpy( hostname, h->h_name );
else
{
#ifdef h_errno
@@ -182,11 +182,11 @@ Do_ResolveAddr( struct sockaddr_in *Addr, INT w_fd )
#else
Log_Resolver( LOG_WARNING, "Can't resolve address \"%s\"!", inet_ntoa( Addr->sin_addr ));
#endif
strlcpy( hostname, inet_ntoa( Addr->sin_addr ), sizeof( hostname ));
strcpy( hostname, inet_ntoa( Addr->sin_addr ));
}
/* Antwort an Parent schreiben */
if( (size_t)write( w_fd, hostname, strlen( hostname ) + 1 ) != (size_t)( strlen( hostname ) + 1 ))
if( write( w_fd, hostname, strlen( hostname ) + 1 ) != ( strlen( hostname ) + 1 ))
{
Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
close( w_fd );
@@ -213,7 +213,7 @@ Do_ResolveName( CHAR *Host, INT w_fd )
if( h )
{
addr = (struct in_addr *)h->h_addr;
strlcpy( ip, inet_ntoa( *addr ), sizeof( ip ));
strcpy( ip, inet_ntoa( *addr ));
}
else
{
@@ -226,7 +226,7 @@ Do_ResolveName( CHAR *Host, INT w_fd )
}
/* Antwort an Parent schreiben */
if( (size_t)write( w_fd, ip, strlen( ip ) + 1 ) != (size_t)( strlen( ip ) + 1 ))
if( write( w_fd, ip, strlen( ip ) + 1 ) != ( strlen( ip ) + 1 ))
{
Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
close( w_fd );

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: resolve.h,v 1.5 2003/04/21 10:53:10 alex Exp $
* $Id: resolve.h,v 1.3 2002/12/12 12:23:43 alex Exp $
*
* Asynchronous resolver (header)
*/
@@ -18,11 +18,11 @@
#define __resolve_h__
#include <sys/types.h>
#include <netinet/in.h>
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
#include <sys/types.h>
#include <netinet/in.h>
typedef struct _Res_Stat

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: tool.c,v 1.1 2003/01/13 12:20:16 alex Exp $";
static char UNUSED id[] = "$Id: tool.c,v 1.10 2002/12/12 12:24:18 alex Exp $";
#include "imp.h"
#include <assert.h>

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: tool.h,v 1.1 2003/01/13 12:20:16 alex Exp $
* $Id: tool.h,v 1.9 2002/12/12 12:23:43 alex Exp $
*
* Tool functions (Header)
*/

View File

@@ -9,23 +9,19 @@
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
#
# $Id: Makefile.am,v 1.7 2003/01/03 22:04:14 alex Exp $
# $Id: Makefile.am,v 1.4 2002/05/22 09:09:43 alex Exp $
#
AUTOMAKE_OPTIONS = ansi2knr
noinst_LIBRARIES = libngportab.a
libngportab_a_SOURCES = strlcpy.c vsnprintf.c
libngportab_a_SOURCES = vsnprintf.c
check_PROGRAMS = portabtest
portabtest_SOURCES = portabtest.c
portabtest_LDFLAGS = -L.
portabtest_LDADD = -lngportab
noinst_HEADERS = imp.h exp.h portab.h
maintainer-clean-local:

View File

@@ -1,16 +1,17 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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.
* Please read the file COPYING, README and AUTHORS for more information.
* Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
* der GNU General Public License (GPL), wie von der Free Software Foundation
* herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
* der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
* $Id: portab.h,v 1.15 2003/03/31 19:01:02 alex Exp $
* $Id: portab.h,v 1.9 2002/12/12 11:26:08 alex Exp $
*
* Portability functions and declarations (header for libngbportab).
* portab.h: "Portabilitaets-Definitionen"
*/
@@ -20,12 +21,8 @@
#include "config.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
/* compiler features */
/* Compiler Features */
#ifdef __GNUC__
# define PUNUSED(x) __attribute__ ((unused)) x
@@ -44,7 +41,7 @@
#endif
/* keywords */
/* Keywords */
#define EXTERN extern
#define STATIC static
@@ -53,7 +50,7 @@
#define REGISTER register
/* datatypes */
/* Datatentypen */
#ifndef PROTOTYPES
# ifndef signed
@@ -108,7 +105,18 @@ typedef UINT8 BOOLEAN;
#endif
/* target constants */
/* configure-Optionen */
#ifndef HAVE_socklen_t
#define socklen_t int /* u.a. fuer Mac OS X */
#endif
#if OS_UNIX_AUX
#define _POSIX_SOURCE /* muss unter A/UX definiert sein */
#endif
/* Konstanten */
#ifndef TARGET_OS
#define TARGET_OS "unknown"
@@ -123,38 +131,6 @@ typedef UINT8 BOOLEAN;
#endif
/* configure options */
#ifndef HAVE_socklen_t
#define socklen_t int /* u.a. fuer Mac OS X */
#endif
#ifndef HAVE_SNPRINTF
EXTERN INT snprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, ... ));
#endif
#ifndef HAVE_STRLCAT
EXTERN size_t strlcat PARAMS(( CHAR *dst, CONST CHAR *src, size_t size ));
#endif
#ifndef HAVE_STRLCPY
EXTERN size_t strlcpy PARAMS(( CHAR *dst, CONST CHAR *src, size_t size ));
#endif
#ifndef HAVE_VSNPRINTF
#include <stdarg.h>
EXTERN INT vsnprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, va_list args ));
#endif
#ifndef PACKAGE_NAME
#define PACKAGE_NAME PACKAGE
#endif
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION VERSION
#endif
#endif

View File

@@ -14,53 +14,30 @@
#include "portab.h"
static char UNUSED id[] = "$Id: portabtest.c,v 1.11 2003/01/04 10:40:01 alex Exp $";
static char UNUSED id[] = "$Id: portabtest.c,v 1.9 2002/12/12 11:38:46 alex Exp $";
#include "imp.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "exp.h"
LOCAL VOID Panic PARAMS (( CHAR *Reason, INT Code ));
GLOBAL int
main( VOID )
{
/* validate datatypes */
if( FALSE != 0 ) Panic( "FALSE", 1 );
if( TRUE != 1 ) Panic( "TRUE", 1 );
if( sizeof( INT8 ) != 1 ) Panic( "INT8", 1 );
if( sizeof( UINT8 ) != 1 ) Panic( "UINT8", 1 );
if( sizeof( INT16 ) != 2 ) Panic( "INT16", 1 );
if( sizeof( UINT16 ) != 2 ) Panic( "UINT16", 1 );
if( sizeof( INT32 ) != 4 ) Panic( "INT32", 1 );
if( sizeof( UINT32 ) != 4 ) Panic( "UINT32", 1 );
#ifdef PROTOTYPES
/* check functions */
if( ! snprintf ) Panic( "snprintf", 2 );
if( ! vsnprintf ) Panic( "vsnprintf", 2 );
if( ! strlcpy ) Panic( "strlcpy", 2 );
if( ! strlcat ) Panic( "strlcat", 2 );
#endif
/* Datentypen pruefen */
if( FALSE != 0 ) return 1;
if( TRUE != 1 ) return 1;
if( sizeof( INT8 ) != 1 ) return 1;
if( sizeof( UINT8 ) != 1 ) return 1;
if( sizeof( INT16 ) != 2 ) return 1;
if( sizeof( UINT16 ) != 2 ) return 1;
if( sizeof( INT32 ) != 4 ) return 1;
if( sizeof( UINT32 ) != 4 ) return 1;
/* ok, no error */
/* kein Fehler */
return 0;
} /* portab_check_types */
LOCAL VOID
Panic( CHAR *Reason, INT Code )
{
/* Oops, something failed!? */
fprintf( stderr, "Oops, test for %s failed!?", Reason );
exit( Code );
} /* Panic */
/* -eof- */

View File

@@ -1,75 +0,0 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
*
* 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.
* Please read the file COPYING, README and AUTHORS for more information.
*
* strlcpy() and strlcat() replacement functions.
* See <http://www.openbsd.org/papers/strlcpy-paper.ps> for details.
*
* Code partially borrowed from compat.c of rsync, written by Andrew
* Tridgell (1998) and Martin Pool (2002):
* <http://samba.anu.edu.au/rsync/doxygen/head/lib_2compat_8c.html>
*/
#include "portab.h"
static char UNUSED id[] = "$Id: strlcpy.c,v 1.2 2002/12/26 14:34:11 alex Exp $";
#include "imp.h"
#include <string.h>
#include <sys/types.h>
#include "exp.h"
#ifndef HAVE_STRLCAT
GLOBAL size_t
strlcat( CHAR *dst, CONST CHAR *src, size_t size )
{
/* Like strncat() but does not 0 fill the buffer and
* always null terminates. */
size_t len1 = strlen( dst );
size_t len2 = strlen( src );
size_t ret = len1 + len2;
if( len1 + len2 >= size ) len2 = size - ( len1 + 1 );
if( len2 > 0 )
{
memcpy( dst + len1, src, len2 );
dst[len1 + len2] = 0;
}
return ret;
} /* strlcat */
#endif
#ifndef HAVE_STRLCPY
GLOBAL size_t
strlcpy( CHAR *dst, CONST CHAR *src, size_t size )
{
/* Like strncpy but does not 0 fill the buffer and
* always null terminates. */
size_t len = strlen( src );
if( size <= 0 ) return len;
if( len >= size ) len = size - 1;
memcpy( dst, src, len );
dst[len] = 0;
return len;
} /* strlcpy */
#endif
/* -eof- */

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: vsnprintf.c,v 1.5 2003/04/21 10:53:38 alex Exp $";
static char UNUSED id[] = "$Id: vsnprintf.c,v 1.4 2002/12/12 11:37:11 alex Exp $";
#include "imp.h"
@@ -98,7 +98,6 @@ static char UNUSED id[] = "$Id: vsnprintf.c,v 1.5 2003/04/21 10:53:38 alex Exp $
/* only include stdio.h if we are not re-defining snprintf or vsnprintf */
#include <stdio.h>
/* make the compiler happy with an empty file */
void dummy_snprintf PARAMS(( void ));
void dummy_snprintf PARAMS(( void )) { }
#else

View File

@@ -1,35 +1,26 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: getpid.sh,v 1.2.4.2 2003/11/07 20:51:11 alex Exp $
# $Id: getpid.sh,v 1.2 2002/11/10 14:28:06 alex Exp $
# did we get a name?
# wurde ein Name uebergeben?
[ $# -ne 1 ] && exit 1
# detect flags for "ps" and "head"
# Flags fuer "ps" ermitteln
if [ `uname` = "FreeBSD" ]; then
PS_FLAGS="-a"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1"
elif [ `uname` = "A/UX" ]; then
PS_FLAGS="-ae"; PS_PIDCOL="1"; HEAD_FLAGS="-1"
elif [ `uname` = "GNU" ]; then
PS_FLAGS="-ax"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
else
PS_FLAGS="-f"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
ps $PS_FLAGS > /dev/null 2>&1
if [ $? -ne 0 ]; then PS_FLAGS="a"; PS_PIDCOL="1"; fi
fi
# debug output
#echo "$0: PS_FLAGS=$PS_FLAGS"
#echo "$0: PS_PIDCOL=$PS_PIDCOL"
#echo "$0: HEAD_FLAGS=$HEAD_FLAGS"
# search PID
# PID ermitteln
ps $PS_FLAGS > procs.tmp
cat procs.tmp | grep -v "$0" | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n > pids.tmp
pid=`head $HEAD_FLAGS pids.tmp`
rm -rf procs.tmp pids.tmp
pid=$( cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n | head $HEAD_FLAGS )
# validate PID
# ermittelte PID validieren
[ "$pid" -gt 1 ] > /dev/null 2>&1
[ $? -ne 0 ] && exit 1

View File

@@ -1,4 +1,4 @@
# $Id: ngircd-test.conf,v 1.3.4.1 2003/11/07 20:51:11 alex Exp $
# $Id: ngircd-test.conf,v 1.3 2002/10/21 13:45:23 alex Exp $
[Global]
Name = ngircd.test.server
@@ -6,7 +6,6 @@
Ports = 6789
MotdFile = ngircd-test.motd
AdminEMail = admin@irc.server
MaxConnectionsIP = 0
[Operator]
Name = TestOp

View File

@@ -1,37 +1,31 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: start-server.sh,v 1.10.4.1 2003/11/07 20:51:11 alex Exp $
# $Id: start-server.sh,v 1.10 2002/11/10 14:28:06 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
echo " starting server ..."
# remove old logfiles
# alte Logfiles loeschen
rm -rf logs *.log
# check weather getpid.sh returns valid PIDs. If not, don't start up the
# test-server, because we won't be able to kill it at the end of the test.
# pruefen, ob getpid.sh gueltige PID's liefert. Wenn dem nicht so ist,
# wird kein ngIRCd gestartet, da dieser ansonsten nicht mehr am Ende
# des Testlaufs beendet werden koennte!
./getpid.sh sh > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " error: getpid.sh FAILED!"
exit 1
fi
# check if there is a test-server already running
./getpid.sh T-ngircd > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo " error: test-server already running!"
exit 1
fi
# generate MOTD for test-server
# MOTD fuer Test-Server erzeugen
echo "This is an ngIRCd Test Server" > ngircd-test.motd
# starting up test-server ...
# Test-Server starten ...
./T-ngircd -np -f ${srcdir}/ngircd-test.conf > ngircd-test.log 2>&1 &
sleep 1
# validate running test-server
# validieren, dass Server laeuft
pid=`./getpid.sh T-ngircd`
[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1 || exit 1

View File

@@ -1,25 +1,17 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: stop-server.sh,v 1.9.4.1 2003/11/07 20:51:11 alex Exp $
# $Id: stop-server.sh,v 1.9 2002/11/10 14:28:06 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
echo " stopping server ..."
# stop test-server ...
# Test-Server stoppen ...
pid=`./getpid.sh T-ngircd`
if [ -z "$pid" ]; then
echo " no running server found!?"
exit 1
fi
kill $pid > /dev/null 2>&1 || exit 1
[ -n "$pid" ] && kill $pid > /dev/null 2>&1 || exit 1
sleep 1
# waiting ...
for i in 1 2 3 4 5; do
kill -0 $pid > /dev/null 2>&1 || exit 0
sleep 1
done
echo " server still running!?"
exit 1
# jetzt duerfte der Prozess nicht mehr laufen
kill -0 $pid > /dev/null 2>&1 && exit 1 || exit 0
# -eof-

View File

@@ -1,10 +1,10 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: stress-server.sh,v 1.6.4.2 2003/11/07 20:51:11 alex Exp $
# $Id: stress-server.sh,v 1.6 2002/09/23 22:07:43 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
[ "$1" -gt 0 ] 2> /dev/null && CLIENTS="$1" || CLIENTS=5
[ $1 -gt 0 ] 2> /dev/null && CLIENTS=$1 || CLIENTS=5
name=`basename $0`
test=`echo ${name} | cut -d '.' -f 1`
@@ -12,11 +12,11 @@ mkdir -p logs tests
type expect > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " ${name}: \"expect\" not found."; exit 77
echo "SKIP: ${name} -- \"expect\" not found."; exit 77
fi
type telnet > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " ${name}: \"telnet\" not found."; exit 77
echo "SKIP: ${name} -- \"telnet\" not found."; exit 77
fi
echo " stressing server with $CLIENTS clients (be patient!) ..."

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: tests.sh,v 1.3.6.1 2003/11/07 20:51:11 alex Exp $
# $Id: tests.sh,v 1.3 2002/09/12 02:29:03 alex Exp $
name=`basename $0`
test=`echo ${name} | cut -d '.' -f 1`
@@ -8,11 +8,11 @@ mkdir -p logs
type expect > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " ${name}: \"expect\" not found."; exit 77
echo "SKIP: ${name} -- \"expect\" not found."; exit 77
fi
type telnet > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " ${name}: \"telnet\" not found."; exit 77
echo "SKIP: ${name} -- \"telnet\" not found."; exit 77
fi
echo " doing ${test} ..."

View File

@@ -1,27 +0,0 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
#
# 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.
# Please read the file COPYING, README and AUTHORS for more information.
#
# $Id: Makefile.am,v 1.1 2003/01/13 12:20:16 alex Exp $
#
AUTOMAKE_OPTIONS = ansi2knr
INCLUDES = -I$(srcdir)/../portab
noinst_LIBRARIES = libngtool.a
libngtool_a_SOURCES = tool.c
noinst_HEADERS = tool.h
maintainer-clean-local:
rm -f Makefile Makefile.in
# -eof-