'\"macro stdmacro
.if n .pH g7.tirdwr @(#)tirdwr	40.4 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} tirdwr 7 "Networking Support Utilities" "\&"
.if \nX=1 .ds x} tirdwr 7 "Networking Support Utilities"
.if \nX=2 .ds x} tirdwr 7 "" "\&"
.if \nX=3 .ds x} tirdwr "" "" "\&"
.TH \*(x}
.SH NAME
\f4tirdwr\f1 \- Transport Interface read/write interface \s-1STREAMS\s0 module
.SH DESCRIPTION
\f4tirdwr\fP is a \s-1STREAMS\s0 module 
that provides an alternate interface to a transport provider which supports the 
Transport
Interface (\s-1TI\s+1) functions of the Network Services library (see Section 3N).
This alternate interface allows a user to communicate with the transport protocol 
provider using the \f4read\fP(2) and \f4write\fP(2) system calls.
The \f4putmsg\fP(2) and \f4getmsg\fP(2) system calls may also be used.
However, \f4putmsg\fP and \f4getmsg\fP can only transfer data messages between 
user and stream.
.PP
The \f4tirdwr\fP module must only be pushed [see \f4I_PUSH\fP in \f4streamio\fP(7)] onto a stream
terminated by a transport protocol provider which supports the \s-1TI\s+1.
After the \f4tirdwr\fP module has been pushed onto a stream, none of the Transport 
Interface functions can be used.
Subsequent calls to TI functions will cause an error on the stream.
Once the error is detected, subsequent system calls on the stream will return
an error with \f4errno\fP set to \f4EPROTO\fP.
.PP
The following are the actions taken by the \f4tirdwr\fP module
when pushed on the stream, popped [see \f4I_POP\fP in \f4streamio\fP(7)] off 
the stream,
or when data passes through it.
.TP 10
\f2push\fP \-
When the module is pushed onto a stream, it
will check any existing data destined for the user to ensure that only
regular data messages are present.
It will ignore any messages on the stream
that relate to process management, such
as messages that generate signals to the
user processes associated with the stream.
If any other messages are present,
the \f4I_PUSH\fP will return an error with \f4errno\fP set to \f4EPROTO\fP.
.TP
\f4write\fP \-
The module will take the following actions on
data that originated from a \f4write\fP system call:
.RS 10
.TP 3
\-
All messages with the exception of messages that contain
control portions (see the \f4putmsg\fP and \f4getmsg\fP
system calls) will be transparently passed onto the module's
downstream neighbor.
.TP
\-
Any zero length data messages will be freed by the module and they will not
be passed onto the module's downstream neighbor.
.TP
\-
Any messages with control portions will generate an error,
and any further system
calls associated with the stream will fail with \f4errno\fP set
to \f4EPROTO\fP.
.RE
.TP 10
\f4read\fP \-
The module will take the following actions on
data that originated from the transport protocol provider:
.RS 10
.TP 3
\-
All messages with the exception of those that contain
control portions (see the \f4putmsg\fP and \f4getmsg\fP system calls)
will be transparently passed onto the module's upstream neighbor.
.TP
\-
The action taken on messages with control portions will be as follows:
.RS 5
.TP 3
+
Messages that represent expedited data will generate an error.
All further system calls associated with the stream will fail with
\f4errno\fP set to \f4EPROTO\fP.
.TP
+
Any data messages with control portions will have the control portions
removed from the message prior to passing the message on to the
upstream neighbor.
.TP
+
Messages that represent an orderly release indication from the transport
provider will generate a zero length data message,
indicating the end of file,
which will be sent to the reader of the stream.
The orderly release message itself will be freed by the module.
.TP
+
Messages that represent an abortive disconnect indication from the transport
provider will cause all further \f4write\fP and
\f4putmsg\fP system calls to fail with \f4errno\fP
set to \f4ENXIO\fP.
All further \f4read\fP and \f4getmsg\fP system
calls will return zero length data (indicating end of file)
once all previous
data has been read.
.TP
+
With the exception of the above rules,
all other messages with control portions
will generate an error and all further system calls
associated with the stream
will fail with \f4errno\fP set to \f4EPROTO\fP.
.RE
.TP 3
\-
Any zero length data messages will be freed by the module and they will not
be passed onto the module's upstream neighbor.
.RE
.TP 10
\f2pop\fP \-
When the module is popped off the stream or the stream is closed, the
module will take the following action:
.RS 10
.TP 3
\-
If an orderly release indication has been previously received,
then an orderly release request
will be sent to the remote side of the transport connection.
.RE
.SH SEE ALSO
\f4streamio\fP(7), \f4timod\fP(7).
.br
\f4intro\fP(2), \f4getmsg\fP(2), \f4putmsg\fP(2), \f4read\fP(2),
\f4write\fP(2), \f4intro\fP(3).
.br
\f2Programmer's Guide: \s-1STREAMS\s0\fP.
.br
\f2Programmer's Guide: Networking Interfaces\fP.
.Ee
