m68knommu: remove local gettimeofday code
[wrt350n-kernel.git] / net / ipv6 / netfilter / ip6table_raw.c
blobeccbaaa104af264a3308208178abce7c30a0c64b
1 /*
2 * IPv6 raw table, a port of the IPv4 raw table to IPv6
4 * Copyright (C) 2003 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
5 */
6 #include <linux/module.h>
7 #include <linux/netfilter_ipv6/ip6_tables.h>
9 #define RAW_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_OUT))
11 static struct
13 struct ip6t_replace repl;
14 struct ip6t_standard entries[2];
15 struct ip6t_error term;
16 } initial_table __initdata = {
17 .repl = {
18 .name = "raw",
19 .valid_hooks = RAW_VALID_HOOKS,
20 .num_entries = 3,
21 .size = sizeof(struct ip6t_standard) * 2 + sizeof(struct ip6t_error),
22 .hook_entry = {
23 [NF_INET_PRE_ROUTING] = 0,
24 [NF_INET_LOCAL_OUT] = sizeof(struct ip6t_standard)
26 .underflow = {
27 [NF_INET_PRE_ROUTING] = 0,
28 [NF_INET_LOCAL_OUT] = sizeof(struct ip6t_standard)
31 .entries = {
32 IP6T_STANDARD_INIT(NF_ACCEPT), /* PRE_ROUTING */
33 IP6T_STANDARD_INIT(NF_ACCEPT), /* LOCAL_OUT */
35 .term = IP6T_ERROR_INIT, /* ERROR */
38 static struct xt_table packet_raw = {
39 .name = "raw",
40 .valid_hooks = RAW_VALID_HOOKS,
41 .lock = RW_LOCK_UNLOCKED,
42 .me = THIS_MODULE,
43 .af = AF_INET6,
46 /* The work comes in here from netfilter.c. */
47 static unsigned int
48 ip6t_hook(unsigned int hook,
49 struct sk_buff *skb,
50 const struct net_device *in,
51 const struct net_device *out,
52 int (*okfn)(struct sk_buff *))
54 return ip6t_do_table(skb, hook, in, out, &packet_raw);
57 static struct nf_hook_ops ip6t_ops[] __read_mostly = {
59 .hook = ip6t_hook,
60 .pf = PF_INET6,
61 .hooknum = NF_INET_PRE_ROUTING,
62 .priority = NF_IP6_PRI_FIRST,
63 .owner = THIS_MODULE,
66 .hook = ip6t_hook,
67 .pf = PF_INET6,
68 .hooknum = NF_INET_LOCAL_OUT,
69 .priority = NF_IP6_PRI_FIRST,
70 .owner = THIS_MODULE,
74 static int __init ip6table_raw_init(void)
76 int ret;
78 /* Register table */
79 ret = ip6t_register_table(&packet_raw, &initial_table.repl);
80 if (ret < 0)
81 return ret;
83 /* Register hooks */
84 ret = nf_register_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops));
85 if (ret < 0)
86 goto cleanup_table;
88 return ret;
90 cleanup_table:
91 ip6t_unregister_table(&packet_raw);
92 return ret;
95 static void __exit ip6table_raw_fini(void)
97 nf_unregister_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops));
98 ip6t_unregister_table(&packet_raw);
101 module_init(ip6table_raw_init);
102 module_exit(ip6table_raw_fini);
103 MODULE_LICENSE("GPL");