aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index aab4d9f6613d..6997f62cb6a0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -274,6 +274,7 @@ struct header_ops {
274 const struct net_device *dev, 274 const struct net_device *dev,
275 const unsigned char *haddr); 275 const unsigned char *haddr);
276 bool (*validate)(const char *ll_header, unsigned int len); 276 bool (*validate)(const char *ll_header, unsigned int len);
277 __be16 (*parse_protocol)(const struct sk_buff *skb);
277}; 278};
278 279
279/* These flag bits are private to the generic network queueing 280/* These flag bits are private to the generic network queueing
@@ -2939,6 +2940,15 @@ static inline int dev_parse_header(const struct sk_buff *skb,
2939 return dev->header_ops->parse(skb, haddr); 2940 return dev->header_ops->parse(skb, haddr);
2940} 2941}
2941 2942
2943static inline __be16 dev_parse_header_protocol(const struct sk_buff *skb)
2944{
2945 const struct net_device *dev = skb->dev;
2946
2947 if (!dev->header_ops || !dev->header_ops->parse_protocol)
2948 return 0;
2949 return dev->header_ops->parse_protocol(skb);
2950}
2951
2942/* ll_header must have at least hard_header_len allocated */ 2952/* ll_header must have at least hard_header_len allocated */
2943static inline bool dev_validate_header(const struct net_device *dev, 2953static inline bool dev_validate_header(const struct net_device *dev,
2944 char *ll_header, int len) 2954 char *ll_header, int len)