Manual pages › Character sets, environment, package files (5)
layers(5)
protocol used between host and windowing terminal under layers(1)
From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.
Also by this name: layers(1), General commands
NAME
layers - protocol used between host and windowing terminal under layers(1)
DESCRIPTION
Layers are asynchronous windows supported by the operating system in a windowing terminal. Communication between the UNIX System processes and terminal processes under the layers command [see layers(1)] occurs via multiplexed channels managed by the respective operating systems using a protocol as specified in xtproto(5).
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 are 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 JTIMOM and JAGENT information, which takes the form
command, data ...
The commands are the bottom eight bits extracted from the following ioctl(2) 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.
JTIMOM Set the timeout parameters for the protocol. The data consist 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(5)] and consist 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(3X) 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 (e.g., 8;7;3).
JXTPROTO Set xt protocol type [see xtproto(5)]. The data consist of one byte specifying maximum size for the data part of regular xt packets sent from the host to the terminal. This number may be lower than the number returned by A_XTPROTO at lower baud rates or if the -m option was specified upon invocation of layers(1). A size of 1 specifies network xt protocol.
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 are no data for this command.
C_DELETE Delete the UNIX System process group attached to this layer. There are no data for this command.
C_EXIT Exit. Kill all UNIX System process groups associated with this terminal and terminate the session. There are 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 are 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 take the same form as for the C_NEW command. A SIGWINCH signal is also sent to the process in the window, so that the process knows that the window has been reshaped and it can get the new window parameters.
C_NOFLOW Disable network xt flow control [see xtproto(5)].
C_YESFLOW Enable network xt flow control [see xtproto(5)].
FILES
/usr/include/windows.h /usr/include/sys/jioctl.h
SEE ALSO
layers(1), libwindows(3X), jagent(5), xtproto(5). xt(7) in the Programmer's Guide: STREAMS.