1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 20:24:26 +01:00

Added test for EthernetII PDU

This commit is contained in:
Santiago Alessandri
2011-09-15 12:01:45 -03:00
parent 13e260b825
commit 8b7f016278
2 changed files with 20 additions and 32 deletions

View File

@@ -77,20 +77,6 @@ Tins::EthernetII::EthernetII(const uint8_t *buffer, uint32_t total_sz) : PDU(ETH
}
}
Tins::EthernetII::EthernetII(const EthernetII &other) : PDU(other) {
copy_fields(&other);
}
Tins::EthernetII &Tins::EthernetII::operator= (const EthernetII &other) {
copy_fields(&other);
copy_inner_pdu(other);
return *this;
}
uint16_t Tins::EthernetII::payload_type() const {
return Utils::net_to_host_s(_eth.payload_type);
}
void Tins::EthernetII::dst_addr(const uint8_t* new_dst_mac) {
memcpy(_eth.dst_mac, new_dst_mac, sizeof(_eth.dst_mac));
}
@@ -109,6 +95,10 @@ void Tins::EthernetII::iface(const std::string& new_iface) throw (std::runtime_e
}
}
void Tins::EthernetII::payload_type(uint16_t new_payload_type) {
this->_eth.payload_type = Utils::net_to_host_s(new_payload_type);
}
uint32_t Tins::EthernetII::header_size() const {
return sizeof(ethhdr);
}