OpenSS7
SS7 for the
Common Man
© Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved.
Last modified: Thu, 30 Nov 2006 15:29:09 GMT
Home Top Index First Prev Next LastMore Download Info FAQ Mail  Home -> Documentation -> Manuals -> LiS Manual
Quick Links

Download

SCTP

SIGTRAN

SS7

Hardware

STREAMS

Asterisk

Related

Package

Manual

Status

FAQ

Manuals

sctp Manual

iperf Manual

SPG Manual

STREAMS Manual

strcompat Manual

strutil Manual

strbcm Manual

strtty Manual

strxns Manual

strxnet Manual

strsock Manual

strinet Manual

strsctp Manual

striso Manual

netperf Manual

strchan Manual

strx25 Manual

strisdn Manual

strss7 Manual

sigtran Manual

strvoip Manual

osr61 Manual

LiS Manual

Documentation

FAQ

SIGTRAN

Design

Conformance

Performance

References

Man Pages

Manuals

Papers

Home

Overview

Status

Documentation

Resources

About

News

LiS Manual

Description: OpenSS7 Online Manuals

A PDF version of this document is available here.

Linux STREAMS (LiS)

Linux STREAMS (LiS) Installation and Reference Manual

About This Manual

This is Edition 6, last updated 2007-06-24, of The Linux STREAMS (LiS) Installation and Reference Manual, for Version 2.18 release 6 of the Linux STREAMS (LiS) package.

Preface

Notice

This package is released and distributed under the GPL (see GNU General Public License). Please note, however, that there are different licensing terms for the manual pages and some of the documentation (derived from OpenGroup1 publications and other sources). Consult the permission notices contained in the documentation for more information.

This manual is released under the FDL (see GNU Free Documentation License) with all sections invariant.

Abstract

This manual provides a Installation and Reference Manual for Linux STREAMS (LiS).

Objective

The objective of this manual is to provide a guide for the STREAMS programmer when developing STREAMS modules, drivers and application programs for Linux STREAMS (LiS).

This guide provides information to developers on the use of the STREAMS mechanism at user and kernel levels.

STREAMS was incorporated in UNIX System V Release 3 to augment the character input/output (I/O) mechanism and to support development of communication services.

STREAMS provides developers with integral functions, a set of utility routines, and facilities that expedite software design and implementation.

Intent

The intent of this manual is to act as an introductory guide to the STREAMS programmer. It is intended to be read alone and is not intended to replace or supplement the Linux STREAMS (LiS) manual pages. For a reference for writing code, the manual pages (see STREAMS(9)) provide a better reference to the programmer. Although this describes the features of the Linux STREAMS (LiS) package, OpenSS7 Corporation is under no obligation to provide any software, system or feature listed herein.

Audience

This manual is intended for a highly technical audience. The reader should already be familiar with Linux kernel programming, the Linux file system, character devices, driver input and output, interrupts, software interrupt handling, scheduling, process contexts, multiprocessor locks, etc.

The guide is intended for network and systems programmers, who use the STREAMS mechanism at user and kernel levels for Linux and UNIX system communication services.

Readers of the guide are expected to possess prior knowledge of the Linux and UNIX system, programming, networking, and data communication.

Revisions

Take care that you are working with a current version of this manual: you will not be notified of updates. To ensure that you are working with a current version, contact the Author, or check The OpenSS7 Project website for a current version.

A current version of this manual is normally distributed with the Linux STREAMS (LiS) package.

Version Control

     
     LiS.texi,v
     Revision 1.1.6.23  2007/02/28 06:30:12  brian
     - updates and corrections, #ifdef instead of #if
     
     Revision 1.1.6.22  2006/09/18 01:06:12  brian
     - updated manuals and release texi docs
     
     Revision 1.1.6.21  2006/08/28 10:46:49  brian
     - correction
     
     Revision 1.1.6.20  2006/08/28 10:32:41  brian
     - updated references
     
     Revision 1.1.6.19  2006/08/27 12:26:26  brian
     - finalizing auto release files
     
     Revision 1.1.6.18  2006/08/26 18:31:29  brian
     - handle long urls
     
     Revision 1.1.6.17  2006/08/26 09:15:54  brian
     - better release file generation
     
     Revision 1.1.6.16  2006/08/23 11:00:19  brian
     - added preface, corrections and updates for release
     
     Revision 1.1.6.14  2006-07-02 06:13:45 -0600  brian
     - release documentation updates
     
     Revision 1.1.6.13  2006-03-22 03:01:55 -0700  brian
     - added makefile target index
     
     Revision 1.1.6.12  2005-09-15 06:59:33 -0600  brian
     - testsuite documentation update
     
     Revision 1.1.6.11  2005-06-24 07:38:56 -0600  brian
     - added troubleshooting section to manuals
     
     Revision 1.1.6.10  2005-06-23 21:35:15 -0600  brian
     - minor updates to documentation
     
     Revision 1.1.6.9  2005-05-14 02:35:10 -0600  brian
     - copyright header correction
     
     Revision 1.1.6.8  2005-04-12 03:28:52 -0600  brian
     - corrections
     
     Revision 1.1.6.7  2005-04-11 14:48:39 -0600  brian
     - documentation updates and corrections
     
     Revision 1.1.6.6  2005-04-04 22:30:00 -0600  brian
     - correct include path
     
     Revision 1.1.6.5  2005-03-15 05:06:37 -0700  brian
     - Updated texinfo documentation.
     
     Revision 1.1.6.4  2005-03-14 17:56:39 -0700  brian
     - Updated version numbering in texinfo files.
     
     Revision 1.1.6.3  2005-03-14 17:51:29 -0700  brian
     - Updated version numbering in texinfo files.
     
     Revision 1.1.6.2  2005-03-13 18:25:36 -0700  brian
     - manual updates for LiS-2.18
     
     Revision 1.1.6.1  2005-03-09 16:14:15 -0700  brian
     - First stab at autoconf'ed 2.18.0.  Results of merge.
     
     Revision 1.1.4.17  2005-02-17 13:00:03 -0700  brian
     - Fixes for texi documentation.
     
     Revision 1.1.4.16  2005-01-24 04:57:52 -0700  brian
     - Updated texinfo headers.
     
     Revision 1.1.4.15  2004-12-19 08:14:19 -0700  brian
     - Corrected include position.
     
     Revision 1.1.4.14  2004-12-16 21:02:34 -0700  brian
     - Improving spec files.
     
     Revision 1.1.4.13  2004-11-09 04:49:12 -0700  brian
     - Manual updates
     
     Revision 1.1.4.12  2004-11-06 02:14:24 -0700  brian
     - Use automatic node features.
     
     Revision 1.1.4.11  2004-10-11 20:26:26 -0600  brian
     - Added texinfo configuration file.
     
     Revision 1.1.4.10  2004-08-21 23:07:16 -0600  brian
     - Converted to common file operation.
     
     Revision 1.1.4.9  2004-08-20 15:15:51 -0600  brian
     - Documentation updates.
     
     Revision 1.1.4.8  2004-08-15 14:01:51 -0600  brian
     - Build system updates.
     
     Revision 1.1.4.7  2004-08-04 13:18:00 -0600  brian
     - Removed references to drivers and modules moved to strxns and strxnet.
     
     Revision 1.1.4.6  2004-08-04 11:24:52 -0600  brian
     - Typographical errors corrected.
     
     Revision 1.1.4.5  2004-05-25 23:25:55 -0600  brian
     - html target more sensitive to syntax
     
     Revision 1.1.4.4  2004-05-25 18:11:10 -0600  brian
     - Updated manual with NexusWare instructions.
     
     Revision 1.1.4.3  2004-05-25 14:03:06 -0600  brian
     - Updating release notes and documentation.
     
     Revision 1.1.4.2  2004-05-13 03:06:35 -0600  brian
     - made tli modules, inet driver and xnet library optional
     - added HTML output to texinfo build
     - passes distcheck
     
     Revision 1.1.4.1  2004-01-12 16:45:36 -0700  brian
     - Updated missing directories.
     
     Revision 1.1.2.5  2004-01-07 04:34:48 -0700  brian
     - Updated copyright dates.
     
     Revision 1.1.2.4  2003-12-22 21:07:31 -0700  brian
     - Updates to manuals.
     
     Revision 1.1.2.3  2003-12-16 17:23:42 -0700  brian
     - Added XTI/TLI package into release.
     
     Revision 1.1.2.2  2003-12-16 05:21:04 -0700  brian
     - Added license files and extra distributions.
     
     Revision 1.1.2.1  2003-12-15 16:38:03 -0700  brian
     - New info documentation.
     
     Revision 1.1  2003-12-15 16:38:03 -0700  brian
     file LiS.texi was initially added on branch LIS-2-16-16-autoconf.
     

