]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man4/ng_pred1.4
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man4 / ng_pred1.4
1 .\"
2 .\" Copyright (c) 2006, Alexander Motin <mav@alkar.net>
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice unmodified, this list of conditions, and the following
10 .\"    disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD$
28 .\"
29 .Dd December 24, 2006
30 .Dt NG_PRED1 4
31 .Os
32 .Sh NAME
33 .Nm ng_pred1
34 .Nd Predictor-1 PPP compression (RFC 1978) netgraph node type
35 .Sh SYNOPSIS
36 .In sys/types.h
37 .In netgraph/ng_pred1.h
38 .Sh DESCRIPTION
39 The
40 .Nm pred1
41 node type implements the Predictor-1 sub-protocols of the Compression Control
42 Protocol (CCP).
43 .Pp
44 The node has two hooks,
45 .Va comp
46 for compression and
47 .Va decomp
48 for decompression.
49 Only one of them can be connected at the same time, specifying node's
50 operation mode.
51 Typically that hooks would be connected to the
52 .Xr ng_ppp 4
53 node type hook of the same name.
54 .Sh HOOKS
55 This node type supports the following hooks:
56 .Pp
57 .Bl -tag -compact -width ".Va decomp"
58 .It Va comp
59 Connection to
60 .Xr ng_ppp 4
61 .Va compress
62 hook.
63 Incoming frames are compressed and sent back out the same hook.
64 .It Va decomp
65 Connection to
66 .Xr ng_ppp 4
67 .Va decompress
68 hook.
69 Incoming frames are decompressed and sent back out the same hook.
70 .El
71 .Pp
72 Only one hook can be connected at the same time,
73 specifying node's operation mode.
74 .Sh CONTROL MESSAGES
75 This node type supports the generic control messages, plus the following:
76 .Bl -tag -width foo
77 .It Dv NGM_PRED1_CONFIG Pq Ic config
78 This command resets and configures the node for a session
79 (i.e., for compression or decompression).
80 This command takes a
81 .Vt "struct ng_pred1_config"
82 as an argument:
83 .Bd -literal -offset 0n
84 struct ng_pred1_config {
85         u_char          enable;                 /* node enabled */
86 };
87 .Ed
88 The
89 .Ft enable
90 field enables traffic flow through the node.
91 .It Dv NGM_PRED1_RESETREQ Pq Ic resetreq
92 This message contains no arguments, and is bi-directional.
93 If an error is detected during decompression, this message is sent by the
94 node to the originator of the
95 .Dv NGM_PRED1_CONFIG
96 message that initiated the session.
97 The receiver should respond by sending a PPP CCP Reset-Request to the peer.
98 .Pp
99 This message may also be received by this node type when a CCP Reset-Request
100 or Reset-Ack is received by the local PPP entity.
101 The node will respond by flushing its compression state so the sides
102 can resynchronize.
103 .It Dv NGM_PRED1_GET_STATS Pq Ic getstats
104 This control message obtains statistics for a given hook.
105 The statistics are returned in
106 .Vt "struct ng_pred1_stats" :
107 .Bd -literal
108 struct ng_pred1_stats {
109         uint64_t        FramesPlain;
110         uint64_t        FramesComp;
111         uint64_t        FramesUncomp;
112         uint64_t        InOctets;
113         uint64_t        OutOctets;
114         uint64_t        Errors;
115 };
116 .Ed
117 .It Dv NGM_PRED1_CLR_STATS Pq Ic clrstats
118 This control message clears statistics for a given hook.
119 .It Dv NGM_PRED1_GETCLR_STATS Pq Ic getclrstats
120 This control message obtains and clears statistics for a given hook.
121 .El
122 .Sh SHUTDOWN
123 This node shuts down upon receipt of a
124 .Dv NGM_SHUTDOWN
125 control message, or when hook have been disconnected.
126 .Sh SEE ALSO
127 .Xr netgraph 4 ,
128 .Xr ng_ppp 4 ,
129 .Xr ngctl 8
130 .Rs
131 .%A D. Rand
132 .%T "PPP Predictor Compression Protocol"
133 .%O RFC 1978
134 .Re
135 .Rs
136 .%A W. Simpson
137 .%T "The Point-to-Point Protocol (PPP)"
138 .%O RFC 1661
139 .Re
140 .Sh AUTHORS
141 .An Alexander Motin Aq mav@alkar.net
142 .Sh BUGS
143 Due to nature of netgraph PPP implementation there are possible race conditions
144 between data packet and ResetAck CCP packet in case of packet loss. As result,
145 packet loss can produce bigger performance degradation than supposed by protocol.