slink(1M) UNIX System V(Internet Utilities) slink(1M)
NAME
slink - streams linker
SYNOPSIS
slink [ -v ] [ -p ] [ -u ] [ -f ] [ -c file ] [ func [arg1 arg2 . . . ]]
DESCRIPTION
slink is a STREAMS configuration utility which is used to link together
the various STREAMS modules and drivers required for STREAMS TCP/IP.
Input to slink is in the form of a script specifying the STREAMS
operations to be performed. Input is normally taken from the file
/etc/strcf.
The following options may be specified on the slink command line:
-c file Use file instead of /etc/strcf.
-v Verbose mode (each operation is logged to stderr).
-p Don't use persistent links (i.e., slink will remain in the
background).
-f Don't use persistent links and don't fork (i.e., slink will
remain in foreground).
-u Unlink persistent links (i.e., shut down network).
The configuration file contains a list of functions, each of which is
composed of a list of commands. Each command is a call to one of the
functions defined in the configuration file or to one of a set of built-
in functions. Among the built-in functions are the basic STREAMS
operations open, link, and push, along with several TCP/IP-specific
functions.
slink processing consists of parsing the input file, then calling the
user-defined function boot, which is normally used to set up the standard
configuration at boot time. If a function is specified on the slink
command line, that function will be called instead of boot.
By default, slink establishes streams with persistent links (IPLINK) and
exits following the execution of the specified function. If the -p flag
is specified, slink establishes streams with regular links (ILINK) and
remains idle in the background, holding open whatever file descriptors
have been opened by the configuration commands. If the -f flag is
specified, slink establishes streams with regular links (ILINK) and
remains in the foreground, holding open whatever file descriptors have
been opened by the configuration commands.
A function definition has the following form:
10/89 Page 1
slink(1M) UNIX System V(Internet Utilities) slink(1M)
function-name {
command1
command2
...
}
The syntax for commands is:
function arg1 arg2 arg3 . . .
or
var = function arg1 arg2 arg3 . . .
The placement of newlines is important: a newline must follow the left
and right braces and every command. Extra newlines are allowed, i.e.
where one newline is required, more than one may be used. A backslash
(\) followed immediately by a newline is considered equivalent to a
space, i.e. may be used to continue a command on a new line. The use of
other white space characters (spaces and tabs) is at the discretion of
the user, except that there must be white space separating the function
name and the arguments of a command.
Comments are delimited by # and newline, and are considered equivalent to
a newline.
Function and variable names may be any string of characters taken from
A-Z, a-z, 0-9, and , except that the first character cannot be a digit.
Function names and variable names occupy separate name spaces. All
functions are global and may be forward referenced. All variables are
local to the functions in which they occur.
Variables are defined when they appear to the left of an equals (=) on a
command line; for example,
tcp = open /dev/tcp
The variable acquires the value returned by the command. In the above
example, the value of the variable tcp will be the file descriptor
returned by the open call.
Arguments to a command may be either variables, parameters, or strings.
A variable that appears as an argument must have been assigned a value on
a previous command line in that function.
Parameters take the form of a dollar sign ($) followed by one or two
decimal digits, and are replaced with the corresponding argument from the
function call. If a given parameter was not specified in the function
call, an error results (e.g. if a command references $3 and only two
arguments were passed to the function, an execution error will occur).
Page 2 10/89
slink(1M) UNIX System V(Internet Utilities) slink(1M)
Strings are sequences of characters optionally enclosed in double quotes
("). Quotes may be used to prevent a string from being interpreted as a
variable name or a parameter, and to allow the inclusion of spaces, tabs,
and the special characters {, }, =, and #. The backslash (\) may also be
used to quote the characters {, }, =, #, ", and \ individually.
The following built-in functions are provided by slink:
open path Open the device specified by pathname path.
Returns a file descriptor referencing the open
stream.
link fd1 fd2 Link the stream referenced by fd2 beneath the
stream referenced by fd1. Returns the link
identifier associated with the link. Unless the -f
or -p flag is specified on the command line, the
streams will be linked with persistent links.
Note: fd2 cannot be used after this operation.
push fd module Push the module module onto the stream referenced
by fd.
sifname fd link name Send a SIOCSIFNAME (set interface name) ioctl down
the stream referenced by fd for the link associated
with link identifier link specifying the name name.
unitsel fd unit Send a IFUNITSEL (unit select) ioctl down the
stream referenced by fd specifying unit unit.
dlattach fd unit Send a DLATTACHREQ message down the stream
referenced by fd specifying unit unit.
initqp path qname lowat hiwat ...
Send an INITQPARMS (initialize queue parameters)
ioctl to the driver corresponding to pathname path.
qname specifies the queue for which the low and
high water marks will be set, and must be one of:
hd stream head
rq read queue
wq write queue
muxrq
multiplexor read queue
muxwq
multiplexor write queue
lowat and hiwat specify the new low and high water
marks for the queue. Both lowat and hiwat must be
present. To change only one of these parameters,
the other may be replaced with a dash (-). Up to
five qname lowat hiwat triplets may be present.
10/89 Page 3
slink(1M) UNIX System V(Internet Utilities) slink(1M)
strcat str1 str2 Concatenate strings str1 and str2 and return the
resulting string.
return val Set the return value for the current function to
val.
Note: executing a return command does not terminate
execution of the current function.
FILES
/etc/strcf
SEE ALSO
strcf(4)
Page 4 10/89