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

Compare commits

...

239 Commits

Author SHA1 Message Date
Alexander Barton
807da1356c Version 0.7.7 2004-02-05 13:33:24 +00:00
Alexander Barton
024c58435e 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.  (from HEAD)
2004-02-04 20:04:54 +00:00
Alexander Barton
e72b817ae6 Updated some copyright notices -- welcome 2004! ;-) 2004-02-03 16:01:29 +00:00
Alexander Barton
47d1cf9b55 Fixed (optional) TCP Wrapper test which was broken and could result in
false results. Thanks to Fuminori Tanizaki <tany@mcnet.ad.jp>!
2004-02-03 13:54:36 +00:00
Alexander Barton
aaaca987cd Adjusted copyright notice to include 2004. 2004-01-02 19:24:46 +00:00
Alexander Barton
a34d8ae59f Removed "USE_" prefixes of configuration #defines (from HEAD). 2003-12-26 16:16:48 +00:00
Alexander Barton
d917f06af8 Fixed error messages related to server name configuration; updated
sample configuration file.
2003-12-19 14:30:49 +00:00
Alexander Barton
715e5532a9 Changed version number back to "0.7-CVS" for this branch. 2003-12-19 14:01:14 +00:00
Alexander Barton
64a8f8a3fd Updated documentation. (from HEAD) 2003-12-08 14:24:13 +00:00
Alexander Barton
7c2d0f20ed Version 0.7.6 2003-12-05 13:40:24 +00:00
Alexander Barton
e75f23cfe8 Fixed abort() ("server crash") when INVITE'ing users to nonexistent
channels. Bug found by <hiddenx@wp.pl>. (from HEAD)
2003-12-05 13:33:12 +00:00
Alexander Barton
c31167572b Added missing file ngircd.postinst to distribution list. 2003-12-05 13:31:22 +00:00
Alexander Barton
dc49d040c2 Changed version number back to "0.7-CVS" for this branch. 2003-12-04 14:20:08 +00:00
Alexander Barton
473feb44bb Extended version reporting of CVS builds. (from HEAD) 2003-12-04 14:13:42 +00:00
Alexander Barton
1ea7b10a82 Updated RPM and Debian package description and configuration. 2003-11-29 20:29:02 +00:00
Alexander Barton
29d430edd5 Release 0.7.5, debian release 0.7.6-0.1ab. 2003-11-07 21:05:15 +00:00
Alexander Barton
2b8052b03a New upstream version. 2003-11-07 21:04:21 +00:00
Alexander Barton
d155ed17c8 Backported all changes up to now from HEAD. 2003-11-07 20:51:08 +00:00
Alexander Barton
0b114e814b Version 0.7.1 2003-07-18 20:55:10 +00:00
Alexander Barton
d72811c9af Updated documentation. 2003-07-18 20:54:47 +00:00
Alexander Barton
4aa0fa7119 Fixed compiler warning. [from HEAD] 2003-07-18 20:50:05 +00:00
Alexander Barton
ad22b3087f Enhanced VERSION command when using debug builds. [from HEAD] 2003-07-18 20:49:35 +00:00
Alexander Barton
c3c4f32145 Made Makefile compatible with parallel builds (make -j). [from HEAD] 2003-07-18 20:49:05 +00:00
Alexander Barton
d72b14b9c8 Updated documentation. [from HEAD] 2003-07-18 20:48:20 +00:00
Alexander Barton
6d7de626c8 Made configure script more portable; added test for GNU Hurd. [from HEAD]. 2003-07-18 20:47:59 +00:00
Alexander Barton
73fc65a35f Updated documentation. 2003-07-18 20:47:08 +00:00
Alexander Barton
01929c161d Fixed up post installation script. 2003-07-12 22:57:00 +00:00
Alexander Barton
b0ea5b7d04 Added interpreter ... 2003-07-12 18:48:17 +00:00
Alexander Barton
f0653cdf24 Added Debian post installation script. 2003-07-12 18:29:19 +00:00
Alexander Barton
0b95570a80 Added /etc/default/ngircd to Debian package. 2003-07-12 18:23:24 +00:00
Alexander Barton
ef907632b8 Updated documentation. 2003-07-09 21:19:40 +00:00
Alexander Barton
810127e2a8 Fixed minor typo. 2003-07-09 21:14:08 +00:00
Alexander Barton
3045ce06ef Included debian packaging files from CVS HEAD. 2003-07-09 21:12:00 +00:00
Alexander Barton
3b17c66068 Added Makefile.am for debian/-subdirectory. 2003-07-09 21:08:55 +00:00
Alexander Barton
25a947f0dd Included debian/-subdirectory in build system. 2003-07-09 21:05:25 +00:00
Alexander Barton
e765124c25 Updated config.guess and config.sub. 2003-07-09 21:04:42 +00:00
Alexander Barton
8186e930aa Changed version number to "0.7-CVS" for this branch. 2003-07-09 18:57:20 +00:00
Alexander Barton
ae683b294f NJOIN propagates user channel modes correctly again. Backport from HEAD. 2003-07-09 18:53:08 +00:00
Alexander Barton
9295fce7cf Version 0.7.0 2003-05-01 10:15:02 +00:00
Alexander Barton
9dfe74ffe2 New FAQ: "why should I use ngIRCd?". [from HEAD] 2003-04-29 13:45:09 +00:00
Alexander Barton
10577f8e36 Fixed spelling, thanks Goetz! [from HEAD] 2003-04-29 13:42:24 +00:00
Alexander Barton
fbead4a15c "ServerName" is checked better now: a dot (".") is required. 2003-04-29 12:37:17 +00:00
Alexander Barton
322d3ebaec The KILL comand verifies and logs more parameters. [from HEAD] 2003-04-29 12:20:14 +00:00
Alexander Barton
bbfeaa953b Updated documentation. 2003-04-28 00:14:04 +00:00
Alexander Barton
26790e960f ngIRCd 0.7.0-pre2 2003-04-27 18:33:26 +00:00
Alexander Barton
4b1711a614 Added missing "Password" variable in "[Global]" section. 2003-04-27 11:50:32 +00:00
Alexander Barton
3630e840e5 Updated documentation. 2003-04-27 11:49:32 +00:00
Alexander Barton
bcd6db9016 Fixed --configtest: There is no variable "ServerPwd", it's "Password". 2003-04-27 11:48:53 +00:00
Alexander Barton
0e7970cfe6 Updated documentation. 2003-04-25 16:59:28 +00:00
Alexander Barton
9a9b4617aa Updated documentation. 2003-04-25 16:51:39 +00:00
Alexander Barton
434a6887f0 The server tried to connect to other servers only once when DNS or socket
failures occured. [from HEAD].
2003-04-25 16:50:53 +00:00
Alexander Barton
a9a605ddb9 Updated documentation. 2003-04-25 15:06:01 +00:00
Alexander Barton
99ab8607c9 Disabling "-ansi" on Cygwin: system headers are incompatible. 2003-04-25 15:02:15 +00:00
Alexander Barton
14b1ae7aea Updated documentation: added i686/pc/cygwin platform. 2003-04-23 23:32:24 +00:00
Alexander Barton
2517c2cb99 Updated documentation. 2003-04-23 01:15:37 +00:00
Alexander Barton
75fb85d029 Check for broken GCC (on Mac OS X) and disable "-pedantic" in this case. [HEAD] 2003-04-23 01:15:20 +00:00
Alexander Barton
1e599eb535 Updated documentation. [from HEAD] 2003-04-23 01:14:40 +00:00
Alexander Barton
36bd5d3ad6 Updated documentation. 2003-04-22 23:53:33 +00:00
Alexander Barton
0be9053c17 New documentation file "Platforms.txt". [from HEAD] 2003-04-22 23:52:48 +00:00
Alexander Barton
cd7d28d743 Made scripts more portable (run on SunOS 5.6 now). [from HEAD] 2003-04-22 20:01:23 +00:00
Alexander Barton
f04a2ce2b4 Updated documentation. 2003-04-22 20:00:32 +00:00
Alexander Barton
4d7a5df0e2 Added defines for SunOS (5.6). [from HEAD] 2003-04-22 20:00:19 +00:00
Alexander Barton
7ba1bde408 Updated documentation. 2003-04-22 10:21:33 +00:00
Alexander Barton
a7d00cd7b1 Made setting of WANT_AUTOMAKE more portable [backport from HEAD]. 2003-04-22 10:18:41 +00:00
Alexander Barton
3585e2bc50 Updated version number to 0.7.0-pre1. 2003-04-21 22:49:45 +00:00
Goetz Hoffart
bd52d4e49c Fixed tabs to spaces. 2003-04-21 21:59:34 +00:00
Goetz Hoffart
e0345e5e0a Translated documentation from German to English. 2003-04-21 21:46:57 +00:00
Alexander Barton
c1dd86d702 Updated documentation. 2003-04-21 21:33:18 +00:00
Alexander Barton
b25faf3c2a Updated documentation. 2003-04-21 12:55:39 +00:00
Alexander Barton
384d6b894a Translated Protocol.txt to english. 2003-04-21 12:48:40 +00:00
Alexander Barton
a061668b1a Added implicit initialisation of "i" in Conf_GetServer to workaround a egcs
2.91.66 bug which claims that this valiable could be used uninitialized.
2003-04-21 11:06:07 +00:00
Alexander Barton
489d8c5cd0 Removed unportable %z formater in strftime(). 2003-04-21 10:54:30 +00:00
Alexander Barton
daa996f177 Added missing prototype for dummy_snprintf(). 2003-04-21 10:53:38 +00:00
Alexander Barton
7deacbaa11 Added missing include for <sys/select.h>. 2003-04-21 10:53:10 +00:00
Alexander Barton
c3dfd63bf3 Fixed up some castings. 2003-04-21 10:52:26 +00:00
Alexander Barton
f5b91cd03d Added some defines for Linux/glibc, reverted unused test for poll(), and
enhanced summary output.
2003-04-21 10:51:44 +00:00
Alexander Barton
8e43b16d22 Using $(prefix)/share/doc/ngircd as documentation directory again. 2003-04-21 08:01:29 +00:00
Alexander Barton
4ef6dae1cd Updated documentation. 2003-04-20 23:12:57 +00:00
Alexander Barton
0b91df05e0 Fixed spelling mistake :-) 2003-04-20 23:09:43 +00:00
Alexander Barton
feafb6cb2e Don't forward NJOIN's for unknown nick names. 2003-04-20 23:09:26 +00:00
Alexander Barton
0391d35a67 Translated success message :-) 2003-04-13 22:34:17 +00:00
Alexander Barton
a93b4d9789 Updated documentation. 2003-04-05 11:37:17 +00:00
Alexander Barton
eefa1b1c64 Added WANT_AUTOMAKE=1.6 to autogen.sh. 2003-04-04 10:05:34 +00:00
Alexander Barton
016e547daa Re-corrected test for CVS version. 2003-03-31 19:01:02 +00:00
Alexander Barton
b588eaed02 Corrected path for documentation files in summary output. 2003-03-31 16:17:33 +00:00
Alexander Barton
36e0345ce6 Changed documentation directory to ".../share/doc/ngIRCd" (and removed the
variable PACKAGE for better Debian automake-1.4 compatibility).
2003-03-31 16:00:49 +00:00
Alexander Barton
62796722f1 Changed all PACKAGE's to PACKAGE_NAME and all VERSION's to PACKAGE_VERSION. 2003-03-31 15:54:21 +00:00
Alexander Barton
935ffd0dc0 Updated documentation. 2003-03-30 13:46:58 +00:00
Alexander Barton
fa54e6e2a4 Added documentation path to summary output. 2003-03-30 13:46:00 +00:00
Alexander Barton
179e760cf1 Implemented proper "uninstall" target for documentation files. 2003-03-30 13:45:29 +00:00
Alexander Barton
47faa8595a Install documentation files in $(datadir)/doc/ngircd. 2003-03-30 13:31:17 +00:00
Alexander Barton
9ab97b29ae Fixed up bad test during unregistering of services. 2003-03-27 01:24:32 +00:00
Alexander Barton
24df40eca7 Synchronize server connections with server configurations after reloading the configuration. 2003-03-27 01:22:44 +00:00
Alexander Barton
02a22611be Clean up duplicate servers correctly. 2003-03-27 01:21:38 +00:00
Alexander Barton
59a0fb8cd9 New function Conn_SyncServerStruct(). 2003-03-27 01:20:22 +00:00
Alexander Barton
d383703b78 Require at least GNU automake 1.6 to generate build scripts and Makefiles. 2003-03-26 22:43:58 +00:00
Alexander Barton
8291e10b96 Translated documentation to english. 2003-03-26 22:34:33 +00:00
Alexander Barton
312e4aeb86 Updated documentation. 2003-03-23 23:13:15 +00:00
Alexander Barton
ac4f25e3a7 Enhanced (and fiexd) IRC_TRACE(): now shows operators and correct link uptimes. 2003-03-19 21:16:53 +00:00
Alexander Barton
7646739431 New message constant RPL_TRACEOPERATOR_MSG. Changed RPL_TRACESERVER_MSG. 2003-03-19 21:16:16 +00:00
Alexander Barton
5f19a9418e Updated Mac OS X project for Project Builder. 2003-03-19 20:09:51 +00:00
Alexander Barton
3858e28e07 Fixed a "checking for ..." text string. 2003-03-19 17:27:05 +00:00
Alexander Barton
f53455977d Added #include for stdarg.h when using ower own version of vsnprintf(). 2003-03-17 01:12:10 +00:00
Alexander Barton
9ca1f6a988 Removed now obsolete test for A/UX: configure does this job now. 2003-03-17 00:53:52 +00:00
Alexander Barton
1a1ff404a8 - Updated documentation. 2003-03-15 11:00:31 +00:00
Alexander Barton
c755b82dd9 - Removed german documentation (no maintainer). 2003-03-15 10:56:20 +00:00
Alexander Barton
8fc69bb6fb Updated documentation. 2003-03-10 01:00:00 +00:00
Alexander Barton
10edb7c741 Fixed up and enhanced formating of manual pages. 2003-03-10 00:58:06 +00:00
Alexander Barton
ff019dd76f Updated manual page. 2003-03-10 00:35:51 +00:00
Alexander Barton
a004f34447 Updated manual page. 2003-03-10 00:23:50 +00:00
Alexander Barton
10bb43c66e Updated documentation. 2003-03-10 00:23:34 +00:00
Alexander Barton
b6999f10c0 Updated and enhanced the daemon manual page. 2003-03-09 23:08:24 +00:00
Alexander Barton
516064dc06 Fixed some spelling mistakes. 2003-03-09 22:17:35 +00:00
Alexander Barton
a84b9d99a1 Fixed some spelling mistakes -- thanks to ispell ;-) 2003-03-09 22:03:58 +00:00
Alexander Barton
5170ecf045 Updated documentation: translated headers ... 2003-03-09 20:04:44 +00:00
Alexander Barton
23a28fa336 Updated documentation. 2003-03-08 12:34:55 +00:00
Alexander Barton
15b5e1a6eb Translated & updated documentation. 2003-03-07 20:42:20 +00:00
Alexander Barton
ade2fdc9aa Updated documentation. 2003-03-07 17:17:23 +00:00
Alexander Barton
e744936d19 New function Simple_Message(). Better error reporting to clients on connect. 2003-03-07 17:16:49 +00:00
Alexander Barton
4a5b3f34a5 Enlarged buffer for version string ;-) 2003-03-07 14:50:13 +00:00
Alexander Barton
7640aa5190 Updated documentation. 2003-03-07 14:45:10 +00:00
Alexander Barton
35771fa776 Added support for TCP Wrappers; redesigned configuration result output;
Changed some "--enable"/"--disable" switches to "--with"/"--without".
2003-03-07 14:37:30 +00:00
Alexander Barton
439c945d56 Added support for TCP Wrappers. 2003-03-07 14:35:52 +00:00
Alexander Barton
93146b5718 Updated documentation. 2003-03-04 14:12:30 +00:00
Alexander Barton
fd4a6b5dd5 Updated documentation. 2003-03-04 13:46:53 +00:00
Alexander Barton
b896f8acda - better compatibility 2003-02-25 14:07:26 +00:00
Alexander Barton
29bd35bc4f - Added optional support for Rendezvous. 2003-02-23 12:04:05 +00:00
Alexander Barton
f179070113 - New constant RENDEZVOUS_TYPE. 2003-02-23 12:03:39 +00:00
Alexander Barton
f813833ba1 - New switch "--enable-rendezvous" to enable support for Rendezvous. 2003-02-23 12:03:10 +00:00
Alexander Barton
f349b18949 - Updated documentation. 2003-02-23 12:02:39 +00:00
Alexander Barton
aa15257936 - Added new source module "rendezvous". 2003-02-23 12:02:26 +00:00
Alexander Barton
6e0c5698e4 - Updated documentation. 2003-02-21 19:44:00 +00:00
Alexander Barton
cf4ad8d6f7 - Conn_Close() ignores recursive calls for the same link now. 2003-02-21 19:19:27 +00:00
Alexander Barton
2a3f8cc57d - new link "option" constant: CONN_ISCLOSING 2003-02-21 19:18:48 +00:00
Alexander Barton
560c79615c - Updated documentation. 2003-01-31 18:29:06 +00:00
Alexander Barton
d1b2a1c4f9 - Added AC_PREREQ(2.50) to configure.in for better autoconf compatibility. 2003-01-31 18:28:31 +00:00
Alexander Barton
9d8f425a9a Updated documentation. 2003-01-21 21:22:00 +00:00
Alexander Barton
fbec1f1070 The server didn't validate wheather the "target" client of a channel
user mode change is a valid channel member or not.
2003-01-21 21:04:16 +00:00
Alexander Barton
d978d8ddbb - Updated documentation. 2003-01-17 19:10:11 +00:00
Alexander Barton
e07542a1ff - Non-members of a channel could crash the server when trying to change its modes. Fixed. 2003-01-17 19:04:19 +00:00
Alexander Barton
155f26eee2 - Updated documentation. 2003-01-15 14:30:44 +00:00
Alexander Barton
9eee0c883b - Client structures are removed correctly now if an outgoing connection can't be estahlished. 2003-01-15 14:28:59 +00:00
Alexander Barton
939767d502 - New function Client_DestroyNow(). 2003-01-15 14:28:25 +00:00
Alexander Barton
dccb297678 - Updated ProjectBuilder project file for Mac OS X. 2003-01-15 13:52:46 +00:00
Alexander Barton
2152e37722 - Added "HELP" command. 2003-01-15 13:49:20 +00:00
Alexander Barton
28cd2c1191 - Updated documentation. 2003-01-15 13:45:59 +00:00
Alexander Barton
947c512435 - Updated documentation. 2003-01-13 18:58:07 +00:00
Alexander Barton
42c4e6c7b1 - Added support for "TRACE" command. 2003-01-13 18:56:30 +00:00
Alexander Barton
f9cb4a42a0 - Updated documentation. 2003-01-13 12:22:16 +00:00
Alexander Barton
0f3e84f415 - new library "libngtool", reorganized code and directory structure therefore. 2003-01-13 12:20:16 +00:00
Alexander Barton
6a0bd57ec4 - Updated documentation. 2003-01-12 22:19:54 +00:00
Alexander Barton
fc1118cb5a - Enhanced error detection for numerics ("status codes"). 2003-01-12 22:18:46 +00:00
Alexander Barton
070976e443 - removed needless warning/info message. 2003-01-11 15:35:47 +00:00
Alexander Barton
0bcaed3564 - Updated documentation. 2003-01-08 23:00:51 +00:00
Alexander Barton
df00b38a0b - MODE returns the key and user limit for channel members correctly now. 2003-01-08 23:00:12 +00:00
Alexander Barton
aca6310dac - Updated documentation. 2003-01-08 22:29:14 +00:00
Alexander Barton
ff98833136 - Kill_Nick() uses an "faked internal KILL" now. 2003-01-08 22:28:12 +00:00
Alexander Barton
1443bc381c - Enhanced IRC_KILL to get along with Client==Client_ThisServer() for "fake KILLs". 2003-01-08 22:27:13 +00:00
Alexander Barton
9d82635b15 - Fixed IRC_KILL: used wrong connection index. 2003-01-08 22:07:34 +00:00
Alexander Barton
fa80012e71 - Enhanced CHANINFO command for channel keys and user limits. 2003-01-08 22:04:43 +00:00
Alexander Barton
43d9a62473 - Enhanced (and fixed) CHANINFO command (channel keys, user limits). 2003-01-08 22:04:05 +00:00
Alexander Barton
51e1a2e04a - Changed semantics of Client_SetAway(). 2003-01-08 22:03:21 +00:00
Alexander Barton
b8a3178a1b - Updated documentation. 2003-01-08 17:45:56 +00:00
Alexander Barton
bb94d18115 - fixed up propagation of modes with arguments between servers. 2003-01-08 17:45:15 +00:00
Alexander Barton
3b79965e38 - Updated documentation. 2003-01-05 23:06:12 +00:00
Alexander Barton
e82e3c3fdc - Updated german documentation. 2003-01-04 13:14:46 +00:00
Alexander Barton
f39d628512 - Updated documentation. 2003-01-04 13:09:07 +00:00
Alexander Barton
5b33308528 - Restructured documentation: now the main language is english. 2003-01-04 13:07:54 +00:00
Alexander Barton
444fdcf905 - Check functions only on systems that support prototypes, elder cpmpilers
become confused instead!
2003-01-04 10:40:01 +00:00
Alexander Barton
1bf0426aaf - Fixed call of tail, should be more portable now ... 2003-01-04 10:39:14 +00:00
Alexander Barton
8139505829 - Link portabtest agains "true" library. 2003-01-03 22:04:14 +00:00
Alexander Barton
c9540015c8 - Added missing PARAMS(). 2003-01-03 22:03:51 +00:00
Alexander Barton
2070cfe107 - Updated configure.in to use newer semantics of AC_INIT und AM_INIT_AUTOMAKE. 2003-01-03 19:07:09 +00:00
Alexander Barton
91f4aeec20 - Updated documentation. 2003-01-02 17:58:31 +00:00
Alexander Barton
8c1df9ef8d - The server sets a correct away message now when receiving a "MODE +a". 2003-01-02 17:57:09 +00:00
Alexander Barton
c428ac7563 - Renamed RPL_FEATURE_MSG to RPL_ISUPPORT_MSG. 2003-01-02 17:55:28 +00:00
Alexander Barton
e12179aa92 - date in version string conforms to ISO now: YYYY-MM-DD 2003-01-02 16:42:33 +00:00
Alexander Barton
cd9650c07e - Updated documentation. 2003-01-01 13:32:47 +00:00
Alexander Barton
5e3e3ad445 - Adjusted copyright banner to include 2003 :-) 2003-01-01 13:32:23 +00:00
Alexander Barton
e6a352dcfe - Updated documentation. 2003-01-01 13:30:51 +00:00
Alexander Barton
e17976a172 - Fixed up command forwarding: only to servers!
- Forwarding of WHOIS was broken in some situations.
2003-01-01 13:30:35 +00:00
Alexander Barton
ae6a7e7c0b - Fixed up command forwarding: only to servers! 2003-01-01 13:29:40 +00:00
Alexander Barton
717a26e37d - Updated documentation. 2002-12-31 16:18:07 +00:00
Alexander Barton
8dadb17f83 - Changed "once"-server-config-flag into a generic flag.
- Changed semantics of "NGIRCd_Passive".
2002-12-31 16:13:29 +00:00
Alexander Barton
281f7583f5 - New functions Conf_EnableServer(), Conf_DisableServer() and Conf_AddServer().
- Changed "once"-server-config-flag into a generic flag.
2002-12-31 16:12:50 +00:00
Alexander Barton
a7956f334e - New command DISCONNECT. 2002-12-31 16:11:24 +00:00
Alexander Barton
3e026ded6f - New commands CONNECT and DISCONNECT. 2002-12-31 16:11:06 +00:00
Alexander Barton
4e485443d3 - New commands CONNECT and DISCONNECT.
- Validate operator status before syntax checks.
2002-12-31 16:10:55 +00:00
Alexander Barton
01b58a0582 - Fixed test if we are still connected after a KILL command. 2002-12-31 16:09:55 +00:00
Alexander Barton
f83ea4b124 - Updated documentation. 2002-12-30 17:16:39 +00:00
Alexander Barton
b8d7dcec77 - Adjusted includes for new "conn-func.h" header. 2002-12-30 17:15:42 +00:00
Alexander Barton
b77dae3499 - Reorganized code for new modules "conn-func.c" and "conn-func.h". 2002-12-30 17:14:59 +00:00
Alexander Barton
0b04bfa7c0 - New source module "conn-func.c" and "conn-func.h". 2002-12-30 17:14:28 +00:00
Alexander Barton
4953c15bdf - Updated dokumentation. 2002-12-30 16:09:39 +00:00
Alexander Barton
437f2c335f - Renamed functions now found in "conn-zip.c". 2002-12-30 16:07:50 +00:00
Alexander Barton
e68cdf304f - New source files "conn-zip.c" and "conn-zip.h". 2002-12-30 16:07:23 +00:00
Alexander Barton
a2544e496c - Cleaned up handling of server configuration structures. 2002-12-30 00:01:42 +00:00
Alexander Barton
e5b824388d - Fixed up some brackets ("[" and "]") ... 2002-12-28 21:58:02 +00:00
Alexander Barton
214842853c - Optimized tests for <sys/select.h> and <sys/poll.h>. 2002-12-28 21:39:06 +00:00
Alexander Barton
cf6b9e3ec1 - Enhanced check for select() and poll(). 2002-12-28 15:17:46 +00:00
Alexander Barton
50d354bc21 - Removed needless include of <sys/select.h>. 2002-12-28 15:01:45 +00:00
Alexander Barton
3c9da65652 - Added tests for <sys/poll.h> and poll(). 2002-12-28 14:56:21 +00:00
Alexander Barton
8340e4267c - Fixed prefix of error messages of KILL. 2002-12-27 13:35:19 +00:00
Alexander Barton
c9ee3ae4f0 - Updated documentation. 2002-12-27 13:24:55 +00:00
Alexander Barton
e21b9d842c - If the server can't close a socket, it panics now.
- Quite enhanced logging :-)
2002-12-27 13:20:13 +00:00
Alexander Barton
15e4f67402 - Nicer log messages ;-) 2002-12-27 13:17:32 +00:00
Alexander Barton
01bec0daa2 - KILL can't kill server-links any more. 2002-12-27 13:17:04 +00:00
Alexander Barton
d19813cc4b - new message ERR_CANTKILLSERVER_MSG. 2002-12-27 13:15:16 +00:00
Alexander Barton
cf7660c975 - Updated documentation. 2002-12-26 18:47:01 +00:00
Alexander Barton
9c5c0c7c84 - Updated documentation. 2002-12-26 18:44:41 +00:00
Alexander Barton
4d2f279d2d - fixed KILL: you can kill yourself now without crashing the server;
QUIT isn't send to other servers after the KILL any more.
2002-12-26 18:41:00 +00:00
Alexander Barton
371fc25967 - Updated documentation. 2002-12-26 17:19:55 +00:00
Alexander Barton
b316c380ad - replaced some calls to sprintf() with snprintf() -- more secure :-) 2002-12-26 17:14:48 +00:00
Alexander Barton
695631b298 - replaced a lot of strcpy() calls with strlcpy() which is more secure. 2002-12-26 17:04:54 +00:00
Alexander Barton
6626395c88 - replaced a lot of strcat() calls with strlcat() which is more secure. 2002-12-26 16:48:14 +00:00
Alexander Barton
0ced4181b0 - replaced all strncpy()'s and strncat()'s with strlcpy() and strlcat(). 2002-12-26 16:25:43 +00:00
Alexander Barton
4f6f84e7e1 - include <sys/types.h>, if available. 2002-12-26 14:48:05 +00:00
Alexander Barton
b8456d1ba6 - addes required libngircd.a library to portabcheck_LDADD. 2002-12-26 14:46:28 +00:00
Alexander Barton
fbdf85b553 - strlcat() and strlcpy() replacement functions. 2002-12-26 14:34:11 +00:00
Alexander Barton
e13cb291dd - added prototypes for replacement functions. 2002-12-26 13:26:34 +00:00
Alexander Barton
8193bf2070 - added tests for strlcpy() and strlcat(). 2002-12-26 13:20:07 +00:00
Alexander Barton
5efd0987f3 - added tests for replacement functions. 2002-12-26 13:19:36 +00:00
Alexander Barton
60cf07c875 - added strlcpy.c for strlcpy() and strlcat() replacement functions. 2002-12-26 13:18:46 +00:00
Alexander Barton
3c738ed46d - definition of CONFIG_FILE and MOTD_FILE is now compatible with -Wtraditional. 2002-12-26 13:17:56 +00:00
Alexander Barton
9353a4a9cb - reverted last patch: now compatible with -Wtraditional of GCC 3. 2002-12-26 13:16:54 +00:00
Alexander Barton
18dfd96635 - Updated documentation. 2002-12-25 13:33:54 +00:00
Alexander Barton
77751e0fbf - GCC: add "-Wtraditional -Wpointer-arith -Wstrict-prototypes" to CFLAGS. 2002-12-25 13:23:11 +00:00
Alexander Barton
d9a13b317e - fixed some warnings that showed up with -Wtraditional 2002-12-25 13:22:43 +00:00
Alexander Barton
d449496aa4 - Updated documentation. 2002-12-24 15:10:14 +00:00
Alexander Barton
2f90341225 - Updated documentation. 2002-12-22 23:51:46 +00:00
Alexander Barton
ab44e1c6cc - new messages: RPL_FEATURE, RPL_LOCALUSERS and RPL_NETUSERS. 2002-12-22 23:32:05 +00:00
Alexander Barton
a3f59f1a5b - new numeric on login: RPL_FEATURE 2002-12-22 23:31:21 +00:00
Alexander Barton
212d36a33c - enhanced LUSERS reply: RPL_LOCALUSERS, RPL_NETUSERS. 2002-12-22 23:30:33 +00:00
Alexander Barton
d0304b19a2 - new Functions: Client_MaxUserCount(), Client_MyMaxUserCount, Adjust_Counters(). 2002-12-22 23:29:09 +00:00
Alexander Barton
c69b208bd4 - Updated documentation. 2002-12-19 04:38:58 +00:00
Alexander Barton
397c5e2e02 - renamed variables to fit new signal handler.
- moved call to NGIRCd_Rehash() to Conn_Handler().
2002-12-19 04:35:26 +00:00
Alexander Barton
77c4c015e3 - renamed variables to fit new signal handler. 2002-12-19 04:33:27 +00:00
Alexander Barton
43a4bc5b8b - New signal handler. 2002-12-19 04:29:59 +00:00
Alexander Barton
1df4081e50 - Updated documentation. 2002-12-18 16:28:36 +00:00
89 changed files with 5329 additions and 2768 deletions

30
AUTHORS
View File

@@ -1,13 +1,33 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- AUTHORS / Autoren --
-- AUTHORS and CONTRIBUTORS --
Alexander Barton, alex@arthur.ath.cx
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 $

143
ChangeLog
View File

@@ -1,17 +1,148 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- ChangeLog / Aenderungen --
-- ChangeLog --
ngIRCd CVS-HEAD
ngIRCd 0.7.7 (2004-02-05)
- 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.
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
- 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
can kill only valid users now.
- The server no longer forwards commands to ordinary users, instead it
answers with the correct error message ("no such server") now.
- WHOIS commands weren't always forwarded as requested.
- 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.
- 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.
- The server didn't validate weather a target user is a valid channel
member when changing his channel user modes which could crash ngIRCd.
Older changes (sorry, only available in german language):
ngIRCd 0.6.0, 2002-12-24
ngIRCd 0.6.0-pre2, 2002-12-23
- neuer Numeric 005 ("Features") beim Connect.
- LUSERS erweitert: nun wird die maximale Anzahl der lokalen und globalen
Clients, die dem Server bzw. im Netzwerk seit dem letzten (Re-)Start
dem Server gleichzeitig bekannt waren, angezeigt.
ngIRCd 0.6.0-pre1, 2002-12-18
- beim Schliessen einer Verbindung zeigt der Server nun vor dem ERROR
noch eine Statistik ueber die empfangene und gesendete Datenmenge an.
- der Server wartet bei einer eingehenden Verbindung nun laenger auf den
@@ -362,4 +493,4 @@ ngIRCd 0.0.1, 31.12.2001
--
$Id: ChangeLog,v 1.147 2002/12/18 14:19:58 alex Exp $
$Id: ChangeLog,v 1.188.2.24 2004/02/05 13:33:24 alex Exp $

263
INSTALL
View File

@@ -1,162 +1,161 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- INSTALL --
-- INSTALL / Installation --
Ilja Osthoff, <ilja@glide.ath.cx>
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"!).
+-----------------------------------------------------------------------+
| Please note: English translations of some of the german documentation |
| files can be found in the directory "doc/en" -- please have a look! |
+-----------------------------------------------------------------------+
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
0. Update von frueheren Versionen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1): "autogen.sh"
Unterschiede zu Version 0.5.x
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.
- 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.
This step is therefore only interesting for developers.
- Neue Konfigurationsvariablen, Sektion [Global]: MaxConnections, MaxJoins
(vgl. auch Beispiel-Konfiguration "doc/sample-ngircd.conf"!)
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!
I. Standard-Installation
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
~~~~~~~~~~~~~~~~~~~~~~~~
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:
These parameters could be passed to the ngIRCd:
-f, --config <file>
Der Daemon wird angewiesen, statt der Standard-Konfigurationsdatei
/usr/local/etc/ngircd.conf die Datei <file> einzulesen.
The daemon uses the file <file> as configuration file rather than
the standard configuration /usr/local/etc/ngircd.conf.
-n, --nodaemon
ngIRCd soll im Fordergrund laufen; alle Meldungen werden zusaetzlich
zum Syslog auch auf der Konsole ausgegeben.
ngIRCd should be running as a foreground process.
-p, --passive
Verbindungen zu anderen Servern (wie in der Konfigurationsdatei in
[Server]-Abschnitten definiert) werden nicht automatisch hergestellt.
Server-links won't be automatically established.
--configtest
Die Konfigurationsdatei wird eingelesen, ueberprueft und so aus-
gegeben, wie sie vom ngIRCd interpretiert wurde. Danach beendet
sich der Server wieder.
Reads, validates and dumps the configuration file as interpreted
by the server. Then exits.
Mit dem Parameter "--help" werden alle unterstuetzten Parameter angezeigt,
mit "--version" die Versionsnummer. Bei beiden Parametern beendet sich der
Server nach der Ausgabe 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.
--
$Id: INSTALL,v 1.9 2002/12/18 12:19:07 alex Exp $
$Id: INSTALL,v 1.15.2.2 2004/02/03 16:01:29 alex Exp $

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1,19 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
# Copyright (c)2001-2003 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.
# 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.10 2002/10/01 09:57:08 alex Exp $
# $Id: Makefile.am,v 1.10.4.2 2003/07/09 21:14:08 alex Exp $
#
AUTOMAKE_OPTIONS = gnu
SUBDIRS = doc MacOSX src man contrib
SUBDIRS = doc MacOSX src man contrib debian
maintainer-clean-local:
rm -rf autom4te.cache
@@ -28,4 +27,7 @@ lint:
rpm: distcheck
rpm -ta ngircd-*.tar.gz
deb:
dpkg-buildpackage -rfakeroot
# -eof-

47
NEWS
View File

@@ -1,16 +1,51 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- NEWS / Neuigkeiten --
-- NEWS --
ngIRCd CVS-HEAD
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
noch eine Statistik ueber die empfangene und gesendete Datenmenge an.
@@ -139,4 +174,4 @@ ngIRCd 0.0.1, 31.12.2001
--
$Id: NEWS,v 1.45 2002/12/18 12:19:07 alex Exp $
$Id: NEWS,v 1.53.2.6 2004/02/03 16:01:29 alex Exp $

111
README
View File

@@ -1,105 +1,86 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2004 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- README / Liesmich --
-- README --
Ilja Osthoff, <ilja@glide.ath.cx>
+-----------------------------------------------------------------------+
| Please note: English translations of some of the german documentation |
| files can be found in the directory "doc/en" -- please have a look! |
+-----------------------------------------------------------------------+
I. Introduction
~~~~~~~~~~~~~~~
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.
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.
II. Status
~~~~~~~~~~~
Zur Zeit befindet sich der ngIRCd noch in Entwicklung, manche Features sind
noch nicht implementiert, andere nur teilweise.
At present, the ngIRCd is under active development, some features are not
implemented, some only partly.
Bisher (mehr oder wenig vollstaendig) implementierte IRC-Befehle:
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.
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.
III. Features (oder: warum gerade ngIRCd?)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
III. Features (or: why use ngIRCd?)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 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.
- 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.
IV. Dokumentation
IV. Documentation
~~~~~~~~~~~~~~~~~
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
More documentation can be found in the "doc/" directory and the homepage of
the ngIRCd: <http://arthur.ath.cx/~alex/ngircd/>.
V. Bezugsquellen
~~~~~~~~~~~~~~~~
V. Download
~~~~~~~~~~~
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.
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.
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.
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".
VI. Bugs
~~~~~~~~
Wenn du im ngIRCd Bugs finden solltest (so was soll ja auch vorkommen :-),
dann lege bitte einen Bug-Report ueber diese URL an:
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>
Dort kannst du dich auch ueber bekannte Fehler informieren.
There you can read about known bugs and limitations, too.
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.
If you have critics, patches or something else, please feel free to post a
mail to: <alex@barton.de> or <alex@arthur.ath.cx>
--
$Id: README,v 1.14 2002/11/24 18:48:59 alex Exp $
$Id: README,v 1.17.2.1 2004/02/03 16:01:29 alex Exp $

View File

@@ -1,16 +1,15 @@
#!/bin/sh
#
# $Id: autogen.sh,v 1.3 2002/03/12 14:37:51 alex Exp $
# $Id: autogen.sh,v 1.6.2.1 2003/04/22 10:18:41 alex Exp $
#
if [ -f configure ]; then
echo "autogen.sh: configure-Skript existiert bereits ..."
fi
WANT_AUTOMAKE=1.6
export WANT_AUTOMAKE
aclocal && \
autoheader && \
automake --add-missing && \
autoconf && \
echo "Okay, autogen.sh war erfolgreich."
echo "Okay, autogen.sh done."
# -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 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2002-03-04'
timestamp='2003-10-07'
# 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,30 +88,42 @@ if test $# != 0; then
exit 1
fi
trap 'exit 1' 1 2 15
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. 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.
# 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.
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
# 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
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)
@@ -142,6 +154,7 @@ 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 ;;
@@ -167,7 +180,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# 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
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
@@ -216,65 +240,52 @@ 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
@@ -313,6 +324,13 @@ EOF
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 ;;
@@ -419,15 +437,20 @@ EOF
exit (-1);
}
EOF
$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
$CC_FOR_BUILD -o $dummy $dummy.c \
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& exit 0
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 ;;
@@ -500,8 +523,7 @@ EOF
exit(0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -599,11 +621,21 @@ EOF
exit (0);
}
EOF
(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
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
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:*:*)
@@ -637,8 +669,7 @@ EOF
exit (0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -696,15 +727,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/\///'`
@@ -721,7 +752,21 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
# 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}
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
@@ -732,14 +777,17 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
x86:Interix*:3*)
echo i386-pc-interix3
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
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 i386-pc-interix
echo i586-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
@@ -751,16 +799,24 @@ 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
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -771,19 +827,37 @@ 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=`
rm -f $dummy.c
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
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
;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
@@ -819,6 +893,9 @@ 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 ;;
@@ -845,7 +922,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 ;;
@@ -876,9 +953,11 @@ 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
;;
@@ -896,6 +975,23 @@ 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
@@ -917,22 +1013,19 @@ 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|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
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_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
(/bin/uname -X|grep '^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
@@ -956,9 +1049,15 @@ 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[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)
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)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -975,9 +1074,6 @@ 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 ;;
@@ -1049,6 +1145,9 @@ 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 ;;
@@ -1056,20 +1155,24 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
echo `uname -p`-apple-darwin${UNAME_RELEASE}
case `uname -p` in
*86) UNAME_PROCESSOR=i686 ;;
powerpc) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
if test "${UNAME_MACHINE}" = "x86pc"; then
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
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-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
@@ -1092,11 +1195,6 @@ 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 ;;
@@ -1115,11 +1213,8 @@ EOF
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit 0 ;;
esac
@@ -1241,8 +1336,7 @@ main ()
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
# 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 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2002-03-04'
timestamp='2003-10-07'
# 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* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -228,28 +228,42 @@ 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 | dsp16xx \
| fr30 \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32r | m68000 | m68k | m88k | mcore \
| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
| mipsisa32 \
| 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 \
| mn10200 | mn10300 \
| msp430 \
| ns16k | ns32k \
| openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
@@ -281,34 +295,50 @@ 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-* | armv*-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \
| d10v-* | d30v-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | fx80-* \
| f30[01]-* | f700-* | fr30-* | frv-* | 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-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| 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-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
@@ -346,6 +376,9 @@ case $basic_machine in
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -695,6 +728,10 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -728,49 +765,55 @@ 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)
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2)
pentiumii | pentium2 | pentiumiii | pentium3)
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-*)
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
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/^[^-]*-//'`
;;
@@ -801,6 +844,16 @@ 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
;;
@@ -808,6 +861,9 @@ 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
@@ -866,7 +922,7 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
sv1)
basic_machine=sv1-cray
os=-unicos
;;
@@ -874,10 +930,6 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
t3d)
basic_machine=alpha-cray
os=-unicos
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
@@ -890,6 +942,14 @@ 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
;;
@@ -924,8 +984,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
@@ -946,11 +1006,7 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
windows32)
basic_machine=i386-pc
os=-windows32-msvcrt
;;
xps | xps100)
xps | xps100)
basic_machine=xps100-honeywell
;;
ymp)
@@ -996,7 +1052,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
sh3 | sh4 | sh3eb | sh4eb)
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sh64)
@@ -1005,7 +1061,7 @@ case $basic_machine in
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
cydra)
basic_machine=cydra-cydrome
;;
orion)
@@ -1020,10 +1076,6 @@ 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.
;;
@@ -1079,18 +1131,19 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -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* | -rhapsody* | -darwin* | -opened* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova*)
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1102,8 +1155,10 @@ case $os in
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=-nto-qnx
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@@ -1112,6 +1167,9 @@ 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|'`
;;
@@ -1155,7 +1213,7 @@ case $os in
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
os=-nextstep2
;;
-nsk*)
os=-nsk
@@ -1194,8 +1252,14 @@ case $os in
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-none)
;;
@@ -1228,11 +1292,14 @@ 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-*)
@@ -1325,19 +1392,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)
@@ -1409,7 +1476,7 @@ case $basic_machine in
-ptx*)
vendor=sequent
;;
-vxsim* | -vxworks*)
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)

View File

@@ -1,24 +1,23 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
# Copyright (c)2001-2003 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.
# 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: configure.in,v 1.69 2002/11/30 22:14:47 alex Exp $
# $Id: configure.in,v 1.89.2.16 2004/02/05 13:33:24 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
AC_CONFIG_SRCDIR(src/config.h.in)
AM_INIT_AUTOMAKE(ngircd,CVSHEAD)
AM_INIT_AUTOMAKE(1.6)
AM_CONFIG_HEADER(src/config.h)
# -- Templates fuer config.h --
@@ -27,9 +26,11 @@ 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([USE_SYSLOG], [Define if syslog should be used for logging])
AH_TEMPLATE([USE_ZLIB], [Define if zlib compression should be enabled])
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([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])
@@ -56,16 +57,32 @@ AC_C_CONST
# -- Defines --
if test `uname` = "A/UX"; then
# unter A/UX sollte _POSIX_SOURCE definiert sein.
AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
CFLAGS="$CFLAGS -D_POSIX_SOURCE"
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 `uname` = "HP-UX"; then
# unter HP-UX 11.11 muss _XOPEN_SOURCE_EXTENDED definiert sein.
if test "$os" = "A/UX"; then
# define _POSIX_SOURCE when compiling on A/UX:
AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
add_DEFINES="-D_POSIX_SOURCE $add_DEFINES"
fi
if test "$os" = "HP-UX"; then
# define _XOPEN_SOURCE_EXTENDED when compiling on HP-UX (11.11):
AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
CFLAGS="$CFLAGS -D_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"
fi
# -- Header --
@@ -81,7 +98,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 sys/select.h varargs.h)
AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
# -- Datentypen --
@@ -118,44 +135,92 @@ AC_FUNC_STRFTIME
AC_CHECK_FUNCS([ \
bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
memset select setsockopt socket strcasecmp strchr strerror \
strstr waitpid \
memset setsockopt socket strcasecmp strchr strerror strstr waitpid \
],,AC_MSG_ERROR([required function missing!]))
AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf)
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!])
)
# -- Konfigurationsoptionen --
x_syslog_on=no
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!])
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!])
)
fi
],
[ AC_CHECK_HEADER(syslog.h, x_syslog_on=yes) ]
[
AC_CHECK_LIB(be, syslog)
AC_CHECK_FUNCS(syslog, x_syslog_on=yes)
]
)
if test "$x_syslog_on" = "yes"; then
AC_DEFINE(USE_SYSLOG, 1)
AC_CHECK_LIB(be,syslog)
AC_DEFINE(SYSLOG, 1)
AC_CHECK_HEADERS(syslog.h)
fi
x_zlib_on=no
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!])
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!])
)
fi
],
[ AC_CHECK_HEADER(zlib.h, x_zlib_on=yes) ]
[ AC_CHECK_LIB(z, deflate)
AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
]
)
if test "$x_zlib_on" = "yes"; then
AC_DEFINE(USE_ZLIB, 1)
AC_CHECK_LIB(z,deflate)
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)
fi
x_ircplus_on=yes
@@ -167,6 +232,7 @@ 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
@@ -183,6 +249,7 @@ 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
@@ -191,7 +258,6 @@ AC_ARG_ENABLE(strict-rfc,
fi
)
# -- Definitionen --
AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
@@ -201,31 +267,64 @@ AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
# -- Variablen --
if test "$GCC" = "yes"; then
CFLAGS="-Wall $CFLAGS"
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"
fi
the_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
CFLAGS="$the_CFLAGS $add_CFLAGS $add_DEFINES -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 \
])
# -- Ergebnis --
# -- Result --
echo
echo "ngIRCd has been configured with the following options:"
echo
# Someone please show me a better way :) [borrowed by OpenSSH]
@@ -233,26 +332,58 @@ 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}"
echo " preprocessor flags: ${CPPFLAGS}"
echo " linker flags: ${LDFLAGS}"
echo " libraries: ${LIBS}"
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
echo " 'ngircd' binary: $S"
echo " configuration file: $C"
echo " manual pages: $M"
echo " 'ngircd' binary: $S"
echo " Configuration file: $C"
echo " Manual pages: $M"
echo " Documentation: $D"
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
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
# -eof-

View File

@@ -1,9 +1,9 @@
%define name ngircd
%define version CurrentCVS
%define version 0.7.7
%define release 1
%define prefix %{_prefix}
Summary: Next Generation Internet Relay Chat Daemon
Summary: A lightweight daemon for the Internet Relay Chat (IRC)
Name: %{name}
Version: %{version}
Release: %{release}
@@ -15,17 +15,18 @@ Packager: Sean Reifschneider <jafo-rpms@tummy.com>
BuildRoot: /var/tmp/%{name}-root
%description
ngIRCd is a free open source daemon for Internet Relay Chat (IRC),
ngIRCd is a free open source daemon for the 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.
Why should you use ngIRCd? Because ...
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.
* ... 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.
ngIRCd is compatible to the "original" ircd 2.10.3p3, so you can run
mixed networks.
%prep
%setup

20
debian/Makefile.am vendored Normal file
View File

@@ -0,0 +1,20 @@
#
# 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 Normal file
View File

@@ -0,0 +1,78 @@
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 Normal file
View File

@@ -0,0 +1 @@
4

23
debian/control vendored Normal file
View File

@@ -0,0 +1,23 @@
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 Normal file
View File

@@ -0,0 +1,13 @@
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 Normal file
View File

@@ -0,0 +1,12 @@
#
# 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 Normal file
View File

@@ -0,0 +1,71 @@
#!/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-

14
debian/ngircd.postinst vendored Normal file
View File

@@ -0,0 +1,14 @@
#!/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 Normal file
View File

@@ -0,0 +1,110 @@
#!/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,64 +1,56 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2003 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- CVS.txt --
Die Sourcen des ngIRCd werden mit dem "Concurrent Versions System" (CVS)
verwaltet. Somit koennen ohne Probleme mehrere Leute gleichzeitig die Sourcen
bearbeitet.
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.
I. Anonymer "Nur-Lesen"-Zugang
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anonymer Zugriff auf die CVS-Repository von ngIRCd ist im "nur-lesen"-Modus
moeglich. Dazu sind folgende Schritte noetig:
I. Anonymous read-only Access
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To access the source tree anonymously in read-only mode, follow these steps:
Beim CVS-Server anmelden
Login to the CVS server:
$ cvs -d:pserver:anonymous@arthur.ath.cx:/usr/local/CVS/ngircd login
Als Benutzername wird "anonymous" mit einem leeren Passwort verwendet.
Nun ein "Check-Out" der Quellcodes durchfuehren:
Use "anonymous" as user name and no password (just hit Return). Now you can
check out the sources:
$ cvs -d:pserver:anonymous@arthur.ath.cx:/usr/local/CVS/ngircd checkout ngircd
Dadurch wird im aktuellen Verzeichnis der neue Ordner "ngircd" mit allen
Quell-Dateien des ngIRCd erzeugt.
Thereby a new folder "ngircd" will be created containing all the individual
source files.
Dieses ist der "Arbeitsordner", alle CVS-Befehle werden in Zukunft aus
diesem Ordner bzw. einem Unterordner davon ausgefuehrt.
This is the "working folder", all CVS commands will be executed from within
this folder in the future.
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!
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.
CVS-Tree aktualisieren:
Updating the CVS tree:
$ cvs update
$ cvs update -d -P [<filename>]
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 ;-))
You can update a single file or the complete source tree.
III. Schreibzugriff
~~~~~~~~~~~~~~~~~~~
Wer Schreibzugriff auf die CVS-Repository wuenscht, der moege sich bitte
mit Alex Barton, <alex@barton.de> in Verbindung setzen.
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>.
--
$Id: CVS.txt,v 1.5 2002/02/15 15:15:22 alex Exp $
$Id: CVS.txt,v 1.7 2003/03/26 22:34:33 alex Exp $

View File

@@ -1,61 +1,67 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2003 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- FAQ: Frequently Asked Questions --
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.
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.
Q: Gibt es eine Homepage mit Informationen und Downloads?
A: Ja. Die URL ist <http://arthur.ath.cx/~alex/ngircd/>.
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.
II. Compilieren
II. Compilation
~~~~~~~~~~~~~~~
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: 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: ./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 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 "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").
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.)
III. Bugs!?
~~~~~~~~~~~
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: 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: 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/>
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 :-)
--
$Id: FAQ.txt,v 1.2 2002/02/19 20:05:02 alex Exp $
$Id: FAQ.txt,v 1.5.2.1 2003/04/29 13:45:09 alex Exp $

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
# Copyright (c)2001-2003 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,21 +9,31 @@
# 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 2002/09/16 10:35:06 alex Exp $
# $Id: Makefile.am,v 1.16.2.1 2003/04/22 23:52:48 alex Exp $
#
SUBDIRS = en
EXTRA_DIST = CVS.txt FAQ.txt Protocol.txt README-AUX.txt \
README-BeOS.txt RFC.txt sample-ngircd.conf
EXTRA_DIST = CVS.txt FAQ.txt Protocol.txt Platforms.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
fi
$(mkinstalldirs) $(DESTDIR)$(docdir)
for f in $(documents); do \
$(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/; \
done
uninstall-hook:
rm -rf $(DESTDIR)$(docdir)
# -eof-

56
doc/Platforms.txt Normal file
View File

@@ -0,0 +1,56 @@
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,109 +1,114 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2003 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the GNU General Public License.
-- Protocol.txt --
I. Kompatibilitaet
~~~~~~~~~~~~~~~~~~
I. Compatibility
~~~~~~~~~~~~~~~~
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.
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.
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.
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.
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.
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".
II. Das IRC+-Protokoll
~~~~~~~~~~~~~~~~~~~~~~
II. The IRC+ Protocol
~~~~~~~~~~~~~~~~~~~~~
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.
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.
Die Protokoll- und Server-Erkennung wird mit dem "PASS"-Befehl durchgefuehrt
(vgl. RFC 2813, Sektion 4.1.1):
The "PASS" command is used to detect the protocol and peer versions see
RFC 2813 (section 4.1.1) and below.
II.1 neuen Server-Link registrieren
II.1 Register new server link
Befehl: PASS
Parameter: <password> <version> <flags> [<options>]
Fuer: mit dieser Syntax nur Server
Command: PASS
Parameters: <password> <version> <flags> [<options>]
Used by: servers only (with these parameters)
<password> enthaelt das Passwort fur den neu aufzubauenden Server-Link,
so wie es in der Konfigurationsdatei definiert wurde.
<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.
<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+".
<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.).
<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>]".
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.
<serverversion> ist hier eine ASCII-Klartext-Darstellung der Versionsnummer,
<serverflags> zeigt die vom Server unterstuetzten Erweiterungen an (und
kann die leere Menge sein).
Example for <version>: "0210-IRC+".
Mit dem optionalen Parameter <options> werden Server-Optionen uebermittelt,
wie sie in RFC 2813, Sektion 4.1.1 definiert sind.
<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>]".
Folgende <serverflags> sind zur Zeit definiert:
<serverversion> is an ASCII representation of the clear-text server version
number, <serverflags> indicates the supported IRC+ protocol extensions (and
may be empty!).
- o: IRC-Operatoren duerfen auch dann Channel- und Channel-User-Modes
aendern, wenn sie kein Channel-Operator im betroffenen Channel sind.
The following <serverflags> are defined at the moment:
- C: der Server unterstuetzt den CHANINFO-Befehl.
- 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.
II.2 Channel-Modes, persistente Channel und Topic austauschen
II.2 Exchange channel-modes, topics, and persistent channels
Befehl: CHANINFO
Parameter: <channel> +<mode> [<topic>]
Fuer: Server
Command: CHANINFO
Parameters: <channel> +<modes> <key> <maxusers> [<topic>]
Used by: servers only
Mit CHANINFO Informiert ein Server den anderen ueber einen Channel: dessen
Modes und dessen Topic. <topic> ist optional.
CHANINFO is used by servers to inform each other about a channel: its
modes, channel key, user limits and its topic. <topic> is optional.
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 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 der Channel noch nicht, so wird er mit den entsprechenden Angaben
erzeugt.
If the channel doesn't exists at all it will be created.
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".
--
$Id: Protocol.txt,v 1.5 2002/09/04 00:06:19 alex Exp $
$Id: Protocol.txt,v 1.9.2.2 2003/12/08 14:24:13 alex Exp $

View File

@@ -1,68 +1,67 @@
ngIRCd - Next Generation IRC Server
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
alex@barton.de, http://www.barton.de/
(c)2001-2003 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
-- README-AUX.txt --
ngIRCd is free software and published under the
terms of the GNU General Public License.
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.
-- README-AUX.txt --
Noch ein paar Hinweise, wenn es doch (noch) nicht klappt:
Since version 0.2.2-pre Apple's A/UX belongs to the officially supported
platforms. It is not restricted in any way.
- 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
Since version 0.5.0 ngIRCd's source compiles with the native A/UX c
compiler. GNU C isn't a must-have anymore.
- 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.
The following software packages are needed:
- 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.
- 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
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.4 2002/11/11 00:59:11 alex Exp $
$Id: README-AUX.txt,v 1.8 2003/04/21 21:59:34 goetz Exp $

View File

