From: Ray Kinsella <mdr@ashroe.eu>
To: netdev@vger.kernel.org
Cc: daniel@iogearbox.net, stephen@networkplumber.org,
Ray Kinsella <mdr@ashroe.eu>
Subject: [PATCH 1/1] tc-bpf: added instructions to build cbpf generator
Date: Mon, 25 Apr 2022 17:57:33 +0100 [thread overview]
Message-ID: <20220425165733.240902-2-mdr@ashroe.eu> (raw)
In-Reply-To: <20220425165733.240902-1-mdr@ashroe.eu>
Updated the man page for tc-bpf, detailing how to build to the cbpf
generator and using it in the subsequent example.
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
man/man8/tc-bpf.8 | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/man/man8/tc-bpf.8 b/man/man8/tc-bpf.8
index e4f68aaa..1d3ab633 100644
--- a/man/man8/tc-bpf.8
+++ b/man/man8/tc-bpf.8
@@ -892,13 +892,21 @@ int main(int argc, char **argv)
.fi
.in
+Build this helper by compiling the source above, and linking with
+.B libpcap
+as follows:
+
+.in +4n
+.B clang -g -O2 cbpf-gen.c -lpcap -o cbpf-gen
+.in
+
Given this small helper, any
.B tcpdump(8)
filter expression can be abused as a classifier where a match will
result in the default classid:
.in +4n
-.B bpftool EN10MB 'tcp[tcpflags] & tcp-syn != 0' > /var/bpf/tcp-syn
+.B cbpf-gen 'tcp[tcpflags] & tcp-syn != 0' > /var/bpf/tcp-syn
.br
.B tc filter add dev em1 parent 1: bpf bytecode-file /var/bpf/tcp-syn flowid 1:1
.in
--
2.26.2
prev parent reply other threads:[~2022-04-25 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 16:57 [PATCH 0/1] updates to tc-bpf manpage Ray Kinsella
2022-04-25 16:57 ` Ray Kinsella [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220425165733.240902-2-mdr@ashroe.eu \
--to=mdr@ashroe.eu \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox