Skip to contentSkip to conversation

updates to tc-bpf manpage

PATCH New Ray Kinsella 1 participant 2 messages Apr 25, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover updates to tc-bpf manpage

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(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 tc-bpf: added instructions to build cbpf generator

Updated the man page for tc-bpf, detailing how to build to the cbpf generator and using it in the subsequent example.

---
 man/man8/tc-bpf.8 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
man/man8/tc-bpf.8 +9 -1
index e4f68aaa..1d3ab633 100644
@@ -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
Signature · 1 line
2.26.2