*** Note: all the enclosed files except nntp.h and wildmat.c (which is
    Copyright Rich $alz 1991 I guess) are Copyrighted as seen below***
* (although the dates may vary)
* Copyright (c) 1993, 1994, 1995 Carnegie Mellon University
* All Rights Reserved.
* 
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
*  Software Distribution Coordinator  or  Software_Distribution@CS.CMU.EDU
*  School of Computer Science
*  Carnegie Mellon University
*  Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*******************************************************************************

(See README.intro for information on what this software does...)
This software should compile with minimal work (ie it compiles for me) on:
(you still have to install it by hand, you need to install:
dnntpd, dnntp_conf (you write one), dnntpd.1 (man page), optional dnntp_access)


			Building directions
using Makefile.other, compile with "SITE=XXX" on the make command line
	Where XXX is the right thing for the OS.

SunOS 4.x (SITE=SUNOS) (note you probably need to use gcc and so
	should do "CC=gcc" too...or maybe the unbundled sun compiler)

OSF/1 (DEC Alpha) (SITE=OSF)

Ultrix 4.3x (run something like:
sed -e '1,$s/${SITE}/ULTRIX/g' < Makefile.other > Makefile.ultrix
and use the result of that, cause Ultrix Make sucks)

HP/UX 9.X (gives lots of warnings about the #error construct)
run something like:
sed -e '1,$s/${SITE}/HP/g' < Makefile.other > Makefile.hp
and use the result of that, cause HP/UX Make also sucks)

AIX (SITE=AIX) (this isn't very well tested...you might need to resolve
	the SITE stuff and make a dumb makefile like the above)

BSD 4.3, or 4.4 (SITE=BSD)

SysVR4 4.0 or 4.2 (SITE=SVR4) (
(you may need to pre-process the Makefile as mentioned above)
(note: with 4.2 you may have trouble with strcasecmp being missing...
and I haven't done any hacks to deal with it...)

If you are doing something not on this list, start with BSD or SVR4 depending
on which it is closer too...

			Configuration
most OS specific things will be taken care of, but there are lots of
configuration options you may wish to change...
almost all configuration takes place in dnntpconf.h

Defines you may wish to play with (lots more with minimal comments in
dnntpconf.h, that you aren't likely to want to play with)

ALONE: this indicates if it runs stand alone or under inetd, if 0, it runs
under inetd, if not, it listens itself on the apropriate socket.

DNNTP_PORT: this tells it to use a static port instead of looking up
"nntp" in the services info.  (maybe needed if you don't have root
on the machine you want to run this on, though you may also have to make
matching port changes to news clients...I wish they let you set the port
in the NNTPSERVER environment variable)

DO_XREALLY: this can enable sending the command XREALLY when the host
reading news doesn't match the host running dnntpd, this way you can log
what hosts are really reading news.  (you send "XREALLY host_name_or_id" and
the result looks like the one of the three response codes you can get
on an initial connection)

DNNTP_ALLOW_OUTSIDE: this enables dnntpd allowing connections from hosts
other than the one it is running on, you also need to list hosts (or nets)
to let in in the file dnntp_access (which you create ussually in /etc)

XHDR, XOVER, LISTGROUP each turns on the respective command (but note: XTHREAD
can also be turned on, but it will break if all the back end news servers don't
have the same byte order)

MODE turns on the MODE command (INN specific), also see DNNTP_INIT_MODE_VAL
which deturmines if the forwarder will generate MODE READER commands
on its own, or only if news-readers send it.

DNNTP_SERVER_CONSISTANT_WO_LISTS will speed things up if it is turned on,
and multiple news readers are run talking to one machine with dnntpd, but
it is only safe if the backend news-servers don't need LIST commands to
update the contents of a group (ie works for INN)

DNNTP_USE_GROUP_INFO tells dnntp to use external information about what
news groups are on what server, instead of just combining the output from
LIST on each server (where it will just choose the first news server in
the dnntp_conf file with each group as the only site for the group).
DNNTP_USE_STATIC_GROUP will compile in a table of group to server
mapings(see group_static.h), without that, it will use a file
(see DNNTP_GROUP_FILE, ussually dnntp_group)

DNNTP_POSSIBLE_XREF_ODDNESS turns on filtering of Xref: lines in articles,
XHDR commands and XOVER commands.  It takes out any Xref's which refer
to a group that isn't on the same server as the article came from.
(otherwise if multiple servers have a group, they may have Xrefs with
bad numbers in them), if you never have servers with overlaping groups (or
all articles from such a time are expired) you can turn this off...

DNNTP_DISK_LIST_CACHE turns on caching of the results of LIST commands to all
the back-end news-servers.  This is nessicary if it is going to hide outages
of back-end news-servers.  (there are also a bunch of parameters for the cache
files, see dnntpconf.h)

DNNTP_TROUBLE_EMAIL email addr listed in the HELP message...feel free
to redirect it from us...(you can then filter bug complaints any only
send on the non-spurious ones (to softdist+dnntpd@cs.cmu.edu))

basic install:
build the binary, with paths for dnntp_conf (and maybe dnntp_access and maybe
dnntp_group set correctly) then make a dnntp_conf file with a list
of the machines that are serving news for real (hostname or ip then
whitespace then port number on one line...as many lines as needed for multiple
hosts.  # starts a comment line)
And if you need to make a dnntp_access file to let other hosts into what
ever machine(s) are running dnntpd (see man page for details on this file).
(see directory example for examples of the basic files)

copy all the files into place 

Create a news account (or run dnntpd as someone else...)
create an inetd.conf entry (for example:
nntp  tcp     nowait  news    /usr/local/lib/dnntpd   dnntpd
)
if you are using ultrix or some such, you can't set the person to run as to
news, but if there is a news account, it will turn from root into news...
(make sure DNNTP_MAYBE_ROOT is on so it will check).

By default (if list caches are on) list cache files will get stuck in the
home directory of who ever it ends up running as (normally news).
(you can override this with a -c /dir_to_put_cache_files_in option to it, in
the inetd.conf) restart inetd (or kill -HUP it if that works)
(note: alot of OS's come with the news account having a home dir as /usr/news,
but also have a program "news" which reads files there...if you leave
news with that as its home dir on systems like that, use the -c to move
where cache files end up)

******Bugs******
There is an unconfirmed out-standing bug where dnntpd keeps running after
whatever was connected to it dies.

See XTHREAD proviso above

IHAVE and AUTH commands not implemented

Some misc INN commands not implemented

Doesn't do the double DNS lookup thing to make sure it isn't be spoofed.

Doesn't use real hashing for group lookups (does qsort/bsearch).

list_cmd.c is a monstrosity.
