SL(4) BSD Programmer's Manual SL(4)NAMEsl - serial-line encapsulation for IP
SYNOPSIS
#include <sys/types.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <net/if_slvar.h>
#include <termios.h>
pseudo-device sl count
DESCRIPTION
Serial line encapsulation is generally superseded by PPP.
The serial-line encapsulation is used to transmit Internet Protocol (IP)
packets over serial lines. The number of SLIP interfaces should be pro-
vided using the sl pseudo-device specification.
The SLIP interface names are composed from the prefix ``sl'' and a deci-
mal interface number; for example ``sl4''.
Three link-level flags are defined:
link0 If this flag is set, the interface will accept and generate com-
pressed (``CSLIP'') headers.
link1 If this flag is set, outgoing ICMP packets are discarded at the
interface. This can be used to prevent responses to ICMP requests
such as echo requests (``pings'').
link2 If this flag is set, the interface will set link0 upon receiving a
compressed packet. This will automatically enable compressed SLIP
when speaking to another CSLIP -capable machine. It can, however,
be fooled by line noise and is therefore off by default.
Any serial line can be attached to a SLIP interface; it is possible to
use the line as a usual tty line (e.g., for dialing a phone number) and
then switch it to the packet mode by changing the line discipline to
SLIPDISC with ioctl(2)'s TIOCSETD request (see also tty(4)).
SLIP LINE DISCIPLINE
Switching to the SLIP line discipline does not change the data transmis-
sion speed on the serial interface but always changes character format to
8 bits, no parity. The flow control modes remain the same, but since no
codes are reserved for flow control, only no flow control or hardware
(RTS/CTS) flow control will work.
To get the number of an attached interface, the SLIOCGUNIT ioctl request
can be used. Its argument is a pointer to an integer variable to which
the interface number will be written.
The line file descriptor should be kept open during the session. There
is no way to end a session without dropping the connection, so the usual
way to deal with this is to make the serial line the process's control
terminal, and wait for a SIGHUP signal.
SEE ALSOstartslip(1), ioctl(2), socket(2), intro(4), tty(4), ppp(4),
ifconfig(8), slattach(8), sliplogin(8).
BSDI BSD/OS January 22, 1995 1