From 47bc5c9a8d8f3ba5af33da61655b9db59f543cbb Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Thu, 25 Aug 2016 17:39:20 +0200 Subject: [PATCH] net/arp: further write accessors and protocol type --- repos/os/include/net/arp.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/repos/os/include/net/arp.h b/repos/os/include/net/arp.h index daf9279157..399c2306ce 100644 --- a/repos/os/include/net/arp.h +++ b/repos/os/include/net/arp.h @@ -77,6 +77,8 @@ class Net::Arp_packet ** ARP parameters ** ********************/ + enum Protocol_address_type { IPV4 = 0x0800 }; + enum Hardware_type { ETHERNET = 0x0001, EXP_ETHERNET = 0x0002, @@ -224,6 +226,28 @@ class Net::Arp_packet ** ARP field write-accessors ** ******************************/ + /** + * \return link layer type (Arp_packet::Hardware_type). + */ + void hardware_address_type(Genode::uint16_t v) { + _hw_addr_type = host_to_big_endian(v); } + + /** + * \return network/internet layer type (Ether_frame::EtherType). + */ + void protocol_address_type(Genode::uint16_t v) { + _prot_addr_type = host_to_big_endian(v); } + + /** + * \return size in bytes of hardware address. + */ + void hardware_address_size(Genode::uint8_t v) { _hw_addr_sz = v; } + + /** + * \return size in bytes of protocol address. + */ + void protocol_address_size(Genode::uint8_t v) { _prot_addr_sz = v; } + /** * Set Operation code. *