]>
Commit | Line | Data |
---|---|---|
9fb9cbb1 YK |
1 | /* |
2 | * (C) 2003,2004 USAGI/WIDE Project <http://www.linux-ipv6.org> | |
3 | * | |
4 | * Based largely upon the original ip_conntrack code which | |
5 | * had the following copyright information: | |
6 | * | |
7 | * (C) 1999-2001 Paul `Rusty' Russell | |
8 | * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org> | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License version 2 as | |
12 | * published by the Free Software Foundation. | |
13 | * | |
14 | * Author: | |
15 | * Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp> | |
16 | */ | |
17 | ||
9fb9cbb1 YK |
18 | #include <linux/types.h> |
19 | #include <linux/ip.h> | |
20 | #include <linux/netfilter.h> | |
21 | #include <linux/module.h> | |
22 | #include <linux/skbuff.h> | |
23 | #include <linux/icmp.h> | |
24 | #include <linux/sysctl.h> | |
25 | #include <net/ip.h> | |
26 | ||
27 | #include <linux/netfilter_ipv4.h> | |
28 | #include <net/netfilter/nf_conntrack.h> | |
605dcad6 | 29 | #include <net/netfilter/nf_conntrack_l4proto.h> |
9fb9cbb1 YK |
30 | #include <net/netfilter/nf_conntrack_l3proto.h> |
31 | #include <net/netfilter/nf_conntrack_core.h> | |
32 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> | |
33 | ||
8ce8439a JE |
34 | static bool generic_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff, |
35 | struct nf_conntrack_tuple *tuple) | |
9fb9cbb1 YK |
36 | { |
37 | memset(&tuple->src.u3, 0, sizeof(tuple->src.u3)); | |
38 | memset(&tuple->dst.u3, 0, sizeof(tuple->dst.u3)); | |
39 | ||
8ce8439a | 40 | return true; |
9fb9cbb1 YK |
41 | } |
42 | ||
8ce8439a JE |
43 | static bool generic_invert_tuple(struct nf_conntrack_tuple *tuple, |
44 | const struct nf_conntrack_tuple *orig) | |
9fb9cbb1 YK |
45 | { |
46 | memset(&tuple->src.u3, 0, sizeof(tuple->src.u3)); | |
47 | memset(&tuple->dst.u3, 0, sizeof(tuple->dst.u3)); | |
48 | ||
8ce8439a | 49 | return true; |
9fb9cbb1 YK |
50 | } |
51 | ||
824f1fbe JP |
52 | static void generic_print_tuple(struct seq_file *s, |
53 | const struct nf_conntrack_tuple *tuple) | |
9fb9cbb1 | 54 | { |
9fb9cbb1 YK |
55 | } |
56 | ||
ffc30690 YK |
57 | static int generic_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, |
58 | unsigned int *dataoff, u_int8_t *protonum) | |
9fb9cbb1 YK |
59 | { |
60 | /* Never track !!! */ | |
61 | return -NF_ACCEPT; | |
62 | } | |
63 | ||
64 | ||
61075af5 | 65 | struct nf_conntrack_l3proto nf_conntrack_l3proto_generic __read_mostly = { |
9fb9cbb1 YK |
66 | .l3proto = PF_UNSPEC, |
67 | .name = "unknown", | |
68 | .pkt_to_tuple = generic_pkt_to_tuple, | |
69 | .invert_tuple = generic_invert_tuple, | |
70 | .print_tuple = generic_print_tuple, | |
ffc30690 | 71 | .get_l4proto = generic_get_l4proto, |
9fb9cbb1 | 72 | }; |
e4bd8bce | 73 | EXPORT_SYMBOL_GPL(nf_conntrack_l3proto_generic); |