6 #include <linux/module.h>
7 #include <linux/netfilter_ipv4/ip_tables.h>
8 #include <linux/slab.h>
11 #define RAW_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_OUT))
13 static const struct xt_table packet_raw = {
31 ip_hdrlen(skb) <
sizeof(
struct iphdr)))
35 net = dev_net((in !=
NULL) ? in : out);
41 static int __net_init iptable_raw_net_init(
struct net *net)
48 net->
ipv4.iptable_raw =
51 return PTR_RET(net->
ipv4.iptable_raw);
54 static void __net_exit iptable_raw_net_exit(
struct net *net)
60 .init = iptable_raw_net_init,
61 .exit = iptable_raw_net_exit,
64 static int __init iptable_raw_init(
void)
73 rawtable_ops =
xt_hook_link(&packet_raw, iptable_raw_hook);
74 if (IS_ERR(rawtable_ops)) {
75 ret = PTR_ERR(rawtable_ops);
82 static void __exit iptable_raw_fini(
void)