ISO 9000 Compliance

Only the TeX, texinfo, or roff source for this manual is controlled. An opaque (printed, postscript or portable document format) version of this manual is an UNCONTROLLED VERSION.

Disclaimer

OpenSS7 Corporation disclaims all warranties with regard to this documentation including all implied warranties of merchantability, fitness for a particular purpose, non-infringement, or title; that the contents of the manual are suitable for any purpose, or that the implementation of such contents will not infringe on any third party patents, copyrights, trademarks or other rights. In no event shall OpenSS7 Corporation be liable for any direct, indirect, special or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with any use of this manual or the performance or implementation of the contents thereof.

OpenSS7 Corporation reserves the right to revise this software and documentation for any reason, including but not limited to, conformity with standards promulgated by various agencies, utilization of advances in the state of the technical arts, or the reflection of changes in the design of any techniques, or procedures embodied, described, or referred to herein. OpenSS7 Corporation is under no obligation to provide any feature listed herein.

U.S. Government Restricted Rights

If you are licensing this Software on behalf of the U.S. Government ("Government"), the following provisions apply to you. If the Software is supplied by the Department of Defense ("DoD"), it is classified as "Commercial Computer Software" under paragraph 252.227-7014 of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any successor regulations) and the Government is acquiring only the license rights granted herein (the license rights customarily provided to non-Government users). If the Software is supplied to any unit or agency of the Government other than DoD, it is classified as "Restricted Computer Software" and the Government's rights in the Software are defined in paragraph 52.227-19 of the Federal Acquisition Regulations ("FAR") (or any successor regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or any successor regulations).

Acknowledgements

As with most open source projects, this project would not have been possible without the valiant efforts and productive software of the Free Software Foundation and the Linux Kernel Community.

Sponsors

Funding for completion of the OpenSS7 Linux STREAMS (LiS) package was provided in part by:

OpenSS7 Corporation

Additional funding for The OpenSS7 Project was provided by:

OpenSS7 Corporation
Lockheed Martin Co.
Performance Technologies Inc.
Motorola
HOB International
Comverse Ltd.
Sonus Networks Inc.
France Telecom
SS8 Networks Inc
Nortel Networks
Verisign

Contributors

The current maintainer of the OpenSS7 Linux STREAMS (LiS) package is Brian F. G. Bidulock.

Linux STREAMS (LiS) was originally written by:

Christian Herkt
David Grothe
Denis Froschauer
Dennis Henriksen
Ed Pendzik
Francisco J. Ballesteros
Gautham Ghantasala
Graham Wheeler
ISOLA Jean-Marc
John A. Boyd Jr.
Lars Dahl-Hansen
Ole Husgaard
Rodney Thayer
Roland Dunkerley
Shyan Katru
Tim G. Boerresen

Packaging was performed by:

Brian Bidulock

Packaging would not be what it is today without the invaluable help of these people:

Christian Hildner
Gurol Akman
John A. Boyd Jr.
William Waites

The primary contributor to The OpenSS7 Project is Brian F. G. Bidulock.

The following is a list of significant contributors to The OpenSS7 Project:

− Per Berquist
− John Boyd
− Chuck Winters
− Peter Courtney
− Tom Chandler
− Gurol Ackman
− Kutluk Testicioglu
− John Wenker
− Others

Additional people not named here that I missed putting on the list. We thank them too!

Authors

Linux STREAMS, termed LiS, is an SVR4 compatible STREAMS executive which runs in the Linux Kernel as a loadable module. It is the product of a joint effort among the following authors:

Francisco J. Ballesteros
John Boyd
Denis Froschauer
David Grothe
Ole Husgaard
Jürgen Magin
Graham Wheeler
G Yeganjaiah
Brian Bidulock

The authors of the OpenSS7 Linux STREAMS (LiS) package include:

Brian Bidulock

See Author Index, for a complete listing and cross-index of authors to sections of this manual.

Maintainer

Brian Bidulock is the principal active maintainer of LiS, so please direct questions to him rather than the others.2 Ole Husgaard has contributed to the kerneld support and installation procedures. Jürgen Magin contributed patches for Linux SPARC. G Yeganjaiah added interrupt routine support. John Boyd implemented fattach and STREAMS pipes and FIFOs. Brian Bidulock developed a complete set of manual pages for LiS, converted the build process to autoconf, wrapped the source RPMS, updated this manual for texinfo and currently maintains the package.

The maintainer of the OpenSS7 Linux STREAMS (LiS) package is:

Brian Bidulock

Please send bug reports to bugs@openss7.org using the send-pr script included in the package, only after reading the BUGS file in the release, or See Problem Reports.

Web Resources

The OpenSS7 Project provides a website dedicated to the software packages released by the OpenSS7 Project.

Bug Reports

Please send bug reports to bugs@openss7.org using the send-pr script included in the Linux STREAMS (LiS) package, only after reading the BUGS file in the release, or See Problem Reports. You can access the OpenSS7 GNATS database directly via the web, however, the preferred method for sending new bug reports is via mail with the send-pr script.

Mailing Lists

The OpenSS7 Project provides a number of general discussion Mailing Lists for discussion concerning the OpenSS7 Linux STREAMS (LiS) package as well as other packages released by The OpenSS7 Project.

These are mailman mailing lists and so have convenient web interfaces for subscribers to control their settings. See http://www.openss7.org/mailinglist.html.

The mailing lists are as follows:

openss7
The openss7 mailing list is for general enquiries, information exchange and announcements regarding the OpenSS7 Project. This is our original mailing list and takes the highest amount of traffic.

openss7-announce
The openss7-announce mailing list is for announcements related to the OpenSS7 Project. This list will accept announcements posted by subscribers. Subscribe to this list if you are interested in announcements from the OpenSS7 Project, subscribers and sponsors, related to the OpenSS7 Project or STREAMS, SS7, SIGTRAN or SCTP in general.

openss7-cvs
The openss7-cvs mailing list is for automatic CVS log reporting. You must get permission of the owner to subscribe to this list. Subscribers are not allowed to post to this list, this is merely for distributing notification of changes to the CVS repository.h

