Patrick McHardy | c7232c9 | 2012-08-26 19:14:06 +0200 | [diff] [blame] | 1 | #ifndef _NF_NAT_L3PROTO_H |
| 2 | #define _NF_NAT_L3PROTO_H |
| 3 | |
| 4 | struct nf_nat_l4proto; |
| 5 | struct nf_nat_l3proto { |
| 6 | u8 l3proto; |
| 7 | |
| 8 | bool (*in_range)(const struct nf_conntrack_tuple *t, |
| 9 | const struct nf_nat_range *range); |
| 10 | |
| 11 | u32 (*secure_port)(const struct nf_conntrack_tuple *t, __be16); |
| 12 | |
| 13 | bool (*manip_pkt)(struct sk_buff *skb, |
| 14 | unsigned int iphdroff, |
| 15 | const struct nf_nat_l4proto *l4proto, |
| 16 | const struct nf_conntrack_tuple *target, |
| 17 | enum nf_nat_manip_type maniptype); |
| 18 | |
| 19 | void (*csum_update)(struct sk_buff *skb, unsigned int iphdroff, |
| 20 | __sum16 *check, |
| 21 | const struct nf_conntrack_tuple *t, |
| 22 | enum nf_nat_manip_type maniptype); |
| 23 | |
| 24 | void (*csum_recalc)(struct sk_buff *skb, u8 proto, |
| 25 | void *data, __sum16 *check, |
| 26 | int datalen, int oldlen); |
| 27 | |
| 28 | void (*decode_session)(struct sk_buff *skb, |
| 29 | const struct nf_conn *ct, |
| 30 | enum ip_conntrack_dir dir, |
| 31 | unsigned long statusbit, |
| 32 | struct flowi *fl); |
| 33 | |
| 34 | int (*nlattr_to_range)(struct nlattr *tb[], |
| 35 | struct nf_nat_range *range); |
| 36 | }; |
| 37 | |
Joe Perches | 4e77be4 | 2013-09-23 11:37:48 -0700 | [diff] [blame] | 38 | int nf_nat_l3proto_register(const struct nf_nat_l3proto *); |
| 39 | void nf_nat_l3proto_unregister(const struct nf_nat_l3proto *); |
| 40 | const struct nf_nat_l3proto *__nf_nat_l3proto_find(u8 l3proto); |
Patrick McHardy | c7232c9 | 2012-08-26 19:14:06 +0200 | [diff] [blame] | 41 | |
Joe Perches | 4e77be4 | 2013-09-23 11:37:48 -0700 | [diff] [blame] | 42 | int nf_nat_icmp_reply_translation(struct sk_buff *skb, struct nf_conn *ct, |
| 43 | enum ip_conntrack_info ctinfo, |
| 44 | unsigned int hooknum); |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 45 | |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 46 | unsigned int nf_nat_ipv4_in(void *priv, struct sk_buff *skb, |
David S. Miller | d7cf408 | 2015-04-03 20:51:13 -0400 | [diff] [blame] | 47 | const struct nf_hook_state *state, |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 48 | unsigned int (*do_chain)(void *priv, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 49 | struct sk_buff *skb, |
David S. Miller | d7cf408 | 2015-04-03 20:51:13 -0400 | [diff] [blame] | 50 | const struct nf_hook_state *state, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 51 | struct nf_conn *ct)); |
| 52 | |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 53 | unsigned int nf_nat_ipv4_out(void *priv, struct sk_buff *skb, |
David S. Miller | d7cf408 | 2015-04-03 20:51:13 -0400 | [diff] [blame] | 54 | const struct nf_hook_state *state, |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 55 | unsigned int (*do_chain)(void *priv, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 56 | struct sk_buff *skb, |
David S. Miller | d7cf408 | 2015-04-03 20:51:13 -0400 | [diff] [blame] | 57 | const struct nf_hook_state *state, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 58 | struct nf_conn *ct)); |
| 59 | |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 60 | unsigned int nf_nat_ipv4_local_fn(void *priv, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 61 | struct sk_buff *skb, |
David S. Miller | d7cf408 | 2015-04-03 20:51:13 -0400 | [diff] [blame] | 62 | const struct nf_hook_state *state, |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 63 | unsigned int (*do_chain)(void *priv, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 64 | struct sk_buff *skb, |
David S. Miller | d7cf408 | 2015-04-03 20:51:13 -0400 | [diff] [blame] | 65 | const struct nf_hook_state *state, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 66 | struct nf_conn *ct)); |
| 67 | |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 68 | unsigned int nf_nat_ipv4_fn(void *priv, struct sk_buff *skb, |
David S. Miller | d7cf408 | 2015-04-03 20:51:13 -0400 | [diff] [blame] | 69 | const struct nf_hook_state *state, |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 70 | unsigned int (*do_chain)(void *priv, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 71 | struct sk_buff *skb, |
David S. Miller | d7cf408 | 2015-04-03 20:51:13 -0400 | [diff] [blame] | 72 | const struct nf_hook_state *state, |
Pablo Neira Ayuso | 30766f4 | 2014-08-05 20:02:42 +0200 | [diff] [blame] | 73 | struct nf_conn *ct)); |
| 74 | |
Joe Perches | 4e77be4 | 2013-09-23 11:37:48 -0700 | [diff] [blame] | 75 | int nf_nat_icmpv6_reply_translation(struct sk_buff *skb, struct nf_conn *ct, |
| 76 | enum ip_conntrack_info ctinfo, |
| 77 | unsigned int hooknum, unsigned int hdrlen); |
Patrick McHardy | c7232c9 | 2012-08-26 19:14:06 +0200 | [diff] [blame] | 78 | |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 79 | unsigned int nf_nat_ipv6_in(void *priv, struct sk_buff *skb, |
David S. Miller | 8fe2238 | 2015-04-03 21:05:07 -0400 | [diff] [blame] | 80 | const struct nf_hook_state *state, |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 81 | unsigned int (*do_chain)(void *priv, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 82 | struct sk_buff *skb, |
David S. Miller | 8fe2238 | 2015-04-03 21:05:07 -0400 | [diff] [blame] | 83 | const struct nf_hook_state *state, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 84 | struct nf_conn *ct)); |
| 85 | |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 86 | unsigned int nf_nat_ipv6_out(void *priv, struct sk_buff *skb, |
David S. Miller | 8fe2238 | 2015-04-03 21:05:07 -0400 | [diff] [blame] | 87 | const struct nf_hook_state *state, |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 88 | unsigned int (*do_chain)(void *priv, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 89 | struct sk_buff *skb, |
David S. Miller | 8fe2238 | 2015-04-03 21:05:07 -0400 | [diff] [blame] | 90 | const struct nf_hook_state *state, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 91 | struct nf_conn *ct)); |
| 92 | |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 93 | unsigned int nf_nat_ipv6_local_fn(void *priv, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 94 | struct sk_buff *skb, |
David S. Miller | 8fe2238 | 2015-04-03 21:05:07 -0400 | [diff] [blame] | 95 | const struct nf_hook_state *state, |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 96 | unsigned int (*do_chain)(void *priv, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 97 | struct sk_buff *skb, |
David S. Miller | 8fe2238 | 2015-04-03 21:05:07 -0400 | [diff] [blame] | 98 | const struct nf_hook_state *state, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 99 | struct nf_conn *ct)); |
| 100 | |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 101 | unsigned int nf_nat_ipv6_fn(void *priv, struct sk_buff *skb, |
David S. Miller | 8fe2238 | 2015-04-03 21:05:07 -0400 | [diff] [blame] | 102 | const struct nf_hook_state *state, |
Eric W. Biederman | 06198b3 | 2015-09-18 14:33:06 -0500 | [diff] [blame] | 103 | unsigned int (*do_chain)(void *priv, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 104 | struct sk_buff *skb, |
David S. Miller | 8fe2238 | 2015-04-03 21:05:07 -0400 | [diff] [blame] | 105 | const struct nf_hook_state *state, |
Pablo Neira Ayuso | 2a5538e | 2014-08-25 12:05:27 +0200 | [diff] [blame] | 106 | struct nf_conn *ct)); |
| 107 | |
Patrick McHardy | c7232c9 | 2012-08-26 19:14:06 +0200 | [diff] [blame] | 108 | #endif /* _NF_NAT_L3PROTO_H */ |