xref: /linux/kernel/bpf/disasm.h (revision fd639726bf15fca8ee1a00dce8e0096d0ad9bd18)
1 /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
2  * Copyright (c) 2016 Facebook
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of version 2 of the GNU General Public
6  * License as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  */
13 
14 #ifndef __BPF_DISASM_H__
15 #define __BPF_DISASM_H__
16 
17 #include <linux/bpf.h>
18 #include <linux/kernel.h>
19 #include <linux/stringify.h>
20 
21 extern const char *const bpf_alu_string[16];
22 extern const char *const bpf_class_string[8];
23 
24 const char *func_id_name(int id);
25 
26 struct bpf_verifier_env;
27 typedef void (*bpf_insn_print_cb)(struct bpf_verifier_env *env,
28 				  const char *, ...);
29 void print_bpf_insn(bpf_insn_print_cb verbose, struct bpf_verifier_env *env,
30 		    const struct bpf_insn *insn, bool allow_ptr_leaks);
31 
32 #endif
33