1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-26 03:51:35 +01:00

DNS, RadioTap and Dot1Q work when using PacketSender::send_recv.

This commit is contained in:
Matias Fontanini
2013-03-26 14:54:24 -03:00
parent 1cec099c0e
commit dfc0498b70
9 changed files with 95 additions and 9 deletions

View File

@@ -259,6 +259,18 @@ void RadioTap::send(PacketSender &sender) {
}
#endif
bool RadioTap::matches_response(uint8_t *ptr, uint32_t total_sz) {
if(sizeof(_radio) < total_sz)
return false;
const radiotap_hdr *radio_ptr = (const radiotap_hdr*)ptr;
if(radio_ptr->it_len <= total_sz) {
ptr += radio_ptr->it_len;
total_sz -= radio_ptr->it_len;
return inner_pdu() ? inner_pdu()->matches_response(ptr, total_sz) : true;
}
return false;
}
void RadioTap::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent) {
uint32_t sz = header_size();
uint8_t *buffer_start = buffer;