30 #include <tins/config.h>
32 #if !defined(TINS_DOT11_DOT11_CONTROL_H) && defined(TINS_HAVE_DOT11)
34 #define TINS_DOT11_DOT11_CONTROL_H
36 #include <tins/dot11/dot11_base.h>
37 #include <tins/macros.h>
116 void target_addr(
const address_type& addr);
137 const address_type& target_addr = address_type());
161 uint32_t header_size()
const;
167 return static_cast<uint32_t
>(taddr_.size() +
sizeof(
dot11_header));
170 void write_ext_header(Memory::OutputMemoryStream& stream);
211 Dot11RTS(
const uint8_t* buffer, uint32_t total_sz);
273 Dot11PSPoll(
const uint8_t* buffer, uint32_t total_sz);
335 Dot11CFEnd(
const uint8_t* buffer, uint32_t total_sz);
457 Dot11Ack(
const uint8_t* buffer, uint32_t total_sz);
531 #if TINS_IS_LITTLE_ENDIAN
532 return bar_control_ & 0xf;
534 return (bar_control_ >> 8) & 0xf;
543 #if TINS_IS_LITTLE_ENDIAN
544 return (start_sequence_ >> 4) & 0xfff;
546 return (Endian::le_to_host<uint16_t>(start_sequence_) >> 4) & 0xfff;
555 #if TINS_IS_LITTLE_ENDIAN
556 return start_sequence_ & 0xf;
558 return (start_sequence_ >> 8) & 0xf;
568 uint32_t header_size()
const;
616 void write_ext_header(Memory::OutputMemoryStream& stream);
618 uint16_t bar_control_;
619 uint16_t start_sequence_;
635 static const size_t bitmap_size = 8;
672 #if TINS_IS_LITTLE_ENDIAN
673 return bar_control_ & 0xf;
675 return (bar_control_ >> 8) & 0xf;
684 #if TINS_IS_LITTLE_ENDIAN
685 return (start_sequence_ >> 4) & 0xfff;
687 return (Endian::le_to_host<uint16_t>(start_sequence_) >> 4) & 0xfff;
696 #if TINS_IS_LITTLE_ENDIAN
697 return start_sequence_ & 0xf;
699 return (start_sequence_ >> 8) & 0xf;
709 uint32_t header_size()
const;
746 void bitmap(
const uint8_t* bit);
774 void write_ext_header(Memory::OutputMemoryStream& stream);
776 uint16_t bar_control_, start_sequence_;
777 uint8_t bitmap_[bitmap_size];
Definition: dot11_control.h:426
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:481
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot11_control.h:472
Dot11Ack * clone() const
Clones this PDU.
Definition: dot11_control.h:464
Class that represents an 802.11 Block Ack Request PDU.
Definition: dot11_control.h:489
Dot11BlockAckRequest * clone() const
Clones this PDU.
Definition: dot11_control.h:595
small_uint< 4 > bar_control() const
Getter for the bar control field.
Definition: dot11_control.h:530
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:612
small_uint< 4 > fragment_number() const
Getter for the fragment number field.
Definition: dot11_control.h:554
small_uint< 12 > start_sequence() const
Getter for the start sequence field.
Definition: dot11_control.h:542
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot11_control.h:603
Class that represents an 802.11 block ack frame.
Definition: dot11_control.h:625
small_uint< 4 > bar_control() const
Getter for the bar control field.
Definition: dot11_control.h:671
Dot11BlockAck * clone() const
Clones this PDU.
Definition: dot11_control.h:770
small_uint< 12 > start_sequence() const
Getter for the start sequence field.
Definition: dot11_control.h:683
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:761
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot11_control.h:752
const uint8_t * bitmap() const
Getter for the bitmap field.
Definition: dot11_control.h:738
small_uint< 4 > fragment_number() const
Getter for the fragment number field.
Definition: dot11_control.h:695
Definition: dot11_control.h:302
Dot11CFEnd * clone() const
Clones this PDU.
Definition: dot11_control.h:342
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot11_control.h:350
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:359
Class that represents an abstraction of the 802.11 control frames that contain a target address.
Definition: dot11_control.h:98
uint32_t controlta_size() const
Getter for the control ta additional fields size.
Definition: dot11_control.h:166
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:123
address_type target_addr() const
Getter for the target address field.
Definition: dot11_control.h:108
Represents an IEEE 802.11 control frame.
Definition: dot11_control.h:43
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:89
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot11_control.h:80
Definition: dot11_control.h:364
Dot11EndCFAck * clone() const
Clones this PDU.
Definition: dot11_control.h:404
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:421
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot11_control.h:412
Definition: dot11_control.h:240
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot11_control.h:288
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:297
Dot11PSPoll * clone() const
Clones this PDU.
Definition: dot11_control.h:280
IEEE 802.11 RTS frame.
Definition: dot11_control.h:179
Dot11RTS * clone() const
Clones this PDU.
Definition: dot11_control.h:218
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_control.h:235
PDUType pdu_type() const
Getter for the PDU's type.
Definition: dot11_control.h:226
Class representing an 802.11 frame.
Definition: dot11_base.h:54
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition: dot11_base.h:636
PDUType
Enum which identifies each type of PDU.
Definition: pdu.h:127
The Tins namespace.
Definition: address_range.h:38