VMSP 0.16
=========

VMSP is an embryonic network protocol for vendor machine simulations. It is
a cross between SMTP and SASL for the purposes of standard and administrative
access to a vendor simulation database. For more detailed information, see
VMSP.txt in this directory.

Quick Install
=============

You'll need, if you don't already have it, a copy of amkCrypto, at least
version 0.1.3 from Andrew Kuchling's site,

http://starship.python.net/crew/amk/

its an update of mxCrypto, which wraps the OpenSSL library, and works with at
least version 0.9.4, but I've had it working up to 0.9.6. 

amkCrypto SHOULD work with python 1.5.2, but since this is really a Python 2.0
project, I'd compile it for that version of Python. Tell me if it's not
working with Python 2.1, I don't yet have that version on my machine, and I'd
like VMSP to be compatible.

You can put vmspd.py, idauth.py, vmspdata.py and pv.dat  in a directory
suitable for running vmspd.py from. vmsplib.py you can put anywhere.

Quick Running
=============

Invoke vmspd.py by 

./vmspd.py -n '':[port] 

where -n means don't setuid it to 'nobody' (only root can do that), '' means
bind on all network interfaces,  and where port is any port above, say,2000
for safety. vmsplib.py expects 3200, so if you need to change that, do so.

There are a few command-line parameters which are explained by just running
./vmspd.py. Note that as yet, vmspd doesn't require any _specific_ port to
use.

Note that vmspd needs the data file (pv.dat) and some log files it creates to
live in the same directory so make sure you (and vmspd.py) can read and write
in that directory. Feel free to edit pv.dat for items, the bank total and item
costs and amounts, but be careful not to put spaces within item names and keep
two spaces between the item name, cost and amount.

Note that this server likes to be run stand-alone: trying to run it under
inetd or xinetd confuses it :( I'd like this fixed at some point...


The Files
=========

vmspd.py is the implementation of VMSP. It was derived (as an implementation)
from two main sources:

- smtpd.py by Barry Warsaw <bwarsaw@beopen.com>

- pyvend.py by myself, itself a derivation of a c++ program by Paul Maddox
  c. 1998, and unfortunately I have no idea if he's still on the net.

VMSP was written to satisfy my desire to learn python network programming, and
to make more use of an admittedly trivial program, rather than simply bunging
it into inetd.conf and hacking up a UNIX port for it.

vmsplib.py 

- is the client library for interacting with VMSP. It is an obvious analogue
  of smtplib.py, written by The Dragon De Monsyne, Eric Rayomond and others.
  You can run it to connect to a VMSP server and test out some commands, but
  otherwise it's there to make writing clients easier. It uses port 3200, so
  change that if you need to.

idauth.py 

- is a simple RFC 1413 ident protocol class, useful for SMTP-like client
  identification. Naturally, you cannot trust the data it returns (if you
  don't understand this, try doing a search for identd daemons on the web, and
  see how many are designed to return false userid's).

vmspdata.py 

- is a class module for dealing with the all-important data file and logging.
  It's essentially a reworking of pyvend.py to work with the client/server
  protocol, and vmspd.py depends on it.

With a fully network-orientated vendor machine simulation, there's also more
scope for remote administration (think of MailMan for instance), statistics
gathering, the list is probably endless. It's true that much the same thing
could be accomplished by a PHP/MySQL combination, but where's the low-level
fun in that? Doing it in python is sometimes easier, sometimes harder, but at
least it's not web-based.

Also included is an imaginary Internet Draft for the VMSP protocol
specification. Internet Drafts are the first stage of writing RFC's, and I
thought it would be interesting to show what such documents mean when included
with an real implementation. As far as possible, the implementation conforms
to the draft, and vice-versa, except for the admin commands, which I haven't
implemented. So it's not fully VMSP-compliant, but then that's the point of
having RFC's around to set standards.

This is not unusual. When an Internet Draft becomes an RFC, it is set in
stone, and the only way to change things is to write _another_ RFC that
obsoletes or updates the original in some way. So anyone is free to implement
what I have set down, or improve on it, and write an RFC that would obsolete
mine (if and when it became a REAL RFC).

Because, by extension, VMSP is totally imaginary, it's available as your
playground as well as mine. I look forward to your (most likely) superior
contributions.

Sean Dwyer <ewe2@can.org.au>, April 2001
