#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/rtnetlink.h>
#include <linux/filter.h>
#include <linux/bpf.h>
#include <net/netlink.h>
#include <net/sock.h>
#include <net/pkt_sched.h>
#include <net/pkt_cls.h>
#include <linux/tc_act/tc_bpf.h>
#include <net/tc_act/tc_bpf.h>
#include <net/tc_wrapper.h>
#define ACT_BPF_NAME_LEN …
struct tcf_bpf_cfg { … };
static struct tc_action_ops act_bpf_ops;
TC_INDIRECT_SCOPE int tcf_bpf_act(struct sk_buff *skb,
const struct tc_action *act,
struct tcf_result *res)
{ … }
static bool tcf_bpf_is_ebpf(const struct tcf_bpf *prog)
{ … }
static int tcf_bpf_dump_bpf_info(const struct tcf_bpf *prog,
struct sk_buff *skb)
{ … }
static int tcf_bpf_dump_ebpf_info(const struct tcf_bpf *prog,
struct sk_buff *skb)
{ … }
static int tcf_bpf_dump(struct sk_buff *skb, struct tc_action *act,
int bind, int ref)
{ … }
static const struct nla_policy act_bpf_policy[TCA_ACT_BPF_MAX + 1] = …;
static int tcf_bpf_init_from_ops(struct nlattr **tb, struct tcf_bpf_cfg *cfg)
{ … }
static int tcf_bpf_init_from_efd(struct nlattr **tb, struct tcf_bpf_cfg *cfg)
{ … }
static void tcf_bpf_cfg_cleanup(const struct tcf_bpf_cfg *cfg)
{ … }
static void tcf_bpf_prog_fill_cfg(const struct tcf_bpf *prog,
struct tcf_bpf_cfg *cfg)
{ … }
static int tcf_bpf_init(struct net *net, struct nlattr *nla,
struct nlattr *est, struct tc_action **act,
struct tcf_proto *tp, u32 flags,
struct netlink_ext_ack *extack)
{ … }
static void tcf_bpf_cleanup(struct tc_action *act)
{ … }
static struct tc_action_ops act_bpf_ops __read_mostly = …;
MODULE_ALIAS_NET_ACT(…) …;
static __net_init int bpf_init_net(struct net *net)
{ … }
static void __net_exit bpf_exit_net(struct list_head *net_list)
{ … }
static struct pernet_operations bpf_net_ops = …;
static int __init bpf_init_module(void)
{ … }
static void __exit bpf_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(bpf_cleanup_module);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;