ethernet.hpp 287 B

12345678910111213141516171819202122
  1. #pragma once
  2. #include <defs.hpp>
  3. namespace net {
  4. u16 htons(u16 val);
  5. u32 htonl(u32 val);
  6. u64 htonll(u64 val);
  7. struct PACKED MACAddress {
  8. u8 addr[6];
  9. };
  10. struct PACKED EthernetHeader {
  11. MACAddress dst;
  12. MACAddress src;
  13. u16 type;
  14. u8 payload[];
  15. };
  16. } // namespace net