*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> ng_tty (4)              
Title
Content
Arch
Section
 

NG_TTY(4)

Contents


NAME    [Toc]    [Back]

     ng_tty -- netgraph node type that is also a line discipline

SYNOPSIS    [Toc]    [Back]

     #include <sys/ttycom.h>
     #include <netgraph/ng_message.h>
     #include <netgraph/ng_tty.h>

DESCRIPTION    [Toc]    [Back]

     The tty node type is both a netgraph node type and a line discipline.  A
     new node is created when the corresponding line discipline, NETGRAPHDISC,
     is registered on a tty device (see tty(4)).

     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 line discipline is installed on a
     tty, the normal read and write operations are unavailable, returning EIO.

     The node supports an optional ``hot character''.  If set to non-zero,
     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
     introduces 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 transmission of data.

     The node will attempt to give itself the same netgraph name as the name
     of the tty device.  In any case, information about the node is available
     via the netgraph ioctl(2) command NGIOCGINFO.  This command returns a
     struct nodeinfo similar to the NGM_NODEINFO netgraph control message.

HOOKS    [Toc]    [Back]

     This node type supports the following hooks:

     hook    tty(4) serial data contained in mbuf structures, with arbitrary
	     inter-frame boundaries.

CONTROL MESSAGES    [Toc]    [Back]

     This 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 forwarded immediately.

     NGM_TTY_GET_HOTCHAR
	  Returns an integer containing the current hot character in the lower
	  eight bits.

SHUTDOWN    [Toc]    [Back]

     This node shuts down when the corresponding device is closed (or the line
     discipline is uninstalled on the device).	The NGM_SHUTDOWN control message
 is not valid, and always returns the error EOPNOTSUPP.

BUGS    [Toc]    [Back]

     The 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.

SEE ALSO    [Toc]    [Back]

      
      
     ioctl(2), netgraph(4), ng_async(4), tty(4), ngctl(8)

HISTORY    [Toc]    [Back]

     The ng_tty node type was implemented in FreeBSD 4.0.

AUTHORS    [Toc]    [Back]

     Archie Cobbs <[email protected]>


FreeBSD 5.2.1		       January 19, 1999 		 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
ng_h4 FreeBSD Netgraph node type that is also an H4 line discipline
ng_atm FreeBSD netgraph ATM node type
ng_UI FreeBSD UI netgraph node type
ng_uni FreeBSD netgraph UNI node type
ng_hole FreeBSD netgraph discard node type
ng_rfc1490 FreeBSD RFC 1490 netgraph node type
ng_ppp FreeBSD PPP protocol netgraph node type
ng_ether FreeBSD Ethernet netgraph node type
ng_sscop FreeBSD netgraph SSCOP node type
ng_ip_input FreeBSD netgraph IP input node type
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service