PPPWart 1.02

 2000, Herbert zur Nedden


Thanksware: Send me a mail if it runs...


Purpose
-------

Network card for RISC OS computers are damn expensice. With this program
you can set up a serial network connection from a Windows PC - using PPP
and Acorn's internet stack. PPPWart is a commandline tool so that it can
be called by obey files. I included a simple Wimp frontend too.


License:
--------

Thanksware, that is enybody using it is asked to send me "thank you" email
to mailto:BinDabei@HQ.gag.de. Questions and suggestions and so on please to
mailto:HzN@HQ.gag.de.

The PPPWart package may be passed on unchanged and complete only.


Prerequisites:
--------------

Acorn TCP/IP stack with PPP modul and Acorn's Resolver module (e.g.
from the Acorn User 200-CDROM).  Blockdrivers (Application !SerialDev)
and module Serial Buffer by David Pilling.

Then you certainly need the null modem cable. One you can buy in a
store should be fine but I recommend that you check the wiring of the
cable since you never know if one with only part of the connections
is around.

 RxD 2 -------------- 3 TxD
 TxD 3 -------------- 2 TxD

                  +-- 1 DCD
 DTR 4 -----------+-- 6 DSR
 DSR 6 --+----------- 4 DTR
 DCD 1 --+

 GND 5 -------------- 5 GND

 RTS 7 -------------- 8 CTS
 CTS 8 -------------- 7 RTS

  RI 9                9 RI

This "picture" is a bit strange ... thus please find a better-looking
drawfile enclosed.


Front- and backend:
-------------------

This package is made of two parts: The backend PPPWart which does the
work and the frontend !PPPWart which is based on The Menu. With the
latter you can run different star commands and thus PPPWart too.


Calling the backend:
--------------------

PPPWart is called with two parameters: The options and the parameter
file.

Options:
L Log the activities on screen. Since this is a simple output the
  informations show in a task window or a command window.
D This option disconnects the connection. In case you don't pass a
  parameter file name the last one will be used (as long as you didn't
  boot inbeween and thus deleted the system variable used to remember
  the name of the last parameter file).
Q This is for querying the state of the PPP connection; internally the
  output of the star command *PPPLog is analysed.

Parameterfile: In this file are the informations for the setup of
the connection in separate lines.
(Lines beginning with a semicolon are comments):

Blockdriver's name            (e.g. InternalPC for the internal
                               interface when using a standard PC
                               cable)
Blockdrivers's port           (for the internal one it's zero: 0)
Baud rate                     (e.g. 152000)
Dialcommand                   (This is the command with phonenumber for
                               which PPPWart waits and then replies with
                               "CONNECT" and then launches PPP)
Own IP address                (The IP address the PPP interface on the
                               own system shall have).
Remove IP address             (The IP address the PPP interface of the
                               computer which dieals in shall get.)
Parameters for *PPPConnect    (see below)
CLI command to be called after connecting
CLI command to be called after disconnecting
CLI command in case of an error (e.g. *Error)

Sample paraemter file:
InternalPC
0
152000
ATDT123
10.10.11.01
10.10.11.04
idle-disconnect 0 noipdefault defaultroute crtscts modem mru 1524
<PPPWart$Dir>.Start
<PPPWart$Dir>.Stop
*Error


Windows config:
---------------

On the Windows PC you should install a "Standard modem 33600 bps"
or the like and configure the baud rate to 115200 (to the baud
rate in the parameter file to be exact).

Then you need to set up a dialup network connection which uses the
modem just installed and as phone number the one stated after the
"ATDT" in the parameter file.

In the settings of th dialup connection please set these things:
- Server type PPP: Internet, Windows NT Server, Windows 98, ...
- Extendes options: everything off
- Allowed network protocols: just TCP/IP
- TCP/IP settings:
  - IP address set by server
  - Name server set by server
  - IP header compression on
  - default gateway in the remote network in case you want just that
