#include <linux/module.h>
#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/init.h>
#include <linux/slab.h>
#include <net/act_api.h>
#include <net/gso.h>
#include <net/netlink.h>
#include <net/pkt_cls.h>
#include <net/tc_act/tc_police.h>
#include <net/tc_wrapper.h>
static struct tc_action_ops act_police_ops;
static const struct nla_policy police_policy[TCA_POLICE_MAX + 1] = …;
static int tcf_police_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 bool tcf_police_mtu_check(struct sk_buff *skb, u32 limit)
{ … }
TC_INDIRECT_SCOPE int tcf_police_act(struct sk_buff *skb,
const struct tc_action *a,
struct tcf_result *res)
{ … }
static void tcf_police_cleanup(struct tc_action *a)
{ … }
static void tcf_police_stats_update(struct tc_action *a,
u64 bytes, u64 packets, u64 drops,
u64 lastuse, bool hw)
{ … }
static int tcf_police_dump(struct sk_buff *skb, struct tc_action *a,
int bind, int ref)
{ … }
static int tcf_police_act_to_flow_act(int tc_act, u32 *extval,
struct netlink_ext_ack *extack)
{ … }
static int tcf_police_offload_act_setup(struct tc_action *act, void *entry_data,
u32 *index_inc, bool bind,
struct netlink_ext_ack *extack)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static struct tc_action_ops act_police_ops = …;
MODULE_ALIAS_NET_ACT(…) …;
static __net_init int police_init_net(struct net *net)
{ … }
static void __net_exit police_exit_net(struct list_head *net_list)
{ … }
static struct pernet_operations police_net_ops = …;
static int __init police_init_module(void)
{ … }
static void __exit police_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(police_cleanup_module);