Radiotap header implementation. More...
#include <radiotap-header.h>
Public Types | |
enum | { FRAME_FLAG_NONE = 0x00, FRAME_FLAG_CFP = 0x01, FRAME_FLAG_SHORT_PREAMBLE = 0x02, FRAME_FLAG_WEP = 0x04, FRAME_FLAG_FRAGMENTED = 0x08, FRAME_FLAG_FCS_INCLUDED = 0x10, FRAME_FLAG_DATA_PADDING = 0x20, FRAME_FLAG_BAD_FCS = 0x40, FRAME_FLAG_SHORT_GUARD = 0x80 } |
enum | { CHANNEL_FLAG_NONE = 0x0000, CHANNEL_FLAG_TURBO = 0x0010, CHANNEL_FLAG_CCK = 0x0020, CHANNEL_FLAG_OFDM = 0x0040, CHANNEL_FLAG_SPECTRUM_2GHZ = 0x0080, CHANNEL_FLAG_SPECTRUM_5GHZ = 0x0100, CHANNEL_FLAG_PASSIVE = 0x0200, CHANNEL_FLAG_DYNAMIC = 0x0400, CHANNEL_FLAG_GFSK = 0x0800 } |
Public Member Functions | |
virtual TypeId | GetInstanceTypeId (void) const |
virtual uint32_t | GetSerializedSize (void) const |
virtual void | Serialize (Buffer::Iterator start) const |
virtual uint32_t | Deserialize (Buffer::Iterator start) |
virtual void | Print (std::ostream &os) const |
void | SetTsft (uint64_t tsft) |
Set the Time Synchronization Function Timer (TSFT) value. Valid for received frames only. | |
uint64_t | GetTsft (void) const |
Get the Time Synchronization Function Timer (TSFT) value. Valid for received frames only. | |
void | SetFrameFlags (uint8_t flags) |
Set the frame flags of the transmitted or received frame. | |
uint8_t | GetFrameFlags (void) const |
Get the frame flags of the transmitted or received frame. | |
void | SetRate (uint8_t rate) |
Set the transmit/receive channel frequency in units of megahertz. | |
uint8_t | GetRate (void) const |
Get the transmit/receive channel frequency in units of megahertz. | |
void | SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags) |
Set the transmit/receive channel frequency and flags. | |
uint16_t | GetChannelFrequency (void) const |
Get the transmit/receive data rate in units of 500 kbps. | |
uint16_t | GetChannelFlags (void) const |
Get the channel flags of the transmitted or received frame. | |
void | SetAntennaSignalPower (int8_t signal) |
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference. | |
void | SetAntennaSignalPower (double signal) |
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference. | |
uint8_t | GetAntennaSignalPower (void) const |
Get the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference. | |
void | SetAntennaNoisePower (int8_t noise) |
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference. | |
void | SetAntennaNoisePower (double noise) |
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference. | |
uint8_t | GetAntennaNoisePower (void) const |
Get the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference. | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Header. |
Radiotap header implementation.
Radiotap is a de facto standard for 802.11 frame injection and reception. The radiotap header format is a mechanism to supply additional information about frames, from the driver to userspace applications such as libpcap, and from a userspace application to the driver for transmission.
anonymous enum |
anonymous enum |
CHANNEL_FLAG_NONE |
No flags set |
CHANNEL_FLAG_TURBO |
Turbo Channel |
CHANNEL_FLAG_CCK |
CCK channel |
CHANNEL_FLAG_OFDM |
OFDM channel |
CHANNEL_FLAG_SPECTRUM_2GHZ |
2 GHz spectrum channel |
CHANNEL_FLAG_SPECTRUM_5GHZ |
5 GHz spectrum channel |
CHANNEL_FLAG_PASSIVE |
Only passive scan allowed |
CHANNEL_FLAG_DYNAMIC |
Dynamic CCK-OFDM channel |
CHANNEL_FLAG_GFSK |
GFSK channel (FHSS PHY) |
virtual uint32_t ns3::RadiotapHeader::Deserialize | ( | Buffer::Iterator | start | ) | [virtual] |
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.
start | An iterator which points to where the header should written. |
Implements ns3::Header.
uint8_t ns3::RadiotapHeader::GetAntennaNoisePower | ( | void | ) | const |
Get the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference.
uint8_t ns3::RadiotapHeader::GetAntennaSignalPower | ( | void | ) | const |
Get the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference.
uint16_t ns3::RadiotapHeader::GetChannelFlags | ( | void | ) | const |
Get the channel flags of the transmitted or received frame.
uint16_t ns3::RadiotapHeader::GetChannelFrequency | ( | void | ) | const |
Get the transmit/receive data rate in units of 500 kbps.
uint8_t ns3::RadiotapHeader::GetFrameFlags | ( | void | ) | const |
Get the frame flags of the transmitted or received frame.
virtual TypeId ns3::RadiotapHeader::GetInstanceTypeId | ( | void | ) | const [virtual] |
This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.
Implements ns3::ObjectBase.
uint8_t ns3::RadiotapHeader::GetRate | ( | void | ) | const |
Get the transmit/receive channel frequency in units of megahertz.
virtual uint32_t ns3::RadiotapHeader::GetSerializedSize | ( | void | ) | const [virtual] |
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet. This method returns the number of bytes which are needed to store the header data during a Serialize.
Implements ns3::Header.
uint64_t ns3::RadiotapHeader::GetTsft | ( | void | ) | const |
Get the Time Synchronization Function Timer (TSFT) value. Valid for received frames only.
static TypeId ns3::RadiotapHeader::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::Header.
No Attributes defined for this type.
No TraceSources defined for this type.
Reimplemented from ns3::Header.
virtual void ns3::RadiotapHeader::Print | ( | std::ostream & | os | ) | const [virtual] |
This method is used by Packet::Print to print the content of the header as ascii data to a C++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace.
eg: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5
os | The output stream |
Implements ns3::Header.
virtual void ns3::RadiotapHeader::Serialize | ( | Buffer::Iterator | start | ) | const [virtual] |
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.
start | An iterator which points to where the header should be written. |
Implements ns3::Header.
void ns3::RadiotapHeader::SetAntennaNoisePower | ( | double | noise | ) |
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference.
noise | The RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference. |
void ns3::RadiotapHeader::SetAntennaNoisePower | ( | int8_t | noise | ) |
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference.
noise | The RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference. |
void ns3::RadiotapHeader::SetAntennaSignalPower | ( | int8_t | signal | ) |
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference.
signal | The RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference. |
void ns3::RadiotapHeader::SetAntennaSignalPower | ( | double | signal | ) |
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference.
signal | The RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference; |
void ns3::RadiotapHeader::SetChannelFrequencyAndFlags | ( | uint16_t | frequency, | |
uint16_t | flags | |||
) |
Set the transmit/receive channel frequency and flags.
frequency | The transmit/receive data rate in units of 500 kbps. | |
flags | The flags to set. |
void ns3::RadiotapHeader::SetFrameFlags | ( | uint8_t | flags | ) |
Set the frame flags of the transmitted or received frame.
flags | flags to set. |
void ns3::RadiotapHeader::SetRate | ( | uint8_t | rate | ) |
Set the transmit/receive channel frequency in units of megahertz.
rate | the transmit/receive channel frequency in units of megahertz. |
void ns3::RadiotapHeader::SetTsft | ( | uint64_t | tsft | ) |
Set the Time Synchronization Function Timer (TSFT) value. Valid for received frames only.
tsft | Value in microseconds of the MAC's 64-bit 802.11 Time Synchronization Function timer when the first bit of the MPDU arrived at the MAC. |