summaryrefslogtreecommitdiff
blob: 95f3b0f9090391829078ebfcd2bffa8de009d158 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff -Naurp netfilter/iptcrdr.c netfilter.new/iptcrdr.c
--- netfilter/iptcrdr.c	2011-06-22 20:34:51.000000000 +0000
+++ netfilter/iptcrdr.c	2011-07-29 19:26:50.703120526 +0000
@@ -29,7 +29,7 @@
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
 #define LIST_POISON2  ((void *) 0x00200200 )
 
-#include <net/netfilter/nf_nat.h>
+#include "tiny_nf_nat.h"
 #define ip_nat_multi_range	nf_nat_multi_range
 #define ip_nat_range		nf_nat_range
 #define IPTC_HANDLE		struct iptc_handle *
@@ -38,7 +38,7 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
 #include <linux/netfilter_ipv4/ip_nat.h>
 #else
-#include <linux/netfilter/nf_nat.h>
+#include "tiny_nf_nat.h"
 #endif
 #define IPTC_HANDLE		iptc_handle_t
 #endif
diff -Naurp netfilter/tiny_nf_nat.h netfilter.new/tiny_nf_nat.h
--- netfilter/tiny_nf_nat.h	1970-01-01 00:00:00.000000000 +0000
+++ netfilter/tiny_nf_nat.h	2011-07-29 19:26:26.895119616 +0000
@@ -0,0 +1,36 @@
+/* Only what miniupnpd needs, until linux-libc-dev gains nf_nat.h */
+
+#ifndef TINY_NF_NAT_H
+#define TINY_NF_NAT_H
+
+#include <linux/types.h>
+
+#define IP_NAT_RANGE_MAP_IPS 1
+#define IP_NAT_RANGE_PROTO_SPECIFIED 2
+#define IP_NAT_RANGE_PROTO_RANDOM 4
+#define IP_NAT_RANGE_PERSISTENT 8
+
+union nf_conntrack_man_proto {
+	__be16 all;
+	struct { __be16 port; } tcp;
+	struct { __be16 port; } udp;
+	struct { __be16 id;   } icmp;
+	struct { __be16 port; } dccp;
+	struct { __be16 port; } sctp;
+	struct { __be16 key;  } gre;
+};
+
+struct nf_nat_range {
+	unsigned int flags;
+	__be32 min_ip, max_ip;
+	union nf_conntrack_man_proto min, max;
+};
+
+struct nf_nat_multi_range_compat {
+	unsigned int rangesize;
+	struct nf_nat_range range[1];
+};
+
+#define nf_nat_multi_range nf_nat_multi_range_compat
+
+#endif /*TINY_NF_NAT_H*/