summaryrefslogtreecommitdiff
path: root/include/linux/ipv6.h
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2012-02-09 09:34:41 +0000
committerDavid S. Miller <davem@davemloft.net>2012-02-13 00:45:38 -0500
commit7a3198a89722ad9521d22b05938d357eac7460fa (patch)
treeca5766b459c7a9a1502fa519a9d287c7c29dcd9c /include/linux/ipv6.h
parent72e60278d7e4a600fd6e067b42a5822e72946d6e (diff)
ipv6: helper function to get tclass
Implement helper inline function to get traffic class from IPv6 header. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ipv6.h')
-rw-r--r--include/linux/ipv6.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 743a16a41040..4847a64d3c0a 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -233,6 +233,11 @@ static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
return (struct ipv6hdr *)skb_transport_header(skb);
}
+static inline __u8 ipv6_tclass(const struct ipv6hdr *iph)
+{
+ return (ntohl(*(__be32 *)iph) >> 20) & 0xff;
+}
+
/*
This structure contains results of exthdrs parsing
as offsets from skb->nh.