@@ -1,15 +1,21 @@
ngIRCd - Next Generation IRC Server
(c)2001,2002 by Alexander Barton,
(c)2001-2003 by Alexander Barton,
alex@barton.de, http://www.barton.de/
ngIRCd ist freie Software und steht unter
der GNU General Public License.
ngIRCd is free software and published under the
terms of the 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
@@ -44,4 +50,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.3 2002/05/19 13:10:26 alex Exp $
$Id: README-BeOS.txt,v 1.6.2.1 2003/07/18 20:48:20 alex Exp $

View File

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

View File

@@ -1,139 +0,0 @@
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 $

View File

@@ -1,20 +0,0 @@
#
# 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-

View File

@@ -1,101 +0,0 @@
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 $

View File

@@ -1,138 +0,0 @@
# $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,164 +1,149 @@
# $Id: sample-ngircd.conf,v 1.17 2002/12/18 12:19:07 alex Exp $
# $Id: sample-ngircd.conf,v 1.20.2.4 2003/12/19 14:30:49 alex Exp $
#
# Das ist eine Beispiel-Konfiguration fuer den ngIRCd, die an die
# jeweiligen Beduerfnisse angepasst werden kann/muss.
# This is a sample configuration file for the ngIRCd, which must be adepted
# to the local preferences and needs.
#
# Kommentare werden mit "#" oder ";" eingeleitet.
# Comments are started with "#" or ";".
#
# +-----------------------------------------------------------------------+
# | 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>
# Use "ngircd --configtest" (see manual page ngircd(8)) to validate that the
# server interpreted the configuration file as expected!
#
[Global]
#
# 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
# 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!
Name = irc.the.net
# Info-Text des Servers. Dieser wird z.B. bei WHOIS- oder LINKS-
# Abfragen entsprechend mit ausgegeben.
# Info text of the server. This will be shown by WHOIS and
# LINKS requests for example.
Info = Server Info Text
# Informationen ueber den Server und Administrator fuer den
# ADMIN-Befehl:
;AdminInfo1 = Beschreibung
;AdminInfo2 = Standort
# 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
;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
# 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.
# 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:
;MotdFile = /usr/local/etc/ngircd.motd
# 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
# 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
# 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
# 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
# Nach <PingTimeout> Sekunden verschickt der Server bei Inaktivitaet
# von einem Client diesem ein PING.
# After <PingTimeout> seconds of inactivity the server will send a
# PING to the peer to test whether it is alive or not.
;PingTimeout = 120
# Antwortet ein Client, der ein PING bekam, nicht innerhalb von
# <PongTimeout> Sekunden mit einem PONG, so wird er disconnectiert.
# If a client fails to answer a PING with a PONG within <PongTimeout>
# seconds, it will be disconnected by the server.
;PongTimeout = 20
# Der Server versucht alle <ConnectRetry> Sekunden, noch nicht bzw.
# nicht mehr connectierte Server-Links aufzubauen.
# The server tries every <ConnectRetry> seconds to establish a link
# to not yet (or no longer) connected servers.
;ConnectRetry = 60
# Sollen IRC-Operatoren immer den MODE-Befehl in Channel benutzen
# koennen, auch wenn sie kein(!) Channel-Operator sind?
# Should IRC Operators be allowed to use the MODE command even if
# they are not(!) channel-operators?
;OperCanUseMode = no
# Maximale Anzahl von gleichzeitigen Verbindungen, die dieser
# Server annehmen darf (<=0: unlimitiert).
# Maximum number of simultaneous connection the server is allowed
# to accept (<=0: unlimited):
;MaxConnections = -1
# Maximum number of simultaneous connections from a single IP address
# the server will accept (<=0: unlimited):
;MaxConnectionsIP = 5
# Maximale Anzahl von Channels, in denen ein User zeitgleich
# Mitglied sein kann (<=0: unlimitiert).
# Maximum number of channels a user can be member of (<=0: no limit):
;MaxJoins = 10
[Operator]
#
# 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).
# [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)
;Name = TheOper
# Passwort des IRC-Operators
# Password of the IRC operator
;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.
#
# 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
# 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
;Name = irc2.the.net
# DNS-Hostname des Servers
# Internet host name of the peer
;Host = connect-to-host.the.net
# Port, zu dem dieser Server eine Verbindung herstellen soll. Wird
# kein Port angegeben, so wird auf eine Verbindung der Gegenseite
# gewartet.
# Port of the server to which the ngIRCd should connect. If you
# assign no port the ngIRCd waits for incoming connections.
;Port = 6666
# Eigenes Passwort fuer diese Verbindung. Dieses Passwort muss auf
# dem anderen Server als "PeerPassword" konfiguriert werden.
# Own password for the connection. This password has to be configured
# as "PeerPassword" on the other server.
;MyPassword = MySecret
# Passwort des Peer-Servers fuer diese Verbindung. Dieses Passwort
# muss auf dem anderen Server als "MyPassword" konfiguriert sein.
# Foreign password for this connection. This password has to be
# configured as "MyPassword" on the other server.
;PeerPassword = PeerSecret
# Gruppe, zu der dieser Server gehoert (optional).
# Group of this server (optional)
;Group = 123
[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
# 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
;Name = #TheName
# Topic, das gesetzt werden soll
;Topic = Ein tolles Topic
# Channel-Modes
# Topic for this channel
;Topic = a great topic
# Initial channel modes
;Modes = tn
# -eof-

View File

@@ -1,7 +1,7 @@
.\"
.\" $Id: ngircd.8,v 1.5 2002/11/18 18:49:34 alex Exp $
.\" $Id: ngircd.8,v 1.8 2003/03/10 00:58:06 alex Exp $
.\"
.TH ngircd 8 "September 2002" ngircd "ngIRCd Manual"
.TH ngircd 8 "March 2003" ngircd "ngIRCd Manual"
.SH NAME
ngircd \- the next generation IRC daemon
.SH SYNOPSIS
@@ -9,32 +9,63 @@ ngircd \- the next generation IRC daemon
.I Options
.B ]
.SH DESCRIPTION
.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.
.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.
.SH OPTIONS
.IP --configtest
read, validate and display configuration; then exit.
.IP "-f file, --config file"
use
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
.I file
as configuration file.
.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.
.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.
.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,14 +1,204 @@
.\"
.\" $Id: ngircd.conf.5,v 1.6 2002/09/16 11:11:21 alex Exp $
.\" $Id: ngircd.conf.5,v 1.9.2.2 2003/11/07 20:51:10 alex Exp $
.\"
.TH ngircd.conf 5 "September 2002" ngircd "ngIRCd Manual"
.TH ngircd.conf 5 "Mai 2003" 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
(coming soon, please have a look at the sample configuration
file "doc/sample-ngircd.conf" -- Thank you!)
.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.
.SH AUTHOR
Alexander Barton,
.UR mailto:alex@barton.de
@@ -21,6 +211,5 @@ http://arthur.ath.cx/~alex/ngircd/
.UE
.SH "SEE ALSO"
.BR ngircd (8)
.BR ircd (8)
.\"
.\" -eof-

View File

@@ -2,17 +2,16 @@
# 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.
# 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.4 2002/09/09 10:00:15 alex Exp $
# $Id: Makefile.am,v 1.5 2003/01/13 12:20:16 alex Exp $
#
SUBDIRS = portab ngircd testsuite
SUBDIRS = portab tool ngircd testsuite
maintainer-clean-local:
rm -f Makefile Makefile.in config.h config.h.in stamp-h.in

View File

@@ -1,36 +1,37 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
# Copyright (c)2001-2003 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.
# 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.31 2002/12/12 12:36:41 alex Exp $
# $Id: Makefile.am,v 1.39.2.3 2003/12/04 14:13:42 alex Exp $
#
AUTOMAKE_OPTIONS = ../portab/ansi2knr
INCLUDES = -I$(srcdir)/../portab
INCLUDES = -I$(srcdir)/../portab -I$(srcdir)/../tool
LINTARGS = -weak -warnunixlib +unixlib -booltype BOOLEAN
sbin_PROGRAMS = ngircd
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_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_LDFLAGS = -L../portab
ngircd_LDFLAGS = -L../portab -L../tool
ngircd_LDADD = -lngportab
ngircd_LDADD = -lngportab -lngtool
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 \
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 \
messages.h defines.h
clean-local:
@@ -60,14 +61,22 @@ lint:
fi; \
done;
ngircd.c: cvs-date cvs-version.h
ngircd.c: cvs-version.h
irc-login.c: cvs-version.h
irc-info.c: cvs-version.h
cvs-version.h: cvs-date
cvs-date:
grep VERSION ../config.h | grep "CVS" \
&& echo "#define CVSDATE \"$$( grep "\$$Id" $(srcdir)/*.c \
| awk "{ print \$$9 }" | sort | tail -n 1 )\"" > cvs-version.new \
| $(AWK) "{ print \$$9 }" | sort | tail -1 \
| sed -e "s/\//-/g" )\"" > cvs-version.new \
|| echo "" > cvs-version.new
diff cvs-version.h cvs-version.new || cp cvs-version.new cvs-version.h
diff cvs-version.h cvs-version.new 2>/dev/null \
|| 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.38 2002/12/16 23:05:24 alex Exp $";
static char UNUSED id[] = "$Id: channel.c,v 1.42.2.1 2003/11/07 20:51:10 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "conn.h"
#include "conn-func.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, " ,:\x07" );
strcpy( badchars, " ,:\007" );
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 */
strcat( Chan->modes, x );
strlcat( Chan->modes, x, sizeof( Chan->modes ));
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 */
strcat( cl2chan->modes, x );
strlcat( cl2chan->modes, x, sizeof( cl2chan->modes ));
return TRUE;
}
else return FALSE;
@@ -629,8 +629,7 @@ Channel_SetTopic( CHANNEL *Chan, CHAR *Topic )
assert( Chan != NULL );
assert( Topic != NULL );
strncpy( Chan->topic, Topic, CHANNEL_TOPIC_LEN - 1 );
Chan->topic[CHANNEL_TOPIC_LEN - 1] = '\0';
strlcpy( Chan->topic, Topic, sizeof( Chan->topic ));
} /* Channel_SetTopic */
@@ -640,8 +639,7 @@ Channel_SetModes( CHANNEL *Chan, CHAR *Modes )
assert( Chan != NULL );
assert( Modes != NULL );
strncpy( Chan->modes, Modes, CHANNEL_MODE_LEN - 1 );
Chan->topic[CHANNEL_MODE_LEN - 1] = '\0';
strlcpy( Chan->modes, Modes, sizeof( Chan->modes ));
} /* Channel_SetModes */
@@ -651,8 +649,7 @@ Channel_SetKey( CHANNEL *Chan, CHAR *Key )
assert( Chan != NULL );
assert( Key != NULL );
strncpy( Chan->key, Key, CLIENT_PASS_LEN - 1 );
Chan->key[CLIENT_PASS_LEN - 1] = '\0';
strlcpy( Chan->key, Key, sizeof( Chan->key ));
Log( LOG_DEBUG, "Channel %s: Key is now \"%s\".", Chan->name, Chan->key );
} /* Channel_SetKey */
@@ -672,7 +669,7 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
{
BOOLEAN is_member, has_voice, is_op, ok;
/* Okay, Ziel ist ein Channel */
/* Okay, target is a channel */
is_member = has_voice = is_op = FALSE;
if( Channel_IsMemberOf( Chan, From ))
{
@@ -681,14 +678,21 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
if( strchr( Channel_UserModes( Chan, From ), 'o' )) is_op = TRUE;
}
/* pruefen, ob Client in Channel schreiben darf */
/* Check weather client is allowed to write to channel */
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 ));
/* Text senden */
/* Send text */
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 */
@@ -710,7 +714,7 @@ Channel_Create( CHAR *Name )
return NULL;
}
c->next = NULL;
strncpy( c->name, Name, CHANNEL_NAME_LEN - 1 );
strlcpy( c->name, Name, sizeof( c->name ));
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.65 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: client.c,v 1.74 2003/03/31 15:54:21 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -57,6 +57,14 @@ LOCAL LONG MyCount PARAMS(( CLIENT_TYPE Type ));
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;
GLOBAL VOID
@@ -68,7 +76,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 );
Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
exit( 1 );
}
@@ -82,7 +90,7 @@ Client_Init( VOID )
gethostname( This_Server->host, CLIENT_HOST_LEN );
h = gethostbyname( This_Server->host );
if( h ) strcpy( This_Server->host, h->h_name );
if( h ) strlcpy( This_Server->host, h->h_name, sizeof( This_Server->host ));
Client_SetID( This_Server, Conf_ServerName );
Client_SetInfo( This_Server, Conf_ServerInfo );
@@ -97,7 +105,7 @@ Client_Exit( VOID )
CLIENT *c, *next;
INT cnt;
if( NGIRCd_Restart ) Client_Destroy( This_Server, "Server going down (restarting).", NULL, FALSE );
if( NGIRCd_SignalRestart ) Client_Destroy( This_Server, "Server going down (restarting).", NULL, FALSE );
else Client_Destroy( This_Server, "Server going down.", NULL, FALSE );
cnt = 0;
@@ -171,12 +179,15 @@ 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' )) strcpy( client->away, DEFAULT_AWAY_MSG );
if( strchr( client->modes, 'a' )) strlcpy( client->away, DEFAULT_AWAY_MSG, sizeof( client->away ));
/* Verketten */
client->next = (POINTER *)My_Clients;
My_Clients = client;
/* Adjust counters */
Adjust_Counters( client );
return client;
} /* Client_New */
@@ -196,7 +207,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 ) sprintf( msg, "%s: lost server %s", This_Server->id, Client->id );
if( Client->type == CLIENT_SERVER ) snprintf( msg, sizeof( msg ), "%s: lost server %s", This_Server->id, Client->id );
last = NULL;
c = My_Clients;
@@ -256,7 +267,7 @@ Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit )
}
/* andere Server informieren */
if( ! NGIRCd_Quit )
if( ! NGIRCd_SignalQuit )
{
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 );
@@ -285,6 +296,35 @@ 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 )
{
@@ -293,8 +333,7 @@ Client_SetHostname( CLIENT *Client, CHAR *Hostname )
assert( Client != NULL );
assert( Hostname != NULL );
strncpy( Client->host, Hostname, CLIENT_HOST_LEN - 1 );
Client->host[CLIENT_HOST_LEN - 1] = '\0';
strlcpy( Client->host, Hostname, sizeof( Client->host ));
} /* Client_SetHostname */
@@ -306,8 +345,7 @@ Client_SetID( CLIENT *Client, CHAR *ID )
assert( Client != NULL );
assert( ID != NULL );
strncpy( Client->id, ID, CLIENT_ID_LEN - 1 );
Client->id[CLIENT_ID_LEN - 1] = '\0';
strlcpy( Client->id, ID, sizeof( Client->id ));
/* Hash */
Client->hash = Hash( Client->id );
@@ -322,13 +360,12 @@ Client_SetUser( CLIENT *Client, CHAR *User, BOOLEAN Idented )
assert( Client != NULL );
assert( User != NULL );
if( Idented ) strncpy( Client->user, User, CLIENT_USER_LEN - 1 );
if( Idented ) strlcpy( Client->user, User, sizeof( Client->user ));
else
{
Client->user[0] = '~';
strncpy( Client->user + 1, User, CLIENT_USER_LEN - 2 );
strlcpy( Client->user + 1, User, sizeof( Client->user ) - 1 );
}
Client->user[CLIENT_USER_LEN - 1] = '\0';
} /* Client_SetUser */
@@ -340,8 +377,7 @@ Client_SetInfo( CLIENT *Client, CHAR *Info )
assert( Client != NULL );
assert( Info != NULL );
strncpy( Client->info, Info, CLIENT_INFO_LEN - 1 );
Client->info[CLIENT_INFO_LEN - 1] = '\0';
strlcpy( Client->info, Info, sizeof( Client->info ));
} /* Client_SetInfo */
@@ -353,8 +389,7 @@ Client_SetModes( CLIENT *Client, CHAR *Modes )
assert( Client != NULL );
assert( Modes != NULL );
strncpy( Client->modes, Modes, CLIENT_MODE_LEN - 1 );
Client->modes[CLIENT_MODE_LEN - 1] = '\0';
strlcpy( Client->modes, Modes, sizeof( Client->modes ));
} /* Client_SetModes */
@@ -366,8 +401,7 @@ Client_SetFlags( CLIENT *Client, CHAR *Flags )
assert( Client != NULL );
assert( Flags != NULL );
strncpy( Client->flags, Flags, CLIENT_FLAGS_LEN - 1 );
Client->flags[CLIENT_FLAGS_LEN - 1] = '\0';
strlcpy( Client->flags, Flags, sizeof( Client->flags ));
} /* Client_SetFlags */
@@ -379,32 +413,20 @@ Client_SetPassword( CLIENT *Client, CHAR *Pwd )
assert( Client != NULL );
assert( Pwd != NULL );
strncpy( Client->pwd, Pwd, CLIENT_PASS_LEN - 1 );
Client->pwd[CLIENT_PASS_LEN - 1] = '\0';
strlcpy( Client->pwd, Pwd, sizeof( Client->pwd ));
} /* Client_SetPassword */
GLOBAL VOID
Client_SetAway( CLIENT *Client, CHAR *Txt )
{
/* Von einem Client gelieferte AWAY-Nachricht */
/* Set AWAY reason of client */
assert( Client != NULL );
assert( Txt != NULL );
if( Txt )
{
/* Client AWAY setzen */
strncpy( Client->away, Txt, CLIENT_AWAY_LEN - 1 );
Client->away[CLIENT_AWAY_LEN - 1] = '\0';
Client_ModeAdd( Client, 'a' );
Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt );
}
else
{
/* AWAY loeschen */
Client_ModeDel( Client, 'a' );
Log( LOG_DEBUG, "User \"%s\" is no longer away.", Client_Mask( Client ));
}
strlcpy( Client->away, Txt, sizeof( Client->away ));
Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt );
} /* Client_SetAway */
@@ -414,6 +436,7 @@ Client_SetType( CLIENT *Client, INT Type )
assert( Client != NULL );
Client->type = Type;
if( Type == CLIENT_SERVER ) Generate_MyToken( Client );
Adjust_Counters( Client );
} /* Client_SetType */
@@ -465,7 +488,7 @@ Client_ModeAdd( CLIENT *Client, CHAR Mode )
if( ! strchr( Client->modes, x[0] ))
{
/* Client hat den Mode noch nicht -> setzen */
strcat( Client->modes, x );
strlcat( Client->modes, x, sizeof( Client->modes ));
return TRUE;
}
else return FALSE;
@@ -531,8 +554,7 @@ Client_Search( CHAR *Nick )
assert( Nick != NULL );
/* Nick kopieren und ggf. Host-Mask abschneiden */
strncpy( search_id, Nick, CLIENT_ID_LEN - 1 );
search_id[CLIENT_ID_LEN - 1] = '\0';
strlcpy( search_id, Nick, sizeof( search_id ));
ptr = strchr( search_id, '!' );
if( ptr ) *ptr = '\0';
@@ -800,7 +822,7 @@ Client_CheckID( CLIENT *Client, CHAR *ID )
if( strcasecmp( c->id, ID ) == 0 )
{
/* die Server-ID gibt es bereits */
sprintf( str, "ID \"%s\" already registered", ID );
snprintf( str, sizeof( 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 );
@@ -919,6 +941,20 @@ Client_UnknownCount( VOID )
} /* Client_UnknownCount */
GLOBAL LONG
Client_MaxUserCount( VOID )
{
return Max_Users;
} /* Client_MaxUserCount */
GLOBAL LONG
Client_MyMaxUserCount( VOID )
{
return My_Max_Users;
} /* Client_MyMaxUserCount */
GLOBAL BOOLEAN
Client_IsValidNick( CHAR *Nick )
{
@@ -1041,4 +1077,24 @@ Generate_MyToken( CLIENT *Client )
} /* Generate_MyToken */
LOCAL VOID
Adjust_Counters( CLIENT *Client )
{
LONG count;
assert( Client != NULL );
if( Client->type != CLIENT_USER ) return;
if( Client->conn_id != NONE )
{
/* Local connection */
count = Client_MyUserCount( );
if( count > My_Max_Users ) My_Max_Users = count;
}
count = Client_UserCount( );
if( count > Max_Users ) Max_Users = count;
} /* Adjust_Counters */
/* -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: client.h,v 1.32 2002/12/12 12:23:43 alex Exp $
* $Id: client.h,v 1.34 2003/01/15 14:28:25 alex Exp $
*
* Client management (header)
*/
@@ -62,76 +62,81 @@ 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 ));
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 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_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.47 2002/12/18 02:53:36 alex Exp $";
static char UNUSED id[] = "$Id: conf.c,v 1.57.2.4 2003/12/19 14:30:49 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -46,9 +46,11 @@ static char UNUSED id[] = "$Id: conf.c,v 1.47 2002/12/18 02:53:36 alex Exp $";
LOCAL BOOLEAN Use_Log = TRUE;
LOCAL CONF_SERVER New_Server;
LOCAL INT New_Server_Idx;
LOCAL VOID Set_Defaults PARAMS(( VOID ));
LOCAL VOID Set_Defaults PARAMS(( BOOLEAN InitServers ));
LOCAL VOID Read_Config PARAMS(( VOID ));
LOCAL VOID Validate_Config PARAMS(( BOOLEAN TestOnly ));
@@ -59,16 +61,27 @@ 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( );
Set_Defaults( TRUE );
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 )
{
@@ -79,7 +92,7 @@ Conf_Test( VOID )
INT i;
Use_Log = FALSE;
Set_Defaults( );
Set_Defaults( TRUE );
Read_Config( );
Validate_Config( TRUE );
@@ -95,7 +108,7 @@ Conf_Test( VOID )
puts( "[GLOBAL]" );
printf( " ServerName = %s\n", Conf_ServerName );
printf( " ServerInfo = %s\n", Conf_ServerInfo );
printf( " ServerPwd = %s\n", Conf_ServerPwd );
printf( " Password = %s\n", Conf_ServerPwd );
printf( " AdminInfo1 = %s\n", Conf_ServerAdmin1 );
printf( " AdminInfo2 = %s\n", Conf_ServerAdmin2 );
printf( " AdminEMail = %s\n", Conf_ServerAdminMail );
@@ -107,6 +120,7 @@ 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 );
@@ -119,6 +133,8 @@ 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( "" );
@@ -134,7 +150,7 @@ Conf_Test( VOID )
puts( "" );
}
for( i = 0; i < Conf_Server_Count; i++ )
for( i = 0; i < MAX_SERVERS; i++ )
{
if( ! Conf_Server[i].name[0] ) continue;
@@ -165,22 +181,169 @@ 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( VOID )
Set_Defaults( BOOLEAN InitServers )
{
/* Initialize configuration variables with default values. */
INT i;
strcpy( Conf_ServerName, "" );
sprintf( Conf_ServerInfo, "%s %s", PACKAGE, VERSION );
sprintf( Conf_ServerInfo, "%s %s", PACKAGE_NAME, PACKAGE_VERSION );
strcpy( Conf_ServerPwd, "" );
strcpy( Conf_ServerAdmin1, "" );
strcpy( Conf_ServerAdmin2, "" );
strcpy( Conf_ServerAdminMail, "" );
strcpy( Conf_MotdFile, MOTD_FILE );
strlcpy( Conf_MotdFile, SYSCONFDIR, sizeof( Conf_MotdFile ));
strlcat( Conf_MotdFile, MOTD_FILE, sizeof( Conf_MotdFile ));
Conf_ListenPorts_Count = 0;
strcpy( Conf_ListenAddress, "" );
Conf_UID = Conf_GID = 0;
@@ -190,13 +353,16 @@ Set_Defaults( VOID )
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 */
@@ -206,22 +372,63 @@ Read_Config( VOID )
/* Read configuration file. */
CHAR section[LINE_LEN], str[LINE_LEN], *var, *arg, *ptr;
INT line;
INT line, i, n;
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 );
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
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;
@@ -234,7 +441,7 @@ Read_Config( VOID )
/* Is this the beginning of a new section? */
if(( str[0] == '[' ) && ( str[strlen( str ) - 1] == ']' ))
{
strcpy( section, str );
strlcpy( section, str, sizeof( section ));
if( strcasecmp( section, "[GLOBAL]" ) == 0 ) continue;
if( strcasecmp( section, "[OPERATOR]" ) == 0 )
{
@@ -250,21 +457,30 @@ Read_Config( VOID )
}
if( strcasecmp( section, "[SERVER]" ) == 0 )
{
if( Conf_Server_Count + 1 > MAX_SERVERS ) Config_Error( LOG_ERR, "Too many servers configured." );
else
/* Check if there is already a server to add */
if( New_Server.name[0] )
{
/* 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++;
/* Copy data to "real" server structure */
assert( New_Server_Idx > NONE );
Conf_Server[New_Server_Idx] = New_Server;
}
/* 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 )
@@ -302,8 +518,17 @@ 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 )
@@ -329,49 +554,37 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
if( strcasecmp( Var, "Name" ) == 0 )
{
/* Server name */
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 );
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 );
return;
}
if( strcasecmp( Var, "Info" ) == 0 )
{
/* Info text of server */
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 );
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 );
return;
}
if( strcasecmp( Var, "Password" ) == 0 )
{
/* Global server password */
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 );
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 );
return;
}
if( strcasecmp( Var, "AdminInfo1" ) == 0 )
{
/* Administrative info #1 */
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 );
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 );
return;
}
if( strcasecmp( Var, "AdminInfo2" ) == 0 )
{
/* Administrative info #2 */
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 );
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 );
return;
}
if( strcasecmp( Var, "AdminEMail" ) == 0 )
{
/* Administrative email contact */
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 );
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 );
return;
}
if( strcasecmp( Var, "Ports" ) == 0 )
@@ -396,9 +609,7 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
if( strcasecmp( Var, "MotdFile" ) == 0 )
{
/* "Message of the day" (MOTD) file */
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 );
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 );
return;
}
if( strcasecmp( Var, "ServerUID" ) == 0 )
@@ -483,6 +694,16 @@ 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". */
@@ -493,6 +714,15 @@ 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 */
@@ -509,17 +739,13 @@ Handle_OPERATOR( INT Line, CHAR *Var, CHAR *Arg )
if( strcasecmp( Var, "Name" ) == 0 )
{
/* Name of IRC operator */
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 );
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 );
return;
}
if( strcasecmp( Var, "Password" ) == 0 )
{
/* Password of IRC operator */
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 );
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 );
return;
}
@@ -536,43 +762,38 @@ 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 */
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 );
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 );
return;
}
if( strcasecmp( Var, "Name" ) == 0 )
{
/* Name of the server ("Nick"/"ID") */
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 );
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 );
return;
}
if( strcasecmp( Var, "MyPassword" ) == 0 )
{
/* Password of this server which is sent to the peer */
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 );
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 );
return;
}
if( strcasecmp( Var, "PeerPassword" ) == 0 )
{
/* Passwort of the peer which must be received */
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 );
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 );
return;
}
if( strcasecmp( Var, "Port" ) == 0 )
{
/* Port to which this server should connect */
port = atol( Arg );
if( port > 0 && port < 0xFFFF ) Conf_Server[Conf_Server_Count - 1].port = (INT)port;
if( port > 0 && port < 0xFFFF ) New_Server.port = (INT)port;
else Config_Error( LOG_ERR, "%s, line %d (section \"Server\"): Illegal port number %ld!", NGIRCd_ConfFile, Line, port );
return;
}
@@ -583,7 +804,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
Conf_Server[Conf_Server_Count - 1].group = atoi( Arg );
New_Server.group = atoi( Arg );
return;
}
@@ -601,25 +822,19 @@ Handle_CHANNEL( INT Line, CHAR *Var, CHAR *Arg )
if( strcasecmp( Var, "Name" ) == 0 )
{
/* Name of the channel */
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 );
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 );
return;
}
if( strcasecmp( Var, "Modes" ) == 0 )
{
/* Initial modes */
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 );
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 );
return;
}
if( strcasecmp( Var, "Topic" ) == 0 )
{
/* Initial topic */
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 );
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 );
return;
}
@@ -631,14 +846,29 @@ 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\" ('ServerName')!", NGIRCd_ConfFile );
Config_Error( LOG_ALERT, "No server name configured in \"%s\" (section 'Global': 'Name')!", NGIRCd_ConfFile );
if( ! Configtest )
{
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
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 );
exit( 1 );
}
}
@@ -650,7 +880,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 );
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
exit( 1 );
}
}
@@ -670,6 +900,19 @@ 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 */
@@ -705,4 +948,26 @@ 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.24 2002/12/14 13:36:19 alex Exp $
* $Id: conf.h,v 1.26.2.1 2003/11/07 20:51:11 alex Exp $
*
* Configuration management (header)
*/
@@ -39,6 +39,8 @@ 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
@@ -49,6 +51,10 @@ 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];
@@ -70,6 +76,9 @@ 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;
@@ -87,7 +96,6 @@ 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];
@@ -102,10 +110,22 @@ 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

