The nasd (pronounced "nasty") system will live in two places, the library
directory $L (typically /usr/lib/nasd) and the spool directory $S (typically
/usr/spool/nasd).

Operations are of two classes: client functions, and server functions.
A machine may act as both a client and a server.

The user interface to the system is the 'dist' command (details to be worked out,
but mostly like ship, except the destination is taken from argument(s) rather than
the environment).

Several programs work behind the scenes:

$L/connect - make a network connection and call $L/query, $L/receive, or $L/notify
$L/query - query a server for pending jobs
$L/receive - request a package from a server and optionally install it
$L/notify - notify a client that a package is a available

$L/dispatch - dispatch incoming network connections to $L/answer, $L/send, or $L/notice
$L/answer - the server for query
$L/send - the server for receive
$L/notice - the server for notify

The network programs are organized so they can work on a batch network as well
as an interactive network.  $L/query, $L/receive expect only input from the
network connection; $L/connect passes any initial arguments to the remote server.
$L/notify produces only output for the network connection.

$L/dispatch, $L/answer, $L/send, and $L/notice are similarly organized.

The whole thing is driven by a configuration file $L/conf describing the
allowed operations to be requested by remote machines.  The format of the
file is as follows:  Lines beginning with a # are comments and are ignored.
Other lines are of the form:

	service system user pathname action

Service is "server" or "client"; system, user, and pathname are regular
expressions, and action is a list of actions, separated by +.  A sample
configuration file might be:

	# service	system		user	pathname	action

	# we are willing to distribute stuff to coma and pyxis.
	server		(coma|pyxis)	.*	.*		accept(yes)
	server		.*		.*	.*		accept(no)
	
	# we don't like fred
	client		.*		fred	.*		accept(no)
	# we also refuse to accept stuff from root as a matter of principle
	client		.*		root	.*		accept(no)
	# stuff from bowell!mjh is installed in /usr/bin as root.
	client		bowell		mjh	/usr/bin/.*	accept(yes)+user(root)
	# we accept files in /usr/pub from anyone on alice, but we don't
	# execute random commands for them
	client		alice		.*	/usr/pub/.*	accept(yes)+cmds(no)

The configuration file is scanned for the first match to get actions.  If no
match is found the request is rejected.  Some actions, such as "accept", must
always be provided; others, such as "cmds" have defaults or are otherwise
	# service	system		user	pathname	action

	# we are willing to distribute stuff to coma and pyxis.
	transmit	(coma|pyxis)	.*	.*		accept(yes)
	transmit	.*		.*	.*		accept(no)
	
	# we don't like fred
	receive		.*		fred	.*		accept(no)
	# we also refuse to accept stuff from root as a matter of principle
	receive		.*		root	.*		accept(no)
	# stuff from bowell!mjh is installed in /usr/bin as root.
	receive		bowell		mjh	/usr/bin/.*	accept(yes)+user(root)
	# we accept files in /usr/pub from anyone on alice, but we don't
	# execute random commands for them
	receive		alice		.*	/usr/pub/.*	accept(yes)+cmds(no)

The configuration file is scanned for the first match to get actions.  If no
match is found the request is rejected.  Some actions, such as "accept", must
always be provided; others, such as "cmds" have defaults or are otherwise
unnecessary.
