home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
sliphang.zip
/
SLIPHang.Doc
next >
Wrap
Text File
|
1994-02-06
|
6KB
|
151 lines
SLIPHang Version 1.0
Copyright (c) 1994 by John C. Frickson
All rights reserved.
REQUIREMENTS
~~~~~~~~~~~~
OS/2 2.0 or later.
IBM's TCP/IP 2.0 for OS/2. (This might work with 1.2.1, but I haven't
tested it. Use at your own risk.)
INTRODUCTION
~~~~~~~~~~~~
SLIPHang is a program you can use when you're finished with your SLIP
connection. It's cleaner than CTRL-C'ing out of SLIP, and easier than
starting up SLIPTERM just to do a "+++ ATH" to hang up.
SLIPHang also returns an errorlevel on exit, so it can be added to a
command file that does cleanup work.
INSTALLING
~~~~~~~~~~
Just put SLIPHang.Exe into any directory that's on your PATH. The
TCPIP\BIN directory is a good place.
RUNNING SLIPHang
~~~~~~~~~~~~~~~~
To run SLIPHang, just type "SLIPHang 1". The "1" in the example is
the COM port number. If your SLIP connection is on COM 2, then use
"SLIPHang 2". Easy, no?
ERRORLEVELS
~~~~~~~~~~~
When SLIPHang is done, it returns an errorlevel that you can check.
The errorlevels are as follows:
0 Successful
1 SLIP is not running
10 Bad parameters (missing or invalid COM port number)
20 Hangup Failed
30 Some problem with SLIP semaphore(s)
40 Couldn't get COM port access from SLIP
50 Couldn't open the COM port
Any error is also reported to the console. Any unexpected error,
such as a non-zero return from DosPostEventSem() will also display
the return code. If you get one of these errors, make sure you
write down the error message, including the return code, and send
it to me so I can figure out what went wrong.
IMPLEMENTATION NOTES
~~~~~~~~~~~~~~~~~~~~
SLIPHang hangs up the phone by dropping DTR. It does not do the
"~~~+++~~~ATH" trick. I could have used that if dropping DTR failed,
but I didn't. If I get reports that some people need this, I'll
probably add it.
POSSIBLE USES
~~~~~~~~~~~~~
IBM's TCP/IP comes with a couple of sample .CMD files for attaching to
SLIP servers and configuring the local address and routing. These can
be used to automate the SLIP startup process. The .CMD file you want
to run is specified in the SLIP.CFG file.
I modified SLIPUP.CMD (one of the included examples) for my situation.
I added the variables com_port (which is set to '1'), hand_cmd (which
is set to 'C:\TCPIP\BIN\HANGUP.CMD'), and mrnet_addr (which is set to
the IP address of MR.NET, my provider). I then added the following
lines right after the ifconfig and route statements, and just before
the "exit 0" statemet:
'del' hang_cmd
call Lineout hang_cmd , '@Echo Off'
call Lineout hang_cmd , 'Cls'
call Lineout hang_cmd , 'SLIPHANG' com_port
call Lineout hang_cmd , 'If errorlevel 1 goto HangFailed'
call Lineout hang_cmd , 'Echo --- Killing SLIP ---'
call Lineout hang_cmd , 'KILLEM SLIP.EXE'
call Lineout hang_cmd , 'Echo --- Resetting Interface ---'
call Lineout hang_cmd , 'ifconfig' interface 'down'
call Lineout hang_cmd , 'Echo --- Clearing Routes ---'
call Lineout hang_cmd , 'route delete' mrnet_addr os2_address
call Lineout hang_cmd , 'route delete default' mrnet_addr
call Lineout hang_cmd , 'Echo.'
call Lineout hang_cmd , 'Echo All Done!'
call Lineout hang_cmd , 'Goto Done'
call Lineout hang_cmd , ':HangFailed'
call Lineout hang_cmd , 'Echo.'
call Lineout hang_cmd , 'Echo Hangup Failed!'
call Lineout hang_cmd , 'Echo Either hangup and clear routes manually'
call Lineout hang_cmd , 'Echo or try running this command again.'
call Lineout hang_cmd , 'Echo.'
call Lineout hang_cmd , ':Done'
These statements create a batch file called HANGUP.CMD. This file will
execute SLIPHang to hang up the phone, kill SLIP using KILLEM (a very
handy utility written by Rick Fishman). It then "downs" the SLIP
interface using 'ifconfig' and deletes the routing through the SLIP
interface using 'route delete ...'
When I'm done with my slip connection, I just run HANGUP.CMD and
everything is taken care of.
DISTRIBUTION
~~~~~~~~~~~~
SLIPHang is copyrighted software, and is distributed as freeware. IT
IS NOT PUBLIC DOMAIN! No registration is required, but if you want to
send me a couple bucks, I certainly won't turn it down :-) I would
very much like to hear from you if you use SLIPHang, and what you think
of it. SLIPHang can be freely distributed to anyone, placed on BBS's,
whatever.
WARRANTY
~~~~~~~~
In short, there isn't any. This is a pretty simple program, so it
can't possibly hurt anything. The worst thing it will do is not work.
However, if SLIPHang erases your disk, eats your backup tapes, zaps
your motherboard, fries your modem, or orders pizza without your
permission, I will not be held responsible. So there!
SOURCE CODE
~~~~~~~~~~~
I really haven't given this much thought, but if you want to look at
the source for SLIPHang, drop me a note, and I'll probably send it to
you.
CONTACT INFORMATION
~~~~~~~~~~~~~~~~~~~
I can be contacted by snailmail at:
John C. Frickson
9864 Palm Street NW
Coon Rapids, MN 55433-5467
E-mail:
Internet: frickson@gibbon.mpls.mn.us
Compuserve: 74266,2661
BIX: jfrickson