'\"macro stdmacro
.if n .pH g7.timod @(#)timod	40.4 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} timod 7 "Networking Support Utilities" "\&"
.if \nX=1 .ds x} timod 7 "Networking Support Utilities"
.if \nX=2 .ds x} timod 7 "" "\&"
.if \nX=3 .ds x} timod "" "" "\&"
.TH \*(x}
.SH NAME
\f4timod\f1 \- Transport Interface cooperating \s-1STREAMS\s0 module
.SH DESCRIPTION
\f4timod\fP is a \s-1STREAMS\s0 module for use with the Transport
Interface (\s-1TI\s+1) functions of the Network Services library.
The \f4timod\fP module converts a set of \f4ioctl\fP(2) calls into
\s-1STREAMS\s0 messages that may be consumed by a transport protocol provider
which supports the Transport Interface.
This allows a user to initiate certain \s-1TI\s+1 functions as atomic operations.
.PP
The \f4timod\fP module must be pushed onto only a stream
terminated by a transport protocol provider which supports the \s-1TI\s+1.
.PP
All \s-1STREAMS\s0 messages, with the exception of the message
types generated from the \f4ioctl\fP commands described below, will be transparently passed to the neighboring \s-1STREAMS\s0 module or driver.
The messages generated from the following \f4ioctl\fP commands are recognized and processed by the \f4timod\fP module.
The format of the \f4ioctl\fP call is:
.PP
.RS 5
.nf
\f4#include <sys/stropts.h>
		-
		-
struct strioctl strioctl;
		-
		-
strioctl.ic_cmd = \f2cmd\fP;
strioctl.ic_timeout = INFTIM;
strioctl.ic_len = \f2size\fP;
strioctl.ic_dp = (char *)\f2buf\fP
ioctl(fildes, I_STR, &strioctl);\fP
.fi
.RE
.PP
Where, on issuance, \f2size\f1 is the size of the appropriate
\s-1TI\s+1 message to be sent to the transport provider and on return
\f2size\f1 is the size of the appropriate \s-1TI\s+1 message
from the transport provider in response to the issued \s-1TI\s+1 message.
\f2buf\f1 is a
pointer to a buffer large enough to hold the contents of the appropriate
\s-1TI\s+1 messages.
The \s-1TI\s+1 message types are defined in \f4<sys/tihdr.h>\f1.
The possible values for the \f2cmd\f1 field are:
.TP 15
\f4TI_BIND\fP
Bind an address to the underlying transport protocol provider.
The message issued to the \f4TI_BIND\fP
\f4ioctl\fP is equivalent to the \s-1TI\s+1
message type \f4T_BIND_REQ\fP and the message returned by the successful
completion of the \f4ioctl\fP is equivalent to the \s-1TI\s+1 message type
\f4T_BIND_ACK\fP.
.TP
\f4TI_UNBIND\fP
Unbind an address from the underlying transport protocol provider.
The message issued to the \f4TI_UNBIND\fP
\f4ioctl\fP is equivalent to the \s-1TI\s+1
message type \f4T_UNBIND_REQ\fP and the message returned by the successful
completion of the \f4ioctl\fP is equivalent to the \s-1TI\s+1 message type
\f4T_OK_ACK\fP.
.TP
\f4TI_GETINFO\fP
Get the \s-1TI\s+1 protocol specific
information from the transport protocol provider.
The message issued to the \f4TI_GETINFO\fP \f4ioctl\fP
is equivalent to the \s-1TI\s+1
message type \f4T_INFO_REQ\fP and the message returned by the successful
completion of the \f4ioctl\fP is equivalent to the \s-1TI\s+1 message type
\f4T_INFO_ACK\fP.
.TP
\f4TI_OPTMGMT\fP
Get, set or negotiate protocol specific options
with the transport protocol provider.
The message issued to the \f4TI_OPTMGMT\fP
\f4ioctl\fP is equivalent to the \s-1TI\s+1
message type \f4T_OPTMGMT_REQ\fP and the message returned by the successful
completion of the \f4ioctl\fP is equivalent to the \s-1TI\s+1 message type
\f4T_OPTMGMT_ACK\fP.
.SH FILES
.nf
\f4<sys/timod.h>
<sys/tiuser.h>
<sys/tihdr.h>
<sys/errno.h>\fP
.SH SEE ALSO
\f4tirdwr\fP(7).
.br
\f2Programmer's Guide: \s-1STREAMS\s0\f1.
.br
\f2Programmer's Guide: Networking Interfaces\f1.
.SH DIAGNOSTICS
If the \f4ioctl\fP system call returns with a value greater than 0, the
lower 8 bits of the return value will
be one of the \s-1TI\s+1 error codes as defined in
\f4<sys/tiuser.h>\f1.
If the \s-1TI\s+1 error is of type \f4TSYSERR\fP,
then the next 8 bits of the return
value will contain an error as defined in
\f4<sys/errno.h>\f1 [see \f4intro\fP(2)].
.Ee
