chromium/sandbox/linux/system_headers/linux_filter.h

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_FILTER_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_FILTER_H_

#include <stdint.h>

// The following structs and macros are taken from linux/filter.h,
// as some toolchain does not expose them.
struct sock_filter {};

struct sock_fprog {};

#ifndef BPF_CLASS
#define BPF_CLASS(code)
#endif

#ifndef BPF_LD
#define BPF_LD
#endif

#ifndef BPF_ALU
#define BPF_ALU
#endif

#ifndef BPF_JMP
#define BPF_JMP
#endif

#ifndef BPF_RET
#define BPF_RET
#endif

#ifndef BPF_SIZE
#define BPF_SIZE(code)
#endif

#ifndef BPF_W
#define BPF_W
#endif

#ifndef BPF_MODE
#define BPF_MODE(code)
#endif

#ifndef BPF_ABS
#define BPF_ABS
#endif

#ifndef BPF_OP
#define BPF_OP(code)
#endif

#ifndef BPF_ADD
#define BPF_ADD
#endif

#ifndef BPF_SUB
#define BPF_SUB
#endif

#ifndef BPF_MUL
#define BPF_MUL
#endif

#ifndef BPF_DIV
#define BPF_DIV
#endif

#ifndef BPF_OR
#define BPF_OR
#endif

#ifndef BPF_AND
#define BPF_AND
#endif

#ifndef BPF_LSH
#define BPF_LSH
#endif

#ifndef BPF_RSH
#define BPF_RSH
#endif

#ifndef BPF_NEG
#define BPF_NEG
#endif

#ifndef BPF_MOD
#define BPF_MOD
#endif

#ifndef BPF_XOR
#define BPF_XOR
#endif

#ifndef BPF_JA
#define BPF_JA
#endif

#ifndef BPF_JEQ
#define BPF_JEQ
#endif

#ifndef BPF_JGT
#define BPF_JGT
#endif

#ifndef BPF_JGE
#define BPF_JGE
#endif

#ifndef BPF_JSET
#define BPF_JSET
#endif

#ifndef BPF_SRC
#define BPF_SRC(code)
#endif

#ifndef BPF_K
#define BPF_K
#endif

#ifndef BPF_MAXINSNS
#define BPF_MAXINSNS
#endif

#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_FILTER_H_