]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/tcp.h
[TCP]: Introduce tcp_hdrlen() and tcp_optlen()
[net-next-2.6.git] / include / linux / tcp.h
index 18a468dd5055213a8c8fb47008eed78b9cbf912c..244ae0dacf4a4232c733a0674f53cad53f35a972 100644 (file)
@@ -178,6 +178,16 @@ struct tcp_md5sig {
 #include <net/inet_connection_sock.h>
 #include <net/inet_timewait_sock.h>
 
+static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
+{
+       return skb->h.th->doff * 4;
+}
+
+static inline unsigned int tcp_optlen(const struct sk_buff *skb)
+{
+       return (skb->h.th->doff - 5) * 4;
+}
+
 /* This defines a selective acknowledgement block. */
 struct tcp_sack_block_wire {
        __be32  start_seq;