Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
[safe/jmp/linux-2.6] / include / linux / if_arp.h
index 7f57142..282eb37 100644 (file)
@@ -52,6 +52,7 @@
 #define ARPHRD_ROSE    270
 #define ARPHRD_X25     271             /* CCITT X.25                   */
 #define ARPHRD_HWX25   272             /* Boards with X.25 in firmware */
+#define ARPHRD_CAN     280             /* Controller Area Network      */
 #define ARPHRD_PPP     512
 #define ARPHRD_CISCO   513             /* Cisco HDLC                   */
 #define ARPHRD_HDLC    ARPHRD_CISCO
 #define ARPHRD_IEEE80211 801           /* IEEE 802.11                  */
 #define ARPHRD_IEEE80211_PRISM 802     /* IEEE 802.11 + Prism2 header  */
 #define ARPHRD_IEEE80211_RADIOTAP 803  /* IEEE 802.11 + radiotap header */
+#define ARPHRD_IEEE802154        804
+
+#define ARPHRD_PHONET  820             /* PhoNet media type            */
+#define ARPHRD_PHONET_PIPE 821         /* PhoNet pipe header           */
 
 #define ARPHRD_VOID      0xFFFF        /* Void type, nothing is known */
 #define ARPHRD_NONE      0xFFFE        /* zero header length */
@@ -148,4 +153,19 @@ struct arphdr
 
 };
 
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+
+static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
+{
+       return (struct arphdr *)skb_network_header(skb);
+}
+
+static inline int arp_hdr_len(struct net_device *dev)
+{
+       /* ARP header, plus 2 device addresses, plus 2 IP addresses. */
+       return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2;
+}
+#endif
+
 #endif /* _LINUX_IF_ARP_H */