summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/ng_ether.4 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man4/ng_ether.4 3.html')
-rw-r--r--static/freebsd/man4/ng_ether.4 3.html193
1 files changed, 193 insertions, 0 deletions
diff --git a/static/freebsd/man4/ng_ether.4 3.html b/static/freebsd/man4/ng_ether.4 3.html
new file mode 100644
index 00000000..a5e1ec66
--- /dev/null
+++ b/static/freebsd/man4/ng_ether.4 3.html
@@ -0,0 +1,193 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">NG_ETHER(4)</td>
+ <td class="head-vol">Device Drivers Manual</td>
+ <td class="head-rtitle">NG_ETHER(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_ether</code> &#x2014;
+ <span class="Nd">Ethernet 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">netgraph/ng_ether.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">ether</code> netgraph node type allows
+ Ethernet interfaces to interact with the <a class="Xr">netgraph(4)</a>
+ networking subsystem. Once the <code class="Nm">ng_ether</code> module is
+ loaded into the kernel, a node is automatically created for each Ethernet
+ interface in the system. Each node will attempt to name itself with the same
+ name as the associated interface.</p>
+<p class="Pp">Three hooks are supported: <var class="Va">lower</var>,
+ <var class="Va">upper</var>, and <var class="Va">orphans</var>. The hook
+ name <var class="Va">divert</var> may be used as an alias for
+ <var class="Va">lower</var>, and is provided for backward compatibility. In
+ reality, the two names represent the same hook.</p>
+<p class="Pp">The <var class="Va">lower</var> hook is a connection to the raw
+ Ethernet device. When connected, all incoming packets are forwarded to this
+ hook, instead of being passed to the kernel for upper layer processing.
+ Writing to this hook results in a raw Ethernet frame being transmitted by
+ the device. Normal outgoing packets are not affected by
+ <var class="Va">lower</var> being connected.</p>
+<p class="Pp">The <var class="Va">upper</var> hook is a connection to the upper
+ protocol layers. When connected, all outgoing packets are forwarded to this
+ hook, instead of being transmitted by the device. Writing to this hook
+ results in a raw Ethernet frame being received by the kernel just as if it
+ had come in over the wire. Normal incoming packets are not affected by
+ <var class="Va">upper</var> being connected.</p>
+<p class="Pp">The <var class="Va">orphans</var> hook is equivalent to
+ <var class="Va">lower</var>, except that only unrecognized packets (that
+ would otherwise be discarded) are written to the hook, while other normal
+ incoming traffic is unaffected. Unrecognized packets written to
+ <var class="Va">upper</var> will be forwarded back out to
+ <var class="Va">orphans</var> if connected.</p>
+<p class="Pp">In all cases, frames are raw Ethernet frames with the standard 14
+ byte Ethernet header (but no checksum).</p>
+<p class="Pp">When no hooks are connected, <var class="Va">upper</var> and
+ <var class="Va">lower</var> are in effect connected together, so that
+ packets flow normally upwards and downwards.</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="lower"><var class="Va">lower</var></dt>
+ <dd>Connection to the lower device link layer.</dd>
+ <dt id="upper"><var class="Va">upper</var></dt>
+ <dd>Connection to the upper protocol layers.</dd>
+ <dt id="orphans"><var class="Va">orphans</var></dt>
+ <dd>Like <var class="Va">lower</var>, but only receives unrecognized
+ packets.</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_ETHER_GET_IFNAME"><a class="permalink" href="#NGM_ETHER_GET_IFNAME"><code class="Dv">NGM_ETHER_GET_IFNAME</code></a>
+ (<code class="Ic">getifname</code>)</dt>
+ <dd>Returns the name of the associated interface as a
+ <code class="Dv">NUL</code>-terminated ASCII string. Normally this is the
+ same as the name of the node.</dd>
+ <dt id="NGM_ETHER_GET_IFINDEX"><a class="permalink" href="#NGM_ETHER_GET_IFINDEX"><code class="Dv">NGM_ETHER_GET_IFINDEX</code></a>
+ (<code class="Ic">getifindex</code>)</dt>
+ <dd>Returns the global index of the associated interface as a 32 bit
+ integer.</dd>
+ <dt id="NGM_ETHER_GET_ENADDR"><a class="permalink" href="#NGM_ETHER_GET_ENADDR"><code class="Dv">NGM_ETHER_GET_ENADDR</code></a>
+ (<code class="Ic">getenaddr</code>)</dt>
+ <dd>Returns the device's unique six byte Ethernet address.</dd>
+ <dt id="NGM_ETHER_SET_ENADDR"><a class="permalink" href="#NGM_ETHER_SET_ENADDR"><code class="Dv">NGM_ETHER_SET_ENADDR</code></a>
+ (<code class="Ic">setenaddr</code>)</dt>
+ <dd>Sets the device's unique six byte Ethernet address. This control message
+ is equivalent to using the <code class="Dv">SIOCSIFLLADDR</code>
+ <a class="Xr">ioctl(2)</a> system call.</dd>
+ <dt id="NGM_ETHER_SET_PROMISC"><a class="permalink" href="#NGM_ETHER_SET_PROMISC"><code class="Dv">NGM_ETHER_SET_PROMISC</code></a>
+ (<code class="Ic">setpromisc</code>)</dt>
+ <dd>Enable or disable promiscuous mode. This message includes a single 32 bit
+ integer flag that enables or disables promiscuous mode on the interface.
+ Any non-zero value enables promiscuous mode.</dd>
+ <dt id="NGM_ETHER_GET_PROMISC"><a class="permalink" href="#NGM_ETHER_GET_PROMISC"><code class="Dv">NGM_ETHER_GET_PROMISC</code></a>
+ (<code class="Ic">getpromisc</code>)</dt>
+ <dd>Get the current value of the node's promiscuous flag. The returned value
+ is always either one or zero. Note that this flag reflects the node's own
+ promiscuous setting and does not necessarily reflect the promiscuous state
+ of the actual interface, which can be affected by other means (e.g.,
+ <a class="Xr">bpf(4)</a>).</dd>
+ <dt id="NGM_ETHER_SET_AUTOSRC"><a class="permalink" href="#NGM_ETHER_SET_AUTOSRC"><code class="Dv">NGM_ETHER_SET_AUTOSRC</code></a>
+ (<code class="Ic">setautosrc</code>)</dt>
+ <dd>Sets the automatic source address override flag. This message includes a
+ single 32 bit integer flag that causes all outgoing packets to have their
+ source Ethernet address field overwritten with the device's unique
+ Ethernet address. If this flag is set to zero, the source address in
+ outgoing packets is not modified. The default setting for this flag is
+ disabled.</dd>
+ <dt id="NGM_ETHER_GET_AUTOSRC"><a class="permalink" href="#NGM_ETHER_GET_AUTOSRC"><code class="Dv">NGM_ETHER_GET_AUTOSRC</code></a>
+ (<code class="Ic">getautosrc</code>)</dt>
+ <dd>Get the current value of the node's source address override flag. The
+ returned value is always either one or zero.</dd>
+ <dt id="NGM_ETHER_ADD_MULTI"><a class="permalink" href="#NGM_ETHER_ADD_MULTI"><code class="Dv">NGM_ETHER_ADD_MULTI</code></a>
+ (<code class="Ic">addmulti</code>)</dt>
+ <dd>Join Ethernet multicast group. This control message is equivalent to using
+ the <code class="Dv">SIOCADDMULTI</code> <a class="Xr">ioctl(2)</a> system
+ call.</dd>
+ <dt id="NGM_ETHER_DEL_MULTI"><a class="permalink" href="#NGM_ETHER_DEL_MULTI"><code class="Dv">NGM_ETHER_DEL_MULTI</code></a>
+ (<code class="Ic">delmulti</code>)</dt>
+ <dd>Leave Ethernet multicast group. This control message is equivalent to
+ using the <code class="Dv">SIOCDELMULTI</code> <a class="Xr">ioctl(2)</a>
+ system call.</dd>
+ <dt id="NGM_ETHER_DETACH"><a class="permalink" href="#NGM_ETHER_DETACH"><code class="Dv">NGM_ETHER_DETACH</code></a>
+ (<code class="Ic">detach</code>)</dt>
+ <dd>Detach from underlying Ethernet interface and shut down node.</dd>
+</dl>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SHUTDOWN"><a class="permalink" href="#SHUTDOWN">SHUTDOWN</a></h1>
+<p class="Pp">Upon receipt of the <code class="Dv">NGM_SHUTDOWN</code> control
+ message, all hooks are disconnected, promiscuous mode is disabled, but the
+ node is not removed. Node can be shut down only using
+ <code class="Dv">NGM_ETHER_DETACH</code> control message. If the interface
+ itself is detached (e.g., because of PC Card removal), the node disappears
+ as well.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
+<p class="Pp">This command dumps all unrecognized packets received by the
+ &#x201C;<code class="Li">fxp0</code>&#x201D; interface to standard output
+ decoded in hex and ASCII:</p>
+<p class="Pp"></p>
+<div class="Bd Bd-indent"><code class="Li">nghook -a fxp0: orphans</code></div>
+<p class="Pp">This command sends the contents of
+ <span class="Pa">sample.pkt</span> out the interface
+ &#x201C;<code class="Li">fxp0</code>&#x201D;:</p>
+<p class="Pp"></p>
+<div class="Bd Bd-indent"><code class="Li">cat sample.pkt | nghook fxp0:
+ orphans</code></div>
+<p class="Pp">These commands insert an <a class="Xr">ng_tee(4)</a> node between
+ the <var class="Va">lower</var> and <var class="Va">upper</var> protocol
+ layers, which can be used for tracing packet flow, statistics, etc.:</p>
+<div class="Bd Pp Bd-indent Li">
+<pre>ngctl mkpeer fxp0: tee lower right
+ngctl connect fxp0: lower upper left</pre>
+</div>
+</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">arp(4)</a>, <a class="Xr">netgraph(4)</a>,
+ <a class="Xr">netintro(4)</a>, <a class="Xr">ifconfig(8)</a>,
+ <a class="Xr">ngctl(8)</a>, <a class="Xr">nghook(8)</a></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
+<p class="Pp"><span class="An">Julian Elischer</span>
+ &lt;<a class="Mt" href="mailto:julian@FreeBSD.org">julian@FreeBSD.org</a>&gt;
+ <br/>
+ <span class="An">Archie Cobbs</span>
+ &lt;<a class="Mt" href="mailto:archie@FreeBSD.org">archie@FreeBSD.org</a>&gt;</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
+<p class="Pp">The automatic KLD module loading mechanism that works for most
+ other Netgraph node types does not work for the
+ <code class="Nm">ether</code> node type, because
+ <code class="Nm">ether</code> nodes are not created on demand; instead, they
+ are created when Ethernet interfaces are attached or when the KLD is first
+ loaded. Therefore, if the KLD is not statically compiled into the kernel, it
+ is necessary to load the KLD manually in order to bring the
+ <code class="Nm">ether</code> nodes into existence.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">June 23, 2011</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>