diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:59:05 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:59:05 -0400 |
| commit | 1f19f33e45791ea59aed048796fc68672c6723a5 (patch) | |
| tree | 54625fba89e91d1c2177801ec635e8528bba937f /static/freebsd/man9/bpf.9 3.html | |
| parent | ac5e55f5f2af5b92794c2aded46c6bae85b5f5ed (diff) | |
docs: Removed Precompiled HTML
Diffstat (limited to 'static/freebsd/man9/bpf.9 3.html')
| -rw-r--r-- | static/freebsd/man9/bpf.9 3.html | 196 |
1 files changed, 0 insertions, 196 deletions
diff --git a/static/freebsd/man9/bpf.9 3.html b/static/freebsd/man9/bpf.9 3.html deleted file mode 100644 index 57031e64..00000000 --- a/static/freebsd/man9/bpf.9 3.html +++ /dev/null @@ -1,196 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">BPF(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">BPF(9)</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">bpf</code> — <span class="Nd">Berkeley - Packet Filter</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 - <<a class="In">net/bpf.h</a>></code></p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">bpfattach</code>(<var class="Fa" style="white-space: nowrap;">struct - ifnet *ifp</var>, <var class="Fa" style="white-space: nowrap;">u_int - dlt</var>, <var class="Fa" style="white-space: nowrap;">u_int - hdrlen</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">bpfattach2</code>(<var class="Fa">struct ifnet *ifp</var>, - <var class="Fa">u_int dlt</var>, <var class="Fa">u_int hdrlen</var>, - <var class="Fa">struct bpf_if **driverp</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">bpfdetach</code>(<var class="Fa" style="white-space: nowrap;">struct - ifnet *ifp</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">bpf_tap</code>(<var class="Fa" style="white-space: nowrap;">struct - ifnet *ifp</var>, <var class="Fa" style="white-space: nowrap;">u_char - *pkt</var>, <var class="Fa" style="white-space: nowrap;">u_int - *pktlen</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">bpf_mtap</code>(<var class="Fa" style="white-space: nowrap;">struct - ifnet *ifp</var>, <var class="Fa" style="white-space: nowrap;">struct mbuf - *m</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">bpf_mtap2</code>(<var class="Fa" style="white-space: nowrap;">struct - bpf_if *bp</var>, <var class="Fa" style="white-space: nowrap;">void - *data</var>, <var class="Fa" style="white-space: nowrap;">u_int dlen</var>, - <var class="Fa" style="white-space: nowrap;">struct mbuf *m</var>);</p> -<p class="Pp"><var class="Ft">u_int</var> - <br/> - <code class="Fn">bpf_filter</code>(<var class="Fa">const struct bpf_insn *pc - </var>, <var class="Fa">u_char *pkt</var>, <var class="Fa">u_int - wirelen</var>, <var class="Fa">u_int buflen</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">bpf_validate</code>(<var class="Fa" style="white-space: nowrap;">const - struct bpf_insn *fcode</var>, - <var class="Fa" style="white-space: nowrap;">int flen</var>);</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The Berkeley Packet Filter provides a raw interface, that is - protocol independent, to data link layers. It allows all packets on the - network, even those destined for other hosts, to be passed from a network - interface to user programs. Each program may specify a filter, in the form - of a <code class="Nm">bpf</code> filter machine program. The - <a class="Xr">bpf(4)</a> manual page describes the interface used by user - programs. This manual page describes the functions used by interfaces to - pass packets to <code class="Nm">bpf</code> and the functions for testing - and running <code class="Nm">bpf</code> filter machine programs.</p> -<p class="Pp" id="bpfattach">The - <a class="permalink" href="#bpfattach"><code class="Fn">bpfattach</code></a>() - function attaches a network interface to <code class="Nm">bpf</code>. The - <var class="Fa">ifp</var> argument is a pointer to the structure that - defines the interface to be attached to an interface. The - <var class="Fa">dlt</var> argument is the data link-layer type: - <code class="Dv">DLT_NULL</code> (no link-layer encapsulation), - <code class="Dv">DLT_EN10MB</code> (Ethernet), - <code class="Dv">DLT_IEEE802_11</code> (802.11 wireless networks), etc. The - rest of the link layer types can be found in - <code class="In"><<a class="In">net/bpf.h</a>></code>. The - <var class="Fa">hdrlen</var> argument is the fixed size of the link header; - variable length headers are not yet supported. The - <code class="Nm">bpf</code> system will hold a pointer to - <var class="Fa">ifp->if_bpf</var>. This variable will set to a - non-<code class="Dv">NULL</code> value when <code class="Nm">bpf</code> - requires packets from this interface to be tapped using the functions - below.</p> -<p class="Pp" id="bpfattach2">The - <a class="permalink" href="#bpfattach2"><code class="Fn">bpfattach2</code></a>() - function allows multiple <code class="Nm">bpf</code> instances to be - attached to a single interface, by registering an explicit - <var class="Fa">if_bpf</var> rather than using - <var class="Fa">ifp->if_bpf</var>. It is then possible to run - <a class="Xr">tcpdump(1)</a> on the interface for any data link-layer types - attached.</p> -<p class="Pp" id="bpfdetach">The - <a class="permalink" href="#bpfdetach"><code class="Fn">bpfdetach</code></a>() - function detaches a <code class="Nm">bpf</code> instance from an interface, - specified by <var class="Fa">ifp</var>. The - <code class="Fn">bpfdetach</code>() function should be called once for each - <code class="Nm">bpf</code> instance attached.</p> -<p class="Pp" id="bpf_tap">The - <a class="permalink" href="#bpf_tap"><code class="Fn">bpf_tap</code></a>() - function is used by an interface to pass the packet to - <code class="Nm">bpf</code>. The packet data (including link-header), - pointed to by <var class="Fa">pkt</var>, is of length - <var class="Fa">pktlen</var>, which must be a contiguous buffer. The - <var class="Fa">ifp</var> argument is a pointer to the structure that - defines the interface to be tapped. The packet is parsed by each processes - filter, and if accepted, it is buffered for the process to read.</p> -<p class="Pp" id="bpf_mtap">The - <a class="permalink" href="#bpf_mtap"><code class="Fn">bpf_mtap</code></a>() - function is like <code class="Fn">bpf_tap</code>() except that it is used to - tap packets that are in an <var class="Vt">mbuf</var> chain, - <var class="Fa">m</var>. The <var class="Fa">ifp</var> argument is a pointer - to the structure that defines the interface to be tapped. Like - <code class="Fn">bpf_tap</code>(), <code class="Fn">bpf_mtap</code>() - requires a link-header for whatever data link layer type is specified. Note - that <code class="Nm">bpf</code> only reads from the - <var class="Vt">mbuf</var> chain, it does not free it or keep a pointer to - it. This means that an <var class="Vt">mbuf</var> containing the link-header - can be prepended to the chain if necessary. A cleaner interface to achieve - this is provided by <code class="Fn">bpf_mtap2</code>().</p> -<p class="Pp" id="bpf_mtap2">The - <a class="permalink" href="#bpf_mtap2"><code class="Fn">bpf_mtap2</code></a>() - function allows the user to pass a link-header <var class="Fa">data</var>, - of length <var class="Fa">dlen</var>, independent of the - <var class="Vt">mbuf</var> <var class="Fa">m</var>, containing the packet. - This simplifies the passing of some link-headers.</p> -<p class="Pp" id="bpf_filter">The - <a class="permalink" href="#bpf_filter"><code class="Fn">bpf_filter</code></a>() - function executes the filter program starting at <var class="Fa">pc</var> on - the packet <var class="Fa">pkt</var>. The <var class="Fa">wirelen</var> - argument is the length of the original packet and - <var class="Fa">buflen</var> is the amount of data present. The - <var class="Fa">buflen</var> value of 0 is special; it indicates that the - <var class="Fa">pkt</var> is actually a pointer to an mbuf chain - (<var class="Vt">struct mbuf *</var>).</p> -<p class="Pp" id="bpf_validate">The - <a class="permalink" href="#bpf_validate"><code class="Fn">bpf_validate</code></a>() - function checks that the filter code <var class="Fa">fcode</var>, of length - <var class="Fa">flen</var>, is valid.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN - VALUES</a></h1> -<p class="Pp">The <code class="Fn">bpf_filter</code>() function returns -1 (cast - to an unsigned integer) if there is no filter. Otherwise, it returns the - result of the filter program.</p> -<p class="Pp">The <code class="Fn">bpf_validate</code>() function returns 0 when - the program is not a valid filter program.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="EVENT_HANDLERS"><a class="permalink" href="#EVENT_HANDLERS">EVENT - HANDLERS</a></h1> -<p class="Pp"><code class="Nm">bpf</code> invokes - <var class="Fa">bpf_track</var> <a class="Xr">EVENTHANDLER(9)</a> event each - time listener attaches to or detaches from an interface. Pointer to - (<var class="Vt">struct ifnet *</var>) is passed as the first argument, - interface <var class="Fa">dlt</var> follows. Last argument indicates - listener is attached (1) or detached (0). Note that handler is invoked with - <code class="Nm">bpf</code> global lock held, which implies restriction on - sleeping and calling <code class="Nm">bpf</code> subsystem inside - <a class="Xr">EVENTHANDLER(9)</a> dispatcher. Note that handler is not - called for write-only listeners.</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">tcpdump(1)</a>, <a class="Xr">bpf(4)</a>, - <a class="Xr">EVENTHANDLER(9)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The Enet packet filter was created in 1980 by Mike Accetta and - Rick Rashid at Carnegie-Mellon University. Jeffrey Mogul, at Stanford, - ported the code to <span class="Ux">BSD</span> and continued its development - from 1983 on. Since then, it has evolved into the Ultrix Packet Filter at - DEC, a STREAMS NIT module under SunOS 4.1, and BPF.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp"><span class="An">Steven McCanne</span>, of Lawrence Berkeley - Laboratory, implemented BPF in Summer 1990. Much of the design is due to - <span class="An">Van Jacobson</span>. This manpage was written by - <span class="An">Orla McGann</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">May 11, 2012</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
