Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

strcf(4)






       slink(1M)                                                  slink(1M)


       NAME
             slink - streams linker

       SYNOPSIS
             slink [-v] [-f] [-p] [-u] [-c file] [func [arg1 arg2 . . .]]

       DESCRIPTION
             The slink command is a STREAMS configuration utility which is
             used to link together the various STREAMS modules and drivers
             required for STREAMS TCP/IP.

          Files
             /etc/strcf

       USAGE
             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 the configuration file file instead of /etc/strcf.

             -v      Verbose mode (each operation is logged to stderr).

             -p      Don't use persistent links (that is, slink remains in
                     the background).

             -f      Don't use persistent links and don't fork (that is,
                     slink remains in foreground).

             -u      Unlink persistent links (that is, 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 the
             function func is specified on the slink command line, func is
             called instead of boot.


                           Copyright 1994 Novell, Inc.               Page 1













      slink(1M)                                                  slink(1M)


            By default, slink establishes streams with persistent links
            (I_PLINK) and exits following the execution of the specified
            function.  If the -p flag is specified, slink establishes
            streams with regular links (I_LINK) 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
            (I_LINK) and remains in the foreground, holding open whatever
            file descriptors have been opened by the configuration
            commands.

            A function definition has the following form:

                  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; that is, where one newline is required, more than
            one may be used.  A backslash (\) followed immediately by a
            newline is considered equivalent to a space, that is, it 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.




                          Copyright 1994 Novell, Inc.               Page 2













       slink(1M)                                                  slink(1M)


             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.  For
             example, if a command references $3 and only two arguments
             were passed to the function, an execution error occurs.

             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.

             bind fd sap [subs_sap]
                                   Bind the stream referenced by fd to the
                                   SAP specified by sap.  If the optional
                                   argument subs_sap is provided, it is
                                   used to perform a subsequent bind on the
                                   stream.  For example, bind fd 0x800
                                   binds the stream referenced by fd to the
                                   IP SAP (the Ethernet II frame type),
                                   while bind fd 0xaa 0x800 binds the
                                   stream referenced by fd to the SNAP SAP
                                   and subsequently binds the stream to the
                                   IP SAP (the Ethernet SNAP frame type).


                           Copyright 1994 Novell, Inc.               Page 3













      slink(1M)                                                  slink(1M)


            new_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 are linked with persistent
                                  links.  Note that fd2 cannot be used
                                  after this operation.  Usually bind (see
                                  above) should be performed on the lower
                                  stream before it is linked with
                                  new_link.

            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 are linked with persistent
                                  links.  Note that fd2 cannot be used
                                  after this operation.  This function is
                                  provided for compatibility purposes
                                  only, and implicitly binds (see above)
                                  the lower stream to the IP SAP.

            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 IF_UNITSEL (unit select) ioctl
                                  down the stream referenced by fd
                                  specifying unit unit.

            dlattach fd unit      Send a DL_ATTACH_REQ 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


                          Copyright 1994 Novell, Inc.               Page 4













       slink(1M)                                                  slink(1M)


                                   and high water marks are to 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.

             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 that executing a return command
                                   does not terminate execution of the
                                   current function.

       REFERENCES
             strcf(4)

















                           Copyright 1994 Novell, Inc.               Page 5








Typewritten Software • bear@typewritten.org • Edmonds, WA 98026