9 #include <linux/module.h>
11 #include <linux/ipv6.h>
12 #include <linux/netfilter.h>
13 #include <linux/netfilter_ipv6.h>
15 #include <linux/netfilter/x_tables.h>
33 return csum16_add(a, csum16_complement(b));
39 __sum16 src_sum = 0, dst_sum = 0;
46 src_sum = csum16_add(src_sum,
48 dst_sum = csum16_add(dst_sum,
52 npt->
adjustment = csum16_sub(src_sum, dst_sum);
65 for (i = 0; i < pfx_len; i += 32) {
66 if (pfx_len - i >= 32)
69 mask =
htonl(~((1 << (pfx_len - i)) - 1));
79 for (idx = 4; idx <
ARRAY_SIZE(addr->s6_addr16); idx++) {
102 if (!ip6t_npt_map_pfx(npt, &ipv6_hdr(skb)->
saddr)) {
115 if (!ip6t_npt_map_pfx(npt, &ipv6_hdr(skb)->
daddr)) {
126 .target = ip6t_snpt_tg,
128 .checkentry = ip6t_npt_checkentry,
136 .target = ip6t_dnpt_tg,
138 .checkentry = ip6t_npt_checkentry,
146 static int __init ip6t_npt_init(
void)
152 static void __exit ip6t_npt_exit(
void)