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

Fixed endianess in IP PDU. Getters and setters use little endian

This commit is contained in:
Santiago Alessandri
2011-08-17 10:04:08 -03:00
parent 0d2b6a507b
commit b844eb84c8
2 changed files with 37 additions and 36 deletions

View File

@@ -70,15 +70,15 @@ void Tins::IP::tos(uint8_t new_tos) {
}
void Tins::IP::tot_len(uint16_t new_tot_len) {
_ip.tot_len = new_tot_len;
_ip.tot_len = Utils::net_to_host_s(new_tot_len);
}
void Tins::IP::id(uint16_t new_id) {
_ip.id = new_id;
_ip.id = Utils::net_to_host_s(new_id);
}
void Tins::IP::frag_off(uint16_t new_frag_off) {
_ip.frag_off = new_frag_off;
_ip.frag_off = Utils::net_to_host_s(new_frag_off);
}
void Tins::IP::ttl(uint8_t new_ttl) {
@@ -90,7 +90,7 @@ void Tins::IP::protocol(uint8_t new_protocol) {
}
void Tins::IP::check(uint16_t new_check) {
_ip.check = new_check;
_ip.check = Utils::net_to_host_s(new_check);
}
void Tins::IP::source_address(const string &ip) {