/* * Minimal BPF assembler * * Instead of libpcap high-level filter expressions, it can be quite * useful to define filters in low-level BPF assembler (that is kept * close to Steven McCanne and Van Jacobson's original BPF paper). * In particular for BPF JIT implementors, JIT security auditors, or * just for defining BPF expressions that contain extensions which are * not supported by compilers. * * How to get into it: * * 1) read Documentation/networking/filter.txt * 2) Run `bpf_asm [-c] ` to translate into binary * blob that is loadable with xt_bpf, cls_bpf et al. Note: -c will * pretty print a C-like construct. * * Copyright 2013 Daniel Borkmann * Licensed under the GNU General Public License, version 2.0 (GPLv2) */ #include #include #include extern void bpf_asm_compile(FILE *fp, bool cstyle); int main(int argc, char **argv) { FILE *fp = stdin; bool cstyle = false; int i; for (i = 1; i < argc; i++) { if (!strncmp("-c", argv[i], 2)) { cstyle = true; continue; } fp = fopen(argv[i], "r"); if (!fp) { fp = stdin; continue; } break; } bpf_asm_compile(fp, cstyle); return 0; } rivate-remove net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-30 09:32:26 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-30 09:32:26 -0800
commit238d1d0f79f619d75c2cc741d6770fb0986aef24 (patch)
treeed11bb89c3c61cba7aff3ebc90647f83758a982d /net/sunrpc/xprtrdma/verbs.c
parentf3de082c12e5e9ff43c58a7561f6ec3272d03a48 (diff)
parent36f671be1db1b17d3d4ab0c8b47f81ccb1efcb75 (diff)
Merge tag 'docs-4.10-rc1-fix' of git://git.lwn.net/linux
Pull documentation fixes from Jonathan Corbet: "Two small fixes: - A merge error on my part broke the DocBook build. I've requisitioned one of tglx's frozen sharks for appropriate disciplinary action and resolved to be more careful about testing the DocBook stuff as long as it's still around. - Fix an error in unaligned-memory-access.txt" * tag 'docs-4.10-rc1-fix' of git://git.lwn.net/linux: Documentation/unaligned-memory-access.txt: fix incorrect comparison operator docs: Fix build failure
Diffstat (limited to 'net/sunrpc/xprtrdma/verbs.c')