50 constexpr auto sender_mac() const noexcept -> std::span<const uint8_t, 6> {
51 return std::span<const uint8_t, 6>{
sha,
sha + 6};
54 constexpr auto target_mac() const noexcept -> std::span<const uint8_t, 6> {
55 return std::span<const uint8_t, 6>{
tha,
tha + 6};
58 constexpr auto sender_ipv4() const noexcept -> std::span<const uint8_t, 4> {
59 return std::span<const uint8_t, 4>{
spa,
spa + 4};
62 constexpr auto target_ipv4() const noexcept -> std::span<const uint8_t, 4> {
63 return std::span<const uint8_t, 4>{
tpa,
tpa + 4};
79static_assert(
sizeof(ArpHeader) == 28,
"Wrong ARP header size");
80static_assert(
alignof(ArpHeader) == 1,
"Wrong ARP header alignment");
ArpOpCode
ARP opcode values.
Definition arp.hxx:17
@ Request
Definition arp.hxx:17
@ Reply
Definition arp.hxx:17
constexpr _Tp read_from_bytes(const uint8_t *src)
Read a trivially copyable type from a byte array.
Definition utils.hxx:24
constexpr _Tp autoswap(_Tp tp)
Byte-swap a value if the host is little-endian.
Definition utils.hxx:13
ArpHType
ARP hardware type values.
Definition arp.hxx:14
@ Ethernet
Definition arp.hxx:14
EtherType
Ethernet frame EtherType values (network byte order).
Definition ether.hxx:19