Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title How to use sliplogin
Ref. No. QNX.000009316
Category(ies) Utilities, Network, Configuration
Issue Rather than use 'slattach' to set up SLIP interfaces, we'd like to work with the 'sliplogin' utility.  That way, we could create dial-up SLIP connections without always having to remember appropriate addresses and ifconfig commands.  Could you give us an example of how to use sliplogin?
Solution Compared to scat, the sliplogin program provides a more transparent method of setting up SLIP interfaces - it doesn't need to be told which specific device to use. But to take advantage of sliplogin you must first ensure you've specified correct information in your configuration files.

Let's look at an example. We'll assume the following files exist on your home and work machines.

Password files:

x09#/etc/passwd -- home machine
x09Swork::102:100:Paul Slip:/home/pk:/etc/sliplogin

x09#/etc/passwd -- work machine
x09Shome::103:100:Paul Slip:/home/pk:/etc/sliplogin

x09Note that the shell parameter in the password file is /etc/sliplogin. When you (Shome) log in from home to work, /etc/sliplogin will be launched automatically.

Host databases:

x09# Host Database
x09# This file is used only for "ifconfig" and other operations
x09# before the nameserver is started
x0927.1x09localhost
x09192.168.200.202x09sliphome
x09192.168.200.200x09slipwork

x09#/etc/slip.hosts
x09# login local-addr remote-addr maskx09opt1x09opt2

x09Swork sliphomex09slipworkx09255.255.255.0x09compress
x09Shome slipworkx09sliphomex09255.255.255.0x09compress

slip.login script:

x09#!/bin/sh - This '/etc/slip.login' script is launched by '/etc/sliplogin'
x09#
x09# slipunit ttyspeed loginname local-addr remote-addr mask opt-args
x09#
x09#/etc/ifconfig sl0 192.168.200.202 192.168.200.200
x09#x09hard-coded for debugging from work to home - login: Swork

x09/etc/ifconfig sl$1 $4 $5 netmask $6
x09exit 0

x09To establish a SLIP connection from work to home you'd follow these steps:

1x09Dial up using qtalk, then log in as Swork:
x09qtalk -m /dev/ser1
x09000
x09login: Swork
x09starting sliplogin for Swork

x09This login invokes /etc/sliplogin Swork, which will configure the line (i.e. slattach ttyname baudrate) and invoke the shell script shp.login.

2x09Press <Ctrl>-<A>, then type x to exit qtalk without hanging up.

3x09Configure the local side. To do this, you could enter the following commands:
x09slattach /dev/ser1 38400
x09ifconfig sIO slipwork sliphome

x09But with the above configuration files, you could simply enter:
x09sliplogin Shome </dev/ser1

4x09Finally, ping the remote side to verify the connection, then begin your session:
x09ping sliphome
x09fttp sliphome

Modem Checklist

•x09Check that carrier detect is enabled so that modem can detect the modem's status, whether on or off line: AT&C1
x09Also check that modem will force a hangup, when DTR drops: AT&D2

•x09To accept incoming calls you can set the modem to "not autoanxwer" (ATSO=0). The modem will emit RING statements when it receives an incoming call and modem will detect these statements and answer.

•x09Check that you've specified the uppercase -T option to tinit (e.g. -c modem...-T/dev/ser1)

•x09Check that both modems have the same flow control, parity, baud, start, and stop bite set on the appropriate ports. Also make sure that both have 8 data bits set.