layers(M)


layers -- protocol used between host and windowing terminal under layers(C)

Syntax

#include <sys/jioctl.h>

Description

layers are asynchronous windows supported by the operating system in a windowing terminal. Communication between the UNIX system processes and terminal processes under layers(C) occurs via multiplexed channels managed by the respective operating systems using a protocol as specified in xtproto(M).

To use layers, you must have configured the xt driver. This is done using the mkdev layers script. For more information, see mkdev(ADM).

The contents of packets transferring data between a UNIX system process and a layer are asymmetric. Data sent from the UNIX system to a particular terminal process is undifferentiated and it is up to the terminal process to interpret the contents of packets.

Control information for terminal processes is sent via channel 0. Process 0 in the windowing terminal performs the designated functions on behalf of the process connected to the designated channel. These packets take the form:

command, channel

except for timeout and jagent information which take the form:

command, data...

The commands are the bottom eight bits extracted from the following ioctl(S) codes:


JBOOT
Prepare to load a new terminal program into the designated layer.

JTERM
Kill the downloaded layer program and restore the default window program.

JTIMO
Set the timeout parameters for the protocol. The data consists of two bytes: the value of the receive timeout in seconds and the value of the transmit timeout in seconds.

JTIMOM
Set the timeout parameters for the protocol. The data consists of four bytes in two groups: the value of the receive timeout in milliseconds (the low eight bits followed by the high eight bits) and the value of the transmit timeout (in the same format).

JZOMBOOT
Like JBOOT, but do not execute the program after loading.

JAGENT
Send a source byte string to the terminal agent routine and wait for a reply byte string to be returned.

The data are from a bagent structure (see jagent(M)) and consists of a one-byte size field followed by a two-byte agent command code and parameters. Two-byte integers transmitted as part of an agent command are sent with the high-order byte first. The response from the terminal is generally identical to the command packet, with the two command bytes replaced by the return code: 0 for success, -1 for failure. Note that the routines in the libwindows(S) library all send parameters in an agentrect structure. The agent command codes and their parameters are as follows:


A_NEWLAYER
followed by a two-byte channel number and a rectangle structure (four two-byte coordinates).

A_CURRENT
followed by a two-byte channel number.

A_DELETE
followed by a two-byte channel number.

A_TOP
followed by a two-byte channel number.

A_BOTTOM
followed by a two-byte channel number.

A_MOVE
followed by a two-byte channel number and a point to move to (two two-byte coordinates).

A_RESHAPE
followed by a two-byte channel number and the new rectangle (four two-byte coordinates).

A_NEW
followed by a two-byte channel number and a rectangle structure (four two-byte coordinates).

A_EXIT
no parameters needed.

A_ROMVERSION
no parameters needed. The response packet contains the size byte, two-byte return code, two unused bytes, and the parameter part of the terminal id string (for example, ``8;7;3'').

Packets from the windowing terminal to the UNIX system all take the following form:

command, data. . .

The single-byte commands are as follows:


C_SENDCHAR
Send the next byte to the UNIX system process.

C_NEW
Create a new UNIX system process group for this layer. Remember the window size parameters for this layer. The data for this command is in the form described by the jwinsize structure. The size of the window is specified by two 2-byte integers, sent low byte first.

C_UNBLK
Unblock transmission to this layer. There is no data for this command.

C_DELETE
Delete the UNIX system process group attached to this layer. There is no data for this command.

C_EXIT
Exit. Kill all UNIX system process groups associated with this terminal and terminate the session. There is no data for this command.

C_DEFUNCT
Layer program has died: send a terminate signal to the UNIX system process groups associated with this terminal. There is no data for this command.

C_SENDNCHARS
The rest of the data are characters to be passed to the UNIX system process.

C_RESHAPE
The layer has been reshaped. Change the window size parameters for this layer. The data takes the same form as for the C_NEW command.

See also

jagent(M), layers(C), libwindows(S), mkdev(ADM), xt(HW), xtproto(M)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005