summaryrefslogtreecommitdiff
path: root/include/linux/if_ether.h
blob: 61b7335aa037c7232a0caa45572043057c02dde3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * INET		An implementation of the TCP/IP protocol suite for the LINUX
 *		operating system.  INET is implemented using the  BSD Socket
 *		interface as the means of communication with the user level.
 *
 *		Global definitions for the Ethernet IEEE 802.3 interface.
 *
 * Version:	@(#)if_ether.h	1.0.1a	02/08/94
 *
 * Author:	Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
 *		Donald Becker, <becker@super.org>
 *		Alan Cox, <alan@lxorguk.ukuu.org.uk>
 *		Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
 */
#ifndef _LINUX_IF_ETHER_H
#define _LINUX_IF_ETHER_H

#include <linux/skbuff.h>
#include <uapi/linux/if_ether.h>

/* XX:XX:XX:XX:XX:XX */
#define MAC_ADDR_STR_LEN (3 * ETH_ALEN - 1)

static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
{
	return (struct ethhdr *)skb_mac_header(skb);
}

/* Prefer this version in TX path, instead of
 * skb_reset_mac_header() + eth_hdr()
 */
static inline struct ethhdr *skb_eth_hdr(const struct sk_buff *skb)
{
	return (struct ethhdr *)skb->data;
}

static inline struct ethhdr *inner_eth_hdr(const struct sk_buff *skb)
{
	return (struct ethhdr *)skb_inner_mac_header(skb);
}

int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);

extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);

#endif	/* _LINUX_IF_ETHER_H */
2022-05-11ptrace: Document that wait_task_inactive can't failEric W. Biederman 2022-05-11ptrace: Reimplement PTRACE_KILL by always sending SIGKILLEric W. Biederman 2022-05-11ptrace: Remove arch_ptrace_attachEric W. Biederman 2022-04-29ptrace: remove redudant check of #ifdef PTRACE_SINGLESTEPTiezhu Yang 2022-03-22ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZEJann Horn 2022-01-08ptrace: Remove second setting of PT_SEIZED in ptrace_attachEric W. Biederman 2021-06-18sched: Change task_struct::statePeter Zijlstra 2021-05-12ptrace: make ptrace() fail if the tracee changed its pid unexpectedlyOleg Nesterov 2021-04-20Merge tag 'v5.12-rc8' into sched/core, to pick up fixesIngo Molnar 2021-03-27Revert "kernel: treat PF_IO_WORKER like PF_KTHREAD for ptrace/signals"Jens Axboe 2021-03-17rseq, ptrace: Add PTRACE_GET_RSEQ_CONFIGURATION requestPiotr Figiel 2021-02-21kernel: treat PF_IO_WORKER like PF_KTHREAD for ptrace/signalsJens Axboe 2020-12-15Merge branch 'akpm' (patches from Andrew)Linus Torvalds 2020-12-15mm: cleanup: remove unused tsk arg from __access_remote_vmJohn Hubbard 2020-12-14Merge tag 'core-entry-2020-12-14' of git://git.kernel.org/pub/scm/linux/kerne...Linus Torvalds 2020-11-17ptrace: Set PF_SUPERPRIV when checking capabilityMickaël Salaün 2020-11-16ptrace: Migrate TIF_SYSCALL_EMU to use SYSCALL_WORK flagGabriel Krisman Bertazi 2020-11-16ptrace: Migrate to use SYSCALL_TRACE flagGabriel Krisman Bertazi