Skip to content

Commit 7a20fd9

Browse files
author
dlg
committedMar 4, 2025
add bpfxattach.
1 parent e1698f2 commit 7a20fd9

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed
 

‎share/man/man9/bpf_mtap.9

+28-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $OpenBSD: bpf_mtap.9,v 1.18 2023/04/12 09:55:22 jsg Exp $
1+
.\" $OpenBSD: bpf_mtap.9,v 1.19 2025/03/04 01:33:42 dlg Exp $
22
.\"
33
.\" Copyright (c) 2016 David Gwynne <dlg@openbsd.org>
44
.\"
@@ -14,11 +14,12 @@
1414
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1515
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1616
.\"
17-
.Dd $Mdocdate: April 12 2023 $
17+
.Dd $Mdocdate: March 4 2025 $
1818
.Dt BPF_MTAP 9
1919
.Os
2020
.Sh NAME
2121
.Nm bpfattach ,
22+
.Nm bpfxattach ,
2223
.Nm bpfdetach ,
2324
.Nm bpfsattach ,
2425
.Nm bpfsdetach ,
@@ -40,6 +41,14 @@
4041
.Fa "u_int dlt"
4142
.Fa "u_int hdrlen"
4243
.Fc
44+
.Ft void *
45+
.Fo bpfxattach
46+
.Fa "caddr_t *bpfp"
47+
.Fa "const char *name"
48+
.Fa "struct ifnet *ifp"
49+
.Fa "u_int dlt"
50+
.Fa "u_int hdrlen"
51+
.Fc
4352
.Ft void
4453
.Fn bpfdetach "struct ifnet *ifp"
4554
.Ft void *
@@ -113,6 +122,19 @@ provide different data link-layer types for filtering.
113122
.Fa hdrlen
114123
indicates the length of the link header for the data link-layer type.
115124
.Pp
125+
.Fn bpfxattach
126+
allocates and configures a BPF interface for use with the network interface
127+
.Fa ifp ,
128+
but with a BPF interface name provided by the
129+
.Fa name
130+
argument instead of the name of the network interface.
131+
The
132+
.Fa bpfp ,
133+
.Fa dlt ,
134+
.Fa hdrlen
135+
arguments work like those in
136+
.Fn bpfattach .
137+
.Pp
116138
.Fn bpfdetach
117139
removes and frees all the BPF interfaces that were configured for
118140
the network interface
@@ -230,6 +252,7 @@ of length
230252
will be prefixed to the buffer for filter evaluation.
231253
.Sh CONTEXT
232254
.Fn bpfattach ,
255+
.Fn bpfxattach ,
233256
.Fn bpfdetach ,
234257
.Fn bpfsattach ,
235258
and
@@ -252,7 +275,9 @@ can be called from process context, or from an interrupt context at or below
252275
.Dv IPL_NET .
253276
.Sh RETURN VALUES
254277
.Fn bpfsattach
255-
returns a reference to the BPF interface it allocates.
278+
and
279+
.Fn bpfxattach
280+
return a reference to the BPF interface they allocate.
256281
.Pp
257282
.Fn bpf_filter
258283
and

0 commit comments

Comments
 (0)