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_;
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];
Dot11Ack(const address_type &dst_addr=address_type())
Constructor for creating a 802.11 Ack frame PDU.
Definition dot11_control.cpp:134
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:431
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition dot11_control.h:481
Dot11Ack * clone() const
Clones this PDU.
Definition dot11_control.h:464
PDUType pdu_type() const
Getter for the PDU's type.
Definition dot11_control.h:472
Dot11BlockAckRequest * clone() const
Clones this PDU.
Definition dot11_control.h:595
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:494
Dot11BlockAckRequest(const address_type &dst_addr=address_type(), const address_type &target_addr=address_type())
Constructor for creating a 802.11 Block Ack request frame PDU.
Definition dot11_control.cpp:146
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
const uint8_t * bitmap() const
Getter for the bitmap field.
Definition dot11_control.h:738
Dot11BlockAck(const address_type &dst_addr=address_type(), const address_type &target_addr=address_type())
Constructor for creating a 802.11 Block Ack frame PDU.
Definition dot11_control.cpp:196
small_uint< 4 > bar_control() const
Getter for the bar control field.
Definition dot11_control.h:671
small_uint< 12 > start_sequence() const
Getter for the start sequence field.
Definition dot11_control.h:683
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:630
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
small_uint< 4 > fragment_number() const
Getter for the fragment number field.
Definition dot11_control.h:695
static const size_t bitmap_size
Definition dot11_control.h:635
Dot11BlockAck * clone() const
Clones this PDU.
Definition dot11_control.h:770
Dot11CFEnd * clone() const
Clones this PDU.
Definition dot11_control.h:342
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:307
Dot11CFEnd(const address_type &dst_addr=address_type(), const address_type &target_addr=address_type())
Constructor for creating a 802.11 CF-End frame PDU.
Definition dot11_control.cpp:108
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
Dot11ControlTA(const address_type &dst_addr=address_type(), const address_type &target_addr=address_type())
Constructor for creating a 802.11 control frame TA PDU.
Definition dot11_control.cpp:56
uint32_t controlta_size() const
Getter for the control ta additional fields size.
Definition dot11_control.h:166
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:103
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
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
Dot11Control(const address_type &dst_addr=address_type())
Constructor for creating a 802.11 control frame PDU.
Definition dot11_control.cpp:44
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:48
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:369
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
Dot11EndCFAck(const address_type &dst_addr=address_type(), const address_type &target_addr=address_type())
Constructor for creating a 802.11 End-CF-Ack frame PDU.
Definition dot11_control.cpp:121
PDUType pdu_type() const
Getter for the PDU's type.
Definition dot11_control.h:412
Dot11PSPoll(const address_type &dst_addr=address_type(), const address_type &target_addr=address_type())
Constructor for creating a 802.11 PS-Poll frame PDU.
Definition dot11_control.cpp:95
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
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:245
Dot11RTS * clone() const
Clones this PDU.
Definition dot11_control.h:218
static const PDU::PDUType pdu_flag
This PDU's flag.
Definition dot11_control.h:184
Dot11RTS(const address_type &dst_addr=address_type(), const address_type &target_addr=address_type())
Constructor for creating a 802.11 RTS frame PDU.
Definition dot11_control.cpp:82
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
bool matches_flag(PDUType flag) const
Check whether this PDU matches the specified flag.
Definition dot11_base.h:636
Dot11(const address_type &dst_hw_addr=address_type())
Constructs an 802.11 PDU.
Definition dot11_base.cpp:61
HWAddress< 6 > address_type
Definition dot11_base.h:59
PDUType
Enum which identifies each type of PDU.
Definition pdu.h:127
Represents a field of n bits.
Definition small_uint.h:52
The Tins namespace.
Definition address_range.h:38