#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "sandbox/linux/bpf_dsl/verifier.h"
#include <stdint.h>
#include <string.h>
#include "base/memory/raw_ref.h"
#include "sandbox/linux/bpf_dsl/seccomp_macros.h"
#include "sandbox/linux/bpf_dsl/trap_registry.h"
#include "sandbox/linux/system_headers/linux_filter.h"
#include "sandbox/linux/system_headers/linux_seccomp.h"
namespace sandbox {
namespace bpf_dsl {
namespace {
struct State { … };
void Ld(State* state, const struct sock_filter& insn, const char** err) { … }
void Jmp(State* state, const struct sock_filter& insn, const char** err) { … }
uint32_t Ret(State*, const struct sock_filter& insn, const char** err) { … }
void Alu(State* state, const struct sock_filter& insn, const char** err) { … }
}
uint32_t Verifier::EvaluateBPF(const std::vector<struct sock_filter>& program,
const struct arch_seccomp_data& data,
const char** err) { … }
}
}