Parse an Radiotap header. More...

#include <senf/Packets/80211Bundle/RadiotapPacket.hh>

Inheritance diagram for senf::RadiotapPacket_HeaderParser:

Public Types

enum  PresentIndex {
  TSFT_INDEX = 0, FLAGS_INDEX = 1, RATE_INDEX = 2, CHANNEL_INDEX = 3,
  FHSS_INDEX = 4, DBM_ANTSIGNAL_INDEX = 5, DBM_ANTNOISE_INDEX = 6, LOCK_QUALITY_INDEX = 7,
  TX_ATTENUATION_INDEX = 8, DB_TX_ATTENUATION_INDEX = 9, DBM_TX_POWER_INDEX = 10, ANTENNA_INDEX = 11,
  DB_ANTSIGNAL_INDEX = 12, DB_ANTNOISE_INDEX = 13, RX_FLAGS_INDEX = 14, TX_FLAGS_INDEX = 15,
  RTS_RETRIES_INDEX = 16, DATA_RETRIES_INDEX = 17, MCS_INDEX = 19, A_MPDU_STATUS_INDEX = 20,
  VHT_INDEX = 21, MAX_INDEX = 21, RADIOTOP_NS_INDEX = 29, VENDOR_NS_INDEX = 30,
  EXTENDED_BITMASK_INDEX = 31
}
 
enum  PresentFlag {
  TSFT_FLAG = (1<<TSFT_INDEX), FLAGS_FLAG = (1<<FLAGS_INDEX), RATE_FLAG = (1<<RATE_INDEX), CHANNEL_FLAG = (1<<CHANNEL_INDEX),
  FHSS_FLAG = (1<<FHSS_INDEX), DBM_ANTSIGNAL_FLAG = (1<<DBM_ANTSIGNAL_INDEX), DBM_ANTNOISE_FLAG = (1<<DBM_ANTNOISE_INDEX), LOCK_QUALITY_FLAG = (1<<LOCK_QUALITY_INDEX),
  TX_ATTENUATION_FLAG = (1<<TX_ATTENUATION_INDEX), DB_TX_ATTENUATION_FLAG = (1<<DB_TX_ATTENUATION_INDEX), DBM_TX_POWER_FLAG = (1<<DBM_TX_POWER_INDEX), ANTENNA_FLAG = (1<<ANTENNA_INDEX),
  DB_ANTSIGNAL_FLAG = (1<<DB_ANTSIGNAL_INDEX), DB_ANTNOISE_FLAG = (1<<DB_ANTNOISE_INDEX), RX_FLAGS_FLAG = (1<<RX_FLAGS_INDEX), TX_FLAGS_FLAG = (1<<TX_FLAGS_INDEX),
  RTS_RETRIES_FLAG = (1<<RTS_RETRIES_INDEX), DATA_RETRIES_FLAG = (1<<DATA_RETRIES_INDEX), MCS_FLAG = (1<<MCS_INDEX), A_MPDU_STATUS_FLAG = (1<<A_MPDU_STATUS_INDEX),
  VHT_FLAG = (1<<VHT_INDEX), RADIOTOP_NS_FLAG = (1<<RADIOTOP_NS_INDEX), VENDOR_NS_FLAG = (1<<VENDOR_NS_INDEX), EXTENDED_BITMASK_FLAG = (1<<EXTENDED_BITMASK_INDEX)
}
 
typedef UInt8Parser version_t
 
typedef UInt16LSBParser length_t
 
- Public Types inherited from senf::PacketParserBase
typedef detail::packet::iterator data_iterator
 Raw data iterator type. More...
 
typedef detail::packet::size_type size_type
 Unsigned integral type. More...
 
typedef detail::packet::difference_type difference_type
 Signed integral type. More...
 
typedef detail::packet::byte byte
 Unsigned 8bit value, the raw value type. More...
 
typedef PacketDatastate_type
 Type of the 'state' parameter. More...
 
typedef PacketParserBase parser_base_type
 Base type of the next parser. More...
 

Public Member Functions

UInt8Parser version () const
 
UInt16LSBParser length () const
 
- Public Member Functions inherited from senf::PacketParserBase
data_iterator i () const
 Return beginning of data to parse. More...
 
data_iterator i (size_type offset) const
 Return iterator offset bytes from the start. More...
 
state_type state () const
 Return state of this parser. More...
 
PacketDatadata () const
 Access the packets raw data container. More...
 
void init () const
 Default implementation. More...
 

Static Public Attributes

static unsigned const FIELD_SIZE [MAX_INDEX+2]
 

Protected Types

typedef UInt32LSBParser presentFlags_t
 
typedef UInt32LSBParser presentFlags_ext1_t
 
typedef UInt32LSBParser presentFlags_ext2_t
 

Protected Member Functions

UInt32LSBParser presentFlags () const
 
UInt32LSBParser presentFlags_ext1 () const
 
UInt32LSBParser presentFlags_ext2 () const
 
