xref: /freebsd/share/man/man4/ng_tee.4 (revision 315ee00f)
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@FreeBSD.org>
34.\" $Whistle: ng_tee.8,v 1.4 1999/01/25 23:46:27 archie Exp $
35.\"
36.Dd May 28, 2004
37.Dt NG_TEE 4
38.Os
39.Sh NAME
40.Nm ng_tee
41.Nd netgraph ``tee'' node type
42.Sh SYNOPSIS
43.In sys/types.h
44.In netgraph/ng_tee.h
45.Sh DESCRIPTION
46The
47.Nm tee
48node type has a purpose similar to the
49.Xr tee 1
50command.
51.Nm Tee
52nodes are useful for debugging or
53.Dq snooping
54on a connection
55between two netgraph nodes.
56.Nm Tee
57nodes have four hooks,
58.Dv right ,
59.Dv left ,
60.Dv right2left ,
61and
62.Dv left2right .
63All data received on
64.Dv right
65is sent unmodified to
66.Em both
67hooks
68.Dv left
69and
70.Dv right2left .
71Similarly, all data received on
72.Dv left
73is sent unmodified to both
74.Dv right
75and
76.Dv left2right .
77.Pp
78Packets may also be received on
79.Dv right2left
80and
81.Dv left2right ;
82if so, they are forwarded unchanged out hooks
83.Dv right
84and
85.Dv left ,
86respectively.
87.Sh HOOKS
88This node type supports the following hooks:
89.Bl -tag -width ".Va left2right"
90.It Va right
91The connection to the node on the right.
92.It Va left
93The connection to the node on the left.
94.It Va right2left
95Tap for right to left traffic.
96.It Va left2right
97Tap for left to right traffic.
98.El
99.Sh CONTROL MESSAGES
100This node type supports the generic control messages, plus the following.
101.Bl -tag -width foo
102.It Dv NGM_TEE_GET_STATS Pq Ic getstats
103Get statistics, returned as a
104.Dv "struct ng_tee_stats" .
105.It Dv NGM_TEE_CLR_STATS Pq Ic clrstats
106Clear statistics.
107.El
108.Sh SHUTDOWN
109This node shuts down upon receipt of an
110.Dv NGM_SHUTDOWN
111control message, or when all hooks have been disconnected.
112If both
113.Dv right
114and
115.Dv left
116hooks are present, node removes itself from the chain gently,
117connecting
118.Dv right
119and
120.Dv left
121together.
122.Sh SEE ALSO
123.Xr tee 1 ,
124.Xr netgraph 4 ,
125.Xr ngctl 8
126.Sh HISTORY
127The
128.Nm
129node type was implemented in
130.Fx 4.0 .
131.Sh AUTHORS
132.An Julian Elischer Aq Mt julian@FreeBSD.org
133