* [PATCH 0/1] updates to tc-bpf manpage
@ 2022-04-25 16:57 Ray Kinsella
2022-04-25 16:57 ` [PATCH 1/1] tc-bpf: added instructions to build cbpf generator Ray Kinsella
0 siblings, 1 reply; 2+ messages in thread
From: Ray Kinsella @ 2022-04-25 16:57 UTC (permalink / raw)
To: netdev; +Cc: daniel, stephen, Ray Kinsella
Hi folks,
I was a bit unsure what ML this patch should go to?
It is a small update/fix for the tc-bpf manpage.
Ray Kinsella (1):
tc-bpf: added instructions to build cbpf generator
man/man8/tc-bpf.8 | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--
2.26.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] tc-bpf: added instructions to build cbpf generator
2022-04-25 16:57 [PATCH 0/1] updates to tc-bpf manpage Ray Kinsella
@ 2022-04-25 16:57 ` Ray Kinsella
0 siblings, 0 replies; 2+ messages in thread
From: Ray Kinsella @ 2022-04-25 16:57 UTC (permalink / raw)
To: netdev; +Cc: daniel, stephen, Ray Kinsella
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-25 16:57 [PATCH 0/1] updates to tc-bpf manpage Ray Kinsella
2022-04-25 16:57 ` [PATCH 1/1] tc-bpf: added instructions to build cbpf generator Ray Kinsella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox