blob: 76cf11e905e160b32625adefd1bcc7b641ff6527 [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
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 Cox113aa832008-10-13 19:01:08 -070013 * Alan Cox, <alan@lxorguk.ukuu.org.uk>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#ifndef _LINUX_IF_ETHER_H
17#define _LINUX_IF_ETHER_H
18
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#include <linux/skbuff.h>
David Howells607ca462012-10-13 10:46:48 +010020#include <uapi/linux/if_ether.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
22static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
23{
Arnaldo Carvalho de Melo98e399f2007-03-19 15:33:04 -070024 return (struct ethhdr *)skb_mac_header(skb);
Linus Torvalds1da177e2005-04-16 15:20:36 -070025}
Arnaldo Carvalho de Melo20380732005-08-16 02:18:02 -030026
Alexander Duyckaf67eb9e2016-05-02 09:25:16 -070027static inline struct ethhdr *inner_eth_hdr(const struct sk_buff *skb)
28{
29 return (struct ethhdr *)skb_inner_mac_header(skb);
30}
31
Stephen Hemminger3b04ddd2007-10-09 01:40:57 -070032int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
33
Michael Chan7ffc49a2007-12-24 21:28:09 -080034extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036#endif /* _LINUX_IF_ETHER_H */