]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/netdevice.h
[NET]: Wrap hard_header_parse
[net-next-2.6.git] / include / linux / netdevice.h
index b33d084712fa410b7c8348f4bb628c65447fb07b..aae9ec367f5d295c4e0fb6d1cbeee42186ccac4f 100644 (file)
@@ -657,7 +657,7 @@ struct net_device
        void                    (*vlan_rx_kill_vid)(struct net_device *dev,
                                                    unsigned short vid);
 
-       int                     (*hard_header_parse)(struct sk_buff *skb,
+       int                     (*hard_header_parse)(const struct sk_buff *skb,
                                                     unsigned char *haddr);
        int                     (*neigh_setup)(struct net_device *dev, struct neigh_parms *);
 #ifdef CONFIG_NETPOLL
@@ -809,6 +809,16 @@ static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
        return dev->hard_header(skb, dev, type, daddr, saddr, len);
 }
 
+static inline int dev_parse_header(const struct sk_buff *skb,
+                                  unsigned char *haddr)
+{
+       const struct net_device *dev = skb->dev;
+
+       if (!dev->hard_header_parse)
+               return 0;
+       return dev->hard_header_parse(skb, haddr);
+}
+
 typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
 extern int             register_gifconf(unsigned int family, gifconf_func_t * gifconf);
 static inline int unregister_gifconf(unsigned int family)