0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _LINUX_IF_ETHER_H
0017 #define _LINUX_IF_ETHER_H
0018
0019 #include <linux/skbuff.h>
0020 #include <uapi/linux/if_ether.h>
0021
0022 static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
0023 {
0024 return (struct ethhdr *)skb_mac_header(skb);
0025 }
0026
0027
0028
0029
0030 static inline struct ethhdr *skb_eth_hdr(const struct sk_buff *skb)
0031 {
0032 return (struct ethhdr *)skb->data;
0033 }
0034
0035 static inline struct ethhdr *inner_eth_hdr(const struct sk_buff *skb)
0036 {
0037 return (struct ethhdr *)skb_inner_mac_header(skb);
0038 }
0039
0040 int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
0041
0042 extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
0043
0044 #endif