'\"macro stdmacro
.if n .pH g7.pckt @(#)pckt	40.7 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} pckt 7 "" "\&"
.if \nX=1 .ds x} pckt 7 ""
.if \nX=2 .ds x} pckt 7 "" "\&"
.if \nX=3 .ds x} pckt "" "" "\&"
.TH \*(x}
.SH NAME
\f4pckt\f1 \- \s-1STREAMS\s0 Packet Mode module
.SH DESCRIPTION
\f4pckt\f1 is a \s-1STREAMS\s0 module that may be used with a pseudo terminal to
packetize certain messages.
The \f4pckt\f1 module should be pushed [see \f4I_PUSH, streamio\fP(7)] onto
the master side of a pseudo terminal.
.PP
Packetizing is performed by prefixing a message with an \f4M_PROTO\fP
message.
The original message type is stored in the 4 byte data portion
of the \f4M_PROTO\fP message.
.PP
On the read-side, only the
\f4M_PROTO, M_PCPROTO, M_STOP, M_START, M_STOPI, M_STARTI, M_IOCTL, M_DATA,
M_FLUSH\fP, and \f4M_READ\fP messages are packetized.
All other message types are passed upstream unmodified.
.PP
Since all unread state information is held in the master's stream
head read queue, flushing of this queue is disabled.
.PP
On the write-side, all messages are sent down unmodified.
.PP
With this module in place, all reads from the master side of
the pseudo terminal should be performed with the \f4getmsg\f1(2)
or \f4getpmsg\f1() system call.
The control part of the message contains the message type.
The data part contains the actual data associated with that message type.
The onus is on the application to separate the data into its
component parts.
.SH SEE ALSO
.nf
\f4crash\fP(1M), \f4getmsg\fP(2), \f4ioctl\fP(2), 
\f4ldterm\fP(7), \f4ptem\fP(7), \f4streamio\fP(7), \f4termio\fP(7). 
.br
\f2Programmer's Guide: \s-1STREAMS\s0\f1.
