summaryrefslogtreecommitdiff
path: root/static/netbsd/man4/tap.4 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/netbsd/man4/tap.4 3.html')
-rw-r--r--static/netbsd/man4/tap.4 3.html138
1 files changed, 0 insertions, 138 deletions
diff --git a/static/netbsd/man4/tap.4 3.html b/static/netbsd/man4/tap.4 3.html
deleted file mode 100644
index 544b5ee3..00000000
--- a/static/netbsd/man4/tap.4 3.html
+++ /dev/null
@@ -1,138 +0,0 @@
-<table class="head">
- <tr>
- <td class="head-ltitle">TAP(4)</td>
- <td class="head-vol">Device Drivers Manual</td>
- <td class="head-rtitle">TAP(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">tap</code> &#x2014; <span class="Nd">Ethernet
- tunnel software network interface</span></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
-<p class="Pp"><code class="Cd">pseudo-device tap</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">tap</code> driver allows the creation and use
- of virtual Ethernet devices. Those interfaces appear just as any real
- Ethernet NIC to the kernel, but can also be accessed by userland through a
- character device node in order to read frames being sent by the system or to
- inject frames. In that respect it is very similar to what
- <a class="Xr">tun(4)</a> provides.</p>
-<section class="Ss">
-<h2 class="Ss" id="INTERFACE_CREATION"><a class="permalink" href="#INTERFACE_CREATION">INTERFACE
- CREATION</a></h2>
-<p class="Pp">Interfaces may be created in two different ways: using the
- <a class="Xr">ifconfig(8)</a> <code class="Cm">create</code> command with a
- specified device number, or its <a class="Xr">ioctl(2)</a> equivalent,
- <code class="Dv">SIOCIFCREATE</code>, or using the special cloning device
- <span class="Pa">/dev/tap</span>.</p>
-<p class="Pp">The former works the same as any other cloning network interface:
- the administrator can create and destroy interfaces at any time, notably at
- boot time. This is the easiest way of combining <code class="Nm">tap</code>
- and <a class="Xr">bridge(4)</a>. Later, userland will actually access the
- interfaces through the specific device nodes
- <span class="Pa">/dev/tapN</span>.</p>
-<p class="Pp">The latter is aimed at applications that need a virtual Ethernet
- device for the duration of their execution. A new interface is created at
- the opening of <span class="Pa">/dev/tap</span>, and is later destroyed when
- the last process using the file descriptor closes it.</p>
-</section>
-<section class="Ss">
-<h2 class="Ss" id="CHARACTER_DEVICES"><a class="permalink" href="#CHARACTER_DEVICES">CHARACTER
- DEVICES</a></h2>
-<p class="Pp">Whether the <code class="Nm">tap</code> devices are accessed
- through the special cloning device <span class="Pa">/dev/tap</span> or
- through the specific devices <span class="Pa">/dev/tapN</span>, the possible
- actions to control the matching interface are the same.</p>
-<p class="Pp">When using <span class="Pa">/dev/tap</span> though, as the
- interface is created on-the-fly, its name is not known immediately by the
- application. Therefore the <code class="Dv">TAPGIFNAME</code> ioctl is
- provided. It should be the first action an application using the special
- cloning device will do. It takes a pointer to a <var class="Ft">struct
- ifreq</var> as an argument.</p>
-<p class="Pp">Ethernet frames sent out by the kernel on a
- <code class="Nm">tap</code> interface can be obtained by the controlling
- application with <a class="Xr">read(2)</a>. It can also inject frames in the
- kernel with <a class="Xr">write(2)</a>. There is absolutely no validation of
- the content of the injected frame, it can be any data, of any length.</p>
-<p class="Pp">One call of <a class="Xr">write(2)</a> will inject a single frame
- in the kernel, as one call of <a class="Xr">read(2)</a> will retrieve a
- single frame from the queue, to the extent of the provided buffer. If the
- buffer is not large enough, the frame will be truncated.</p>
-<p class="Pp"><code class="Nm">tap</code> character devices support the
- <code class="Dv">FIONREAD</code> ioctl which returns the size of the next
- available frame, or 0 if there is no available frame in the queue.</p>
-<p class="Pp">They also support non-blocking I/O through the
- <code class="Dv">FIONBIO</code> ioctl. In that mode,
- <code class="Er">EWOULDBLOCK</code> is returned by <a class="Xr">read(2)</a>
- when no data is available.</p>
-<p class="Pp">Asynchronous I/O is supported through the
- <code class="Dv">FIOASYNC</code>, <code class="Dv">FIOSETOWN</code>, and
- <code class="Dv">FIOGETOWN</code> ioctls. The first will enable
- <code class="Dv">SIGIO</code> generation, while the two other configure the
- process group that will receive the signal when data is ready.</p>
-<p class="Pp">Synchronisation may also be achieved through the use of
- <a class="Xr">select(2)</a>, <a class="Xr">poll(2)</a>, or
- <a class="Xr">kevent(2)</a>.</p>
-</section>
-<section class="Ss">
-<h2 class="Ss" id="ETHERNET_ADDRESS"><a class="permalink" href="#ETHERNET_ADDRESS">ETHERNET
- ADDRESS</a></h2>
-<p class="Pp">When a <code class="Nm">tap</code> device is created, it is
- assigned an Ethernet address of the form f2:0b:a4:xx:xx:xx. This address can
- later be changed using <a class="Xr">ifconfig(8)</a> to add an active link
- layer address, or directly via the <code class="Dv">SIOCALIFADDR</code>
- ioctl on a <code class="Dv">PF_LINK</code> socket, as it is not available on
- the ioctl handler of the character device interface.</p>
-</section>
-<section class="Ss">
-<h2 class="Ss" id="LINK_STATE"><a class="permalink" href="#LINK_STATE">LINK
- STATE</a></h2>
-<p class="Pp">When an application has opened the <code class="Nm">tap</code>
- character device the link is considered up, otherwise down. As such, it is
- best to open the character device once connectivity has been established so
- that Duplicate Address Detection, if applicable, can be performed. If
- connectivity is lost, the character device should be closed.</p>
-</section>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
-<dl class="Bl-tag Bl-compact">
- <dt><span class="Pa">/dev/tap</span></dt>
- <dd>cloning device</dd>
- <dt><span class="Pa">/dev/tap[0-9]*</span></dt>
- <dd>individual character device nodes</dd>
-</dl>
-</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">bridge(4)</a>, <a class="Xr">l2tp(4)</a>,
- <a class="Xr">tun(4)</a>, <a class="Xr">vether(4)</a>,
- <a class="Xr">ifconfig(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">tap</code> driver first appeared in
- <span class="Ux">NetBSD 3.0</span>.</p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="CAVEATS"><a class="permalink" href="#CAVEATS">CAVEATS</a></h1>
-<p class="Pp">Starting from <span class="Ux">NetBSD 10.0</span>, the
- <code class="Nm">tap</code> driver can no longer be used as a
- <a class="Xr">bridge(4)</a> endpoint because it supports a link state based
- on if it has been opened or not. Use the <a class="Xr">vether(4)</a> driver
- instead as it's been explicitly designed for this purpose.</p>
-</section>
-</div>
-<table class="foot">
- <tr>
- <td class="foot-date">May 2, 2022</td>
- <td class="foot-os">NetBSD 10.1</td>
- </tr>
-</table>