mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 375 forks source link

Reading Block Ack Control Field #379

Open jvillasante opened 4 years ago

jvillasante commented 4 years ago

https://groups.google.com/forum/#!topic/libtins/yCX9rvbhjuc

Hello,

Is there a way to accomplish this with libints? Basically, I don't see a way to access the bar control field of the block ack frame (which is 2 bytes) by using the bar_contol() getter which is only small_uint<4>.

If I wanted to get to this field and read the compressed bit (bit 2) and the TID (high 4 bytes) do I need to parse the raw data myself?

Please, see image. I'm having a hard time getting at this field. block_ack

Regards and thanks in advance!

jvillasante commented 4 years ago

Adding to this, according to the spec the bar_control is 16 bits and is read as 16 bits on the Dot11BlockAck class, the only problem is that the getter returns a small_uint<4>.

Maybe something like this on Dot11BlockAck class:

uint16_t bar_control_uint16() const { return Endian::le_to_host(_bar_control); } void bar_control_uint16(uint16_t new_bar_control) { _bar_control = Endian::host_to_le(new_bar_control); }

I'm I missing something?