My Kernel v0.1.0
Collaboration diagram for Layer 2 - Ethernet:

Data Structures

struct  ethernet_header
 An ethernet frame. More...
 

Macros

#define ETHERNET_ADDR_SIZE   6
 Size of an ethernet MAC address.
 
#define ETHERNET_HEADER_SIZE   14
 Size of an ethernet header.
 

Typedefs

typedef uint8_t mac_address_t[ETHERNET_ADDR_SIZE]
 Represents an ethernet MAC address. More...
 

Enumerations

enum  ethernet_type { ETH_PROTO_IP = 0x0800 , ETH_PROTO_ARP = 0x0806 }
 Supported ethernet protocols, as defined by IANA. More...
 

Functions

void ethernet_fill_packet (struct packet *, enum ethernet_type, const mac_address_t dst)
 Insert headers for layer 2 inside a packet over ethernet.
 
error_t ethernet_receive_packet (struct packet *)
 Process a packet received by an ethernet network device.
 

Detailed Description

See also
- TCP/IP Illustrated Vol I - Chapter 2 - Link Layer
- https://ieeexplore.ieee.org/document/9844436

Typedef Documentation

◆ mac_address_t

typedef uint8_t mac_address_t[ETHERNET_ADDR_SIZE]
Note
The content of this buffer is ALWAYS in big endian notation.

Enumeration Type Documentation

◆ ethernet_type

See also
https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml
Enumerator
ETH_PROTO_IP 

IPv4.

ETH_PROTO_ARP 

Address resolution protocol.