]> err.no Git - linux-2.6/blobdiff - include/linux/tcp.h
[PATCH] zd1211rw: Extend RF layer
[linux-2.6] / include / linux / tcp.h
index 18a468dd5055213a8c8fb47008eed78b9cbf912c..c6b9f92e8289949bde61f0ea384f48349d5a083f 100644 (file)
@@ -178,6 +178,21 @@ struct tcp_md5sig {
 #include <net/inet_connection_sock.h>
 #include <net/inet_timewait_sock.h>
 
+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;
+}
+
 /* This defines a selective acknowledgement block. */
 struct tcp_sack_block_wire {
        __be32  start_seq;