#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/ip.h>
#include <net/route.h>
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
#include <net/ipv6.h>
#include <net/ip6_route.h>
#include <net/ip6_fib.h>
#endif
#include <linux/netfilter_ipv6.h>
#include <linux/netfilter/xt_addrtype.h>
#include <linux/netfilter/x_tables.h>
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;
MODULE_ALIAS(…) …;
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
static u32 match_lookup_rt6(struct net *net, const struct net_device *dev,
const struct in6_addr *addr, u16 mask)
{ … }
static bool match_type6(struct net *net, const struct net_device *dev,
const struct in6_addr *addr, u16 mask)
{ … }
static bool
addrtype_mt6(struct net *net, const struct net_device *dev,
const struct sk_buff *skb, const struct xt_addrtype_info_v1 *info)
{ … }
#endif
static inline bool match_type(struct net *net, const struct net_device *dev,
__be32 addr, u_int16_t mask)
{ … }
static bool
addrtype_mt_v0(const struct sk_buff *skb, struct xt_action_param *par)
{ … }
static bool
addrtype_mt_v1(const struct sk_buff *skb, struct xt_action_param *par)
{ … }
static int addrtype_mt_checkentry_v1(const struct xt_mtchk_param *par)
{ … }
static struct xt_match addrtype_mt_reg[] __read_mostly = …;
static int __init addrtype_mt_init(void)
{ … }
static void __exit addrtype_mt_exit(void)
{ … }
module_init(…) …;
module_exit(addrtype_mt_exit);