]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* (C) 1999-2001 Paul `Rusty' Russell |
2 | * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org> | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License version 2 as | |
6 | * published by the Free Software Foundation. | |
7 | */ | |
8 | ||
9 | #include <linux/types.h> | |
1da177e4 LT |
10 | #include <linux/timer.h> |
11 | #include <linux/netfilter.h> | |
12 | #include <linux/netfilter_ipv4/ip_conntrack_protocol.h> | |
13 | ||
94aec08e | 14 | unsigned int ip_ct_generic_timeout __read_mostly = 600*HZ; |
1da177e4 LT |
15 | |
16 | static int generic_pkt_to_tuple(const struct sk_buff *skb, | |
17 | unsigned int dataoff, | |
18 | struct ip_conntrack_tuple *tuple) | |
19 | { | |
20 | tuple->src.u.all = 0; | |
21 | tuple->dst.u.all = 0; | |
22 | ||
23 | return 1; | |
24 | } | |
25 | ||
26 | static int generic_invert_tuple(struct ip_conntrack_tuple *tuple, | |
27 | const struct ip_conntrack_tuple *orig) | |
28 | { | |
29 | tuple->src.u.all = 0; | |
30 | tuple->dst.u.all = 0; | |
31 | ||
32 | return 1; | |
33 | } | |
34 | ||
35 | /* Print out the per-protocol part of the tuple. */ | |
36 | static int generic_print_tuple(struct seq_file *s, | |
37 | const struct ip_conntrack_tuple *tuple) | |
38 | { | |
39 | return 0; | |
40 | } | |
41 | ||
42 | /* Print out the private part of the conntrack. */ | |
43 | static int generic_print_conntrack(struct seq_file *s, | |
44 | const struct ip_conntrack *state) | |
45 | { | |
46 | return 0; | |
47 | } | |
48 | ||
49 | /* Returns verdict for packet, or -1 for invalid. */ | |
50 | static int packet(struct ip_conntrack *conntrack, | |
51 | const struct sk_buff *skb, | |
52 | enum ip_conntrack_info ctinfo) | |
53 | { | |
54 | ip_ct_refresh_acct(conntrack, ctinfo, skb, ip_ct_generic_timeout); | |
55 | return NF_ACCEPT; | |
56 | } | |
57 | ||
58 | /* Called when a new connection for this protocol found. */ | |
59 | static int new(struct ip_conntrack *conntrack, const struct sk_buff *skb) | |
60 | { | |
61 | return 1; | |
62 | } | |
63 | ||
64 | struct ip_conntrack_protocol ip_conntrack_generic_protocol = | |
65 | { | |
66 | .proto = 0, | |
67 | .name = "unknown", | |
68 | .pkt_to_tuple = generic_pkt_to_tuple, | |
69 | .invert_tuple = generic_invert_tuple, | |
70 | .print_tuple = generic_print_tuple, | |
71 | .print_conntrack = generic_print_conntrack, | |
72 | .packet = packet, | |
73 | .new = new, | |
74 | }; |