Page MenuHomeFreeBSD

[WIP] bpf(9): Refactor to improve readability.
Needs ReviewPublic

Authored by delphij on Nov 30 2022, 4:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 1:28 AM
Unknown Object (File)
Dec 19 2023, 1:55 PM
Unknown Object (File)
Nov 9 2023, 4:44 PM
Unknown Object (File)
Oct 8 2023, 3:40 PM
Unknown Object (File)
May 4 2023, 1:25 AM
Unknown Object (File)
Apr 8 2023, 5:50 AM
Unknown Object (File)
Mar 22 2023, 6:42 PM
Unknown Object (File)
Mar 21 2023, 3:09 AM
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

The API was confusing that it uses the length parameter to
distinguish between mbufs and plain memory buffers.

The existing bpf_filter is renamed to _bpf_filter and modified
so that the packet memory is referred to by an opaque pointer,
and callers have to provide a set of operators to extract values
from that opaque pointer.

bpf_filter is converted to a wrapper around _bpf_filter with
a set of operators that work on a plain memory buffer.

A new function, bpf_mfilter is added, which is a wrapper around
_bpf_filter with operators for extracting values from mbufs.

In-tree consumers of bpf_filter(9) are modified to use
bpf_mfilter(9) when appropriate.

Obtained from: OpenBSD

Test Plan

Run regression tests, etc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 48563
Build 45449: arc lint + arc unit

Event Timeline

delphij retitled this revision from bpf(9): Refactor to improve readability. to [WIP] bpf(9): Refactor to improve readability..Nov 30 2022, 4:18 AM
delphij edited the test plan for this revision. (Show Details)