aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dccp.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-25 21:04:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:31 -0400
commit9c70220b73908f64792422a2c39c593c4792f2c5 (patch)
tree2090ea10aaa2714a5e095bae8cc02e743c378a3a /include/linux/dccp.h
parenta27ef749e7be3b06fb58df53d94eb97a21f18707 (diff)
[SK_BUFF]: Introduce skb_transport_header(skb)
For the places where we need a pointer to the transport header, it is still legal to touch skb->h.raw directly if just adding to, subtracting from or setting it to another layer header. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/dccp.h')
-rw-r--r--include/linux/dccp.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 1f4df61735f..fdd4217f104 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -260,19 +260,20 @@ enum {
260 260
261static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) 261static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb)
262{ 262{
263 return (struct dccp_hdr *)skb->h.raw; 263 return (struct dccp_hdr *)skb_transport_header(skb);
264} 264}
265 265
266static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen) 266static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen)
267{ 267{
268 skb_push(skb, headlen); 268 skb_push(skb, headlen);
269 skb_reset_transport_header(skb); 269 skb_reset_transport_header(skb);
270 return memset(skb->h.raw, 0, headlen); 270 return memset(skb_transport_header(skb), 0, headlen);
271} 271}
272 272
273static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) 273static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb)
274{ 274{
275 return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); 275 return (struct dccp_hdr_ext *)(skb_transport_header(skb) +
276 sizeof(struct dccp_hdr));
276} 277}
277 278
278static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh) 279static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh)
@@ -301,12 +302,14 @@ static inline __u64 dccp_hdr_seq(const struct sk_buff *skb)
301 302
302static inline struct dccp_hdr_request *dccp_hdr_request(struct sk_buff *skb) 303static inline struct dccp_hdr_request *dccp_hdr_request(struct sk_buff *skb)
303{ 304{
304 return (struct dccp_hdr_request *)(skb->h.raw + dccp_basic_hdr_len(skb)); 305 return (struct dccp_hdr_request *)(skb_transport_header(skb) +
306 dccp_basic_hdr_len(skb));
305} 307}
306 308
307static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff *skb) 309static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff *skb)
308{ 310{
309 return (struct dccp_hdr_ack_bits *)(skb->h.raw + dccp_basic_hdr_len(skb)); 311 return (struct dccp_hdr_ack_bits *)(skb_transport_header(skb) +
312 dccp_basic_hdr_len(skb));
310} 313}
311 314
312static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) 315static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb)
@@ -317,12 +320,14 @@ static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb)
317 320
318static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) 321static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb)
319{ 322{
320 return (struct dccp_hdr_response *)(skb->h.raw + dccp_basic_hdr_len(skb)); 323 return (struct dccp_hdr_response *)(skb_transport_header(skb) +
324 dccp_basic_hdr_len(skb));
321} 325}
322 326
323static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb) 327static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb)
324{ 328{
325 return (struct dccp_hdr_reset *)(skb->h.raw + dccp_basic_hdr_len(skb)); 329 return (struct dccp_hdr_reset *)(skb_transport_header(skb) +
330 dccp_basic_hdr_len(skb));
326} 331}
327 332
328static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh) 333static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh)