6ff71524023bba55518c6601a0ef9d8a6cf08d42
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / include / linux / ip.h
1 #ifndef __LINUX_IP_WRAPPER_H
2 #define __LINUX_IP_WRAPPER_H 1
3
4 #include_next <linux/ip.h>
5
6 #ifndef HAVE_SKBUFF_HEADER_HELPERS
7 #include <linux/skbuff.h>
8 static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
9 {
10         return (struct iphdr *)skb_network_header(skb);
11 }
12
13 static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
14 {
15         return ip_hdr(skb)->ihl * 4;
16 }
17 #endif /* !HAVE_SKBUFF_HEADER_HELPERS */
18
19 #endif