xref: /freebsd/share/man/man4/ng_async.4 (revision 4cf49a43559ed9fdad601bdcccd2c55963008675)
1.\" Copyright (c) 1996-1999 Whistle Communications, Inc.
2.\" All rights reserved.
3.\"
4.\" Subject to the following obligations and disclaimer of warranty, use and
5.\" redistribution of this software, in source or object code forms, with or
6.\" without modifications are expressly permitted by Whistle Communications;
7.\" provided, however, that:
8.\" 1. Any and all reproductions of the source or object code must include the
9.\"    copyright notice above and the following disclaimer of warranties; and
10.\" 2. No rights are granted, in any manner or form, to use Whistle
11.\"    Communications, Inc. trademarks, including the mark "WHISTLE
12.\"    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
13.\"    such appears in the above copyright notice or in the software.
14.\"
15.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
16.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
17.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
18.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
19.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
20.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
21.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
22.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
23.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
24.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
25.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
27.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
31.\" OF SUCH DAMAGE.
32.\"
33.\" Author: Archie Cobbs <archie@whistle.com>
34.\"
35.\" $FreeBSD$
36.\" $Whistle: ng_async.8,v 1.6 1999/01/25 23:46:25 archie Exp $
37.\"
38.Dd January 19, 1999
39.Dt NG_ASYNC 8
40.Os FreeBSD 3
41.Sh NAME
42.Nm ng_async
43.Nd asynchronous framing netgraph node type
44.Sh SYNOPSIS
45.Fd #include <netgraph/ng_async.h>
46.Sh DESCRIPTION
47The
48.Nm async
49node type performs conversion between synchronous frames and
50asynchronous frames, as defined for the PPP protocol in RFC 1662.
51Asynchronous framing uses flag bytes and octet-stuffing
52to simulate a frame oriented connection over an octet-oriented
53asynchronous line.
54.Pp
55The node trasmits and receives asynchronous data on the
56.Dv async
57hook.  Incoming data mbuf boundaries are ignored, while
58outgoing data is sent as a complete frame at a time.
59.Pp
60There are two synchronous hooks,
61.Dv sync
62and
63.Dv sync2 .
64For both hooks, received packets are encoded as asynchronous frames
65and sent out on
66.Dv async .
67Hook
68.Dv sync2
69differs from
70.Dv sync
71only in that any configured address and control field compression
72and/or control character escaping is disabled when the frame is encoded.
73This is useful for transmitting PPP LCP packets, which are always sent
74this way.
75.Pp
76This node supports ``flag sharing'' for packets transmitted on
77.Dv async .
78This is an optimization where the trailing flag byte
79of one frame is shared with the opening flag byte of the next.
80Flag sharing between frames is disabled after one second of transmit
81idle time.
82.Sh HOOKS
83This node type supports the following hooks:
84.Pp
85.Bl -tag -width foobar
86.It Dv async
87Asynchronous connection.
88Typically this hook would be connected to a
89.Xr ng_tty 8
90node, which handles transmission of serial data over a tty device.
91.It Dv sync
92Synchronous connection. This hook sends and receives synchronous frames.
93For PPP, these frames contain no address, control, or checksum fields;
94each frame begins with the PPP protocol number. Typically this hook would
95be connected to the
96.Dv downstream
97hook of a
98.Xr ng_ppp 8
99type node.
100.El
101.Sh CONTROL MESSAGES
102This node type supports the generic control messages, plus the following:
103.Bl -tag -width foo
104.It Dv NGM_ASYNC_CMD_GET_STATS
105This command returns a
106.Dv "struct ng_async_stat"
107containing node statistics for packet, octet, and error counts.
108.It Dv NGM_ASYNC_CMD_CLR_STATS
109Clears the node statistics.
110.It Dv NGM_ASYNC_CMD_SET_CONFIG
111Sets the node configuration, which is described by a
112.Dv "struct ng_async_cfg" :
113.Bd -literal -offset 4n
114struct ng_async_cfg {
115  u_char    enabled;  /* Turn encoding on/off */
116  u_char    acfcomp;  /* Address/control field comp. */
117  u_int16_t amru;     /* Max receive async frame len */
118  u_int16_t smru;     /* Max receive sync frame len */
119  u_int32_t accm;     /* ACCM encoding */
120};
121.Ed
122.Pp
123The
124.Dv enabled
125field enables or disables all encoding/decoding functions (default disabled).
126When disabled, the node operates in simple ``pass through'' mode.  Setting
127.Dv acfcomp
128enables address and control field compression on transmission (for packets
129received on the
130.Dv sync
131hook only; default off).
132.Dv amru
133and
134.Dv smru
135are the asynchronous and synchronous MRU (maximum receive unit) values,
136respectively. These both default to 1600; note that the async MRU
137applies to the incoming frame length after asynchronous decoding.
138Finally,
139.Dv accm
140is the asynchronous character control map, which controls the escaping
141of characters 0x00 thorough 0x1f (default 0xffffffff).
142.It Dv NGM_ASYNC_CMD_GET_CONFIG
143This command returns the current configuration structure.
144.El
145.Sh SHUTDOWN
146This node shuts down upon receipt of a
147.Dv NGM_SHUTDOWN
148control message, or when all hooks have been disconnected.
149.Sh SEE ALSO
150.Xr netgraph 4 ,
151.Xr ng_ppp 8 ,
152.Xr ng_tty 8 ,
153.Xr ngctl 8 .
154.Rs
155.%A W. Simpson
156.%T "PPP in HDLC-link Framing"
157.%O RFC 1662
158.Re
159.Sh AUTHOR
160Archie Cobbs <archie@whistle.com>
161