NG_TTY(4FREEBSD) - Linux man page online | Special files
Netgraph node type that is also a TTY hook.
December 25, 2008
NG_TTY(4) BSD Kernel Interfaces Manual NG_TTY(4)
BSD December 25, 2008 BSD
NAMEng_tty — netgraph node type that is also a TTY hook
SYNOPSIS#include <sys/types.h> #include <sys/ttycom.h> #include <netgraph/ng_tty.h>
DESCRIPTIONThe tty node type is both a netgraph node type and a TTY hook. The node has a single hook called hook. Incoming bytes received on the tty device are sent out on this hook, and frames received on hook are transmitted out on the tty device. No modification to the data is performed in either direction. While the hook is installed on a tty, the normal read and write operations are unavailable, returning EIO. Incoming data is delivered directly to ng_tty via the tty bypass hook as a buffer pointer and length, this is converted to a mbuf and passed to the peer. The node supports an optional “hot character”. If the driver can not deliver data directly to the tty bypass hook then each character is input one at a time. If set to non-zero and bypass mode is unavailable, incoming data from the tty device is queued until this character is seen. This avoids sending lots of mbufs containing a small number of bytes, but intro‐ duces potentially infinite latency. The default hot character is 0x7e, consistent with hook being connected to a ng_async(4) type node. The hot character has no effect on the trans‐ mission of data.
HOOKSThis node type supports the following hooks: hook tty(4) serial data contained in mbuf structures, with arbitrary inter-frame bound‐ aries.
CONTROL MESSAGESThis node type supports the generic control messages, plus the following: NGM_TTY_SET_HOTCHAR This command takes an integer argument and sets the hot character from the lower 8 bits. A hot character of zero disables queueing, so that all received data is for‐ warded immediately. NGM_TTY_GET_HOTCHAR Returns an integer containing the current hot character in the lower eight bits. NGM_TTY_SET_TTY This command takes integer process ID and file descriptor of open tty and registers the tty hooks.
SHUTDOWNThis node shuts down when the corresponding device is closed.
SEE ALSOioctl(2), netgraph(4), ng_async(4), tty(4), ngctl(8)
HISTORYThe ng_tty node type was implemented in FreeBSD 4.0.
AUTHORSArchie Cobbs <@FreeBSD.org> Andrew Thompson <@FreeBSD.org>
BUGSThe serial driver code also has a notion of a “hot character”. Unfortunately, this value is statically defined in terms of the line discipline and cannot be changed. Therefore, if a hot character other than 0x7e (the default) is set for the ng_tty node, the node has no way to convey this information to the serial driver, and sub-optimal performance may result.
|This manual||Reference||Other manuals|
|ng_tty(4freebsd)||referred by||netgraph(4freebsd) | ng_async(4freebsd) | tty(4freebsd)|
|refer to||ioctl(2) | netgraph(4freebsd) | ng_async(4freebsd) | tty(4)|