aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netfilter
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /include/net/netfilter
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'include/net/netfilter')
-rw-r--r--include/net/netfilter/nf_nat_protocol.h74
-rw-r--r--include/net/netfilter/nf_nat_rule.h15
2 files changed, 89 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h
new file mode 100644
index 00000000000..93cc90d28e6
--- /dev/null
+++ b/include/net/netfilter/nf_nat_protocol.h
@@ -0,0 +1,74 @@
1/* Header for use in defining a given protocol. */
2#ifndef _NF_NAT_PROTOCOL_H
3#define _NF_NAT_PROTOCOL_H
4#include <net/netfilter/nf_nat.h>
5#include <linux/netfilter/nfnetlink_conntrack.h>
6
7struct nf_nat_range;
8
9struct nf_nat_protocol {
10 /* Protocol number. */
11 unsigned int protonum;
12
13 struct module *me;
14
15 /* Translate a packet to the target according to manip type.
16 Return true if succeeded. */
17 bool (*manip_pkt)(struct sk_buff *skb,
18 unsigned int iphdroff,
19 const struct nf_conntrack_tuple *tuple,
20 enum nf_nat_manip_type maniptype);
21
22 /* Is the manipable part of the tuple between min and max incl? */
23 bool (*in_range)(const struct nf_conntrack_tuple *tuple,
24 enum nf_nat_manip_type maniptype,
25 const union nf_conntrack_man_proto *min,
26 const union nf_conntrack_man_proto *max);
27
28 /* Alter the per-proto part of the tuple (depending on
29 maniptype), to give a unique tuple in the given range if
30 possible. Per-protocol part of tuple is initialized to the
31 incoming packet. */
32 void (*unique_tuple)(struct nf_conntrack_tuple *tuple,
33 const struct nf_nat_range *range,
34 enum nf_nat_manip_type maniptype,
35 const struct nf_conn *ct);
36
37 int (*range_to_nlattr)(struct sk_buff *skb,
38 const struct nf_nat_range *range);
39
40 int (*nlattr_to_range)(struct nlattr *tb[],
41 struct nf_nat_range *range);
42};
43
44/* Protocol registration. */
45extern int nf_nat_protocol_register(const struct nf_nat_protocol *proto);
46extern void nf_nat_protocol_unregister(const struct nf_nat_protocol *proto);
47
48/* Built-in protocols. */
49extern const struct nf_nat_protocol nf_nat_protocol_tcp;
50extern const struct nf_nat_protocol nf_nat_protocol_udp;
51extern const struct nf_nat_protocol nf_nat_protocol_icmp;
52extern const struct nf_nat_protocol nf_nat_unknown_protocol;
53
54extern int init_protocols(void) __init;
55extern void cleanup_protocols(void);
56extern const struct nf_nat_protocol *find_nat_proto(u_int16_t protonum);
57
58extern bool nf_nat_proto_in_range(const struct nf_conntrack_tuple *tuple,
59 enum nf_nat_manip_type maniptype,
60 const union nf_conntrack_man_proto *min,
61 const union nf_conntrack_man_proto *max);
62
63extern void nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
64 const struct nf_nat_range *range,
65 enum nf_nat_manip_type maniptype,
66 const struct nf_conn *ct,
67 u_int16_t *rover);
68
69extern int nf_nat_proto_range_to_nlattr(struct sk_buff *skb,
70 const struct nf_nat_range *range);
71extern int nf_nat_proto_nlattr_to_range(struct nlattr *tb[],
72 struct nf_nat_range *range);
73
74#endif /*_NF_NAT_PROTO_H*/
diff --git a/include/net/netfilter/nf_nat_rule.h b/include/net/netfilter/nf_nat_rule.h
new file mode 100644
index 00000000000..2890bdc4cd9
--- /dev/null
+++ b/include/net/netfilter/nf_nat_rule.h
@@ -0,0 +1,15 @@
1#ifndef _NF_NAT_RULE_H
2#define _NF_NAT_RULE_H
3#include <net/netfilter/nf_conntrack.h>
4#include <net/netfilter/nf_nat.h>
5#include <linux/netfilter_ipv4/ip_tables.h>
6
7extern int nf_nat_rule_init(void) __init;
8extern void nf_nat_rule_cleanup(void);
9extern int nf_nat_rule_find(struct sk_buff *skb,
10 unsigned int hooknum,
11 const struct net_device *in,
12 const struct net_device *out,
13 struct nf_conn *ct);
14
15#endif /* _NF_NAT_RULE_H */