1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-25 19:51:34 +01:00

IP now fills automatically the sender address when no link layer PDU is present. Made some protocols work when using PacketSender::send_recv.

This commit is contained in:
Matias Fontanini
2013-03-25 14:08:59 -03:00
parent b0dc376494
commit 82ef41dd92
16 changed files with 241 additions and 114 deletions

View File

@@ -117,4 +117,11 @@ void BootP::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *p
std::memcpy(buffer, &_bootp, sizeof(bootphdr));
std::copy(_vend.begin(), _vend.end(), buffer + sizeof(bootphdr));
}
bool BootP::matches_response(uint8_t *ptr, uint32_t total_sz) {
if(total_sz < sizeof(bootphdr))
return false;
const bootphdr *bootp_ptr = (const bootphdr *)ptr;
return bootp_ptr->xid == _bootp.xid;
}
}