openss7-develop
The openss7-develop mailing list is for email exchange related to the development projects under the OpenSS7 Project. This includes development requests, proposals, requests for comment or proposal. Subscribe to this list if you are interested in ongoing development details regarding the OpenSS7 Project.

openss7-test
The openss7-test mailing list is for email exchange related to the testing of code under the OpenSS7 Project. This specifically relates to conformance testing, verification testing, interoperability testing and beta testing. Subscribe to this list if you are interested in participating in and receiving ongoing details of test activities under the OpenSS7 Project.

openss7-bugs
The openss7-bugs mailing list is specifically tailored to bug tracking. The mailing list takes a feed from the OpenSS7 GNATS bug tracking system and accepts posting of responses to bug reports, tracking and resolution. Subscribe to this list if you are interested in receiving detailed OpenSS7 release code bug tracking information. This list is not archived; for historical information on problem reports, see our GNATS databases.

openss7-updates
The openss7-updates mailing list provides updates on OpenSS7 Project code releases and ongoing activities. Subscribers are not allowed to post to this list; this list is for official OpenSS7 Project announcements only. Subscribe to this list if you are interested in receiving updates concerning official releases and activities of the OpenSS7 Project.

openss7-streams
The openss7-streams mailing list is for email exchange related to the STREAMS development projects under the OpenSS7 Project. This includes development requests, proposals, requests for comment or proposal. Subscribe to this list if you are interested in ongoing development details regarding the OpenSS7 Project STREAMS components.

linux-streams
The linux-streams mailing list is for mail exchange related to Linux Fast-STREAMS or Linux STREAMS. This includes patches, development requests, proposals, requests for comment or proposal. Subscribe to this list if you are interested in ongoing development details regarding the STREAMS for Linux components. This is the the new (September 2006) home of the linux-streams list formerly of <gsyc.escet.urjc.es>.
Spam

To avoid spam being sent to the members of the OpenSS7 mailing list(s), we have blocked mail from non-subscribers. Please subscribe to the mailing list before attempting to post to them. (Attempts to post when not subscribed get bounced.)

As an additional measure against spam, subscriber lists for all OpenSS7 mailing lists are not accessible to non-subscribers; for most lists subscriber lists are only accessible to the list administrator. This keeps your mailing address from being picked off our website by bulk mailers.

Acceptable Use Policy

It is acceptable to post professional and courteous messages regarding the OpenSS7 package or any general information or questions concerning STREAMS, SS7, SIGTRAN, SCTP or telecommunications applications in general.

Large Attachments

The mailing list is blocked from messages of greater than 40k. If you have attachments (patches, test programs, etc.) and you mail them to the list, it will bounce to the list administrator. If you are interested in making your patches, test programs, test results or other large attachments available to the members of the mailing list, state in the message that you would like them posted and the list administrator will place them in the mail archives.

Quick Start Guide

Linux STREAMS (LiS)

Package LiS-2.18.6 was released under GPLv2 2007-06-24.

The OpenSS7 Linux STREAMS (LiS) package is an OpenSS7 modified version of the LiS-2.18 package formerly from GCOM, and formerly maintained by David Grothe.

Note: The original LiS package from GCOM is no longer actively maintained by either GCOM or the OpenSS7 Project: use the OpenSS7 Linux Fast-STREAMS package <http://www.openss7.org/STREAMS.html> instead.

The following are claims made by its authors and original maintainer:

The OpenSS7 Modified Linux STREAMS (LiS) package is as STREAMS framework that is compatible with SVR 4 STREAMS. It has lots of debugging features not found in other STREAMS packages. Good to do networking and other things. It allows for installation of binary drivers.

Linux STREAMS (LiS) aims to provide SVR 4 compatible STREAMS implementation for Linux and claims to have special debugging facilities; however, the package suffers from the major failings that it is:

  • no longer maintained;
  • full of bugs;
  • incompatible with POSIX;
  • implements SVR 4 STREAMS rather than the more popular SVR 4.2 MP/ES STREAMS;
  • portions dubiously licensed under the LGPL;
  • unsuitable for mainline adoption;
  • adapts poorly to production kernels;
  • many SMP races and lockups;
  • broken 32-bit over 64-bit compatibility;
  • no strlog(9) STREAMS logger;

This distribution is only currently applicable to Linux 2.4 and 2.6 kernels and was targeted at ix86, x86_64, ppc and ppc64 architectures, but should build and install for other architectures as well.

Release

This is the LiS-2.18.6 package, released 2007-06-24. This `2.18.6' release, and the latest version, can be obtained from the download area of The OpenSS7 Project website using a command such as:

     $> wget http://www.openss7.org/tarballs/LiS-2.18.6.tar.bz2

The release is available as an autoconf(1) tarball, src.rpm or dsc, or as a set of binary rpms or debs. See the download page for the autoconf(1) tarballs, src.rpms or dscs. See the LiS package page for tarballs, source and binary packages.

Please see the NEWS file for release notes and history of user visible changes for the current version, and the ChangeLog file for a more detailed history of implementation changes. The TODO file lists features not yet implemented and other outstanding items.

Please see the INSTALL, INSTALL-LiS and README-make, files (or see Installation) for installation instructions.

When working from cvs(1) or git(1), please see the README-cvs, file (or see Downloading from CVS). An abbreviated installation procedure that works for most applications appears below.

This release of the package is published strictly under Version 2 of the GNU Public License which can be found in the file COPYING. Package specific licensing terms (if any) can be found in the file LICENSES. Please respect these licensing arrangements. If you are interested in different licensing terms, please contact the copyright holder, or OpenSS7 Corporation <sales@openss7.com>.

See README-alpha (if it exists) for alpha release information.

Prerequisites

The quickest and easiest way to ensure that all prerequisites are met is to download and install this package from within the OpenSS7 Master Package, openss7-0.9.2.F, instead of separately.

Prerequisites for the Linux STREAMS (LiS) package are as follows:

  1. Linux distribution, somewhat Linux Standards Base compliant, with a 2.4 or 2.6 kernel and the appropriate tool chain for compiling out-of-tree kernel modules. Most recent Linux distributions are usable out of the box, but some development packages must be installed. For more information, see Compatibility.

    − A fairly LSB compliant GNU/Linux distribution.3
    − Linux 2.4 kernel (2.4.10 - 2.4.27), or
    − Linux 2.6 kernel (2.6.3 - 2.6.21);
    − glibc2 or better.
    − GNU info (for info files).
    − GNU groff (for man pages).4

When configuring and building multiple OpenSS7 Project release packages, place all of the source packages (unpacked tarballs) at the same directory level and all build directories at the same directory level (e.g. all source packages under /usr/src).

When installing packages that install as kernel modules, it is necessary to have the correct kernel development package installed. For the following distributions, use the following commands:

     Ubuntu:  $> apt-get install linux-headers
     Debian:  $> apt-get install kernel-headers
     Fedora:  $> yum install kernel-devel

You also need the same version of gcc(1) compiler with which the kernel was built. If it is not the default, add `CC=kgcc' on the line after `./configure', for example:

     $> ../LiS-2.18.6/configure CC='gcc-3.4'

Installation

The following commands will download, configure, build, check, install, validate, uninstall and remove the package:

     $> wget http://www.openss7.org/tarballs/LiS-2.18.6.tar.bz2
     $> tar -xjvf LiS-2.18.6.tar.bz2
     $> mkdir build
     $> pushd build
     $> ../LiS-2.18.6/configure --enable-autotest
     $> make
     $> make check
     $> sudo make install
     $> sudo make installcheck
     $> sudo make uninstall
     $> popd
     $> sudo rm -rf build
     $> rm -rf LiS-2.18.6
     $> rm -f LiS-2.18.6.tar.bz2

