Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / net / ipv4 / netfilter / ip_conntrack_proto_generic.c
blob88c3712bd251f406d48fa1b7beb861289e953487
1 /* (C) 1999-2001 Paul `Rusty' Russell
2 * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
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 */
9 #include <linux/types.h>
10 #include <linux/sched.h>
11 #include <linux/timer.h>
12 #include <linux/netfilter.h>
13 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
15 unsigned long ip_ct_generic_timeout = 600*HZ;
17 static int generic_pkt_to_tuple(const struct sk_buff *skb,
18 unsigned int dataoff,
19 struct ip_conntrack_tuple *tuple)
21 tuple->src.u.all = 0;
22 tuple->dst.u.all = 0;
24 return 1;
27 static int generic_invert_tuple(struct ip_conntrack_tuple *tuple,
28 const struct ip_conntrack_tuple *orig)
30 tuple->src.u.all = 0;
31 tuple->dst.u.all = 0;
33 return 1;
36 /* Print out the per-protocol part of the tuple. */
37 static int generic_print_tuple(struct seq_file *s,
38 const struct ip_conntrack_tuple *tuple)
40 return 0;
43 /* Print out the private part of the conntrack. */
44 static int generic_print_conntrack(struct seq_file *s,
45 const struct ip_conntrack *state)
47 return 0;
50 /* Returns verdict for packet, or -1 for invalid. */
51 static int packet(struct ip_conntrack *conntrack,
52 const struct sk_buff *skb,
53 enum ip_conntrack_info ctinfo)
55 ip_ct_refresh_acct(conntrack, ctinfo, skb, ip_ct_generic_timeout);
56 return NF_ACCEPT;
59 /* Called when a new connection for this protocol found. */
60 static int new(struct ip_conntrack *conntrack, const struct sk_buff *skb)
62 return 1;
65 struct ip_conntrack_protocol ip_conntrack_generic_protocol =
67 .proto = 0,
68 .name = "unknown",
69 .pkt_to_tuple = generic_pkt_to_tuple,
70 .invert_tuple = generic_invert_tuple,
71 .print_tuple = generic_print_tuple,
72 .print_conntrack = generic_print_conntrack,
73 .packet = packet,
74 .new = new,