277
src/ngircd/conn-func.c Normal file
View File

@@ -0,0 +1,277 @@
/*
* 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- */

61
src/ngircd/conn-func.h Normal file
View File

@@ -0,0 +1,61 @@
/*
* 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- */

210
src/ngircd/conn-zip.c Normal file
View File

@@ -0,0 +1,210 @@
/*
* 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- */

38
src/ngircd/conn-zip.h Normal file
View File

@@ -0,0 +1,38 @@
/*
* 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.26 2002/12/18 13:50:22 alex Exp $
* $Id: conn.h,v 1.31.2.1 2003/12/26 16:16:48 alex Exp $
*
* Connection management (header)
*/
@@ -18,17 +18,69 @@
#define __conn_h__
#include <time.h> /* wg. time_t, s.u. */
#include <time.h> /* fro time_t, see below */
#ifdef USE_ZLIB
#define CONN_ZIP 4 /* Kompression mit zlib */
#define CONN_ISCLOSING 1 /* Conn_Close() already called */
#ifdef ZLIB
#define CONN_ZIP 2 /* zlib compressed link */
#endif
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 ));
@@ -44,42 +96,7 @@ 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_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 VOID Conn_SyncServerStruct PARAMS(( VOID ));
GLOBAL INT Conn_MaxFD;

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 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
@@ -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.40 2002/12/16 23:10:56 alex Exp $
* $Id: defines.h,v 1.42.2.2 2003/12/26 16:16:48 alex Exp $
*
* Global defines of ngIRCd.
*/
@@ -19,8 +19,6 @@
#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 */
@@ -59,7 +57,7 @@
#define READBUFFER_LEN 2048 /* Laenge des Lesepuffers je Verbindung (Bytes) */
#define WRITEBUFFER_LEN 4096 /* Laenge des Schreibpuffers je Verbindung (Bytes) */
#ifdef USE_ZLIB
#ifdef ZLIB
#define ZREADBUFFER_LEN 1024 /* Laenge des Lesepuffers je Verbindung (Bytes) */
#define ZWRITEBUFFER_LEN 4096 /* Laenge des Schreibpuffers fuer Kompression (Bytes) */
#endif
@@ -83,13 +81,9 @@
#define DEFAULT_AWAY_MSG "Away" /* Away-Meldung fuer User von anderen Servern */
#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 CONFIG_FILE "/ngircd.conf"
#define MOTD_FILE "/ngircd.motd"
#define ERROR_DIR "/tmp"
#define MAX_LOG_MSG_LEN 256 /* max. Laenge einer Log-Meldung */
@@ -98,6 +92,10 @@
#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.6 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: hash.c,v 1.9 2002/12/26 16:25:43 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -38,9 +38,7 @@ Hash( CHAR *String )
CHAR buffer[LINE_LEN];
strncpy( buffer, String, LINE_LEN - 1 );
buffer[LINE_LEN - 1] = '\0';
strlcpy( buffer, String, sizeof( buffer ));
return jenkins_hash( (UINT8 *)ngt_LowerStr( buffer ), strlen( buffer ), 42 );
} /* Hash */
@@ -102,7 +100,7 @@ jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval
/* handle the last 11 bytes */
c += length;
switch(len) /* all the case statements fall through */
switch( (INT)len ) /* all the case statements fall through */
{
case 11: c+=((UINT32)k[10]<<24);
case 10: c+=((UINT32)k[9]<<16);

View File

@@ -14,10 +14,12 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-channel.c,v 1.21 2002/12/16 23:06:46 alex Exp $";
static char UNUSED id[] = "$Id: irc-channel.c,v 1.25 2003/01/08 22:04:05 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "defines.h"
@@ -179,7 +181,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? */
strcpy( &modes[1], Channel_UserModes( chan, target ));
strlcpy( &modes[1], Channel_UserModes( chan, target ), sizeof( modes ) - 1 );
if( modes[1] ) modes[0] = 0x7;
else modes[0] = '\0';
@@ -326,7 +328,7 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
{
/* an anderen Server forwarden */
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[1] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[1] );
if( target != Client_ThisServer( ))
{
@@ -362,21 +364,27 @@ 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 );
assert( Req != NULL );
/* Falsche Anzahl Parameter? */
if(( Req->argc < 1 ) || ( Req->argc > 3 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Bad number of parameters? */
if(( Req->argc < 2 ) || ( Req->argc == 4 ) || ( Req->argc > 5 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* From-Server suchen */
/* Compatibility kludge */
if( Req->argc == 5 ) arg_topic = 4;
else if( Req->argc == 3 ) arg_topic = 2;
else arg_topic = -1;
/* Search origin */
from = Client_Search( Req->prefix );
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
/* Channel suchen bzw. erzeugen */
/* Search or create channel */
chan = Channel_Search( Req->argv[0] );
if( ! chan ) chan = Channel_Create( Req->argv[0] );
if( ! chan ) return CONNECTED;
@@ -386,27 +394,61 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
ptr = Channel_Modes( chan );
if( ! *ptr )
{
/* OK, es sind noch keine Modes gesetzt */
/* OK, this channel doesn't have modes jet, set the received ones: */
Channel_SetModes( chan, &Req->argv[1][1] );
IRC_WriteStrChannelPrefix( Client, chan, from, FALSE, "MODE %s +%s", Req->argv[0], &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' );
}
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 );
}
}
else Log( LOG_WARNING, "CHANNELINFO: invalid MODE format ignored!" );
else Log( LOG_WARNING, "CHANINFO: invalid MODE format ignored!" );
if( Req->argc == 3 )
if( arg_topic > 0 )
{
/* Es wurde auch ein Topic mit uebermittelt */
/* We got a topic */
ptr = Channel_Topic( chan );
if( ! *ptr )
if(( ! *ptr ) && ( Req->argv[arg_topic][0] ))
{
/* OK, es ist bisher kein Topic gesetzt */
Channel_SetTopic( chan, Req->argv[2] );
IRC_WriteStrChannelPrefix( Client, chan, from, FALSE, "TOPIC %s :%s", Req->argv[0], Req->argv[2] );
/* OK, there is no topic jet */
Channel_SetTopic( chan, Req->argv[arg_topic] );
IRC_WriteStrChannelPrefix( Client, chan, from, FALSE, "TOPIC %s :%s", Req->argv[0], Channel_Topic( chan ));
}
}
/* an andere Server forwarden */
IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s :%s", Req->argv[0], Req->argv[1], Req->argv[2] );
/* Forward CHANINFO to other serevrs */
if( Req->argc == 5 ) IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s %s %s :%s", Req->argv[0], Req->argv[1], Req->argv[2], Req->argv[3], Req->argv[4] );
else if( Req->argc == 3 ) IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s :%s", Req->argv[0], Req->argv[1], Req->argv[2] );
else IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s", Req->argv[0], Req->argv[1] );
return CONNECTED;
} /* IRC_CHANINFO */

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-info.c,v 1.8 2002/12/18 13:55:41 alex Exp $";
static char UNUSED id[] = "$Id: irc-info.c,v 1.16.2.4 2003/12/26 16:16:48 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -23,7 +23,9 @@ static char UNUSED id[] = "$Id: irc-info.c,v 1.8 2002/12/18 13:55:41 alex Exp $"
#include <string.h>
#include "ngircd.h"
#include "conn.h"
#include "cvs-version.h"
#include "conn-func.h"
#include "conn-zip.h"
#include "client.h"
#include "channel.h"
#include "resolve.h"
@@ -62,7 +64,7 @@ IRC_ADMIN(CLIENT *Client, REQUEST *Req )
/* An anderen Server weiterleiten? */
if( target != Client_ThisServer( ))
{
if( ! target ) return IRC_WriteStrClient( prefix, ERR_NOSUCHSERVER_MSG, Client_ID( prefix ), Req->argv[0] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( prefix, ERR_NOSUCHSERVER_MSG, Client_ID( prefix ), Req->argv[0] );
/* forwarden */
IRC_WriteStrClientPrefix( target, prefix, "ADMIN %s", Req->argv[0] );
@@ -75,6 +77,7 @@ 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 */
@@ -104,8 +107,8 @@ IRC_ISON( CLIENT *Client, REQUEST *Req )
if( c && ( Client_Type( c ) == CLIENT_USER ))
{
/* Dieser Nick ist "online" */
strcat( rpl, ptr );
strcat( rpl, " " );
strlcat( rpl, ptr, sizeof( rpl ));
strlcat( rpl, " ", sizeof( rpl ));
}
ptr = strtok( NULL, " " );
}
@@ -141,7 +144,7 @@ IRC_LINKS( CLIENT *Client, REQUEST *Req )
if( Req->argc == 2 )
{
target = Client_Search( Req->argv[0] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
else if( target != Client_ThisServer( )) return IRC_WriteStrClientPrefix( target, from, "LINKS %s %s", Req->argv[0], Req->argv[1] );
}
@@ -159,7 +162,8 @@ 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 */
@@ -184,7 +188,7 @@ IRC_LUSERS( CLIENT *Client, REQUEST *Req )
if( Req->argc == 2 )
{
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[1] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[1] );
else if( target != Client_ThisServer( )) return IRC_WriteStrClientPrefix( target, from, "LUSERS %s %s", Req->argv[0], Req->argv[1] );
}
@@ -195,6 +199,7 @@ IRC_LUSERS( CLIENT *Client, REQUEST *Req )
IRC_Send_LUSERS( target );
IRC_SetPenalty( target, 1 );
return CONNECTED;
} /* IRC_LUSERS */
@@ -219,7 +224,7 @@ IRC_MOTD( CLIENT *Client, REQUEST *Req )
{
/* an anderen Server forwarden */
target = Client_Search( Req->argv[0] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
if( target != Client_ThisServer( ))
{
@@ -228,6 +233,7 @@ IRC_MOTD( CLIENT *Client, REQUEST *Req )
}
}
IRC_SetPenalty( from, 3 );
return IRC_Show_MOTD( from );
} /* IRC_MOTD */
@@ -254,7 +260,7 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
{
/* an anderen Server forwarden */
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[1] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[1] );
if( target != Client_ThisServer( ))
{
@@ -296,20 +302,20 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
/* Nun noch alle Clients ausgeben, die in keinem Channel sind */
c = Client_First( );
sprintf( rpl, RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
snprintf( rpl, sizeof( 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] != ':' ) strcat( rpl, " " );
strcat( rpl, Client_ID( c ));
if( rpl[strlen( rpl ) - 1] != ':' ) strlcat( rpl, " ", sizeof( rpl ));
strlcat( rpl, Client_ID( c ), sizeof( rpl ));
if( strlen( rpl ) > ( LINE_LEN - CLIENT_NICK_LEN - 4 ))
{
/* Zeile wird zu lang: senden! */
if( ! IRC_WriteStrClient( from, "%s", rpl )) return DISCONNECTED;
sprintf( rpl, RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
snprintf( rpl, sizeof( rpl ), RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
}
}
@@ -322,6 +328,7 @@ 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 */
@@ -349,7 +356,7 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
{
/* an anderen Server forwarden */
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[1] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[1] );
if( target != Client_ThisServer( ))
{
@@ -372,10 +379,10 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
if( cl && (( Client_Type( cl ) == CLIENT_SERVER ) || ( cl == Client )))
{
/* Server link or our own connection */
#ifdef USE_ZLIB
#ifdef 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 ), Conn_SendBytesZip( con ), Conn_SendBytes( con ), Conn_RecvMsg( con ), Conn_RecvBytesZip( 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 ), Zip_SendBytes( con ), Conn_SendBytes( con ), Conn_RecvMsg( con ), Zip_RecvBytes( con ), Conn_RecvBytes( con ), (LONG)( time( NULL ) - Conn_StartTime( con )))) return DISCONNECTED;
}
else
#endif
@@ -400,6 +407,7 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
break;
}
IRC_SetPenalty( from, 2 );
return IRC_WriteStrClient( from, RPL_ENDOFSTATS_MSG, Client_ID( from ), query );
} /* IRC_STATS */
@@ -426,7 +434,7 @@ IRC_TIME( CLIENT *Client, REQUEST *Req )
{
/* an anderen Server forwarden */
target = Client_Search( Req->argv[0] );
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] );
if( target != Client_ThisServer( ))
{
@@ -436,7 +444,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 */
@@ -464,15 +472,15 @@ IRC_USERHOST( CLIENT *Client, REQUEST *Req )
if( c && ( Client_Type( c ) == CLIENT_USER ))
{
/* Dieser Nick ist "online" */
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, " " );
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 ));
}
}
if( rpl[strlen( rpl ) - 1] == ' ' ) rpl[strlen( rpl ) - 1] = '\0';
@@ -485,6 +493,9 @@ 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 );
@@ -504,7 +515,7 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
/* An anderen Server weiterleiten? */
if( target != Client_ThisServer( ))
{
if( ! target ) return IRC_WriteStrClient( prefix, ERR_NOSUCHSERVER_MSG, Client_ID( prefix ), Req->argv[0] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( prefix, ERR_NOSUCHSERVER_MSG, Client_ID( prefix ), Req->argv[0] );
/* forwarden */
IRC_WriteStrClientPrefix( target, prefix, "VERSION %s", Req->argv[0] );
@@ -512,7 +523,16 @@ IRC_VERSION( CLIENT *Client, REQUEST *Req )
}
/* mit Versionsinfo antworten */
return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), PACKAGE, VERSION, NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( ));
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
} /* IRC_VERSION */
@@ -572,7 +592,7 @@ IRC_WHO( CLIENT *Client, REQUEST *Req )
{
/* Flags zusammenbasteln */
strcpy( flags, "H" );
if( strchr( Client_Modes( c ), 'o' )) strcat( flags, "*" );
if( strchr( Client_Modes( c ), 'o' )) strlcat( flags, "*", sizeof( flags ));
/* ausgeben */
cl2chan = Channel_FirstChannelOf( c );
@@ -596,72 +616,71 @@ GLOBAL BOOLEAN
IRC_WHOIS( CLIENT *Client, REQUEST *Req )
{
CLIENT *from, *target, *c;
CHAR str[LINE_LEN + 1], *ptr = NULL;
CHAR str[LINE_LEN + 1];
CL2CHAN *cl2chan;
CHANNEL *chan;
assert( Client != NULL );
assert( Req != NULL );
/* Falsche Anzahl Parameter? */
/* Bad number of parameters? */
if(( Req->argc < 1 ) || ( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Client suchen */
/* Search client */
c = Client_Search( Req->argv[Req->argc - 1] );
if(( ! c ) || ( Client_Type( c ) != CLIENT_USER )) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[Req->argc - 1] );
/* Empfaenger des WHOIS suchen */
/* Search sender of the WHOIS */
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 );
/* Forwarden an anderen Server? */
/* Forward to other server? */
if( Req->argc > 1 )
{
/* angegebenen Ziel-Server suchen */
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[1] );
ptr = Req->argv[1];
/* Search target server (can be specified as nick of that server!) */
target = Client_Search( Req->argv[0] );
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
}
else target = Client_ThisServer( );
assert( target != NULL );
if(( Client_NextHop( target ) != Client_ThisServer( )) && ( Client_Type( Client_NextHop( target )) == CLIENT_SERVER )) return IRC_WriteStrClientPrefix( target, from, "WHOIS %s :%s", Req->argv[0], ptr );
if(( Client_NextHop( target ) != Client_ThisServer( )) && ( Client_Type( Client_NextHop( target )) == CLIENT_SERVER )) return IRC_WriteStrClientPrefix( target, from, "WHOIS %s :%s", Req->argv[0], Req->argv[1] );
/* Nick, User und Name */
/* Nick, user and name */
if( ! IRC_WriteStrClient( from, RPL_WHOISUSER_MSG, Client_ID( from ), Client_ID( c ), Client_User( c ), Client_Hostname( c ), Client_Info( c ))) return DISCONNECTED;
/* Server */
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 */
sprintf( str, RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
snprintf( str, sizeof( str ), RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
cl2chan = Channel_FirstChannelOf( c );
while( cl2chan )
{
chan = Channel_GetChannel( cl2chan );
assert( chan != NULL );
/* Channel-Name anhaengen */
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 ));
/* 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( strlen( str ) > ( LINE_LEN - CHANNEL_NAME_LEN - 4 ))
{
/* Zeile wird zu lang: senden! */
/* Line becomes too long: send it! */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
sprintf( str, RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
snprintf( str, sizeof( str ), RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
}
/* naechstes Mitglied suchen */
/* next */
cl2chan = Channel_NextChannelOf( c, cl2chan );
}
if( str[strlen( str ) - 1] != ':')
{
/* Es sind noch Daten da, die gesendet werden muessen */
/* There is data left to send: */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
}
@@ -671,7 +690,7 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
if( ! IRC_WriteStrClient( from, RPL_WHOISOPERATOR_MSG, Client_ID( from ), Client_ID( c ))) return DISCONNECTED;
}
/* Idle (nur lokale Clients) */
/* Idle (only local clients) */
if( Client_Conn( c ) > NONE )
{
if( ! IRC_WriteStrClient( from, RPL_WHOISIDLE_MSG, Client_ID( from ), Client_ID( c ), Conn_GetIdle( Client_Conn ( c )))) return DISCONNECTED;
@@ -710,29 +729,36 @@ IRC_Send_LUSERS( CLIENT *Client )
assert( Client != NULL );
/* Users, Services und Serevr im Netz */
/* Users, services and serevers in the network */
if( ! IRC_WriteStrClient( Client, RPL_LUSERCLIENT_MSG, Client_ID( Client ), Client_UserCount( ), Client_ServiceCount( ), Client_ServerCount( ))) return DISCONNECTED;
/* IRC-Operatoren im Netz */
/* Number of IRC operators */
cnt = Client_OperCount( );
if( cnt > 0 )
{
if( ! IRC_WriteStrClient( Client, RPL_LUSEROP_MSG, Client_ID( Client ), cnt )) return DISCONNECTED;
}
/* Unbekannt Verbindungen */
/* Unknown connections */
cnt = Client_UnknownCount( );
if( cnt > 0 )
{
if( ! IRC_WriteStrClient( Client, RPL_LUSERUNKNOWN_MSG, Client_ID( Client ), cnt )) return DISCONNECTED;
}
/* Channels im Netz */
/* Number of created channels */
if( ! IRC_WriteStrClient( Client, RPL_LUSERCHANNELS_MSG, Client_ID( Client ), Channel_Count( ))) return DISCONNECTED;
/* Channels im Netz */
/* Number of local users, services and servers */
if( ! IRC_WriteStrClient( Client, RPL_LUSERME_MSG, Client_ID( Client ), Client_MyUserCount( ), Client_MyServiceCount( ), Client_MyServerCount( ))) return DISCONNECTED;
#ifndef STRICT_RFC
/* Maximum number of local users */
if( ! IRC_WriteStrClient( Client, RPL_LOCALUSERS_MSG, Client_ID( Client ), Client_MyUserCount( ), Client_MyMaxUserCount( ))) return DISCONNECTED;
/* Maximum number of users in the network */
if( ! IRC_WriteStrClient( Client, RPL_NETUSERS_MSG, Client_ID( Client ), Client_UserCount( ), Client_MaxUserCount( ))) return DISCONNECTED;
#endif
return CONNECTED;
} /* IRC_Send_LUSERS */
@@ -787,7 +813,7 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
else is_member = FALSE;
/* Alle Mitglieder suchen */
sprintf( str, RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
snprintf( str, sizeof( str ), RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
cl2chan = Channel_FirstMember( Chan );
while( cl2chan )
{
@@ -799,16 +825,16 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
if( is_member || is_visible )
{
/* Nick anhaengen */
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( 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( strlen( str ) > ( LINE_LEN - CLIENT_NICK_LEN - 4 ))
{
/* Zeile wird zu lang: senden! */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
sprintf( str, RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
snprintf( str, sizeof( str ), RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
}
}
@@ -852,9 +878,9 @@ IRC_Send_WHO( CLIENT *Client, CHANNEL *Chan, BOOLEAN OnlyOps )
{
/* Flags zusammenbasteln */
strcpy( flags, "H" );
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, "+" );
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 ));
/* 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.27 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: irc-login.c,v 1.34.2.3 2004/02/04 20:04:54 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -24,15 +24,17 @@ static char UNUSED id[] = "$Id: irc-login.c,v 1.27 2002/12/12 12:24:18 alex Exp
#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"
@@ -222,6 +224,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
/* neuen Client-Nick speichern */
Client_SetID( target, Req->argv[0] );
IRC_SetPenalty( target, 2 );
}
return CONNECTED;
@@ -291,11 +294,17 @@ IRC_USER( CLIENT *Client, REQUEST *Req )
if( Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_GOTPASS )
#endif
{
/* Falsche Anzahl Parameter? */
/* Wrong number of parameters? */
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 );
Client_SetInfo( Client, Req->argv[3] );
/* "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, "-" );
Log( LOG_DEBUG, "Connection %d: got valid USER command ...", Client_Conn( Client ));
if( Client_Type( Client ) == CLIENT_GOTNICK ) return Hello_User( Client );
@@ -371,7 +380,7 @@ IRC_PING( CLIENT *Client, REQUEST *Req )
{
/* es wurde ein Ziel-Client angegeben */
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[1] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[1] );
if( target != Client_ThisServer( ))
{
/* ok, forwarden */
@@ -403,7 +412,7 @@ IRC_PONG( CLIENT *Client, REQUEST *Req )
if( Req->argc == 2 )
{
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[1] );
if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[1] );
if( target != Client_ThisServer( ))
{
/* ok, forwarden */
@@ -427,12 +436,16 @@ IRC_PONG( CLIENT *Client, REQUEST *Req )
LOCAL BOOLEAN
Hello_User( CLIENT *Client )
{
#ifdef CVSDATE
CHAR ver[12], vertxt[30];
#endif
assert( Client != NULL );
/* Passwort ueberpruefen */
/* Check password ... */
if( strcmp( Client_Password( Client ), Conf_ServerPwd ) != 0 )
{
/* Falsches Passwort */
/* Bad password! */
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;
@@ -440,19 +453,41 @@ Hello_User( CLIENT *Client )
Log( LOG_NOTICE, "User \"%s\" registered (connection %d).", Client_Mask( Client ), Client_Conn( Client ));
/* Andere Server informieren */
/* Inform other servers */
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;
if( ! IRC_WriteStrClient( Client, RPL_YOURHOST_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, TARGET_CPU, TARGET_VENDOR, TARGET_OS )) 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_CREATED_MSG, Client_ID( Client ), NGIRCd_StartStr )) return FALSE;
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, USERMODES, CHANMODES )) 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
/* 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;
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 */
@@ -460,19 +495,18 @@ Hello_User( CLIENT *Client )
LOCAL VOID
Kill_Nick( CHAR *Nick, CHAR *Reason )
{
CLIENT *c;
REQUEST r;
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 );
/* 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 );
IRC_KILL( Client_ThisServer( ), &r );
} /* Kill_Nick */

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-mode.c,v 1.24 2002/12/18 14:16:21 alex Exp $";
static char UNUSED id[] = "$Id: irc-mode.c,v 1.31.2.1 2003/11/07 20:51:11 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -142,7 +142,8 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
else
{
/* Append modifier character to result string */
x[0] = *mode_ptr; strcat( the_modes, x );
x[0] = *mode_ptr;
strlcat( the_modes, x, sizeof( the_modes ));
}
if( *mode_ptr == '+' ) set = TRUE;
else set = FALSE;
@@ -156,7 +157,11 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
{
case 'a':
/* Away */
if( Client_Type( Client ) == CLIENT_SERVER ) x[0] = 'a';
if( Client_Type( Client ) == CLIENT_SERVER )
{
x[0] = 'a';
Client_SetAway( Client, DEFAULT_AWAY_MSG );
}
else ok = IRC_WriteStrClient( Origin, ERR_NOPRIVILEGES_MSG, Client_ID( Origin ));
break;
case 'i':
@@ -195,13 +200,13 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
if( set )
{
/* Set mode */
if( Client_ModeAdd( Target, x[0] )) strcat( the_modes, x );
if( Client_ModeAdd( Target, x[0] )) strlcat( the_modes, x, sizeof( the_modes ));
}
else
{
/* Unset mode */
if( Client_ModeDel( Target, x[0] )) strcat( the_modes, x );
if( Client_ModeDel( Target, x[0] )) strlcat( the_modes, x, sizeof( the_modes ));
}
}
client_exit:
@@ -225,7 +230,8 @@ 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 */
@@ -242,11 +248,42 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
LONG l;
/* Mode request: let's answer it :-) */
if( Req->argc == 1 ) return IRC_WriteStrClient( Origin, RPL_CHANNELMODEIS_MSG, Client_ID( Origin ), Channel_Name( Channel ), Channel_Modes( Channel ));
if( Req->argc == 1 )
{
/* Member or not? -- That's the question! */
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 ));
mode_ptr = the_modes;
strcpy( the_args, "" );
while( *mode_ptr )
{
switch( *mode_ptr )
{
case 'l':
snprintf( argadd, sizeof( argadd ), " %ld", Channel_MaxUsers( Channel ));
strlcat( the_args, argadd, sizeof( the_args ));
break;
case 'k':
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_args, Channel_Key( Channel ), sizeof( the_args ));
break;
}
mode_ptr++;
}
if( the_args[0] ) strlcat( the_modes, the_args, sizeof( the_modes ));
return IRC_WriteStrClient( Origin, RPL_CHANNELMODEIS_MSG, Client_ID( Origin ), Channel_Name( Channel ), the_modes );
}
/* Is the user allowed to change modes? */
if( Client_Type( Client ) == CLIENT_USER )
{
/* Is the originating user on that channel? */
if( ! Channel_IsMemberOf( Channel, Origin )) return IRC_WriteStrClient( Origin, ERR_NOTONCHANNEL_MSG, Client_ID( Origin ), Channel_Name( Channel ));
/* Is he channel operator? */
if( strchr( Channel_UserModes( Channel, Origin ), 'o' )) modeok = TRUE;
else modeok = FALSE;
if( Conf_OperCanMode )
@@ -305,7 +342,8 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
else
{
/* Append modifier character to result string */
x[0] = *mode_ptr; strcat( the_modes, x );
x[0] = *mode_ptr;
strlcat( the_modes, x, sizeof( the_modes ));
}
if( *mode_ptr == '+' ) set = TRUE;
else set = FALSE;
@@ -390,7 +428,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
{
Channel_ModeDel( Channel, 'k' );
Channel_SetKey( Channel, Req->argv[arg_arg] );
strcpy( argadd, Channel_Key( Channel ));
strlcpy( argadd, Channel_Key( Channel ), sizeof( argadd ));
x[0] = *mode_ptr;
}
else ok = IRC_WriteStrClient( Origin, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( Origin ), Channel_Name( Channel ));
@@ -416,7 +454,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
{
Channel_ModeDel( Channel, 'l' );
Channel_SetMaxUsers( Channel, l );
sprintf( argadd, "%ld", l );
snprintf( argadd, sizeof( argadd ), "%ld", l );
x[0] = *mode_ptr;
}
}
@@ -472,6 +510,13 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Is there a valid mode change? */
if( ! x[0] ) continue;
/* Validate target client */
if( client && ( ! Channel_IsMemberOf( Channel, client )))
{
if( ! IRC_WriteStrClient( Origin, ERR_USERNOTINCHANNEL_MSG, Client_ID( Origin ), Client_ID( client ), Channel_Name( Channel ))) break;
continue;
}
if( set )
{
/* Set mode */
@@ -480,8 +525,9 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-User-Mode */
if( Channel_UserModeAdd( Channel, client, x[0] ))
{
strcat( the_args, Client_ID( client ));
strcat( the_args, " " ); strcat( the_modes, x );
strlcat( the_args, Client_ID( client ), sizeof( the_args ));
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_modes, x, sizeof( the_modes ));
Log( LOG_DEBUG, "User \"%s\": Mode change on %s, now \"%s\"", Client_Mask( client ), Channel_Name( Channel ), Channel_UserModes( Channel, client ));
}
}
@@ -490,7 +536,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-Mode */
if( Channel_ModeAdd( Channel, x[0] ))
{
strcat( the_modes, x );
strlcat( the_modes, x, sizeof( the_modes ));
Log( LOG_DEBUG, "Channel %s: Mode change, now \"%s\".", Channel_Name( Channel ), Channel_Modes( Channel ));
}
}
@@ -503,8 +549,9 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-User-Mode */
if( Channel_UserModeDel( Channel, client, x[0] ))
{
strcat( the_args, Client_ID( client ));
strcat( the_args, " " ); strcat( the_modes, x );
strlcat( the_args, Client_ID( client ), sizeof( the_args ));
strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_modes, x, sizeof( the_modes ));
Log( LOG_DEBUG, "User \"%s\": Mode change on %s, now \"%s\"", Client_Mask( client ), Channel_Name( Channel ), Channel_UserModes( Channel, client ));
}
}
@@ -513,7 +560,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
/* Channel-Mode */
if( Channel_ModeDel( Channel, x[0] ))
{
strcat( the_modes, x );
strlcat( the_modes, x, sizeof( the_modes ));
Log( LOG_DEBUG, "Channel %s: Mode change, now \"%s\".", Channel_Name( Channel ), Channel_Modes( Channel ));
}
}
@@ -522,8 +569,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] != ' ' ) strcat( the_args, " " );
strcat( the_args, argadd );
if( the_args[strlen( the_args ) - 1] != ' ' ) strlcat( the_args, " ", sizeof( the_args ));
strlcat( the_args, argadd, sizeof( the_args ));
}
}
chan_exit:
@@ -552,6 +599,7 @@ chan_exit:
}
}
IRC_SetPenalty( Client, 1 );
return CONNECTED;
} /* Channel_Mode */
@@ -569,13 +617,14 @@ IRC_AWAY( CLIENT *Client, REQUEST *Req )
{
/* AWAY setzen */
Client_SetAway( Client, Req->argv[0] );
Client_ModeAdd( Client, 'a' );
IRC_WriteStrServersPrefix( Client, Client, "MODE %s :+a", Client_ID( Client ));
return IRC_WriteStrClient( Client, RPL_NOWAWAY_MSG, Client_ID( Client ));
}
else
{
/* AWAY loeschen */
Client_SetAway( Client, NULL );
Client_ModeDel( Client, 'a' );
IRC_WriteStrServersPrefix( Client, Client, "MODE %s :-a", Client_ID( Client ));
return IRC_WriteStrClient( Client, RPL_UNAWAY_MSG, Client_ID( Client ));
}

