1 .\" Copyright (c) 1996-1999 Whistle Communications, Inc.
2 .\" All rights reserved.
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.
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
33 .\" Author: Archie Cobbs <archie@FreeBSD.org>
36 .\" $Whistle: ng_async.8,v 1.6 1999/01/25 23:46:25 archie Exp $
43 .Nd asynchronous framing netgraph node type
46 .In netgraph/ng_async.h
50 node type performs conversion between synchronous frames and
51 asynchronous frames, as defined for the PPP protocol in RFC 1662.
52 Asynchronous framing uses flag bytes and octet-stuffing
53 to simulate a frame oriented connection over an octet-oriented
54 asynchronous serial line.
56 The node transmits and receives asynchronous data on the
59 Mbuf boundaries of incoming data are ignored.
60 Once a complete packet has been received, it is decoded and
61 stripped of all framing bytes, and transmitted out the
63 hook as a single frame.
65 Synchronous frames are transmitted and received on the
68 Packets received on this hook are encoded as asynchronous frames
71 Received packets should start with the address and control fields,
72 or the PPP protocol field if address and control field compression
73 is employed, and contain no checksum field.
74 If the first four bytes are
75 .Dv "0xff 0x03 0xc0 0x21"
76 (an LCP protocol frame) then complete control character escaping
77 is enabled for that frame (in PPP, LCP packets are always sent with
78 no address and control field compression and all control characters
83 for packets transmitted on
85 This is an optimization where the trailing flag byte
86 of one frame is shared with the opening flag byte of the next.
87 Flag sharing between frames is disabled after one second of transmit
90 This node type supports the following hooks:
91 .Bl -tag -width foobar
93 Asynchronous connection.
94 Typically this hook would be connected to a
96 node, which handles transmission of serial data over a tty device.
98 Synchronous connection.
99 This hook sends and receives synchronous frames.
100 For PPP, these frames should contain address, control, and protocol fields,
101 but no checksum field.
102 Typically this hook would be connected to an individual link hook of a
107 This node type supports the generic control messages, plus the following:
109 .It Dv NGM_ASYNC_CMD_GET_STATS
110 This command returns a
111 .Dv "struct ng_async_stat"
112 containing node statistics for packet, octet, and error counts.
113 .It Dv NGM_ASYNC_CMD_CLR_STATS
114 Clears the node statistics.
115 .It Dv NGM_ASYNC_CMD_SET_CONFIG
116 Sets the node configuration, which is described by a
117 .Dv "struct ng_async_cfg" :
118 .Bd -literal -offset 4n
119 struct ng_async_cfg {
120 u_char enabled; /* Turn encoding on/off */
121 u_int16_t amru; /* Max receive async frame len */
122 u_int16_t smru; /* Max receive sync frame len */
123 u_int32_t accm; /* ACCM encoding */
129 field enables or disables all encoding/decoding functions (default disabled).
130 When disabled, the node operates in simple
137 fields are the asynchronous and synchronous MRU (maximum receive unit) values,
139 These both default to 1600; note that the async MRU
140 applies to the incoming frame length after asynchronous decoding.
143 field is the asynchronous character control map, which controls the escaping
144 of characters 0x00 thorough 0x1f (default 0xffffffff).
145 .It Dv NGM_ASYNC_CMD_GET_CONFIG
146 This command returns the current configuration structure.
149 This node shuts down upon receipt of a
151 control message, or when all hooks have been disconnected.
159 .%T "PPP in HDLC-link Framing"
164 .%T "The Point-to-Point Protocol (PPP)"
170 node type was implemented in
173 .An Archie Cobbs Aq archie@FreeBSD.org