The Linux Channel

Videos :: Linux Kernel struct ethhdr data-structure

Written by: Kiran Kankipati - Published: 02-Nov-2016

(API) Watch Video: 264 Linux Kernel struct ethhdr data-structure - Introduction, code-walk, eth_hdr(), skb_mac_header() APIs - Ep1
264 Linux Kernel struct ethhdr data-structure - Introduction, code-walk, eth_hdr(), skb_mac_header() APIs - Ep1
* Click the image to watch this video on Youtube ↗

For more details refer Linux Kernel Source:
struct ethhdr - http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/if_ether.h#L145
eth_hdr() API - http://elixir.free-electrons.com/linux/latest/source/include/linux/if_ether.h#L26
skb_mac_header() API - http://elixir.free-electrons.com/linux/latest/source/include/linux/skbuff.h#L2215
----
QUICK LINKS for students and advance developers:
Linux Kernel Network stack and architecture - http://the-linux-channel.the-toffee-project.org/index.php?page=3-links-linux-kernel-network-stack-and-architecture
----
Videos related to protocol header data-structures:
struct iphdr - http://the-linux-channel.the-toffee-project.org/index.php?page=48-videos-linux-kernel-struct-iphdr-data-structure
struct tcphdr - http://the-linux-channel.the-toffee-project.org/index.php?page=50-videos-linux-kernel-struct-tcphdr-data-structure
struct udphdr - http://the-linux-channel.the-toffee-project.org/index.php?page=49-videos-linux-kernel-struct-udphdr-data-structure

And here is the copy paste of struct ethhdr data-structure (/include/uapi/linux/if_ether.h) from the Kernel-source version 4.13 for quick reference:

/*
 *	This is an Ethernet frame header.
 */

struct ethhdr {
	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
	__be16		h_proto;		/* packet type ID field	*/
} __attribute__((packed));

Where these are the various Ethernet Header related constants, which are defined in the same file (/include/uapi/linux/if_ether.h) from the Kernel-source version 4.13 for quick reference:

/*
 *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
 *	and FCS/CRC (frame check sequence).
 */

#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
#define ETH_HLEN	14		/* Total octets in header.	 */
#define ETH_ZLEN	60		/* Min. octets in frame sans FCS */
#define ETH_DATA_LEN	1500		/* Max. octets in payload	 */
#define ETH_FRAME_LEN	1514		/* Max. octets in frame sans FCS */
#define ETH_FCS_LEN	4		/* Octets in the FCS		 */

#define ETH_MIN_MTU	68		/* Min IPv4 MTU per RFC791	*/
#define ETH_MAX_MTU	0xFFFFU		/* 65535, same as IP_MAX_MTU	*/



Suggested Topics:


Linux Kernel programming :: Video Episodes
Linux Kernel Compilation ↗
05-Jul-2016

Linux Kernel Architecture - Generic ↗
13-May-2017

Linux Kernel struct iphdr data-structure ↗
05-Jul-2016

Linux Kernel FileSystems Subsystem ↗
16-Dec-2017

Linux Kernel sk_buff data-structure - Episode-11 to Episode-18 ↗
26-Mar-2017

Linux Kernel /proc Interface ↗
22-Feb-2017

Linux Kernel Network Programming ↗
05-Nov-2017

Linux Kernel - Containers and Namespaces ↗
11-Feb-2018

Linux Kernel Network Programming - struct net - struct netns_ipv4 - /proc/sys/net/ipv4 ↗
21-May-2018

Linux Kernel Network Programming - Transport Layer L4 TCP/UDP Registration - Protocol APIs ↗
20-Sep-2019

Linux Kernel TCP Congestion Control Algorithms ↗
20-Nov-2017

Linux ioctl() API interface ↗
11-Oct-2017

Linux Kernel Networking Sub-system ↗
05-Jul-2016

Linux Kernel struct socket and struct sock data-structure ↗
31-Oct-2017

Linux Kernel struct tcphdr data-structure ↗
05-Jul-2016

Linux Kernel net_device data-structure ↗
05-Jul-2016

Linux Kernel struct ethhdr data-structure ↗
02-Nov-2016

Linux Kernel Programming ↗
05-Jul-2016

Linux Kernel struct udphdr data-structure ↗
05-Jul-2016

Linux Kernel dst_entry data-structure ↗
04-May-2017

Linux Kernel sk_buff data-structure - Episode-1 to Episode-10 ↗
05-Jul-2016

Linux Operating System - User-space Processes ↗
22-Jan-2018

Linux Kernel Programming - Device Drivers ↗
30-Mar-2018

 

Join The Linux Channel :: Facebook Group


Join a course:

💎 Linux, Kernel, Networking and Device Drivers: PDF Brochure
💎 PhD or equivalent (or Post Doctoral) looking for assistance: Details
💎 ... or unlimited life-time mentorship: Details


💗 Help shape the future: Sponsor/Donate


Recommended Topics:
Complete Starter Kit - RASPBERRY-PI 3 B+
Buy at Amazon Buy at Amazon

Featured Video:
(API) Watch Video: 0x1c3 ARMv7 Marvell Armada 370/XP | Netgear ReadyNAS Teardown and Upgrade | VLOG & Workflow
0x1c3 ARMv7 Marvell Armada 370/XP | Netgear ReadyNAS Teardown and Upgrade | VLOG & Workflow
* Click the image to watch this video on Youtube ↗

Download: Linux Kernel Booting_1.pdf


Trending Video:
(API) Watch Video: 0x1ce New Job Offer? verify in Glassdoor before you join #TheLinuxChannel #KiranKankipati
0x1ce New Job Offer? verify in Glassdoor before you join #TheLinuxChannel #KiranKankipati
* Click the image to watch this video on Youtube ↗

TUTORIALS :: Linux Networking Stack :: RFS: Receive Flow Steering:


Linux Kernel TCP Congestion Control Algorithms:
Linux Kernel Programming - Device Drivers:


Research :: Content Delivery Networks (CDN):
CDN Networks


Recommended Video:
(API) Watch Video: 0x18b Network MTU and Path MTU Discovery PMTUD | WAN and Internet Performance Optimization - Part2
0x18b Network MTU and Path MTU Discovery PMTUD | WAN and Internet Performance Optimization - Part2
* Click the image to watch this video on Youtube ↗