- Protected Member Functions inherited from senf::PacketParserBase
ParserProtector protect () const
 
 PacketParserBase (data_iterator i, state_type s)
 Standard constructor. More...
 
 PacketParserBase (data_iterator i, state_type s, size_type size)
 Size checking constructor. More...
 
bool check (size_type size) const
 Check size of data container. More...
 
void validate (size_type size) const
 Validate size of data container. More...
 
template<class Parser >
Parser parse (data_iterator i) const
 Create sub-parser. More...
 
template<class Parser , class Arg >
Parser parse (Arg const &arg, data_iterator i) const
 Create sub-parser. More...
 
template<class Parser >
Parser parse (size_type n) const
 Create sub-parser. More...
 
template<class Parser , class Arg >
Parser parse (Arg const &arg, size_type n) const
 Create sub-parser. More...
 
void defaultInit () const
 Default implementation. More...
 
Packet packet () const
 Get packet this parser is parsing from. More...
 
void resize (size_type oldSize, size_type newSize)
 Resize data container. More...
 

Detailed Description

Parse an Radiotap header.

Parser implementing the Radiotap header

Radiotap requires that all fields in the radiotap header are aligned to natural boundaries. For radiotap, that means all 8-, 16-, 32-, and 64-bit fields must begin on 8-, 16-, 32-, and 64-bit boundaries, respectively. In this way, generators and parsers can avoid unaligned accesses to radiotap capture fields. Radiotap-compliant generators must insert padding before a capture field to ensure its natural alignment.

See also
Radiotap.org
Todo:
extended present field (bit 31 of present field is set)

Definition at line 199 of file RadiotapPacket.hh.

Member Typedef Documentation

◆ length_t

◆ presentFlags_ext1_t

◆ presentFlags_ext2_t

◆ presentFlags_t

◆ version_t

Member Enumeration Documentation

◆ PresentFlag

Enumerator
TSFT_FLAG 
FLAGS_FLAG 
RATE_FLAG 
CHANNEL_FLAG 
FHSS_FLAG 
DBM_ANTSIGNAL_FLAG 
DBM_ANTNOISE_FLAG 
LOCK_QUALITY_FLAG 
TX_ATTENUATION_FLAG 
DB_TX_ATTENUATION_FLAG 
DBM_TX_POWER_FLAG 
ANTENNA_FLAG 
DB_ANTSIGNAL_FLAG 
DB_ANTNOISE_FLAG 
RX_FLAGS_FLAG 
TX_FLAGS_FLAG 
RTS_RETRIES_FLAG 
DATA_RETRIES_FLAG 
MCS_FLAG 
A_MPDU_STATUS_FLAG 
VHT_FLAG 
RADIOTOP_NS_FLAG 
VENDOR_NS_FLAG 
EXTENDED_BITMASK_FLAG 

Definition at line 250 of file RadiotapPacket.hh.

◆ PresentIndex

Enumerator
TSFT_INDEX 
FLAGS_INDEX 
RATE_INDEX 
CHANNEL_INDEX 
FHSS_INDEX 
DBM_ANTSIGNAL_INDEX 
DBM_ANTNOISE_INDEX 
LOCK_QUALITY_INDEX 
TX_ATTENUATION_INDEX 
DB_TX_ATTENUATION_INDEX 
DBM_TX_POWER_INDEX 
ANTENNA_INDEX 
DB_ANTSIGNAL_INDEX 
DB_ANTNOISE_INDEX 
RX_FLAGS_INDEX 
TX_FLAGS_INDEX 
RTS_RETRIES_INDEX 
DATA_RETRIES_INDEX 
MCS_INDEX 
A_MPDU_STATUS_INDEX 
VHT_INDEX 
MAX_INDEX 
RADIOTOP_NS_INDEX 
VENDOR_NS_INDEX 
EXTENDED_BITMASK_INDEX 

Definition at line 218 of file RadiotapPacket.hh.

Member Function Documentation

◆ length()

UInt16LSBParser senf::RadiotapPacket_HeaderParser::length ( ) const

◆ presentFlags()

UInt32LSBParser senf::RadiotapPacket_HeaderParser::presentFlags ( ) const
protected

◆ presentFlags_ext1()

UInt32LSBParser senf::RadiotapPacket_HeaderParser::presentFlags_ext1 ( ) const
protected

◆ presentFlags_ext2()

UInt32LSBParser senf::RadiotapPacket_HeaderParser::presentFlags_ext2 ( ) const
protected

◆ version()

UInt8Parser senf::RadiotapPacket_HeaderParser::version ( ) const

Member Data Documentation

◆ FIELD_SIZE

unsigned const senf::RadiotapPacket_HeaderParser::FIELD_SIZE
static
Initial value:
= {
8, 1, 1, 4, 2, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 0, 3, 8, 12 }

Definition at line 278 of file RadiotapPacket.hh.


The documentation for this struct was generated from the following files: