ARP::ARP(ipaddress_type target_ip, ipaddress_type sender_ip, const hwaddress_type &target_hw, const hwaddress_type &sender_hw) { memset(&_arp, 0, sizeof(arphdr)); hw_addr_format((uint16_t)Constants::ARP::ETHER); prot_addr_format((uint16_t)Constants::Ethernet::IP); hw_addr_length(Tins::EthernetII::address_type::address_size); prot_addr_length(Tins::IP::address_type::address_size); sender_ip_addr(sender_ip); target_ip_addr(target_ip); sender_hw_addr(sender_hw); target_hw_addr(target_hw); }
ARP::ARP(ipaddress_type target_ip, ipaddress_type sender_ip, const hwaddress_type& target_hw, const hwaddress_type& sender_hw) : header_() { hw_addr_format((uint16_t)Constants::ARP::ETHER); prot_addr_format((uint16_t)Constants::Ethernet::IP); hw_addr_length(Tins::EthernetII::address_type::address_size); prot_addr_length(4 /* IP address size */); sender_ip_addr(sender_ip); target_ip_addr(target_ip); sender_hw_addr(sender_hw); target_hw_addr(target_hw); }