If you have problems, try building with the logging targets instead. If the make of a logging target fails, an automatic problem report will be generated that can be mailed to The OpenSS7 Project.5 Installation steps using the logging targets proceed as follows:

     $> wget http://www.openss7.org/tarballs/LiS-2.18.6.tar.bz2
     $> tar -xjvf LiS-2.18.6.tar.bz2
     $> mkdir build
     $> pushd build
     $> ../LiS-2.18.6/configure --enable-autotest
     $> make compile.log
     $> make check.log
     $> sudo make install.log
     $> sudo make installcheck.log
     $> sudo make uninstall.log
     $> popd
     $> sudo rm -rf build
     $> rm -rf LiS-2.18.6
     $> rm -f LiS-2.18.6.tar.bz2

See README-make for additional specialized make targets.

For custom applications, see the INSTALL and INSTALL-LiS files or the see Installation, as listed below. If you encounter troubles, see Troubleshooting, before issuing a bug report.

Brief Installation Instructions

The Linux STREAMS (LiS) package is available from the downloads area of The OpenSS7 Project website using a command such as:

     $> wget http://www.openss7.org/tarballs/LiS-2.18.6.tar.bz2

Unpack the tarball using a command such as:

     $> tar -xjvf LiS-2.18.6.tar.bz2

The tarball will unpack into the relative subdirectory named after the package name: LiS-2.18.6.

The package builds using the GNU autoconf utilities and the configure script. To build the package, we recommend using a separate build directory as follows:

     $> mkdir build
     $> cd build
     $> ../LiS-2.18.6/configure

In general, the package configures and builds without adding any special options to the configure script. For general options to the configure script, see the GNU INSTALL file in the distribution:

     $> less ../LiS-2.18.6/INSTALL

For specific options to the configure script, see the INSTALL-LiS file in the distribution, or simply execute the configure script with the --help option like so:

     $> ../LiS-2.18.6/configure --help

After configuring the package, the package can be compiled simply by issuing the `make' command:

     $> make

Some specialized makefile targets exists, see the README-make file in the distribution or simply invoke the `help' target like so:

     $> make help | less

After successfully building the package, the package can be checked by invoking the `check' make target like so:

     $> make check

After successfully checking the package, the package can be installed by invoking the `install' make target (as root) like so:

     $> sudo make install

The test suites that ship with the package can be invoked after the package has been installed by invoking the `installcheck' target. This target can either be invoked as root, or as a normal user, like so:

     $> make installcheck

(Note: you must add the --enable-autotest flag to configure, above for the test suites to be invoked with `make installcheck'.)

The package can be cleanly removed by invoking the `uninstall' target (as root):

     $> sudo make uninstall

Then the build directory and tarball can be simply removed:

     $> cd ..
     $> rm -rf build
     $> rm -rf LiS-2.18.6
     $> rm -f LiS-2.18.6.tar.bz2

Detailed Installation Instructions

More detailed installation instructions can be found in the Installation, contained in the distribution in `text', `info', `html' and `pdf' formats:

     $> cd ../LiS-2.18.6
     $> less doc/manual/LiS.txt
     $> lynx doc/manual/LiS.html
     $> info doc/manual/LiS.info
     $> xpdf doc/manual/LiS.pdf

