summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/ng_vlan.4 3.html
blob: df328b81c2285a0879d3920bf7eb9e5c641e0993 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<table class="head">
  <tr>
    <td class="head-ltitle">NG_VLAN(4)</td>
    <td class="head-vol">Device Drivers Manual</td>
    <td class="head-rtitle">NG_VLAN(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">ng_vlan</code> &#x2014; <span class="Nd">IEEE
    802.1Q VLAN tagging netgraph node type</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
    &lt;<a class="In">sys/types.h</a>&gt;</code>
  <br/>
  <code class="In">#include &lt;<a class="In">netgraph.h</a>&gt;</code>
  <br/>
  <code class="In">#include
  &lt;<a class="In">netgraph/ng_vlan.h</a>&gt;</code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">vlan</code> node type multiplexes frames
    tagged according to the IEEE 802.1Q standard between different hooks.</p>
<p class="Pp">Each node has two special hooks, <var class="Va">downstream</var>
    and <var class="Va">nomatch</var>, and an arbitrary number of
    &#x201C;vlan&#x201D; hooks, each associated with a particular VLAN tag.</p>
<p class="Pp">An <code class="Dv">ETHERTYPE_VLAN</code> frame received on the
    <var class="Va">downstream</var> hook with a tag that the node has been
    configured to filter is sent out the corresponding &#x201C;vlan&#x201D;
    hook. If it does not match any of the configured tags, or is not of a type
    <code class="Dv">ETHERTYPE_VLAN</code>, it is sent out the
    <var class="Va">nomatch</var> hook. If the <var class="Va">nomatch</var>
    hook is not connected, the packet is dropped.</p>
<p class="Pp">An Ethernet frame received on the <var class="Va">nomatch</var>
    hook is passed unmodified to the <var class="Va">downstream</var> hook.</p>
<p class="Pp">An Ethernet frame received on any of the &#x201C;vlan&#x201D;
    hooks is tagged accordingly and sent out the
    <var class="Va">downstream</var> hook.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HOOKS"><a class="permalink" href="#HOOKS">HOOKS</a></h1>
<p class="Pp">This node type supports the following hooks:</p>
<dl class="Bl-tag">
  <dt id="downstream"><var class="Va">downstream</var></dt>
  <dd>Typically this hook would be connected to a <a class="Xr">ng_ether(4)</a>
      node, using the <var class="Va">lower</var> hook.</dd>
  <dt id="nomatch"><var class="Va">nomatch</var></dt>
  <dd>Typically this hook would also be connected to an
      <a class="Xr">ng_ether(4)</a> type node using the
      <var class="Va">upper</var> hook.</dd>
  <dt id="any">&#x27E8;<a class="permalink" href="#any"><i class="Em">any valid
    name</i></a>&#x27E9;</dt>
  <dd>Any other hook name will be accepted and should later be associated with a
      particular tag. Typically this hook would be attached to an
      <a class="Xr">ng_eiface(4)</a> type node using the
      <var class="Va">ether</var> hook.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="CONTROL_MESSAGES"><a class="permalink" href="#CONTROL_MESSAGES">CONTROL
  MESSAGES</a></h1>
<p class="Pp">This node type supports the generic control messages, plus the
    following:</p>
<dl class="Bl-tag">
  <dt id="NGM_VLAN_ADD_FILTER"><a class="permalink" href="#NGM_VLAN_ADD_FILTER"><code class="Dv">NGM_VLAN_ADD_FILTER</code></a>
    (<code class="Ic">addfilter</code>)</dt>
  <dd>Associates a hook with the tag.</dd>
  <dt id="NGM_VLAN_DEL_FILTER"><a class="permalink" href="#NGM_VLAN_DEL_FILTER"><code class="Dv">NGM_VLAN_DEL_FILTER</code></a>
    (<code class="Ic">delfilter</code>)</dt>
  <dd>Disassociates a hook from the tag.</dd>
  <dt id="NGM_VLAN_GET_TABLE"><a class="permalink" href="#NGM_VLAN_GET_TABLE"><code class="Dv">NGM_VLAN_GET_TABLE</code></a>
    (<code class="Ic">gettable</code>)</dt>
  <dd>Returns a table of all hook/tag associations.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<div class="Bd Li">
<pre>#!/bin/sh

ETHER_IF=rl0

ngctl -f- &lt;&lt;EOF
shutdown ${ETHER_IF}:
mkpeer ${ETHER_IF}: vlan lower downstream
name ${ETHER_IF}:lower vlan
connect ${ETHER_IF}: vlan: upper nomatch
EOF

ngctl mkpeer vlan: eiface vlan123 ether
ngctl msg vlan: addfilter '{ vlan=123 hook=&quot;vlan123&quot; }'</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SHUTDOWN"><a class="permalink" href="#SHUTDOWN">SHUTDOWN</a></h1>
<p class="Pp">This node shuts down upon receipt of a
    <code class="Dv">NGM_SHUTDOWN</code> control message, or when all hooks have
    been disconnected.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">netgraph(4)</a>, <a class="Xr">ng_eiface(4)</a>,
    <a class="Xr">ng_ether(4)</a>, <a class="Xr">ngctl(8)</a>,
    <a class="Xr">nghook(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">ng_vlan</code> node type appeared in
    <span class="Ux">FreeBSD 4.10</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp"><span class="An">Ruslan Ermilov</span>
    &lt;<a class="Mt" href="mailto:ru@FreeBSD.org">ru@FreeBSD.org</a>&gt;</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">March 1, 2004</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>