#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/skbuff.h>
#include <linux/rtnetlink.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/gfp.h>
#include <net/net_namespace.h>
#include <net/netlink.h>
#include <net/pkt_sched.h>
#include <linux/tc_act/tc_sample.h>
#include <net/tc_act/tc_sample.h>
#include <net/psample.h>
#include <net/pkt_cls.h>
#include <net/tc_wrapper.h>
#include <linux/if_arp.h>
static struct tc_action_ops act_sample_ops;
static const struct nla_policy sample_policy[TCA_SAMPLE_MAX + 1] = …;
static int tcf_sample_init(struct net *net, struct nlattr *nla,
struct nlattr *est, struct tc_action **a,
struct tcf_proto *tp,
u32 flags, struct netlink_ext_ack *extack)
{ … }
static void tcf_sample_cleanup(struct tc_action *a)
{ … }
static bool tcf_sample_dev_ok_push(struct net_device *dev)
{ … }
TC_INDIRECT_SCOPE int tcf_sample_act(struct sk_buff *skb,
const struct tc_action *a,
struct tcf_result *res)
{ … }
static void tcf_sample_stats_update(struct tc_action *a, u64 bytes, u64 packets,
u64 drops, u64 lastuse, bool hw)
{ … }
static int tcf_sample_dump(struct sk_buff *skb, struct tc_action *a,
int bind, int ref)
{ … }
static void tcf_psample_group_put(void *priv)
{ … }
static struct psample_group *
tcf_sample_get_group(const struct tc_action *a,
tc_action_priv_destructor *destructor)
{ … }
static void tcf_offload_sample_get_group(struct flow_action_entry *entry,
const struct tc_action *act)
{ … }
static int tcf_sample_offload_act_setup(struct tc_action *act, void *entry_data,
u32 *index_inc, bool bind,
struct netlink_ext_ack *extack)
{ … }
static struct tc_action_ops act_sample_ops = …;
MODULE_ALIAS_NET_ACT(…) …;
static __net_init int sample_init_net(struct net *net)
{ … }
static void __net_exit sample_exit_net(struct list_head *net_list)
{ … }
static struct pernet_operations sample_net_ops = …;
static int __init sample_init_module(void)
{ … }
static void __exit sample_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(sample_cleanup_module);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;