The `text' version of the manual is always available in the MANUAL file in the release.

The current manual is also always available online from The OpenSS7 Project website at:

     $> lynx http://www.openss7.org/LiS_manual.html

1 Introduction

This manual documents the design, implementation, installation, operation and future development schedule of the Linux STREAMS (LiS) package.

1.1 Overview

This manual documents the design, implementation, installation, operation and future development of the Linux STREAMS (LiS) package.

LiS is a software package that comprises an implementation of SVR4 compatible STREAMS for Linux. It takes the form of a loadable module for the Linux kernel. LiS installs in any directory on your system, not in the kernel source tree. (see Installation)

LiS-2.12 and beyond utilizes aggressive multi-tasking in multiple CPU SMP environments. For further information concerning this implementation, see LiS SMP Implementation.

WARNING: This autoconf/RPM release of Linux STREAMS is distributed under the terms of the GNU Public License (GPL) and not the GNU Lesser Public License (LGPL).

This means that you cannot link proprietary STREAMS drivers with LiS and load the entirety into the Linux kernel without violating license restrictions. OpenSS7 Corporation can remove this restriction for subscribers and sponsors of the OpenSS7 Project.

1.2 Organization of this Manual

This manual is organized (loosely) into several sections as follows:

Introduction. This introduction
Objective. Objective of the package
Reference. Contents of the package
Conformance. Conformance of the package
Releases. Releases of the package
Installation. Installation of the package
Troubleshooting. Troubleshooting of the package

1.3 Conventions and Definitions

This manual uses texinfo typographic conventions.

2 Objective

3 Reference

3.1 Files

specfs.o

streams.o

streams-aixcompat.o

streams-hpuxcompat.o

streams-liscompat.o

streams-osfcompat.o

streams-suncompat.o

streams-svr4compat.o

streams-uw7compat.o

3.2 Drivers

The LiS package comes with a number of STREAMS drivers and pushable modules in source code form. A number of these drivers and modules are small entities that are used in the testing of LiS. They are included so as to make it easy for any user to run the LiS tests for themselves.

Other drivers are used to implement STREAMS based pipes and FIFOs.

A driver in STREAMS has a major and minor device number associated with it and an entry in the /dev directory. The driver is opened and closed just like any file. The driver names used in this manual are the declared names that appear in the LiS Config file for the particular driver.

3.2.1 clone-drvr

Device Name

     /dev/clone_drvr

Description

This driver is used to assist LiS in implementing the "clone" open function. It appears under its own name as /dev/clone_drvr. By convention, it is allocated the first major number of all the STREAMS drivers. In order to implement clone opens, one creates a node in the /dev directory for a device whose major number is set to that of the clone driver, and whose minor number is the major number of the driver to which the clone open is to be directed. The clone driver's open routine transfers the open call to the target driver, passing a unique flag that informs the driver that a clone open is being requested. The target driver then allocated a minor device number to uniquely associate with this instance of the open operation. The clone driver synthesizes a new major/minor "device id" to pass back to LiS. LiS recognizes the change of major/minor from the original open and takes steps to allocate control structures unique to this open.

The "clone open" operation is intended to make is easy to open one device from a pool of devices, such as pseudo ttys or logical connections. It saves application programs from having to scan a list of device mnemonics issuing trial opens until one is found that succeeds.

Note that the driver is named /dev/clone_drvr instead of the more traditional SVR4 /dev/clone. This is to avoid a conflict with another driver named /dev/clone on Linux systems.

Author

David Grothe dave@gcom.com

3.2.2 fifo

Device Name

     /dev/fifo (clone device)
     /dev/fifo.0

Description

The fifo pseudo-driver (which is internal to LiS) provides STREAMS-based fifos as single character special files, and STREAMS-based pipes as pairs of character special files which are interconnected (see pipe(3)).

STREAMS-based fifos differ from typical STREAMS-based character special files in that there are not separate stream head and driver queue pair within the STREAMS-based file. Instead, a fifo is created with only a single queue pair for the stream head. Moreover, in a typical driver queue pair, the write queue is not connected to a next queue. In a fifo, the write queue is directed to the read queue of the pair. A pipe comprises a pair of fifos, with the write queue of each pair directed to the read queue of the other. The two fifos comprising a pipe are referred to as peers, and each somewhat represents a driver to the other. As a degenerate case, a fifo is its own peer.

STREAMS modules may be pushed onto fifos and pipes, but should not expect a driver below them; instead, the SAMESTR() function should be used from the write queue of a pair to determine if the module is the lowest in the STREAMS-based file (this is called the midpoint). The structure of a fifo or pipe is preserved when modules are pushed (and popped); i.e., the write queue at the midpoint will always be directed at the read queue of the peer.

Input and output are handled at a fifo stream head as they would normally be handled at a stream head. In LiS, an fifo open() entry point exists to assign minor device numbers to new opens under the fifo major device number, and a close() entry point is used correspondingly to release them. These functions are kept in a streamtab data struc ture (as they would normally be for any STREAMS driver or module) which is private to the LiS implementation.

Application Usage

In the current Linux kernels, character special major numbers are limited to 16 bits, and major and minor device numbers to 8 bits each. This limits a system to 256 total major device numbers and 256 total minor devices per major device number. This is a rather severe limitation where mechanisms like fifos and pipes are concerned.

However, a driver may handle more than one major device number. The fifo pseudo-driver uses this to overcome this limitation, by supporting the automatic allocation and use of multiple major device numbers for fifos and pipes. Specifying more than 256 minor devices is done in the usual manner, i.e., by specifying the number of "units" in the appropriate Config file. Enough major device numbers will be allocated to cover the requested number of minor devices (if available, else an error will occur in strconf(8)). The number allocated will include one minor device per major number to be used as a fifo-specific clone minor device (specifically, minor number 0), which exhibits special behaviour. Normally, when cloning is done via the clone pseudo-driver, the clone major device number is used, along with the desired actual major number as the minor device number. When an open() is performed on such a device, the clone open() routine in turn calls the appropriate driver's open(), with the sflag parameter set to CLONEOPEN. The driver's open() is expected in this case to allocate an unused minor device number, and return it via an entirely new device number in the devp parameter. In this way, a driver can change the device number to be used for a STREAMS-based file. When minor device 0 for a specified for a fifo major device, the driver will also clone a new minor device number. However, LiS opens fifo devices differently; specifically, when an already-opened fifo-specific clone minor device is reopened, the new and subsequent opens will use the already-opened clone. Thus, using minor device 0 for a fifo when creating a file sys tem node will ensure that all concurrent opens of the associated path name will use the same STREAMS-based file; at the same time, opens of different file system nodes via different paths will open their respectively different STREAMS-based files. This is essentially how kernel-based fifos behave -applications and users of STREAMS-based fifos don't have to keep track of minor numbers to achieve this same behaviour when it is desired.

It is in fact recommended that only two forms of file sys tem nodes be used for STREAMS-based fifos: the clone major number as major number with a fifo major number as minor number, to be used when every open of the associated path must clone a new fifo, and a fifo major number as major number with 0 as the minor number, to be used when new opens are to clone a new fifo but subsequent concurrent opens are to use the already opened fifo. These are represented by two device special file paths created when LiS is installed: /dev/fifo for the former, and /dev/fifo.0 for the latter. It is recommended that these be used, possibly along with the equivalent of stat(2) to determine appropriate major device numbers for the clone and fifo pseudo-drivers, which are also determined when LiS is installed. It can be noted that pipes are actually created as instances of the former, after which the write queues are peer-connected. The fifo pseudo-driver allocates minor devices in round-robin fashion; i.e., a list of available minor devices is kept, and once a minor number is finally closed, it is put at the end of this list. Thus, a fifo minor device which is opened and closed will not be immediately reused.

Warnings

Because STREAMS-based fifos and pipes are implemented as character special devices, they do not appear as pipe devices when examined with stat(2) or the equivalent (e.g., ls(1)); i.e. the S_IFIFO indication is not set in the mode - S_IFCHR is set instead, and the actual device number is indicated in the st_rdev field of the stat data structure.

Because of the potential use of multiple major numbers, applications should not depend on a fifo or pipe having a specific major device number, nor should an application depend on all fifos and pipes having the same major device number.

See Also

clone(9), connld(9), fifo(4), ls(1), pipe(3), pipemod(9), STREAMS(4), stat(2), strconf(8)

Author

John Boyd, protologos LLC. jaboydjr@netwalk.com

3.2.3 loop-around

Device Name

     /dev/loop_clone (clone device)
     /dev/loop.1
     /dev/loop.2

Description

This driver is used by LiS and the strtst(8) utility to assist in the regression testing of LiS. It connects two streams together in a manner similar to that of a pipe. Messages written into one stream can be read back from the other.

The driver can be operated as a clone device with the two streams being connected via ioctls. A number of ioctls exist that tailor the operation of the driver. The user codes these ioctls as type I_STR and passes a structure of type struct strioctl to the driver. The ic_cmd field of this structure is decoded according to the following table. the ic_dp and ic_len fields delimit an argument structure which is also passed to the driver. The argument structure differs for each type of ic_cmd.

ic_cmd value Argument Structure Description


LOOP_SET IN: int Argument is the minor device number of the loop device to use for the other end of the connection. If the loop-around device had been opened by a directed open, such as to /dev/loop.1, then the minor device number is known from the device node. If it was opened via the /dev/loop_clone device then the minor device can be discovered via the LOOP_GET_DEV ioctl.
LOOP_PUTNXT None Set the driver into a mode in which it will perform a direct putnext(9) call on the other stream rather than the default behaviour of using the service queue to forward the message.


LOOP_MSGLVL IN: int Set to the number of messages to queue in the service queue before forwarding to the other stream. Zero means forward immediately.


LOOP_TIMR IN: int Set the number of "ticks" to hold messages before forwarding them to the other stream.


LOOP_MARK IN: int Set the MSGMARK flag for each of the next n messages before forwarding them to the other stream.


LOOP_GET_DEV OUT: int Return the minor device number of this stream. Useful for finding out the minor number of a clone device.


LOOP_BUFCALL None Use the bufcall(9) mechanism to allocate a buffer for copying the next message.


LOOP_CONCAT IN: int Concatenate this many messages into a single message and then forward on the other stream. One concatenation resets this value to zero and the ioctl needs to be issued again to repeat the behaviour.


LOOP_COPY None From this point on, copy messages rather than passing them through to the other stream.


Author

David Grothe dave@gcom.com plus others originally.

3.2.4 mini-mux

Device Name

     /dev/mux_clone (clone device)
     /dev/minimux.1
     /dev/minimux.2

Description

This driver is used by LiS in its testing procedures. It is a small multiplexing driver that allows cascaded multiplexors to be built and torn down. The driver uses a pair of ioctls to establish connectivity between upper streams and lower streams. This allows control over how data flows through the multiplexor.

Both of these ioctls are coded as type I_STR and pass a structure of type struct strioctl to the driver. The ic_cmd field of this structure is decoded according to the following table. the ic_dp and ic_len fields delimit an argument structure which is also passed to the driver. The argument structure may differ for each type of ic_cmd.

ic_cmd value Argument Structure Description


MINIMUX_UP IN: int The argument is a muxid that was returned from an I_LINK ioctl. This ioctl causes the lower stream indicated by the muxid to be connected to this stream. This is unidirectional linkage and only affects the upstream flow of messages.


MINIMUX_DOWN IN: int The argument is a muxid that was returned from an I_LINK ioctl. This ioctl causes this stream to be connected to the lower stream indicated by the muxid. This is unidirectional linkage and only affects the downstream flow of messages.


Author

David Grothe dave@gcom.com

3.2.5 printk

Device Name

     /dev/printk

Description

This driver accepts messages written to it and prints them from the kernel using the kernel's printk function. It is used by the LiS test software to keep messages from LiS and messages from the test program in sequence.

Author

David Grothe dave@gcom.com

3.2.6 sad

Device Name

     /dev/sad

Description

The STREAMS Administrative Driver manages the autopush function of LiS. Using ioctls the system administrator can provide a list of modules that are to be automatically pushed onto a given device when that device is opened. The controls are specified via the strapush structure which is defined in <sys/sad.h>.

The ioctl used by the user is of the form:

ioctl(fd, command, arg)

Where fd is the file descriptor of the file that is open to the sad driver, command and arg are described in the following table.

Command Argument Description

SAD_SAP struct strapush * Set the list of autopushed modules according to the sap_cmd and other arguments contained within the strapush structure.

SAD_GAP struct strapush * Get the list of configured autopushed modules associated with the indicated major and minor device number. The sad driver fills in this structure with the names of the modules and the applicable range of minor device numbers.

SAD_VML struct str_list * Validates a list of pushable module names to verify that they are installed in LiS. The str_list structure is defined in the file <sys/stropts.h>.

The strapush structure used by the SAD_SAP and SAD_GAP ioctls contains the following fields.

unsigned sap_cmd
This is the autopush command to be executed. The values are as follows.
SAP_ONE
Configure one minor device of the driver indicated by sap_major.

SAP_RANGE
Configure a range of minor devices of the driver indicated by sap_major. The range runs from sap_minor to sap_lastminor, inclusively.

SAP_ALL
Configure all minor devices of the driver indicated by sap_major.

SAP_CLEAR
Undo all autopush configuration for the driver indicated by sap_major.

major_t sap_major
The major device number of the driver which is being configured for autopush.

minor_t sap_minor
The minor device being configured, or the first of a range.

minor_t sap_lastminor
The last minor device of a range to be configured.

unsigned sap_npush
Number of modules to be pushed when the indicated device is opened.

char sap_list[MAXAPUSH][FMNAMESZ+1]
List of module names to be pushed, or list of modules names returned to user.

The ioctl function call returns zero upon success or -1 on failure. Upon failure errno(3) is set to the error number describing the failure, usually either EFAULT or EINVAL.

Note that the sad driver is a standard AT&T STREAMS function. More comprehensive documentation for this driver can be found in the [40]SVR4 Programmer's Guide: STREAMS.

Author

Ole Husgaard sparre@login.dknet.dk

3.3 Modules

streams-connld.o
Connld module.

streams-pipemod.o
Pipe module.

streams-sc.o
STREAMS configuration module.

streams-sth.o
Stream Head module.

The LiS package comes with a number of STREAMS drivers and pushable modules in source code form. A number of these drivers and modules are small entities that are used in the testing of LiS. They are included so as to make it easy for any user to run the LiS tests for themselves.

A pushable module in STREAMS is an entity that is added to an existing STREAMS file via the I_PUSH ioctl. These modules are known to LiS by mnemonic name, given as an argument to the I_PUSH ioctl. There are no major and minor device numbers or /dev entries associated with pushable modules.

3.3.1 connld

Module Name

connld

Description

The connld module provides a means to generate multiple unique STREAMS-based pipes from a single existing pipe end. connld may only be pushed (via the STREAMS I_PUSH ioctl) onto a STREAMS-based pipe. When first pushed, connld does nothing; on each subsequent open(2), connld will generate a unique STREAMS-based pipe. One end of each new pipe replaces the original pipe end from the perspective of the open call. The other end of each new pipe is sent, effectively as if by the I_SENDFD ioctl, to the other end of the original pipe, ostensibly to be received by a subsequent I_RECVFD ioctl operation.

Application Usage

The intent of connld is to provide a means to generate unique pipes which separately and independently connect client processes to a server process. The point of access for such clients is expected to be a path name known to all such clients and to which a pipe end may be connected (via fattach(3)) by the server process. The server establishes the original pipe, pushes connld onto the client end, and then listens via I_RECVFD for new connections on the server end. A client wishing to connect to the server will open(2) the path name representing the client end, and can determine via isastream(3) whether or not the server process is active and attached. If it is, the open() call returns one end of a unique new pipe that thus connects the client to the server.

Such a server is responsible both for accepting new connections via I_RECVFD on the original pipe, and for communicating with clients so connected via the received pipe ends. It would also be reasonable for such a server process to invalidate the point of access by calling fdetach(3) before terminating.

It should be noted that the poll(2) primitive may be used to indicate when an M_PASSFP representing a newly passed file is available on the original server pipe end. This is reflected by the POLLIN status setting in the events and revents fields of a pollfd structure. Moreover, any attempt to read an M_PASSFP message via the data-receiving primitives (i.e., read(2), getmsg(3), and getpmsg(3)) will fail with errno(3) returning an EBADMSG indication without discarding the message.

Even so, it should be reasonable to expect only M_PASSFP messages will be received on the original server pipe end, since it is not possible to carry on normal data traffic which has connld on one end, since connld does not support such traffic.

The use of connld can be made entirely free-standing by attaching well-known paths to both ends of the original pipe. The relevant capabilities are implemented in LiS so that the original creator of the pipe can close both ends after attaching paths to them, and the process of passing file descriptors can still be carried out via new open()'s as long as both ends remain attached.

See Also

fattach(3), fattach(8), fdetach(3), fifo(4), fifo(9),

pipe(3), STREAMS(4)

History

Unix System V Release 4 (SVR4)

Author

John Boyd, protologos LLC. jaboydjr@netwalk.com

3.3.2 pipemod

Module Name

pipemod

Description

The pipemod module has the relatively simple task of reversing the sense of the FLUSH flag bits in M_FLUSH messages sent in STREAMS-based fifos and pipes. This must happen at the midpoint of a fifo or pipe, so that FLUSHR becomes FLUSHW, and FLUSHW becomes FLUSHR. pipemod does this, and has no other function.

To be used appropriately, then, pipemod must be the first module pushed onto a pipe end or a fifo, but it is only necessary on one end of a pipe.

pipemod is not needed if flush handling need not be supported, or if its function is supported by other means.

See Also

fifo(9), pipe(3), fifo(4), STREAMS(4)

History

Unix System V Release 4 (SVR4)

Author

John Boyd, protologos LLC. jaboydjr@netwalk.com

3.3.3 relay, relay2

Module Name

relay relay2

Description

These are two names for the same module. All the module does is forward STREAMS messages along on the stream using putnext(9). These modules are used in the testing of LiS but are not otherwise useful. One could use the source code as a starting point for coding a pushable STREAMS module.

Author

David Grothe dave@gcom.com

3.4 Libraries

During the installation process of Linux STREAMS (LiS) a subroutine library is built and installed on your system. Three versions of the library are built and installed. They are as follows.

libLiS.a
Interface routines to LiS in static library form.

libLiS.so
Interface routines to LiS in dynamic library form.

libpLiS.so
Like libLiS.so but omits the "pipe" system call.

These three libraries are copied to the directory /usr/lib when LiS is installed. In addition, the utility program ldconfig is run during the LiS make install. This causes this library to be linked, or searched, ahead of the standard C library. This is necessary because the standard C library contains dummy routines for the STREAMS interface functions, or most of them in the best case. If these dummy routines preempt the LiS versions then STREAMS applications will always perceive error returns from such routines as see getmsg(2) and see putmsg(2).

3.4.1 Library Routines

The following routines are present in the libraries libLiS.a and libLiS.so. The library libpLiS.so omits the "pipe" routine.

The routines in these libraries are standard STREAMS interface routines. As such we do not offer detailed descriptions of the functions of these routines. Instead we refer the reader to the AT&T SVR4 STREAMS documentation.

     int fattach(int fd, const char *path);
     int fdetach(const char *path);
     int getmsg(int fd, void *ctlptr, void *dataptr, int *flagsp);
     int getpmsg(int fd, void *ctlptr, void *dataptr, int *bandp, int *flagsp);
     int isastream(int fd);
     int pipe(int *fd);
     int poll(void *pollfds, long nfds, int timeout);
     int putmsg(int fd, void *ctlptr, void *dataptr, int flags);
     int putpmsg(int fd, void *ctlptr, void *dataptr, int *bandp, int *flagsp);
int fattach(int fd, const char *path);
see fattach(3)

int fdetach(const char *path);
see detach(3)

int getmsg(int fd, void *ctlptr, void *dataptr, int *flagsp);
see getmsg(2)

int getpmsg(int fd, void *ctlptr, void *dataptr, int *bandp, int *flagsp);
see getpmsg(2s)

int isastream(int fd);
see isastream(3)

int pipe(int *fd);
see pipe(2s)

int poll(void *pollfds, long nfds, int timeout);
see poll(2s)

int putmsg(int fd, void *ctlptr, void *dataptr, int flags);
see putmsg(2)

int putpmsg(int fd, void *ctlptr, void *dataptr, int *bandp, int *flagsp);
see putpmsg(2s)

These routines are all very small pieces of code. Most of them simply pass their parameters to LiS via a system call. The see fattach(3) and fdetach see fdetach(3) routines use ioctls to LiS if there is no system call available to call directly.

The poll see poll(2s) routine simply executes the poll system call. It is present for backward compatibility to 2.0 kernels, in which LiS provided the poll system call.

The see pipe(2s) routine has the same semantics as the standard C library routine. It uses STREAMS FIFOs to implement the pipe instead of the standard Linux pipes.

The libpLiS.so library, the one that preempts the standard C library, omits the STREAMS pipe routine so that standard Linux pipes are used unless the user explicitly links in libLiS.

3.4.2 Using the Library

To use one of the LiS libraries you can include the file <sys/stropts.h> in your program source code. On your compiler command line you can add the option `-I/usr/include/LiS' to include the version of stropts.h that is distributed with LiS, or omit the option to include the system standard header file. The two header files are believed to be compatible enough that it does not matter which one you include in your program. When linking your program, or performing a final cc to build your executable, include one of the following options on your command line.

