#include <linux/bpf.h>
#include <linux/filter.h>
#include <linux/kmod.h>
#include <linux/module.h>
#include <linux/netfilter.h>
#include <net/netfilter/nf_bpf_link.h>
#include <uapi/linux/netfilter_ipv4.h>
static unsigned int nf_hook_run_bpf(void *bpf_prog, struct sk_buff *skb,
const struct nf_hook_state *s)
{ … }
struct bpf_nf_link { … };
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4) || IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
static const struct nf_defrag_hook *
get_proto_defrag_hook(struct bpf_nf_link *link,
const struct nf_defrag_hook __rcu **ptr_global_hook,
const char *mod)
{ … }
#endif
static int bpf_nf_enable_defrag(struct bpf_nf_link *link)
{ … }
static void bpf_nf_disable_defrag(struct bpf_nf_link *link)
{ … }
static void bpf_nf_link_release(struct bpf_link *link)
{ … }
static void bpf_nf_link_dealloc(struct bpf_link *link)
{ … }
static int bpf_nf_link_detach(struct bpf_link *link)
{ … }
static void bpf_nf_link_show_info(const struct bpf_link *link,
struct seq_file *seq)
{ … }
static int bpf_nf_link_fill_link_info(const struct bpf_link *link,
struct bpf_link_info *info)
{ … }
static int bpf_nf_link_update(struct bpf_link *link, struct bpf_prog *new_prog,
struct bpf_prog *old_prog)
{ … }
static const struct bpf_link_ops bpf_nf_link_lops = …;
static int bpf_nf_check_pf_and_hooks(const union bpf_attr *attr)
{ … }
int bpf_nf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
{ … }
const struct bpf_prog_ops netfilter_prog_ops = …;
static bool nf_ptr_to_btf_id(struct bpf_insn_access_aux *info, const char *name)
{ … }
static bool nf_is_valid_access(int off, int size, enum bpf_access_type type,
const struct bpf_prog *prog,
struct bpf_insn_access_aux *info)
{ … }
static const struct bpf_func_proto *
bpf_nf_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
{ … }
const struct bpf_verifier_ops netfilter_verifier_ops = …;