Linux-2.6.12-rc2
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / net / ipv4 / netfilter / ip_nat_proto_unknown.c
1 /* The "unknown" protocol. This is what is used for protocols we
2 * don't understand. It's returned by ip_ct_find_proto().
3 */
4
5 /* (C) 1999-2001 Paul `Rusty' Russell
6 * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13 #include <linux/types.h>
14 #include <linux/init.h>
15 #include <linux/netfilter.h>
16 #include <linux/if.h>
17
18 #include <linux/netfilter_ipv4/ip_nat.h>
19 #include <linux/netfilter_ipv4/ip_nat_rule.h>
20 #include <linux/netfilter_ipv4/ip_nat_protocol.h>
21
22 static int unknown_in_range(const struct ip_conntrack_tuple *tuple,
23 enum ip_nat_manip_type manip_type,
24 const union ip_conntrack_manip_proto *min,
25 const union ip_conntrack_manip_proto *max)
26 {
27 return 1;
28 }
29
30 static int unknown_unique_tuple(struct ip_conntrack_tuple *tuple,
31 const struct ip_nat_range *range,
32 enum ip_nat_manip_type maniptype,
33 const struct ip_conntrack *conntrack)
34 {
35 /* Sorry: we can't help you; if it's not unique, we can't frob
36 anything. */
37 return 0;
38 }
39
40 static int
41 unknown_manip_pkt(struct sk_buff **pskb,
42 unsigned int iphdroff,
43 const struct ip_conntrack_tuple *tuple,
44 enum ip_nat_manip_type maniptype)
45 {
46 return 1;
47 }
48
49 static unsigned int
50 unknown_print(char *buffer,
51 const struct ip_conntrack_tuple *match,
52 const struct ip_conntrack_tuple *mask)
53 {
54 return 0;
55 }
56
57 static unsigned int
58 unknown_print_range(char *buffer, const struct ip_nat_range *range)
59 {
60 return 0;
61 }
62
63 struct ip_nat_protocol ip_nat_unknown_protocol = {
64 "unknown", 0,
65 unknown_manip_pkt,
66 unknown_in_range,
67 unknown_unique_tuple,
68 unknown_print,
69 unknown_print_range
70 };