/usr/lib/libLiS.a
Use libLiS.a (static, includes "pipe")

-lLiS
Use libLiS.so (dynamic, includes "pipe")

-lpLiS
Use libpLiS.so (dynamic, omits "pipe")

Omit any options

As of libc-2.2.1 the LiS STREAMS interface routines will be used automatically via libpLiS.so.

3.5 Utilities

The Linux STREAMS (LiS) package contains some user level commands that are used to manage the package and assist the user with STREAMS functions.

These commands are installed in /usr/bin or /usr/sbin. They are referred to a "global commands." A second group is built in the LiS installation directory and left there. This second group is oriented more toward testing of LiS than toward its operation. These commands remain undocumented since they are primarily intended for the use of the authors of the modules that they test.

These are the commands that are installed in /usr/bin or /usr/sbin, and are thus globally accessible to any user with those directories in his/her path.

3.5.1 fattach

     /usr/sbin/fattach [-v] [-m|-u|-M mode] [-p|STREAMS-path] path ...
     /usr/sbin/fattach -?

Description

The fattach program provides a command-line interface to the underlying fattach(3) function. If the -p and/or the -c option is specified, a STREAMS-based pipe is created and its two ends are alternately attached to the path names given. In this mode of usage, at least two path names are required, but there need not be an even number of path names (i.e., the pipe ends need not be attached to the same number of paths).

