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.
9 #include <linux/types.h>
10 #include <linux/timer.h>
11 #include <linux/netfilter.h>
12 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
14 unsigned int ip_ct_generic_timeout __read_mostly = 600*HZ;
16 static int generic_pkt_to_tuple(const struct sk_buff *skb,
18 struct ip_conntrack_tuple *tuple)
26 static int generic_invert_tuple(struct ip_conntrack_tuple *tuple,
27 const struct ip_conntrack_tuple *orig)
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)
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)
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)
54 ip_ct_refresh_acct(conntrack, ctinfo, skb, ip_ct_generic_timeout);
58 /* Called when a new connection for this protocol found. */
59 static int new(struct ip_conntrack *conntrack, const struct sk_buff *skb)
64 struct ip_conntrack_protocol ip_conntrack_generic_protocol =
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,