disasm.h 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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. #ifndef __BPF_DISASM_H__
  14. #define __BPF_DISASM_H__
  15. #include <linux/bpf.h>
  16. #include <linux/kernel.h>
  17. #include <linux/stringify.h>
  18. extern const char *const bpf_alu_string[16];
  19. extern const char *const bpf_class_string[8];
  20. const char *func_id_name(int id);
  21. struct bpf_verifier_env;
  22. typedef void (*bpf_insn_print_cb)(struct bpf_verifier_env *env,
  23. const char *, ...);
  24. void print_bpf_insn(bpf_insn_print_cb verbose, struct bpf_verifier_env *env,
  25. const struct bpf_insn *insn, bool allow_ptr_leaks);
  26. #endif