1 /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
2 * Copyright (c) 2016 Facebook
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.
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.
14 #ifndef __BPF_DISASM_H__
15 #define __BPF_DISASM_H__
17 #include <linux/bpf.h>
18 #include <linux/kernel.h>
19 #include <linux/stringify.h>
21 extern const char *const bpf_alu_string
[16];
22 extern const char *const bpf_class_string
[8];
24 const char *func_id_name(int id
);
26 struct bpf_verifier_env
;
27 typedef void (*bpf_insn_print_cb
)(struct bpf_verifier_env
*env
,
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
);