# $Id: README,v 1.2 1999/02/23 10:14:09 vasim Exp $

rtnppd
-----

Have a look at example.complex to see a more complicated setup then the one I
have presented here.

rtnppd is an OSS (Open Source Software) general purpose TNPP router with
extra abilities. Now you can compile it under FreeBSD and Linux. It can do:

- TNPP <--> TCP/IP: enscapsulate TNPP packets TCP/IP, send these packets
to another rtnppd which decapsulates them back to TNPP, routing them to
their final destination. This means you can use IP networking to link TNPP
devices together.

- packet logging: the program will log all packets to a log file. This log
file can then be read, creating a record of all pages.

- SQL database logging: all packets are into an SQL database, allowing
network storage and queries. Currently, msql, PostgreSQL and MySQL are
supported.

- external queues sockets: this feature allows you to more easily debug and 
extend the features of this program. For example, packet manipulation utility:
the packets can be read, changed, delayed or otherwise manipulated to add
value to your TNPP network.

- open source: which means you get the source code to modify for yourself
as you wish (see COPYRIGHT for more info).

- stand alone logging: rtnppd can also act as in a stand-alone packet logging
mode. See the "tnpp-trans.conf" file.


Installation Instructions:
--------------------------
1
Download the "rtnppd.tar.gz" file, and unpack using "tar xzvf
rtnppd.tar.gz"
Change to the rtnppd directory.

2
Have a look at the Makefile first, then type "make".
If it builds without any errors, then you probably have a working version.
If not, fix the error and try again.

3
As root, type "make install" which installs the configuration files by
default into "/usr/local/etc" and "rtnppd" into the "/usr/local/sbin"
directory. Log files are will be created by default into /var/log.

If you don't want to run the program as root, then make sure the
appropriate user has read + write permissions to the appropriate device.
This could be "/dev/ttyS1" which corresponds to "/dev/cua1" or the DOS
comm 1 (/dev/ttyd1 and /dev/cuaa1 under FreeBSD). The command
"chmod 666 /dev/ttys*" will give reed and write permissions to the ttyS*
serial devices to any user. The user must have the correct permissions for
access to the log file directory and files.

4
Type "rtnppd -h" to see what command line options are available.
-------
rtnppd v1.5b by Vasim V.

Usage: rtnppd [-ds] [-C CONFIG] [-S SECTION] [-x LOGLEVEL]

Options:
  -d		Do not daemonize
  -s		Use stderr instead syslog
  -C CONFIG	Use config file CONFIG instead '/usr/local/etc/rtnppd/rtnppd.conf'
  -S SECTION	Use section [SECTION] in config files instead [vasim.ufa.ru]
  -x LOGLEVEL	Log at level LOGLEVEL (default is 2):
			0 - No logging
			1 - Log only errors
			2 - Log errors and warnings
			3 - Log some info about packets, etc
			4 - Log everything
------------
Most of these options are great for testing. Once the configuration files
are properly set up, the appropriate run command would likely be "./rtnppd"
alone.

Since this is a daemon, and should run whenever the computer is on, there
needs to be an initialization script. This doesn't exist yet, so you may
want to put an appropriate start up command into the "/etc/rc.d/rc.local"
file, or create a full init script for your whatever particular system.

5
Edit the configuration files. A simply configuration would include four
tnpp devices:

System          TNPP Address             Description
------          -----------              -----------
one             4000                     paging terminal
two             0010                     rtnppd
three           0020                     rtnppd
four            5000                     paging terminal

System:         two                 three
TNPP address:   0010                0020
serial port:    /dev/ttyS1          /dev/ttyS1
IP address:     192.168.1.1         192.168.1.2
IP port:        4444                4444
Connected to
TNPP device:    4000                5000

First you should read through all the configuration files. I'm only going
to give an example, which may not help much if you need a much different
set-up. This is for system two.

rtnppd.conf - setup the local IP port
-----------
BindAddress     192.168.1.1
Port            4444
TNPPAddress     0001
OneLineLog      On
-----------

tnpp_dev.conf - setup two devices, one a local serial port and another
remote IP port
-------------
device 192.168.1.2:4444
devicename Link Edmonton
address 0020
routefor 5000

device /dev/ttyS1
devicename Link Calgary
address 4000
; the default serial configuration is 8,n,1
baud 9600
clocal yes
;routefor 6000 (possibly another tnpp device connected to this device)
-------------

tnpp_trans.conf - setup tnpp packet logging
---------------
translatefrom 5000 (log all TNPP packets for destination 5000)
logpacket yes

translatefrom 4000 (log all TNPP packets for destination 4000)
logpacketyes
---------------

That's it. Use the "-ds" command to see when the links come up (or look into
syslog's logfiles), and set the logging level to see the appropriate messages.

If you have any suggestions and/or questions, contact to Vasim Valejev
(vasim@geocities.com)

This README was written by Brandon Bidewell (bb@selectcomm.ab.ca)

