tirdwr Module

Purpose

Supports the Transport Interface functions of the Network Services library.

Description

The tirdwr module is a STREAMS module that provides an alternate interface to a transport provider that supports the Transport Interface (TI) functions of the Network Services library. This alternate interface allows a user to communicate with the transport protocol provider by using the read and write subroutines. The putmsg and getmsg system calls can also be used. However, the putmsg and getmsg system calls can only transfer data messages between user and stream.

The tirdwr module must only be pushed (see the I_PUSH operation) onto a stream terminated by a transport protocol provider that supports the TI. After the tirdwr module has been pushed onto a stream, none of the TI 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 the errno global variable set to EPROTO.

The following list describes actions taken by the tirdwr module when it is pushed or popped or when data passes through it:

Action Description
push Checks any existing data to ensure that only regular data messages are present. It ignores any messages on the stream that relate to process management. If any other messages are present, the I_PUSH operation returns an error and sets the errno global variable to EPROTO.
write Takes the following actions on data that originated from a write subroutine:
Messages with no control portions
Passes the message on downstream.
Zero length data messages
Frees the message and does not pass downstream.
Messages with control portions
Generates an error, fails any further system calls, and sets the errno global variable to EPROTO.
read Takes the following actions on data that originated from the transport protocol provider:
Messages with no control portions
Passes the message on upstream.
Zero length data messages
Frees the message and does not pass upstream.

Messages with control portions will produce the following actions:

  • Messages that represent expedited data generate an error. All further calls associated with the stream fail with the errno global variable set to EPROTO.
  • Any data messages with control portions have the control portions removed from the message prior to passing the message to the upstream neighbor.
  • Messages that represent an orderly release indication from the transport provider generate a zero length data message, indicating the end of file, which is sent to the reader of the stream. The orderly release message itself is freed by the module.
  • Messages that represent an abortive disconnect indication from the transport provider cause all further write and putmsg calls to fail with the errno global variable set to ENXIO. All further read and getmsg calls return zero length data (indicating end of file) once all previous data has been read.
  • With the exception of the above rules, all other messages with control portions generate an error, and all further system calls associated with the stream fail with the errno global variable set to EPROTO.
pop Sends an orderly release request to the remote side of the transport connection if an orderly release indication has been previously received.