Root/
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> |
10 | #include <linux/jiffies.h> |
11 | #include <linux/timer.h> |
12 | #include <linux/netfilter.h> |
13 | #include <net/netfilter/nf_conntrack_l4proto.h> |
14 | |
15 | static unsigned int nf_ct_generic_timeout __read_mostly = 600*HZ; |
16 | |
17 | static bool generic_pkt_to_tuple(const struct sk_buff *skb, |
18 | unsigned int dataoff, |
19 | struct nf_conntrack_tuple *tuple) |
20 | { |
21 | tuple->src.u.all = 0; |
22 | tuple->dst.u.all = 0; |
23 | |
24 | return true; |
25 | } |
26 | |
27 | static bool generic_invert_tuple(struct nf_conntrack_tuple *tuple, |
28 | const struct nf_conntrack_tuple *orig) |
29 | { |
30 | tuple->src.u.all = 0; |
31 | tuple->dst.u.all = 0; |
32 | |
33 | return true; |
34 | } |
35 | |
36 | /* Print out the per-protocol part of the tuple. */ |
37 | static int generic_print_tuple(struct seq_file *s, |
38 | const struct nf_conntrack_tuple *tuple) |
39 | { |
40 | return 0; |
41 | } |
42 | |
43 | /* Returns verdict for packet, or -1 for invalid. */ |
44 | static int packet(struct nf_conn *ct, |
45 | const struct sk_buff *skb, |
46 | unsigned int dataoff, |
47 | enum ip_conntrack_info ctinfo, |
48 | u_int8_t pf, |
49 | unsigned int hooknum) |
50 | { |
51 | nf_ct_refresh_acct(ct, ctinfo, skb, nf_ct_generic_timeout); |
52 | return NF_ACCEPT; |
53 | } |
54 | |
55 | /* Called when a new connection for this protocol found. */ |
56 | static bool new(struct nf_conn *ct, const struct sk_buff *skb, |
57 | unsigned int dataoff) |
58 | { |
59 | return true; |
60 | } |
61 | |
62 | #ifdef CONFIG_SYSCTL |
63 | static struct ctl_table_header *generic_sysctl_header; |
64 | static struct ctl_table generic_sysctl_table[] = { |
65 | { |
66 | .procname = "nf_conntrack_generic_timeout", |
67 | .data = &nf_ct_generic_timeout, |
68 | .maxlen = sizeof(unsigned int), |
69 | .mode = 0644, |
70 | .proc_handler = proc_dointvec_jiffies, |
71 | }, |
72 | { } |
73 | }; |
74 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT |
75 | static struct ctl_table generic_compat_sysctl_table[] = { |
76 | { |
77 | .procname = "ip_conntrack_generic_timeout", |
78 | .data = &nf_ct_generic_timeout, |
79 | .maxlen = sizeof(unsigned int), |
80 | .mode = 0644, |
81 | .proc_handler = proc_dointvec_jiffies, |
82 | }, |
83 | { } |
84 | }; |
85 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ |
86 | #endif /* CONFIG_SYSCTL */ |
87 | |
88 | struct nf_conntrack_l4proto nf_conntrack_l4proto_generic __read_mostly = |
89 | { |
90 | .l3proto = PF_UNSPEC, |
91 | .l4proto = 255, |
92 | .name = "unknown", |
93 | .pkt_to_tuple = generic_pkt_to_tuple, |
94 | .invert_tuple = generic_invert_tuple, |
95 | .print_tuple = generic_print_tuple, |
96 | .packet = packet, |
97 | .new = new, |
98 | #ifdef CONFIG_SYSCTL |
99 | .ctl_table_header = &generic_sysctl_header, |
100 | .ctl_table = generic_sysctl_table, |
101 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT |
102 | .ctl_compat_table = generic_compat_sysctl_table, |
103 | #endif |
104 | #endif |
105 | }; |
106 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9