Submit and pass all tests to enable saving to GitHub.
Implementation
Why This Matters
Every packet you've ever captured with tcpdump -e or Scapy's Ether() layer starts with exactly these 14 bytes, and switches use the destination MAC you're parsing here to decide which port to flood a frame out of. Getting EtherType wrong is a real bug class: VLAN-tagged frames (0x8100) trip up naive parsers that assume payload always starts at byte 14.
Hints
0 / 3 revealed
Sample validation
Sample case for Run. Submit grades this sample plus all hidden tests.
main.c
Workspace 1.0
Write a C program that parses a simulated Ethernet frame byte array. Print the destination MAC, source MAC, EtherType, and payload length.
Requirements:
Define a simulated Ethernet frame as an unsigned char array
Parse and print the destination MAC address in hex
Parse and print the source MAC address in hex
Parse and print the EtherType value in hex (0x0800 = IPv4, 0x0806 = ARP)
Calculate and print the payload length
Use clear formatting for all output
Include the keywords: Ethernet, MAC, EtherType, 0x0800