#include <linux/module.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <net/sock.h>
#include <net/route.h>
#include <linux/ip.h>
#include <net/ip.h>
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
#define MANGLE_VALID_HOOKS …
static const struct xt_table packet_mangler = …;
static unsigned int
ipt_mangle_out(void *priv, struct sk_buff *skb, const struct nf_hook_state *state)
{ … }
static unsigned int
iptable_mangle_hook(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
{ … }
static struct nf_hook_ops *mangle_ops __read_mostly;
static int iptable_mangle_table_init(struct net *net)
{ … }
static void __net_exit iptable_mangle_net_pre_exit(struct net *net)
{ … }
static void __net_exit iptable_mangle_net_exit(struct net *net)
{ … }
static struct pernet_operations iptable_mangle_net_ops = …;
static int __init iptable_mangle_init(void)
{ … }
static void __exit iptable_mangle_fini(void)
{ … }
module_init(…) …;
module_exit(iptable_mangle_fini);