#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netfilter.h>
#include <linux/rtnetlink.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/tc_act/tc_nat.h>
#include <net/act_api.h>
#include <net/pkt_cls.h>
#include <net/icmp.h>
#include <net/ip.h>
#include <net/netlink.h>
#include <net/tc_act/tc_nat.h>
#include <net/tcp.h>
#include <net/udp.h>
#include <net/tc_wrapper.h>
static struct tc_action_ops act_nat_ops;
static const struct nla_policy nat_policy[TCA_NAT_MAX + 1] = …;
static int tcf_nat_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)
{ … }
TC_INDIRECT_SCOPE int tcf_nat_act(struct sk_buff *skb,
const struct tc_action *a,
struct tcf_result *res)
{ … }
static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a,
int bind, int ref)
{ … }
static void tcf_nat_cleanup(struct tc_action *a)
{ … }
static struct tc_action_ops act_nat_ops = …;
MODULE_ALIAS_NET_ACT(…) …;
static __net_init int nat_init_net(struct net *net)
{ … }
static void __net_exit nat_exit_net(struct list_head *net_list)
{ … }
static struct pernet_operations nat_net_ops = …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static int __init nat_init_module(void)
{ … }
static void __exit nat_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(nat_cleanup_module);