HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man7/!!!intro.7
________________________________________________________________
___ ___
p
pckt(7) pckt(7)
NAME
pckt - Packet Mode module for STREAMS pty (pseudo-terminal)
SYNOPSIS
#include <sys/stropts.h>
int ioctl(fd_slave, I_PUSH, "pckt");
DESCRIPTION
The Packet Mode feature for STREAMS pty devices allows the user process on the master side of the
pty device to be informed of state changes in the pty. To enable Packet Mode in the STREAMS pty dev-
ice, the user process must push the pckt module onto the master side of the pty with a call to the
STREAMS I_PUSH ioctl(2) system call. When the pckt module is pushed onto a STREAMS pty master,
certain STREAMS messages going upstream on the master side will get packetized so they can be subse-
quently retrieved by the master side with a getmsg function.
When the user process writes data, the pckt module passes the message unchanged downstream on to
the next module or driver. When the user process reads data or when the pckt module receives certain
STREAMS message types, it constructs a packet out of the message for forwarding upstream. To construct
a message packet, the module creates an M_PROTO message. This
M_PROTO message contains the origi-
nal message type in the first data block and the original message in as many data blocks as needed. The
user process can then retrieve the
M_PROTO message with a call to the getmsg() function.
The
pckt module packetizes the following STREAMS message types:
M_DATA, M_IOCTL, M_PROTO, M_PCPROTO, M_FLUSH, M_START, M_STOP, M_STARTI, M_STOPI,
M_READ.
All other messages are passed unchanged upstream.
If the message is an M_FLUSH message, the pckt module looks at the flag and takes the following
actions:
If the flag is FLUSHW, the module changes it to FLUSHR before creating the M_PROTO
message
and passing the message upstream. This prevents the stream head’s read queue from being
flushed by the original
M_FLUSHmessage.
If the flag is FLUSHR, the module changes it to FLUSHW before creating the
M_PROTO message
and passing it upstream. To flush the write queues properly, the module also sends an
M_FLUSH
message with the FLUSHW flag set.
If the flag is FLUSHRW, the module changes it to FLUSHW before creating the
M_PROTO message
and passing it upstream. To flush the write queues properly, the module also sends an
M_FLUSH
message with the FLUSHW flag set.
AUTHOR
pckt(7) was developed by HP and OSF.
SEE ALSO
getmsg(2), ioctl(2), ptm(7), pts(7), ldterm(7), ptem(7), streamio(7).
HP-UX Release 11i: December 2000 1 Section 781
___
___