net/arp: further write accessors and protocol type

This commit is contained in:
Martin Stein 2016-08-25 17:39:20 +02:00 committed by Christian Helmuth
parent 79bc0ab789
commit 47bc5c9a8d

View File

@ -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.
*