Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * INET An implementation of the TCP/IP protocol suite for the LINUX |
| 4 | * operating system. INET is implemented using the BSD Socket |
| 5 | * interface as the means of communication with the user level. |
| 6 | * |
| 7 | * Global definitions for the Ethernet IEEE 802.3 interface. |
| 8 | * |
| 9 | * Version: @(#)if_ether.h 1.0.1a 02/08/94 |
| 10 | * |
| 11 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
| 12 | * Donald Becker, <becker@super.org> |
Alan Cox | 113aa83 | 2008-10-13 19:01:08 -0700 | [diff] [blame] | 13 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #ifndef _LINUX_IF_ETHER_H |
| 17 | #define _LINUX_IF_ETHER_H |
| 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <linux/skbuff.h> |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 20 | #include <uapi/linux/if_ether.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
| 22 | static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) |
| 23 | { |
Arnaldo Carvalho de Melo | 98e399f | 2007-03-19 15:33:04 -0700 | [diff] [blame] | 24 | return (struct ethhdr *)skb_mac_header(skb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | } |
Arnaldo Carvalho de Melo | 2038073 | 2005-08-16 02:18:02 -0300 | [diff] [blame] | 26 | |
Alexander Duyck | af67eb9e | 2016-05-02 09:25:16 -0700 | [diff] [blame] | 27 | static inline struct ethhdr *inner_eth_hdr(const struct sk_buff *skb) |
| 28 | { |
| 29 | return (struct ethhdr *)skb_inner_mac_header(skb); |
| 30 | } |
| 31 | |
Stephen Hemminger | 3b04ddd | 2007-10-09 01:40:57 -0700 | [diff] [blame] | 32 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); |
| 33 | |
Michael Chan | 7ffc49a | 2007-12-24 21:28:09 -0800 | [diff] [blame] | 34 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
| 35 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | #endif /* _LINUX_IF_ETHER_H */ |