]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man4/ng_vlan.4
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man4 / ng_vlan.4
1 .\" Copyright (c) 2003 Ruslan Ermilov
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd March 1, 2004
28 .Dt NG_VLAN 4
29 .Os
30 .Sh NAME
31 .Nm ng_vlan
32 .Nd IEEE 802.1Q VLAN tagging netgraph node type
33 .Sh SYNOPSIS
34 .In sys/types.h
35 .In netgraph.h
36 .In netgraph/ng_vlan.h
37 .Sh DESCRIPTION
38 The
39 .Nm vlan
40 node type multiplexes frames tagged according to
41 the IEEE 802.1Q standard between different hooks.
42 .Pp
43 Each node has two special hooks,
44 .Va downstream
45 and
46 .Va nomatch ,
47 and an arbitrary number of
48 .Dq vlan
49 hooks, each associated with a particular VLAN tag.
50 .Pp
51 An
52 .Dv ETHERTYPE_VLAN
53 frame received on the
54 .Va downstream
55 hook with a tag that the node has been configured to filter
56 is sent out the corresponding
57 .Dq vlan
58 hook.
59 If it does not match any of the configured tags, or is not of a type
60 .Dv ETHERTYPE_VLAN ,
61 it is sent out the
62 .Va nomatch
63 hook.
64 If the
65 .Va nomatch
66 hook is not connected, the packet is dropped.
67 .Pp
68 An Ethernet frame received on the
69 .Va nomatch
70 hook is passed unmodified to the
71 .Va downstream
72 hook.
73 .Pp
74 An Ethernet frame received on any of the
75 .Dq vlan
76 hooks is tagged accordingly and sent out the
77 .Va downstream
78 hook.
79 .Sh HOOKS
80 This node type supports the following hooks:
81 .Bl -tag -width "Aq Em any valid name"
82 .It Va downstream
83 Typically this hook would be connected to a
84 .Xr ng_ether 4
85 node, using the
86 .Va lower
87 hook.
88 .It Va nomatch
89 Typically this hook would also be connected to an
90 .Xr ng_ether 4
91 type node using the
92 .Va upper
93 hook.
94 .It Aq Em "any valid name"
95 Any other hook name will be accepted and should later be associated with
96 a particular tag.
97 Typically this hook would be attached to an
98 .Xr ng_eiface 4
99 type node using the
100 .Va ether
101 hook.
102 .El
103 .Sh CONTROL MESSAGES
104 This node type supports the generic control messages, plus the following:
105 .Bl -tag -width foo
106 .It Dv NGM_VLAN_ADD_FILTER Pq Ic addfilter
107 Associates a hook with the tag.
108 .It Dv NGM_VLAN_DEL_FILTER Pq Ic delfilter
109 Disassociates a hook from the tag.
110 .It Dv NGM_VLAN_GET_TABLE Pq Ic gettable
111 Returns a table of all hook/tag associations.
112 .El
113 .Sh EXAMPLES
114 .Bd -literal
115 #!/bin/sh
116
117 ETHER_IF=rl0
118
119 ngctl -f- <<EOF
120 shutdown ${ETHER_IF}:
121 mkpeer ${ETHER_IF}: vlan lower downstream
122 name ${ETHER_IF}:lower vlan
123 connect ${ETHER_IF}: vlan: upper nomatch
124 EOF
125
126 ngctl mkpeer vlan: eiface vlan123 ether
127 ngctl msg vlan: addfilter '{ vlan=123 hook="vlan123" }'
128 .Ed
129 .Sh SHUTDOWN
130 This node shuts down upon receipt of a
131 .Dv NGM_SHUTDOWN
132 control message, or when all hooks have been disconnected.
133 .Sh SEE ALSO
134 .Xr netgraph 4 ,
135 .Xr ng_eiface 4 ,
136 .Xr ng_ether 4 ,
137 .Xr ngctl 8 ,
138 .Xr nghook 8
139 .Sh HISTORY
140 The
141 .Nm
142 node type appeared in
143 .Fx 4.10 .
144 .Sh AUTHORS
145 .An Ruslan Ermilov Aq ru@FreeBSD.org