home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / sliphang.zip / SLIPHang.Doc next >
Text File  |  1994-02-06  |  6KB  |  151 lines

  1. SLIPHang Version 1.0
  2. Copyright (c) 1994 by John C. Frickson
  3. All rights reserved.
  4.  
  5.  
  6. REQUIREMENTS
  7. ~~~~~~~~~~~~
  8.    OS/2 2.0 or later.
  9.  
  10.    IBM's TCP/IP 2.0 for OS/2.  (This might work with 1.2.1, but I haven't
  11.    tested it.  Use at your own risk.)
  12.  
  13.  
  14. INTRODUCTION
  15. ~~~~~~~~~~~~
  16.    SLIPHang is a program you can use when you're finished with your SLIP
  17.    connection.  It's cleaner than CTRL-C'ing out of SLIP, and easier than
  18.    starting up SLIPTERM just to do a "+++ ATH" to hang up.
  19.  
  20.    SLIPHang also returns an errorlevel on exit, so it can be added to a
  21.    command file that does cleanup work.
  22.  
  23.  
  24. INSTALLING
  25. ~~~~~~~~~~
  26.    Just put SLIPHang.Exe into any directory that's on your PATH.  The
  27.    TCPIP\BIN directory is a good place.
  28.  
  29.  
  30. RUNNING SLIPHang
  31. ~~~~~~~~~~~~~~~~
  32.    To run SLIPHang, just type "SLIPHang 1".  The "1" in the example is
  33.    the COM port number.  If your SLIP connection is on COM 2, then use
  34.    "SLIPHang 2".  Easy, no?
  35.  
  36.  
  37. ERRORLEVELS
  38. ~~~~~~~~~~~
  39.    When SLIPHang is done, it returns an errorlevel that you can check.
  40.    The errorlevels are as follows:
  41.  
  42.          0     Successful
  43.          1     SLIP is not running
  44.          10    Bad parameters (missing or invalid COM port number)
  45.          20    Hangup Failed
  46.          30    Some problem with SLIP semaphore(s)
  47.          40    Couldn't get COM port access from SLIP
  48.          50    Couldn't open the COM port
  49.  
  50.    Any error is also reported to the console.  Any unexpected error,
  51.    such as a non-zero return from DosPostEventSem() will also display
  52.    the return code.  If you get one of these errors, make sure you
  53.    write down the error message, including the return code, and send
  54.    it to me so I can figure out what went wrong.
  55.  
  56.  
  57. IMPLEMENTATION NOTES
  58. ~~~~~~~~~~~~~~~~~~~~
  59.    SLIPHang hangs up the phone by dropping DTR.  It does not do the
  60.    "~~~+++~~~ATH" trick.  I could have used that if dropping DTR failed,
  61.    but I didn't.  If I get reports that some people need this, I'll
  62.    probably add it.
  63.  
  64.  
  65. POSSIBLE USES
  66. ~~~~~~~~~~~~~
  67.    IBM's TCP/IP comes with a couple of sample .CMD files for attaching to
  68.    SLIP servers and configuring the local address and routing.  These can
  69.    be used to automate the SLIP startup process.  The .CMD file you want
  70.    to run is specified in the SLIP.CFG file.
  71.  
  72.    I modified SLIPUP.CMD (one of the included examples) for my situation.
  73.    I added the variables com_port (which is set to '1'), hand_cmd (which
  74.    is set to 'C:\TCPIP\BIN\HANGUP.CMD'), and mrnet_addr (which is set to
  75.    the IP address of MR.NET, my provider).  I then added the following
  76.    lines right after the ifconfig and route statements, and just before
  77.    the "exit 0" statemet:
  78.  
  79.       'del' hang_cmd
  80.       call Lineout hang_cmd , '@Echo Off'
  81.       call Lineout hang_cmd , 'Cls'
  82.       call Lineout hang_cmd , 'SLIPHANG' com_port
  83.       call Lineout hang_cmd , 'If errorlevel 1 goto HangFailed'
  84.       call Lineout hang_cmd , 'Echo --- Killing SLIP ---'
  85.       call Lineout hang_cmd , 'KILLEM SLIP.EXE'
  86.       call Lineout hang_cmd , 'Echo --- Resetting Interface ---'
  87.       call Lineout hang_cmd , 'ifconfig' interface 'down'
  88.       call Lineout hang_cmd , 'Echo --- Clearing Routes ---'
  89.       call Lineout hang_cmd , 'route delete' mrnet_addr os2_address
  90.       call Lineout hang_cmd , 'route delete default' mrnet_addr
  91.       call Lineout hang_cmd , 'Echo.'
  92.       call Lineout hang_cmd , 'Echo All Done!'
  93.       call Lineout hang_cmd , 'Goto Done'
  94.       call Lineout hang_cmd , ':HangFailed'
  95.       call Lineout hang_cmd , 'Echo.'
  96.       call Lineout hang_cmd , 'Echo Hangup Failed!'
  97.       call Lineout hang_cmd , 'Echo Either hangup and clear routes manually'
  98.       call Lineout hang_cmd , 'Echo or try running this command again.'
  99.       call Lineout hang_cmd , 'Echo.'
  100.       call Lineout hang_cmd , ':Done'
  101.  
  102.    These statements create a batch file called HANGUP.CMD.  This file will
  103.    execute SLIPHang to hang up the phone, kill SLIP using KILLEM (a very
  104.    handy utility written by Rick Fishman).  It then "downs" the SLIP
  105.    interface using 'ifconfig' and deletes the routing through the SLIP
  106.    interface using 'route delete ...'
  107.  
  108.    When I'm done with my slip connection, I just run HANGUP.CMD and
  109.    everything is taken care of.
  110.  
  111.  
  112. DISTRIBUTION
  113. ~~~~~~~~~~~~
  114.    SLIPHang is copyrighted software, and is distributed as freeware.  IT
  115.    IS NOT PUBLIC DOMAIN!  No registration is required, but if you want to
  116.    send me a couple bucks, I certainly won't turn it down :-)  I would
  117.    very much like to hear from you if you use SLIPHang, and what you think
  118.    of it.  SLIPHang can be freely distributed to anyone, placed on BBS's,
  119.    whatever.
  120.  
  121.  
  122. WARRANTY
  123. ~~~~~~~~
  124.    In short, there isn't any.  This is a pretty simple program, so it
  125.    can't possibly hurt anything.  The worst thing it will do is not work.
  126.    However, if SLIPHang erases your disk, eats your backup tapes, zaps
  127.    your motherboard, fries your modem, or orders pizza without your
  128.    permission, I will not be held responsible.  So there!
  129.  
  130.  
  131. SOURCE CODE
  132. ~~~~~~~~~~~
  133.    I really haven't given this much thought, but if you want to look at
  134.    the source for SLIPHang, drop me a note, and I'll probably send it to
  135.    you.
  136.  
  137.  
  138. CONTACT INFORMATION
  139. ~~~~~~~~~~~~~~~~~~~
  140.    I can be contacted by snailmail at:
  141.  
  142.       John C. Frickson
  143.       9864 Palm Street NW
  144.       Coon Rapids, MN 55433-5467
  145.  
  146.    E-mail:
  147.  
  148.       Internet:   frickson@gibbon.mpls.mn.us
  149.       Compuserve: 74266,2661
  150.       BIX:        jfrickson
  151.