View File

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

View File

@@ -14,16 +14,17 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc-oper.c,v 1.13 2002/12/12 12:33:14 alex Exp $";
static char UNUSED id[] = "$Id: irc-oper.c,v 1.17 2002/12/31 16:10:55 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "ngircd.h"
#include "resolve.h"
#include "conf.h"
#include "conn.h"
#include "conf.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
@@ -82,16 +83,19 @@ IRC_OPER( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_DIE( CLIENT *Client, REQUEST *Req )
{
/* Shut down server */
assert( Client != NULL );
assert( Req != NULL );
/* Falsche Anzahl Parameter? */
/* 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 != 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 ));
Log( LOG_NOTICE|LOG_snotice, "Got DIE command from \"%s\", going down!", Client_Mask( Client ));
NGIRCd_Quit = TRUE;
Log( LOG_NOTICE|LOG_snotice, "Got DIE command from \"%s\" ...", Client_Mask( Client ));
NGIRCd_SignalQuit = TRUE;
return CONNECTED;
} /* IRC_DIE */
@@ -99,16 +103,19 @@ IRC_DIE( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_REHASH( CLIENT *Client, REQUEST *Req )
{
/* Reload configuration file */
assert( Client != NULL );
assert( Req != NULL );
/* Falsche Anzahl Parameter? */
if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Not a local IRC operator? */
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( );
/* Bad number of parameters? */
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;
return CONNECTED;
} /* IRC_REHASH */
@@ -117,16 +124,19 @@ 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 );
/* Falsche Anzahl Parameter? */
if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Not a local IRC operator? */
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;
/* Bad number of parameters? */
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;
return CONNECTED;
} /* IRC_RESTART */
@@ -134,20 +144,64 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_CONNECT(CLIENT *Client, REQUEST *Req )
{
/* Vorlaeufige Version zu Debug-Zwecken: es wird einfach
* der "passive mode" aufgehoben, mehr passiert nicht ... */
/* Connect configured or new server */
assert( Client != NULL );
assert( Req != NULL );
/* Falsche Anzahl Parameter? */
if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Not a local IRC operator? */
if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
Log( LOG_NOTICE|LOG_snotice, "Got CONNECT command from \"%s\".", Client_Mask( Client ));
NGIRCd_Passive = FALSE;
/* 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] );
}
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.9 2002/12/12 12:23:43 alex Exp $
* $Id: irc-oper.h,v 1.10 2002/12/31 16:11:06 alex Exp $
*
* IRC operator commands (header)
*/
@@ -23,6 +23,7 @@ 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.24 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: irc-server.c,v 1.32.2.2 2003/12/26 16:16:48 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -23,8 +23,9 @@ static char UNUSED id[] = "$Id: irc-server.c,v 1.24 2002/12/12 12:24:18 alex Exp
#include <string.h>
#include "resolve.h"
#include "conf.h"
#include "conn.h"
#include "conn-zip.h"
#include "conf.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
@@ -40,7 +41,7 @@ static char UNUSED id[] = "$Id: irc-server.c,v 1.24 2002/12/12 12:24:18 alex Exp
GLOBAL BOOLEAN
IRC_SERVER( CLIENT *Client, REQUEST *Req )
{
CHAR str[LINE_LEN], *ptr;
CHAR str[LINE_LEN], *ptr, *modes, *topic;
CLIENT *from, *c, *cl;
CL2CHAN *cl2chan;
INT max_hops, i;
@@ -63,8 +64,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 < Conf_Server_Count; i++ ) if( strcasecmp( Req->argv[0], Conf_Server[i].name ) == 0 ) break;
if( i >= Conf_Server_Count )
for( i = 0; i < MAX_SERVERS; i++ ) if( strcasecmp( Req->argv[0], Conf_Server[i].name ) == 0 ) break;
if( i >= MAX_SERVERS )
{
/* Server ist nicht konfiguriert! */
Log( LOG_ERR, "Connection %d: Server \"%s\" not configured here!", Client_Conn( Client ), Req->argv[0] );
@@ -114,13 +115,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 );
Conn_SetServer( con, i );
Conf_SetServer( i, con );
#ifdef USE_ZLIB
#ifdef ZLIB
/* Kompression initialisieren, wenn erforderlich */
if( strchr( Client_Flags( Client ), 'Z' ))
{
if( ! Conn_InitZip( con ))
if( ! Zip_InitConn( con ))
{
/* Fehler! */
Conn_Close( con, "Can't inizialize compression (zlib)!", NULL, FALSE );
@@ -178,33 +179,53 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
while( chan )
{
#ifdef IRCPLUS
/* Wenn unterstuetzt, CHANINFO senden */
/* Send CHANINFO if the peer supports it */
if( strchr( Client_Flags( Client ), 'C' ))
{
/* CHANINFO senden */
if( ! IRC_WriteStrClient( Client, "CHANINFO %s +%s :%s", Channel_Name( chan ), Channel_Modes( chan ), Channel_Topic( chan ))) return DISCONNECTED;
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;
}
}
}
#endif
/* alle Member suchen */
cl2chan = Channel_FirstMember( chan );
sprintf( str, "NJOIN %s :", Channel_Name( chan ));
snprintf( str, sizeof( 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] != ':' ) 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( 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( strlen( str ) > ( LINE_LEN - CLIENT_NICK_LEN - 8 ))
{
/* Zeile senden */
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
sprintf( str, "NJOIN %s :", Channel_Name( chan ));
snprintf( str, sizeof( str ), "NJOIN %s :", Channel_Name( chan ));
}
cl2chan = Channel_NextMember( chan, cl2chan );
@@ -257,7 +278,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
}
/* Log-Meldung zusammenbauen und ausgeben */
if(( Client_Hops( c ) > 1 ) && ( Req->prefix[0] )) sprintf( str, "connected to %s, ", Client_ID( from ));
if(( Client_Hops( c ) > 1 ) && ( Req->prefix[0] )) snprintf( str, sizeof( 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": "" );
@@ -273,7 +294,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
GLOBAL BOOLEAN
IRC_NJOIN( CLIENT *Client, REQUEST *Req )
{
CHAR str[COMMAND_LEN], *channame, *ptr, modes[8];
CHAR nick_in[COMMAND_LEN], nick_out[COMMAND_LEN], *channame, *ptr, modes[8];
BOOLEAN is_op, is_voiced;
CHANNEL *chan;
CLIENT *c;
@@ -284,11 +305,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 );
strncpy( str, Req->argv[1], COMMAND_LEN - 1 );
str[COMMAND_LEN - 1] = '\0';
strlcpy( nick_in, Req->argv[1], sizeof( nick_in ));
strcpy( nick_out, "" );
channame = Req->argv[0];
ptr = strtok( str, "," );
ptr = strtok( nick_in, "," );
while( ptr )
{
is_op = is_voiced = FALSE;
@@ -315,12 +336,17 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
IRC_WriteStrChannelPrefix( Client, chan, c, FALSE, "JOIN :%s", channame );
/* Channel-User-Modes setzen */
strcpy( modes, Channel_UserModes( chan, c ));
strlcpy( modes, Channel_UserModes( chan, c ), sizeof( modes ));
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 );
@@ -329,7 +355,7 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
}
/* an andere Server weiterleiten */
IRC_WriteStrServersPrefix( Client, Client_ThisServer( ), "NJOIN %s :%s", Req->argv[0], Req->argv[1] );
if( nick_out[0] != '\0' ) IRC_WriteStrServersPrefix( Client, Client_ThisServer( ), "NJOIN %s :%s", Req->argv[0], nick_out );
return CONNECTED;
} /* IRC_NJOIN */
@@ -360,9 +386,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';
sprintf( msg, "%s (SQUIT from %s).", Req->argv[1], Client_ID( Client ));
snprintf( msg, sizeof( msg ), "%s (SQUIT from %s).", Req->argv[1], Client_ID( Client ));
}
else sprintf( msg, "Got SQUIT from %s.", Client_ID( Client ));
else snprintf( msg, sizeof( 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.13 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: irc-write.c,v 1.14.2.1 2003/11/07 20:51:11 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -22,7 +22,7 @@ static char UNUSED id[] = "$Id: irc-write.c,v 1.13 2002/12/12 12:24:18 alex Exp
#include <stdio.h>
#include <string.h>
#include "conn.h"
#include "conn-func.h"
#include "client.h"
#include "channel.h"
#include "defines.h"
@@ -395,6 +395,21 @@ 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 2002/12/12 12:23:43 alex Exp $
* $Id: irc-write.h,v 1.5.4.1 2003/11/07 20:51:11 alex Exp $
*
* Sending IRC commands over the network (header)
*/
@@ -18,17 +18,19 @@
#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 BOOLEAN IRC_WriteStrRelatedPrefix PARAMS(( CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));
GLOBAL VOID IRC_SetPenalty PARAMS(( CLIENT *Client, INT Seconds ));
#endif

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 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,14 +14,18 @@
#include "portab.h"
static char UNUSED id[] = "$Id: irc.c,v 1.107 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: irc.c,v 1.120.2.3 2003/12/26 16:16:48 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"
@@ -34,6 +38,9 @@ static char UNUSED id[] = "$Id: irc.c,v 1.107 2002/12/12 12:24:18 alex Exp $";
#include "irc.h"
LOCAL CHAR *Option_String PARAMS(( CONN_ID Idx ));
GLOBAL BOOLEAN
IRC_ERROR( CLIENT *Client, REQUEST *Req )
{
@@ -52,14 +59,15 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
{
CLIENT *prefix, *c;
CHAR reason[COMMAND_LEN];
CONN_ID my_conn, conn;
assert( Client != NULL );
assert( Req != NULL );
/* is the user an IRC operator? */
/* Is the user an IRC operator? */
if(( Client_Type( Client ) != CLIENT_SERVER ) && ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
/* Falsche Anzahl Parameter? */
/* Bad number of parameters? */
if(( Req->argc != 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
if( Req->prefix ) prefix = Client_Search( Req->prefix );
@@ -70,26 +78,60 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
prefix = Client_ThisServer( );
}
Log( LOG_NOTICE|LOG_snotice, "Got KILL command from \"%s\" for \"%s\": %s", Client_Mask( prefix ), Req->argv[0], Req->argv[1] );
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] );
/* build reason string */
if( Client_Type( Client ) == CLIENT_USER ) sprintf( reason, "KILLed by %s: %s", Client_ID( Client ), Req->argv[1] );
else strcpy( reason, 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 ));
/* andere Server benachrichtigen */
/* Inform other servers */
IRC_WriteStrServersPrefix( Client, prefix, "KILL %s :%s", Req->argv[0], reason );
/* haben wir selber einen solchen Client? */
/* Save ID of this connection */
my_conn = Client_Conn( Client );
/* Do we host such a client? */
c = Client_Search( Req->argv[0] );
if( c )
{
/* Ja, wir haben einen solchen Client */
if( Client_Conn( c ) != NONE ) Conn_Close( Client_Conn( c ), NULL, reason, TRUE );
else Client_Destroy( c, NULL, reason, TRUE );
/* 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 );
}
}
else Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
return CONNECTED;
/* Are we still connected or were we killed, too? */
if(( my_conn > NONE ) && ( Client_GetFromConn( my_conn ))) return CONNECTED;
else return DISCONNECTED;
} /* IRC_KILL */
@@ -163,4 +205,109 @@ 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.36 2002/12/12 12:23:43 alex Exp $
* $Id: irc.h,v 1.38 2003/01/15 13:49:20 alex Exp $
*
* IRC commands (header)
*/
@@ -22,6 +22,8 @@ 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.10 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: lists.c,v 1.11 2002/12/26 16:25:43 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -331,19 +331,17 @@ Lists_MakeMask( CHAR *Pattern )
if(( ! at ) && ( ! excl ))
{
/* weder ! noch @<EFBFBD>vorhanden: als Nick annehmen */
strncpy( TheMask, Pattern, MASK_LEN - 5 );
TheMask[MASK_LEN - 5] = '\0';
strcat( TheMask, "!*@*" );
/* weder ! noch @ vorhanden: als Nick annehmen */
strlcpy( TheMask, Pattern, sizeof( TheMask ) - 5 );
strlcat( TheMask, "!*@*", sizeof( TheMask ));
return TheMask;
}
if(( ! at ) && ( excl ))
{
/* Domain fehlt */
strncpy( TheMask, Pattern, MASK_LEN - 3 );
TheMask[MASK_LEN - 3] = '\0';
strcat( TheMask, "@*" );
strlcpy( TheMask, Pattern, sizeof( TheMask ) - 3 );
strlcat( TheMask, "@*", sizeof( TheMask ));
return TheMask;
}
@@ -351,17 +349,14 @@ Lists_MakeMask( CHAR *Pattern )
{
/* User fehlt */
*at = '\0'; at++;
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';
strlcpy( TheMask, Pattern, sizeof( TheMask ) - strlen( at ) - 4 );
strlcat( TheMask, "!*@", sizeof( TheMask ));
strlcat( TheMask, at, sizeof( TheMask ));
return TheMask;
}
/* alle Teile vorhanden */
strncpy( TheMask, Pattern, MASK_LEN - 1 );
TheMask[MASK_LEN - 1] = '\0';
strlcpy( TheMask, Pattern, sizeof( TheMask ));
return TheMask;
} /* Lists_MakeMask */
@@ -382,7 +377,7 @@ New_C2C( CHAR *Mask, CHANNEL *Chan, BOOLEAN OnlyOnce )
return NULL;
}
strncpy( c2c->mask, Mask, MASK_LEN );
strlcpy( c2c->mask, Mask, sizeof( c2c->mask ));
c2c->channel = Chan;
c2c->onlyonce = OnlyOnce;

View File

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

View File

@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 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
@@ -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.59 2002/12/18 14:03:14 alex Exp $
* $Id: messages.h,v 1.64.2.1 2003/12/26 16:16:48 alex Exp $
*
* IRC numerics (Header)
*/
@@ -22,6 +22,11 @@
#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_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"
@@ -35,6 +40,9 @@
#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"
#define RPL_AWAY_MSG "301 %s %s :%s"
#define RPL_USERHOST_MSG "302 %s :"
@@ -101,6 +109,7 @@
#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"
@@ -108,7 +117,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 USE_ZLIB
#ifdef 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,2002 by Alexander Barton (alex@barton.de)
* Copyright (c)2001-2004 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.64 2002/12/12 11:31:21 alex Exp $";
static char UNUSED id[] = "$Id: ngircd.c,v 1.76.2.3 2004/01/02 19:24:46 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -43,6 +43,10 @@ static char UNUSED id[] = "$Id: ngircd.c,v 1.64 2002/12/12 11:31:21 alex Exp $";
#include "parse.h"
#include "irc.h"
#ifdef RENDEZVOUS
#include "rendezvous.h"
#endif
#include "exp.h"
#include "ngircd.h"
@@ -65,17 +69,16 @@ main( int argc, const char *argv[] )
umask( 0077 );
NGIRCd_Restart = FALSE;
NGIRCd_Quit = FALSE;
NGIRCd_NoDaemon = FALSE;
NGIRCd_Passive = FALSE;
NGIRCd_SignalQuit = NGIRCd_SignalRestart = NGIRCd_SignalRehash = FALSE;
NGIRCd_NoDaemon = NGIRCd_Passive = FALSE;
#ifdef DEBUG
NGIRCd_Debug = FALSE;
#endif
#ifdef SNIFFER
NGIRCd_Sniffer = FALSE;
#endif
strcpy( NGIRCd_ConfFile, CONFIG_FILE );
strlcpy( NGIRCd_ConfFile, SYSCONFDIR, sizeof( NGIRCd_ConfFile ));
strlcat( NGIRCd_ConfFile, CONFIG_FILE, sizeof( NGIRCd_ConfFile ));
/* Kommandozeile parsen */
for( i = 1; i < argc; i++ )
@@ -89,11 +92,10 @@ main( int argc, const char *argv[] )
{
if( i + 1 < argc )
{
/* Ok, danach kommt noch ein Parameter */
strncpy( NGIRCd_ConfFile, argv[i + 1], FNAME_LEN - 1 );
NGIRCd_ConfFile[FNAME_LEN - 1] = '\0';
/* Ok, there's an parameter left */
strlcpy( NGIRCd_ConfFile, argv[i + 1], sizeof( NGIRCd_ConfFile ));
/* zum uebernaechsten Parameter */
/* next parameter */
i++; ok = TRUE;
}
}
@@ -156,11 +158,10 @@ main( int argc, const char *argv[] )
{
if(( ! argv[i][n + 1] ) && ( i + 1 < argc ))
{
/* Ok, danach kommt ein Leerzeichen */
strncpy( NGIRCd_ConfFile, argv[i + 1], FNAME_LEN - 1 );
NGIRCd_ConfFile[FNAME_LEN - 1] = '\0';
/* Ok, next character is a blank */
strlcpy( NGIRCd_ConfFile, argv[i + 1], sizeof( NGIRCd_ConfFile ));
/* zum uebernaechsten Parameter */
/* go to the following parameter */
i++; n = (LONG)strlen( argv[i] );
ok = TRUE;
}
@@ -185,8 +186,8 @@ main( int argc, const char *argv[] )
if( ! ok )
{
printf( "%s: invalid option \"-%c\"!\n", PACKAGE, argv[i][n] );
printf( "Try \"%s --help\" for more information.\n", PACKAGE );
printf( "%s: invalid option \"-%c\"!\n", PACKAGE_NAME, argv[i][n] );
printf( "Try \"%s --help\" for more information.\n", PACKAGE_NAME );
exit( 1 );
}
}
@@ -194,8 +195,8 @@ main( int argc, const char *argv[] )
}
if( ! ok )
{
printf( "%s: invalid option \"%s\"!\n", PACKAGE, argv[i] );
printf( "Try \"%s --help\" for more information.\n", PACKAGE );
printf( "%s: invalid option \"%s\"!\n", PACKAGE_NAME, argv[i] );
printf( "Try \"%s --help\" for more information.\n", PACKAGE_NAME );
exit( 1 );
}
}
@@ -220,7 +221,7 @@ main( int argc, const char *argv[] )
exit( Conf_Test( ));
}
while( ! NGIRCd_Quit )
while( ! NGIRCd_SignalQuit )
{
/* In der Regel wird ein Sub-Prozess ge-fork()'t, der
* nicht mehr mit dem Terminal verbunden ist. Mit der
@@ -238,7 +239,7 @@ main( int argc, const char *argv[] )
if( pid < 0 )
{
/* Fehler */
printf( "%s: Can't fork: %s!\nFatal error, exiting now ...\n", PACKAGE, strerror( errno ));
printf( "%s: Can't fork: %s!\nFatal error, exiting now ...\n", PACKAGE_NAME, strerror( errno ));
exit( 1 );
}
@@ -250,8 +251,9 @@ 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_Restart = FALSE;
NGIRCd_Quit = FALSE;
NGIRCd_SignalRehash = FALSE;
NGIRCd_SignalRestart = FALSE;
NGIRCd_SignalQuit = FALSE;
/* Module initialisieren */
Log_Init( );
@@ -260,6 +262,9 @@ 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
@@ -292,16 +297,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, VERSION, IRCPLUSFLAGS );
#ifdef USE_ZLIB
sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION, IRCPLUSFLAGS );
#ifdef ZLIB
strcat( NGIRCd_ProtoID, "Z" );
#endif
if( Conf_OperCanMode ) strcat( NGIRCd_ProtoID, "o" );
#else
sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGE, VERSION );
sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGE_NAME, PACKAGE_VERSION );
#endif
strcat( NGIRCd_ProtoID, " P" );
#ifdef USE_ZLIB
#ifdef ZLIB
strcat( NGIRCd_ProtoID, "Z" );
#endif
Log( LOG_DEBUG, "Protocol and server ID is \"%s\".", NGIRCd_ProtoID );
@@ -313,7 +318,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 );
Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
exit( 1 );
}
@@ -322,6 +327,9 @@ main( int argc, const char *argv[] )
/* Alles abmelden */
Conn_Exit( );
#ifdef RENDEZVOUS
Rendezvous_Exit( );
#endif
Client_Exit( );
Channel_Exit( );
Lists_Exit( );
@@ -338,9 +346,9 @@ NGIRCd_Version( VOID )
STATIC CHAR version[126];
#ifdef CVSDATE
sprintf( version, "%s %s(%s)-%s", PACKAGE, VERSION, CVSDATE, NGIRCd_VersionAddition( ));
sprintf( version, "%s %s(%s)-%s", PACKAGE_NAME, PACKAGE_VERSION, CVSDATE, NGIRCd_VersionAddition( ));
#else
sprintf( version, "%s %s-%s", PACKAGE, VERSION, NGIRCd_VersionAddition( ));
sprintf( version, "%s %s-%s", PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_VersionAddition( ));
#endif
return version;
} /* NGIRCd_Version */
@@ -349,18 +357,26 @@ NGIRCd_Version( VOID )
GLOBAL CHAR *
NGIRCd_VersionAddition( VOID )
{
STATIC CHAR txt[64];
STATIC CHAR txt[200];
strcpy( txt, "" );
#ifdef USE_SYSLOG
#ifdef SYSLOG
if( txt[0] ) strcat( txt, "+" );
strcat( txt, "SYSLOG" );
#endif
#ifdef USE_ZLIB
#ifdef 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" );
@@ -378,12 +394,12 @@ NGIRCd_VersionAddition( VOID )
strcat( txt, "IRCPLUS" );
#endif
if( txt[0] ) strcat( txt, "-" );
strcat( txt, TARGET_CPU );
strcat( txt, "/" );
strcat( txt, TARGET_VENDOR );
strcat( txt, "/" );
strcat( txt, TARGET_OS );
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 ));
return txt;
} /* NGIRCd_VersionAddition */
@@ -393,15 +409,21 @@ 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_Init( );
Conf_Rehash( );
/* Alten Server-Namen wiederherstellen: dieser
* kann nicht zur Laufzeit geaendert werden ... */
@@ -417,7 +439,10 @@ NGIRCd_Rehash( VOID )
/* Listen-Sockets neu anlegen: */
Conn_InitListeners( );
Log( LOG_INFO, "Re-reading of configuration done." );
/* Sync configuration with established connections */
Conn_SyncServerStruct( );
Log( LOG_NOTICE|LOG_snotice, "Re-reading of configuration done." );
} /* NGIRCd_Rehash */
@@ -481,23 +506,21 @@ Signal_Handler( INT Signal )
case SIGINT:
case SIGQUIT:
/* wir soll(t)en uns wohl beenden ... */
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;
NGIRCd_SignalQuit = TRUE;
break;
case SIGHUP:
/* Konfiguration neu einlesen: */
Log( LOG_WARNING|LOG_snotice, "Got HUP signal, re-reading configuration ..." );
NGIRCd_Rehash( );
NGIRCd_SignalRehash = TRUE;
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_NOTICE, "Got signal %d! Ignored.", Signal );
Log( LOG_DEBUG, "Got signal %d! Ignored.", Signal );
#endif
}
} /* Signal_Handler */
@@ -506,7 +529,7 @@ LOCAL VOID
Show_Version( VOID )
{
puts( NGIRCd_Version( ));
puts( "Copyright (c)2001,2002 by Alexander Barton (<alex@barton.de>)." );
puts( "Copyright (c)2001-2004 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.17 2002/12/12 11:30:23 alex Exp $
* $Id: ngircd.h,v 1.19 2002/12/26 16:48:14 alex Exp $
*
* Prototypes of the "main module".
*/
@@ -37,14 +37,15 @@ GLOBAL BOOLEAN NGIRCd_NoDaemon; /* nicht im Hintergrund laufen */
GLOBAL BOOLEAN NGIRCd_Passive; /* nicht zu anderen Servern connecten */
GLOBAL BOOLEAN NGIRCd_Quit; /* TRUE: ngIRCd beenden */
GLOBAL BOOLEAN NGIRCd_Restart; /* TRUE: neu starten */
GLOBAL BOOLEAN NGIRCd_SignalQuit; /* TRUE: quit server*/
GLOBAL BOOLEAN NGIRCd_SignalRestart; /* TRUE: restart server */
GLOBAL BOOLEAN NGIRCd_SignalRehash; /* TRUE: reload configuration */
GLOBAL CHAR NGIRCd_DebugLevel[2]; /* Debug-Level fuer IRC_VERSION() */
GLOBAL CHAR NGIRCd_ConfFile[FNAME_LEN]; /* Konfigurationsdatei */
GLOBAL CHAR NGIRCd_ProtoID[1024]; /* Protokoll- und Server-Identifikation */
GLOBAL CHAR NGIRCd_ProtoID[COMMAND_LEN];/* 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.52 2002/12/18 13:53:20 alex Exp $";
static char UNUSED id[] = "$Id: parse.c,v 1.59 2003/01/15 13:49:20 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -24,7 +24,7 @@ static char UNUSED id[] = "$Id: parse.c,v 1.52 2002/12/18 13:53:20 alex Exp $";
#include "ngircd.h"
#include "defines.h"
#include "conn.h"
#include "conn-func.h"
#include "client.h"
#include "channel.h"
#include "log.h"
@@ -54,7 +54,9 @@ 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 },
@@ -83,6 +85,7 @@ 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 },
@@ -163,7 +166,7 @@ Parse_Request( CONN_ID Idx, CHAR *Request )
*ptr = '\0';
#ifndef STRICT_RFC
/* multiple Leerzeichen als Trenner vor
*Parametertrennern ignorieren */
* Parametern ignorieren */
while( *(ptr + 1) == ' ' ) ptr++;
#endif
}
@@ -326,46 +329,50 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
client = Client_GetFromConn( Idx );
assert( client != NULL );
/* Statuscode, der geforwarded werden muss? */
if(( strlen( Req->command ) == 3 ) && ( atoi( Req->command ) > 100 ))
/* Statuscode? */
if(( Client_Type( client ) == CLIENT_SERVER ) && ( strlen( Req->command ) == 3 ) && ( atoi( Req->command ) > 100 ))
{
/* Befehl ist ein Statuscode */
/* Command is a status code from an other server */
/* Zielserver ermitteln */
if(( Client_Type( client ) == CLIENT_SERVER ) && ( Req->argc > 0 )) target = Client_Search( Req->argv[0] );
/* Determine target */
if( 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;
}
/* Quell-Client ermitteln */
/* Determine source */
if( ! Req->prefix[0] )
{
Log( LOG_WARNING, "Got status code without prefix!?" );
/* Oops, no prefix!? */
Log( LOG_WARNING, "Got status code %s from \"%s\" without prefix!?", Req->command, Client_ID( client ));
return TRUE;
}
else prefix = Client_Search( Req->prefix );
if( ! prefix )
{
Log( LOG_WARNING, "Got status code from unknown source: \"%s\"", Req->prefix );
/* Oops, unknown prefix!? */
Log( LOG_WARNING, "Got status code %s from unknown source: \"%s\"", Req->command, Req->prefix );
return TRUE;
}
/* Statuscode weiterleiten */
strcpy( str, Req->command );
/* Forward status code */
strlcpy( str, Req->command, sizeof( str ));
for( i = 0; i < Req->argc; i++ )
{
if( i < Req->argc - 1 ) strcat( str, " " );
else strcat( str, " :" );
strcat( str, Req->argv[i] );
if( i < Req->argc - 1 ) strlcat( str, " ", sizeof( str ));
else strlcat( str, " :", sizeof( str ));
strlcat( str, Req->argv[i], sizeof( str ));
}
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.9 2002/12/18 13:53:20 alex Exp $
* $Id: parse.h,v 1.10 2003/01/03 22:03:51 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)( CLIENT *Client, REQUEST *Request );
BOOLEAN (*function) PARAMS(( 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 */

229
src/ngircd/rendezvous.c Normal file
View File

@@ -0,0 +1,229 @@
/*
* 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- */

39
src/ngircd/rendezvous.h Normal file
View File

@@ -0,0 +1,39 @@
/*
* 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.4 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: resolve.c,v 1.6 2003/04/21 10:52:51 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 ) strcpy( hostname, h->h_name );
if( h ) strlcpy( hostname, h->h_name, sizeof( hostname ));
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
strcpy( hostname, inet_ntoa( Addr->sin_addr ));
strlcpy( hostname, inet_ntoa( Addr->sin_addr ), sizeof( hostname ));
}
/* Antwort an Parent schreiben */
if( write( w_fd, hostname, strlen( hostname ) + 1 ) != ( strlen( hostname ) + 1 ))
if( (size_t)write( w_fd, hostname, strlen( hostname ) + 1 ) != (size_t)( 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;
strcpy( ip, inet_ntoa( *addr ));
strlcpy( ip, inet_ntoa( *addr ), sizeof( ip ));
}
else
{
@@ -226,7 +226,7 @@ Do_ResolveName( CHAR *Host, INT w_fd )
}
/* Antwort an Parent schreiben */
if( write( w_fd, ip, strlen( ip ) + 1 ) != ( strlen( ip ) + 1 ))
if( (size_t)write( w_fd, ip, strlen( ip ) + 1 ) != (size_t)( 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.3 2002/12/12 12:23:43 alex Exp $
* $Id: resolve.h,v 1.5 2003/04/21 10:53:10 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

@@ -9,19 +9,23 @@
# 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.4 2002/05/22 09:09:43 alex Exp $
# $Id: Makefile.am,v 1.7 2003/01/03 22:04:14 alex Exp $
#
AUTOMAKE_OPTIONS = ansi2knr
noinst_LIBRARIES = libngportab.a
libngportab_a_SOURCES = vsnprintf.c
libngportab_a_SOURCES = strlcpy.c 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,17 +1,16 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
* Copyright (c)2001-2003 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.
* 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: portab.h,v 1.9 2002/12/12 11:26:08 alex Exp $
* $Id: portab.h,v 1.15 2003/03/31 19:01:02 alex Exp $
*
* portab.h: "Portabilitaets-Definitionen"
* Portability functions and declarations (header for libngbportab).
*/
@@ -21,8 +20,12 @@
#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
@@ -41,7 +44,7 @@
#endif
/* Keywords */
/* keywords */
#define EXTERN extern
#define STATIC static
@@ -50,7 +53,7 @@
#define REGISTER register
/* Datatentypen */
/* datatypes */
#ifndef PROTOTYPES
# ifndef signed
@@ -105,18 +108,7 @@ typedef UINT8 BOOLEAN;
#endif
/* 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 */
/* target constants */
#ifndef TARGET_OS
#define TARGET_OS "unknown"
@@ -131,6 +123,38 @@ 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,30 +14,53 @@
#include "portab.h"
static char UNUSED id[] = "$Id: portabtest.c,v 1.9 2002/12/12 11:38:46 alex Exp $";
static char UNUSED id[] = "$Id: portabtest.c,v 1.11 2003/01/04 10:40:01 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 )
{
/* 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;
/* 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
/* kein Fehler */
/* ok, no error */
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- */

75
src/portab/strlcpy.c Normal file
View File

@@ -0,0 +1,75 @@
/*
* 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.4 2002/12/12 11:37:11 alex Exp $";
static char UNUSED id[] = "$Id: vsnprintf.c,v 1.5 2003/04/21 10:53:38 alex Exp $";
#include "imp.h"
@@ -98,6 +98,7 @@ static char UNUSED id[] = "$Id: vsnprintf.c,v 1.4 2002/12/12 11:37:11 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,26 +1,35 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: getpid.sh,v 1.2 2002/11/10 14:28:06 alex Exp $
# $Id: getpid.sh,v 1.2.4.2 2003/11/07 20:51:11 alex Exp $
# wurde ein Name uebergeben?
# did we get a name?
[ $# -ne 1 ] && exit 1
# Flags fuer "ps" ermitteln
# detect flags for "ps" and "head"
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
# PID ermitteln
ps $PS_FLAGS > procs.tmp
pid=$( cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n | head $HEAD_FLAGS )
# debug output
#echo "$0: PS_FLAGS=$PS_FLAGS"
#echo "$0: PS_PIDCOL=$PS_PIDCOL"
#echo "$0: HEAD_FLAGS=$HEAD_FLAGS"
# ermittelte PID validieren
# search PID
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
# validate PID
[ "$pid" -gt 1 ] > /dev/null 2>&1
[ $? -ne 0 ] && exit 1

View File

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

View File

@@ -1,31 +1,37 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: start-server.sh,v 1.10 2002/11/10 14:28:06 alex Exp $
# $Id: start-server.sh,v 1.10.4.1 2003/11/07 20:51:11 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
echo " starting server ..."
# alte Logfiles loeschen
# remove old logfiles
rm -rf logs *.log
# 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!
# 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.
./getpid.sh sh > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " error: getpid.sh FAILED!"
exit 1
fi
# MOTD fuer Test-Server erzeugen
# 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
echo "This is an ngIRCd Test Server" > ngircd-test.motd
# Test-Server starten ...
# starting up test-server ...
./T-ngircd -np -f ${srcdir}/ngircd-test.conf > ngircd-test.log 2>&1 &
sleep 1
# validieren, dass Server laeuft
# validate running test-server
pid=`./getpid.sh T-ngircd`
[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1 || exit 1

View File

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

View File

@@ -1,10 +1,10 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: stress-server.sh,v 1.6 2002/09/23 22:07:43 alex Exp $
# $Id: stress-server.sh,v 1.6.4.2 2003/11/07 20:51:11 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 "SKIP: ${name} -- \"expect\" not found."; exit 77
echo " ${name}: \"expect\" not found."; exit 77
fi
type telnet > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "SKIP: ${name} -- \"telnet\" not found."; exit 77
echo " ${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 2002/09/12 02:29:03 alex Exp $
# $Id: tests.sh,v 1.3.6.1 2003/11/07 20:51:11 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 "SKIP: ${name} -- \"expect\" not found."; exit 77
echo " ${name}: \"expect\" not found."; exit 77
fi
type telnet > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "SKIP: ${name} -- \"telnet\" not found."; exit 77
echo " ${name}: \"telnet\" not found."; exit 77
fi
echo " doing ${test} ..."

27
src/tool/Makefile.am Normal file
View File

@@ -0,0 +1,27 @@
#
# 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-

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: tool.c,v 1.10 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: tool.c,v 1.1 2003/01/13 12:20:16 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.9 2002/12/12 12:23:43 alex Exp $
* $Id: tool.h,v 1.1 2003/01/13 12:20:16 alex Exp $
*
* Tool functions (Header)
*/