Files
openflow/datapath/linux-2.6/compat-2.6/include/linux/tcp.h
T
Ben Pfaff 7fe9460749 Compatibility fixes for 2.6.18 kernel
Functions added in the 2.6.22 kernel in tcp.h and skbuff.h
have been added to the compatibility headers. Additionally
the data argument was dropped in 2.6.22 for the work queue
macros, requiring them to be redfined for previous kernels.

Based on changes from David Erickson.
2008-09-05 21:46:20 -07:00

24 lines
483 B
C

#ifndef __LINUX_TCP_WRAPPER_H
#define __LINUX_TCP_WRAPPER_H 1
#include_next <linux/tcp.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
#ifdef __KERNEL__
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;
}
#endif /* __KERNEL__ */
#endif /* linux kernel < 2.6.22 */
#endif