Signed-off-by: Arnaud Lacombe <lacombar@xxxxxxxxx> --- include/linux/compat-2.6.22.h | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/include/linux/compat-2.6.22.h b/include/linux/compat-2.6.22.h index e0cdab2..73dbbb6 100644 --- a/include/linux/compat-2.6.22.h +++ b/include/linux/compat-2.6.22.h @@ -80,6 +80,26 @@ static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb, memcpy(to, skb->data + offset, len); } +static inline struct iphdr *ip_hdr(const struct sk_buff *skb) +{ + return (struct iphdr *)skb_network_header(skb); +} + +static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) +{ + return (struct tcphdr *)skb_transport_header(skb); +} + +static inline unsigned int tcp_hdrlen(const struct sk_buff *skb) +{ + return tcp_hdr(skb)->doff * 4; +} + +static inline unsigned int tcp_optlen(const struct sk_buff *skb) +{ + return (tcp_hdr(skb)->doff - 5) * 4; +} + #if defined(__GNUC__) #define __maybe_unused __attribute__((unused)) #define uninitialized_var(x) x = x -- 1.7.2.30.gc37d7.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html