diff options
author | Patrick McHardy <kaber@trash.net> | 2010-02-11 06:23:53 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-02-11 06:23:53 -0500 |
commit | 3b6b9fab42fe98358d70735cf98d43fc18dc79c9 (patch) | |
tree | 98703e92c7259e35b7d6cd557bf0c1a6965f4e7c /include/linux | |
parent | 54101f4f3bed87fa968b57f77f8ff3b09fd88bcf (diff) |
netfilter: nf_conntrack_sip: pass data offset to NAT functions
When using TCP multiple SIP messages might be present in a single packet.
A following patch will parse them by setting the dptr to the beginning of
each message. The NAT helper needs to reload the dptr value after mangling
the packet however, so it needs to know the offset of the message to the
beginning of the packet.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netfilter/nf_conntrack_sip.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 23aa2ec6b7b7..2c6950b8bf7e 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
@@ -34,10 +34,10 @@ struct sdp_media_type { | |||
34 | struct sip_handler { | 34 | struct sip_handler { |
35 | const char *method; | 35 | const char *method; |
36 | unsigned int len; | 36 | unsigned int len; |
37 | int (*request)(struct sk_buff *skb, | 37 | int (*request)(struct sk_buff *skb, unsigned int dataoff, |
38 | const char **dptr, unsigned int *datalen, | 38 | const char **dptr, unsigned int *datalen, |
39 | unsigned int cseq); | 39 | unsigned int cseq); |
40 | int (*response)(struct sk_buff *skb, | 40 | int (*response)(struct sk_buff *skb, unsigned int dataoff, |
41 | const char **dptr, unsigned int *datalen, | 41 | const char **dptr, unsigned int *datalen, |
42 | unsigned int cseq, unsigned int code); | 42 | unsigned int cseq, unsigned int code); |
43 | }; | 43 | }; |
@@ -100,33 +100,39 @@ enum sdp_header_types { | |||
100 | }; | 100 | }; |
101 | 101 | ||
102 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, | 102 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, |
103 | unsigned int dataoff, | ||
103 | const char **dptr, | 104 | const char **dptr, |
104 | unsigned int *datalen); | 105 | unsigned int *datalen); |
105 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, | 106 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, |
107 | unsigned int dataoff, | ||
106 | const char **dptr, | 108 | const char **dptr, |
107 | unsigned int *datalen, | 109 | unsigned int *datalen, |
108 | struct nf_conntrack_expect *exp, | 110 | struct nf_conntrack_expect *exp, |
109 | unsigned int matchoff, | 111 | unsigned int matchoff, |
110 | unsigned int matchlen); | 112 | unsigned int matchlen); |
111 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, | 113 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, |
112 | const char **dptr, | ||
113 | unsigned int dataoff, | 114 | unsigned int dataoff, |
115 | const char **dptr, | ||
114 | unsigned int *datalen, | 116 | unsigned int *datalen, |
117 | unsigned int sdpoff, | ||
115 | enum sdp_header_types type, | 118 | enum sdp_header_types type, |
116 | enum sdp_header_types term, | 119 | enum sdp_header_types term, |
117 | const union nf_inet_addr *addr); | 120 | const union nf_inet_addr *addr); |
118 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, | 121 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, |
122 | unsigned int dataoff, | ||
119 | const char **dptr, | 123 | const char **dptr, |
120 | unsigned int *datalen, | 124 | unsigned int *datalen, |
121 | unsigned int matchoff, | 125 | unsigned int matchoff, |
122 | unsigned int matchlen, | 126 | unsigned int matchlen, |
123 | u_int16_t port); | 127 | u_int16_t port); |
124 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, | 128 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, |
125 | const char **dptr, | ||
126 | unsigned int dataoff, | 129 | unsigned int dataoff, |
130 | const char **dptr, | ||
127 | unsigned int *datalen, | 131 | unsigned int *datalen, |
132 | unsigned int sdpoff, | ||
128 | const union nf_inet_addr *addr); | 133 | const union nf_inet_addr *addr); |
129 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, | 134 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, |
135 | unsigned int dataoff, | ||
130 | const char **dptr, | 136 | const char **dptr, |
131 | unsigned int *datalen, | 137 | unsigned int *datalen, |
132 | struct nf_conntrack_expect *rtp_exp, | 138 | struct nf_conntrack_expect *rtp_exp, |