- User and password for dialling are stored in !PPPWart.User (see
  the example below for details).

How it goes:
------------

To launch a connection PPPWart does this:
0. Remember the parameter file name in the system variable
   PPPWart$File.
1. Initialise the block driver using the first three parameters from the
   parameter file (block drivers's name, port and baud rate).
2. Wait what comes along ...

3. Now the dialup connection is initiated in Windows.

4. PPPWart replies to the AT commands it gets, usually with "OK".

5. When the dial command ATDTnnnn apprears like stated in the paramter
   file PPPWart replies with a "CONNECT" and
6. Runs the *PPPConnect command with the parameters stated in the
   parameter file as well as the local and the remote IP address.
7. Checks that the connection has been established by inspecting the
   output of *PPPLog (this should be able using the SWI PPP_Status
   too but no documentation is available).
8. Run the star command set for the connect in the parameter file.

In case at some place an error occurred the connection is terminated
and the star command for an error is called with the error message
as parameter.

If the connection is to be terminated PPPWart does:
0. if no parameter file is named it uses the one it stored in the
   system variable PPPWart$File.
1. Check if a PPP connection is up (inspecting the *PPPLog output)
2. If a PPP connection is up it is terminated using the star command
   *PPPDisconnect.
3. Then PPPWart waits for a moment for the ATH and the ATZ from the
   Windows computer (Windows tries to disconnect the "modem"),

Querying the connection is done by PPPWart this way:
Soll die Verbindung abgefragt werden, so geht PPPWart wie folgt vor:
0. if no parameter file is named it uses the one it stored in the
   system variable PPPWart$File.
2. Check if a PPP connection is up (inspecting the *PPPLog output)
3. Ouput of th result.


The frontend:
-------------

The frontend !PPPWart is based on The Menu (by the way, that is from
me too); please read the docs from The Menu in case you want to know
more about it. Here I'll just look into the points of interest for
PPPWart.

In !PPPWart is a file named TheMenu. In this is the control data for
The Menu:

In the first line is just the menu title which I set to PPPWart for
obvious reasons.

In the second line is the text for the first menu entry, a tab, a T,
another tab and then the star command to call this entry is selected.
The further lines contain further menu entries built the same way.


Example for Windows PC
----------------------

This example is not a dummy but worked exactly this way - you might
have to amend the blockdriver settings.

The parameter file for windows is named Windows and is located inside
!PPPWart (you can put it any place you like) and looks like this:

InternalPC
0
115200
ATDT1234567
10.10.11.01
10.10.11.04
idle-disconnect 0 noipdefault defaultroute crtscts modem mru 1524 +ua <PPPWart$Dir>.User
*Echo Online
*Echo Offline
Error

Then we need another file named User inside !PPPWart which contains in
the first line the user name and in the second one the password of the
user the Windows PC uses when dialling into PPPWart.

Now we can set up the file TheMenu; the tab has been replaced by an
underscore here:

PPPWart
Bye    _T_Run <PPPWart$Dir>.PPPWart DL *
Windows_T_Run <PPPWart$Dir>.PPPWart L <PPPWart$Dir>.Windows
Log    _T_PPPLog

As you can see in th logoff entry the parameter file is not mentioned.
Thus PPPWart uses the parameter file it used for the last connect and
thus it is easier to set up different connection - all you need are the
respective parameter files.


Hints:
-----

If you e.g. run Samba on RISC OS you can access the shares from Windows.
The other way round shouldn't be a problem using OmniClient.



History:
--------

see file "!Help"


Me:
---

Last but not least ...

Herbert zur Nedden
Alte Landstrae 21
22962 Siek
Deutschland (alias Germany)
mailto: HzN@HQ.gag.de
http://www.gag.de

Editor and publisher of the RISC OS magazine GAG-News and head of
the German Archimedes Group (in short GAG)

Homepage of PPPWart: http://www.gag.de/software/PPPWart

Homepage of TheMenu: http://www.gag.de/software/TheMenu

