18 #include <linux/module.h>
19 #include <linux/netfilter_ipv4/ip_tables.h>
20 #include <linux/slab.h>
27 #define SECURITY_VALID_HOOKS (1 << NF_INET_LOCAL_IN) | \
28 (1 << NF_INET_FORWARD) | \
29 (1 << NF_INET_LOCAL_OUT)
31 static const struct xt_table security_table = {
49 ip_hdrlen(skb) <
sizeof(
struct iphdr)))
53 net = dev_net((in !=
NULL) ? in : out);
59 static int __net_init iptable_security_net_init(
struct net *net)
66 net->
ipv4.iptable_security =
69 return PTR_RET(net->
ipv4.iptable_security);
72 static void __net_exit iptable_security_net_exit(
struct net *net)
78 .init = iptable_security_net_init,
79 .exit = iptable_security_net_exit,
82 static int __init iptable_security_init(
void)
90 sectbl_ops =
xt_hook_link(&security_table, iptable_security_hook);
91 if (IS_ERR(sectbl_ops)) {
92 ret = PTR_ERR(sectbl_ops);
103 static void __exit iptable_security_fini(
void)