⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module ethernet

Module ethernet 

Source
Expand description

Ethernet frame parsing and construction

Implements IEEE 802.3 Ethernet frame handling for the network stack. Supports parsing incoming frames and constructing outgoing frames with proper MAC addressing and EtherType identification.

Structs§

EthernetFrame
Parsed Ethernet frame

Constants§

ETHERNET_HEADER_SIZE
Ethernet frame header size: dst(6) + src(6) + ethertype(2) = 14 bytes
ETHERNET_MAX_PAYLOAD
Maximum Ethernet frame payload (standard MTU)
ETHERNET_MIN_PAYLOAD
Minimum Ethernet frame payload (excluding header)
ETHERTYPE_ARP
ETHERTYPE_IPV4
EtherType constants
ETHERTYPE_IPV6

Functions§

construct_frame
Construct an Ethernet frame from components.
dispatch_frame
Dispatch a received Ethernet frame to the appropriate protocol handler.
is_broadcast
Check if a MAC address is a broadcast address (FF:FF:FF:FF:FF:FF)
is_for_us
Check if a MAC address matches or is broadcast or is IPv6 multicast
is_ipv6_multicast
Check if a MAC address is an IPv6 multicast address (33:33:xx:xx:xx:xx)
parse_frame
Parse an Ethernet frame from raw bytes.