If the -p and -c options are not specified, the first path name given must identify a STREAMS-based file. That file will be opened, and it will be attached to each of the path names subsequently specified (of which there must be at least one).

Options
-p
Create a STREAMS-based pipe, to which to attach the subsequently specified path names. The first path will be attached to the first pipe end, the second to the second pipe end, the third to the first pipe end, etc., until the list of path names is exhausted.

By default, the umask (see umask(2)) is also applied to each end of the pipe after attaching. (See fattach(3)).


-c
Like -p (both may be given), but additionally pushes the connld module onto the first end of the pipe. This conveniently creates a free-standing pipe-serving pipe (see connld(9), and below).

-m
Apply the mode of the last-specified path(s) to the attached STREAMS-based file(s) after attaching. (See fattach(3).

-u
Apply the umask (see umask(2)) of the STREAMS-based file after attaching. (See fattach(3)). This is done by default when a pipe is created via -p.

-M mode
Apply the given mode to the STREAMS-based file(s) after attaching. (See fattach(3)).

-v
Operate in a "verbose" manner. This causes fattach to report its progress via message output to stdout or stderr.

-?
Provide a usage summary.
Return Value

Upon successful completion, i.e., if all given path names are attached to, fattach returns 0. Upon failure, fattach returns 1. However, the failure of one more attachments does not otherwise affect those that succeed, and the user is responsible for detaching any that may have succeeded if that is the desired behaviour in the event of any failures.

Application Usage

The -p and -c options provide a convenient means for creating free-standing mounted pipes. The openers of the paths attached via -p will share a single pipe, while the openers of the paths attached via -c will have access to a pipe-serving pipe. I.e., each open of the first end (e.g., the client end) will generate a new pipe, one end of which will be given to the opener, and the other end of which will be passed as if by the I_SENDFD ioctl to the path attached to the other end (e.g., the server end). Each opener of the server path could poll(2) for input, receive a new pipe end using the I_RECVFD ioctl, and then close the server path, thereafter using the new pipe end to communicate with the corresponding opener of the client path (note that the sense of client and server will in fact depend on the application - users of the two paths need only be aware of whether or not an I_RECVFD ioctl must be performed).

See Also

connld(9), fattach(3), fdetach(3), fdetach(8), STREAMS(4), umask(2)

History

An fattach function has been provided for various STREAMS implementations based on SVR4 STREAMS. Not all of these have provided a corresponding utility program of this sort.

Author

John Boyd, protologos LLC jaboydjr@netwalk.com

3.5.2 fdetach

     /usr/sbin/fdetach [-v] path ...
     /usr/sbin/fdetach -a
     /usr/sbin/fdetach -?

Description

The fdetach program provides a command-line interface to the underlying fdetach(3) function.

It is thus intended to provide a convenient means to dismantle so-called mounted STREAMS.

If the -a option is specified, all currently attached STREAMS-based files are detached. If the -a option is not specified, the path names given are taken to identify paths to which STREAMS-based files are currently attached. Those files will be detached from these paths.

Options
-a
Undo all attachments currently in effect.

-v
Operate in a "verbose" manner. This causes fdetach to report its progress via message output to stdout or stderr.

-?
Provide a usage summary.
Return Value

Upon successful completion, i.e., if all given path names identify mounted STREAMS and these are all successfully detached, fdetach returns 0. Upon failure, fdetach returns 1.

Note, however, that a failure indication does not mean that no action is taken; i.e., those detachments that succeed are not affected by those that fail.

Warnings

It should be noted that although the fdetach program implements the -a option, by passing "*" to the fdetach function, this is not at all equivalent to specifying "*" on the command line when executing the program. Normally, "*" specified on the command line will be converted by a shell into a list of all files in the current working directory. By contrast, the -a option causes the fdetach operation to operate not with respect to path names at all, but with respect to STREAMS devices currently active within the STREAMS subsystem. I.e., each active stream head is examined for attachments, and any attachments found are dismantled.

The intended use for the -a option is thus to undo all attachments, e.g., in preparation for unloading the STREAMS subsystem.

See Also

fdetach(3), fattach(8), STREAMS(4)

History

An fdetach function has been provided for various STREAMS implementations based on SVR4 STREAMS. Not all of these have provided a corresponding utility program of this sort.

Author

John Boyd, protologos LLC jaboydjr@netwalk.com

3.5.3 polltst

     /usr/bin/polltst

Description

polltst is a simple test program for the poll system call. Using poll, it reads keystrokes from stdin, writes them to one end of the LiS loopback driver, reads them from the other end and then writes them back to stdout.

While performing this operation it configures stdin for "no echo" mode, so the appearance of "echoed" characters is evidence of the operation of poll involving both a STREAMS and a non-STREAMS file.

Author

David Grothe dave@gcom.com

3.5.4 streams

     /usr/sbin/streams Options

Description

The streams program is used to perform several different management functions for the LiS package, including starting and stopping the LiS subsystem.

Options
`start'
Start the LiS subsystem. This amounts to performing the command "modprobe streams".

`stop'
Stop the LiS subsystem. This amounts to performing the command "modprobe -r streams".

`status'
Reports on the status of the LiS subsystem.

-c Kbytes
Print or set the maximum message memory usage for LiS. The value 0 (default) means unlimited.

-C Kbytes
Print or set the maximum total memory usage for LiS. The value 0 (default) means unlimited.

-d mask
Set the debug mask for LiS. See below for details.

-D mask
Set an additional debug mask for LiS. See below for details.

-s
Print STREAMS memory usage statistics.

-L
Print out lock contention statistics. Use debug bit DEBUG_LOCK_CONTENTION to enable the lock contention statistics gathering.

-m
Print STREAMS memory allocation to the system messages file (from kernel). This option should be used only for debugging and only when LiS is in a quiescent state. Unpredictable results can occur if this option is used while LiS memory allocations are changing dynamically.

-p
Print the LiS lock trace buffer to the system messages file (from kernel). Used in conjunction with the DEBUG_SPL_TRACE debug option.

-q
Print all STREAMS queues to the system messages file (from kernel). This option should be used only for debugging and only when LiS is in a quiescent state. Unpredictable results can occur if this option is used while LiS queue allocations are changing dynamically.

-S
Print out STREAMS queue-runner thread statistics.

-t
Print STREAMS timing statistics. Used in conjunction with the DEBUG_MEAS_TIME debug option.

-T
Print the LiS semaphore latency histogram. Use debug bit DEBUG_SEMTIME to enable the statistics collection.

-h
Print a command synopsis.

-H
Print a command synopsis including the debug mask mnemonics.
Debug Options

The value that is used with the -d option consists of the logical "or" of the following single bit options.

-d Options
          DEBUG_OPEN             0x00000001
          DEBUG_CLOSE            0x00000002
          DEBUG_READ             0x00000004
          DEBUG_WRITE            0x00000008
          DEBUG_IOCTL            0x00000010
          DEBUG_PUTNEXT          0x00000020
          DEBUG_STRRPUT          0x00000040
          DEBUG_SIG              0x00000080
          DEBUG_PUTMSG           0x00000100
          DEBUG_GETMSG           0x00000200
          DEBUG_POLL             0x00000400
          DEBUG_LINK             0x00000800
          DEBUG_MEAS_TIME        0x00001000
          DEBUG_MEM_LEAK         0x00002000
          DEBUG_FLUSH            0x00004000
          DEBUG_FATTACH          0x00008000
          DEBUG_SAFE             0x00010000
          DEBUG_TRCE_MSG         0x00020000
          DEBUG_CLEAN_MSG        0x00040000
          DEBUG_SPL_TRACE        0x00080000
          DEBUG_MP_ALLOC         0x00100000
          DEBUG_MP_FREEMSG       0x00200000
          DEBUG_MALLOC           0x00400000
          DEBUG_MONITOR_MEM      0x00800000
          DEBUG_DMP_QUEUE        0x01000000
          DEBUG_DMP_MBLK         0x02000000
          DEBUG_DMP_DBLK         0x04000000
          DEBUG_DMP_STRHD        0x08000000
          DEBUG_ADDRS            0x80000000
     

-D Options
          DEBUG_SNDFD            0x00000001
          DEBUG_CP	       0x00000002
          DEBUG_CACHE	       0x00000004
          DEBUG_LOCK_CONTENTION  0x00000008
          DEBUG_REFCNTS          0x00000010
          DEBUG_SEMTIME          0x00000020
     

Most of these options are intuitive as to their operation from the mnemonics.

The DEBUG_MEAS_TIME option causes LiS to use a high precision timer to calculate the execution time of several operations within itself. These timings include the time spent in STREAMS drivers. Thus, under controlled circumstances this option can be used to time STREAMS driver code. It is used in conjunction with the -t option to print out the timing statistics.

The DEBUG_SAFE option causes LiS to carefully check for NULL pointers when performing message passing and queueing operations such as putq(9) and putnext(9).

The DEBUG_CLEAN_MSG option causes LiS to clear message data buffers to zero when they are allocated. It is useful for tracking down driver problems relating to using uninitialized areas of messages.

The DEBUG_SPL_TRACE option causes LiS to maintain a trace table of all LiS locking operations. It is used in conjunction with the -p option to print out the lock trace table. The locking operations that are traced include calls on the LiS locking primitives from STREAMS drivers.

The options DEBUG_DMP_QUEUE, DEBUG_DMP_MBLK and DEBUG_DMP_DBLK control the verbosity of the printing out of LiS memory areas via the -m option. With these debug mask bits set, LiS will print out the contents of these structures as well as the headers indicating that such a structure was allocated.

The DEBUG_ADDRS option causes the -m option to print out the addresses of structures as well as their memory tags and/or contents.

The DEBUG_MONITOR_MEM option causes LiS to monitor the guard words surrounding allocated memory areas in an attempt to catch overwriting of these words in a timely fashion. This option comes at a fairly substantial CPU time penalty.

Author

David Grothe dave@gcom.com

3.5.5 strmakenodes

     /usr/sbin/strmakenodes

Description

strmakenodes makes all of the /dev entries that are associated with LiS as a result of the LiS build process. All of the Config files that contributed to the LiS build are scanned for their "node" declarations. strmakenodes performs a mknod system call for each specified "node". This command must be run before LiS can operate correctly after it is installed. This command is run automatically as a result of the "make install" operation of LiS.

This command accepts the option "-r" to mean remove nodes instead of making them. The command is run with this option as a result of the "make uninstall" operation.

The source code for this command is generated automatically as a side-effect of running the strconf utility.

3.5.6 strtst

     /usr/bin/strtst

Description

strtst is a test program which tests the core functionality of LiS. It is a user level program which uses the built-in drivers that are installed by default with LiS. It performs numerous STREAMS operatio