summaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-09-26 22:13:38 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:52:51 -0700
commitb95cce3576813ac3f86bafa6b5daaaaf7574b0fe (patch)
tree54da3f245ee145722623a8e0eaab5fc49ea78511 /include/linux/netdevice.h
parent0c4e85813d0a94eeb8bf813397a4907bdd7bb610 (diff)
downloadlinux-b95cce3576813ac3f86bafa6b5daaaaf7574b0fe.tar.gz
linux-b95cce3576813ac3f86bafa6b5daaaaf7574b0fe.tar.bz2
linux-b95cce3576813ac3f86bafa6b5daaaaf7574b0fe.zip
[NET]: Wrap hard_header_parse
Wrap the hard_header_parse function to simplify next step of header_ops conversion. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b33d084712fa..aae9ec367f5d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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)