@@ -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
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(-)