Comments, errors, complaints, or suggestions invited.
Mailto:blogan@crash.cts.com
Disclaim: everything.
1. What is command-line SLIP and why would I want it?
4.1 Can the slip.cfg file be bypassed by passing parms to slip.exe directly?
5. How can my userid and password be passed from the command line?
7. What I really want is to have SLIP start and automatically check mail.
8. How do I tell if There is a SLIP connection to the host?
9. Ping worked but I can't FTP or telnet etc.
10. How do I make it stop? (i.e., disconnect)
Appendix B - slip.exe command line options
Appendix C - runslip.cmd - sample REXX exec with dialing queue
Appendix D - feedback about bootp.
domain myhost.com nameserver nnn.nnn.nn.nnReturn to Table of Contents
interface sl0 { device=COM2 mtu=1006 compression=on attachcmd = slipup.cmd }Return to Table of Contents
slip -nocfg -com2 -speed 57600 -vj -connect "runslip.cmd"Return to Table of Contents
What I really want is something like this:
/* slipwait */ start /c ConnectToInternet.cmd 'slipwait 360' /* seconds until timeout */ if rc = 1 then exit /* exit program when slipwait times out */ else do 'program1' /* start programs when SLIP established */ 'program2' end exitReturn to Table of Contents
/* KillSLIP.cmd */ 'c:\tcpip\bin\go kill slip' exitReturn to Table of Contents
#------------------------------------------------------------------------ # # OS/2 2.0 SLIP Driver for IBM TCP/IP v1.2.1 # # Version 1.0 # David Bolen - db3l@ans.net # # SLIP.CFG # # .................................................. # # SLIP Configuration File # # .................................................. # # # Copyright (c) 1993 # David Bolen and Advanced Network & Services, Inc. # All Rights Reserved # # # This file controls the interfaces that the SLIP driver creates and manages. # It is used to set up interface values (such as MTU, RTT estimates, and # device information), as well as specifying other per-interface data, such # as what scripts should be run to make a SLIP attachment over an interface. # # # The general format of the file is a series of interface "clauses", of the # form: # # interface ??? { # Comments # parameter = value [,] [ parameter = value [,] ... ] # } # # Spaces, commas and newlines are ignored (except within quoted strings). # In general, the layout of the file is free-form, within the general bounds # of the interface blocks. # # Comments may begin at any point on the line, and are signified by a hash # (#) character - everything past the comment character is ignored. # # Parameter names and values are delimited by whitespace. Special characters # (whitespace, ',', '{', '}', '#', '=') may be included in a value by # surrounding that value in double quotes ("), or by prefixing the special # character with a backslash (\). Use \\ to get a backslash itself, and use # \" within a quoted string to get a double quote within the value. # # In the above, ??? specifies an interface to be defined. Currently only # two values are allowed: # # default Default settings. Specifies parameters that will # be assumed for any interfaces later in the file # where their interface clauses do not contain new # values for the parameters. # sl0 Serial Interface 0. # # The "interface default" clause may be specified multiple times, and is # additive. Where a parameter appears in more than one such clause, its # most recent value will be used for any later interface clauses. # # The following parameters and values are allowed for each interface: # # Basic Parameters # device Interface serial device (ie: "com1") # mtu Maximum transmission unit (bytes) # compression Adjusts VJ compression. Can be "ON" (always compress), # "OFF" (never), or "AUTO" (accept compression and # start compressing if compressed packets are received) # attachcmd Name of rexx command script to run to attach interface # attachparms Parameters to pass to command script # # Queuing Parameters # fastqueue Enables priority queueing for interactive traffic. # nofastqueue Disables priority queueing # queuesize Normal and priority queue sizes (IP kernel<->SLIP) in # fastqueuesize packets. These should be multiples of 4. # # Protocol Parameters # rtt Initial TCP RTT estimates. Like BSD-Reno's per-route # rttvar defaults, but per-interface. The values assigned # rttmin to these parameters are in milliseconds # sendpipe Size of TCP send and receive windows (bytes) # recvpipe # ssthresh "Slow start" congestion window threshold (bytes) # # # When this file is initially processed, the system default interface clause # is as follows: # # interface default { # mtu=1006, compression=off, # fastqueue, queuesize=12, fastqueuesize=24, # recvpipe=4096 # } # # And the default device for the "sl0" interface is "com1" # # If an interface definition enables compression (compression=on), and does # not otherwise specify an MTU, the default MTU will be lowered to 296. # Note that this does not happen with compression=auto. # # It is not recommended that anything other than "Basic Parameter" values # be adjusted unless truly necessary. In particular, adjusting queue sizes # and rtt* values without a complete understanding of the affect such # adjustments will have on protocol (such as TCP) behavior can seriously # affect both interactive response and throughput. # # # $Id: slip.cfg,v 1.4 1993/07/05 22:49:40 db3l Exp $ # #------------------------------------------------------------------------------ # # # Set up a simple default sl0 interface sl0 { }Return to Table of Contents
Type slip -? at the command for the following informaition. [SLIP] - SL/IP (Serial Line/Internet Protocol) driver Usage: SLIP [options], where options are: -? Usage help. -comReturn to Table of ContentsUse com port for interface sl0. -connect "command" Invoke command to setup modem connection. -d Increase debug level. -exit Exit SL/IP minutes after line disconnect. -f Use instead of default: slip.cfg. -hangup Send to sl0 com port on exit. -idle Exit SL/IP after minutes of idle time. -ifconfig Configure sl0 with the specified IP addresses, +defaultroute optionally add a default route through , +proxyarp make a proxy ARP entry for using . -modem Send modem to interface sl0 com port. -mtu Set interface sl0 MTU to . -nocfg Ignore configuration file. -notify Notify on termination of Data Carrier Detect. -p Run SL/IP at priority , where =1-4. If is ommitted run in time critical server mode, =3. -rtscts Use RTS/CTS hardware flow control. -speed Set sl0 com port speed to . -t[i|o] Trace input and output packets. -vj Use VJ header compression for interface sl0.
/* SLIP REXX: */ /* Author: Kai Uwe RommelReturn to Table of Contents* Created: Sun Mar 12 1995 * * modified apr 7 1995 * by Barry Logan blogan@cts.com * This script is called by slip.exe * Login and password should be hardcoded or add readpass module from * annex.cmd and pass them as parms with -attchparms switch in slip.cfg * * SysSleep RexxUtil function is called - be sure to have it loaded * * change number.o = (number of tel numbers in dial queue ) */ parse arg interface , dialcmd login password call RxFuncAdd 'SysSleep', 'RexxUtil', 'SysSleep' /* comment out login, password and dialcmd if passing them from the * command line or through slip.cfg */ login = "merlin" /* Insert your account name */ password = "********" /* Insert your password */ dialcmd = "ATDT" /* Modem dial string */ number.0 = 3 /* tel numbers in dial queue */ number.1 = '595-0001' /* central */ number.2 = '395-0002' /* east county */ number.3 = '295-0666' /* south bay */ redial = 0 /* retry counter */ zzz = 3 /* seconds to sleep between redials */ myip = "198.68.170.46" /* my ip address */ hostip = "198.147.219.17" /* gateway - provider host address */ netmask = "255.255.255.240" /* provider netmask */ cr = '0D'X crlf = '0D0A'X say '' say 'SLIP ..... Standby' '(interface' interface')' say '' call send 'atz' || cr call waitfor('OK') call flush_receive /* clean it out */ do forever do num = 1 to number.0 /* cycle through the dialing queue */ call charout , 'Dialing 'number.num' ('redial' redials)'crlf call send dialcmd || number.num || cr if waitfor('CONNECT', 60, 1) = 0 then leave loop call send 'ATH' || cr /* hangup if not connect */ redial = redial + 1 call SysSleep zzz end end if waitfor('ogin:', 60) \= 0 then exit 1 call flush_receive 'echo' call send login || cr if waitfor('assword:', 60) \= 0 then exit 1 call flush_receive 'echo' call send password || cr if waitfor('Packet mode enabled', 60) \= 0 then exit 1 call flush_receive 'echo' 'ifconfig sl0 'myip' 'hostip' netmask 255.255.255.0' 'route -f add default 'hostip' 1' say "We're in! - Connection Established" call beep 1000,150 /* announce login done */ exit 0 send: parse arg sendstring call slip_com_output interface , sendstring return waitfor: parse arg waitstring, timeout, fail, noecho if timeout = '' then timeout = 5000 /* LONG delay if not specified */ if fail = '' then fail = 0 if noecho = '' then noecho = 0 if remain_buffer = 'REMAIN_BUFFER' then remain_buffer = '' waitfor_buffer = '' done = -1 curpos = 1 start_time = time('E') do while done = -1 if (remain_buffer \= '') then do line = remain_buffer remain_buffer = '' end else do line = slip_com_input(interface, , 10) end waitfor_buffer = waitfor_buffer || line index = pos(waitstring, waitfor_buffer) if index > 0 then do remain_buffer = substr(waitfor_buffer, index + length(waitstring)) waitfor_buffer = delstr(waitfor_buffer, index + length(waitstring)) done = 0 end if fail > 0 then do if pos('BUSY', waitfor_buffer) > 0 then done = 2 if pos('ERROR', waitfor_buffer) > 0 then done = 2 if pos('NO CARRIER', waitfor_buffer) > 0 then done = 2 if pos('NO DIALTONE', waitfor_buffer) > 0 then done = 2 end if noecho = 0 then call charout , substr(waitfor_buffer, curpos) curpos = length(waitfor_buffer) + 1 if done \= 0 & time('E') > timeout then do call lineout , 'Timed out.' done = 1 end if done = -1 then call SysSleep 1 end timeout = 0 return done flush_receive: parse arg echo if echo \= '' & length(remain_buffer) > 0 then do call charout , remain_buffer remain_buffer = '' end do until line = '' line = slip_com_input(interface, , 100) if echo \= '' then call charout , line end return /* end */
From: Charles HedrickReturn to Table of Contents2) You might want to tell people about bootp. Your script assumes that your host has a fixed address. For a lot of people, the service they connect to assigns a new address each time. Rather than complex things to parse the printout, it's easier just to call "bootp sl0", which gets the address using bootp, and then does the ifconfig and route commands. /* REXX */ call RxFuncAdd 'SysSleep', 'RexxUtil', 'SysSleep' start "/min slip -notify -p3 -rtscts -speed 57600 -vj" call SysSleep 5 bootp sl0