--- a/src/wifi/helper/wifi-helper.cc Mon Aug 06 21:55:21 2018 -0700
+++ b/src/wifi/helper/wifi-helper.cc Tue Aug 07 10:44:57 2018 +0200
@@ -168,8 +168,6 @@
MpduInfo aMpdu)
{
uint32_t dlt = file->GetDataLinkType ();
- WifiPreamble preamble = txVector.GetPreambleType ();
-
switch (dlt)
{
case PcapHelper::DLT_IEEE802_11:
@@ -183,166 +181,7 @@
case PcapHelper::DLT_IEEE802_11_RADIO:
{
Ptr<Packet> p = packet->Copy ();
- RadiotapHeader header;
- uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE;
- header.SetTsft (Simulator::Now ().GetMicroSeconds ());
-
- //Our capture includes the FCS, so we set the flag to say so.
- frameFlags |= RadiotapHeader::FRAME_FLAG_FCS_INCLUDED;
-
- if (preamble == WIFI_PREAMBLE_SHORT)
- {
- frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE;
- }
-
- if (txVector.GetGuardInterval () == 400)
- {
- frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_GUARD;
- }
-
- header.SetFrameFlags (frameFlags);
-
- uint64_t rate = 0;
- if (txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HT && txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_VHT && txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HE)
- {
- rate = txVector.GetMode ().GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), 1) * txVector.GetNss () / 500000;
- header.SetRate (static_cast<uint8_t> (rate));
- }
-
- uint16_t channelFlags = 0;
- switch (rate)
- {
- case 2: //1Mbps
- case 4: //2Mbps
- case 10: //5Mbps
- case 22: //11Mbps
- channelFlags |= RadiotapHeader::CHANNEL_FLAG_CCK;
- break;
- default:
- channelFlags |= RadiotapHeader::CHANNEL_FLAG_OFDM;
- break;
- }
-
- if (channelFreqMhz < 2500)
- {
- channelFlags |= RadiotapHeader::CHANNEL_FLAG_SPECTRUM_2GHZ;
- }
- else
- {
- channelFlags |= RadiotapHeader::CHANNEL_FLAG_SPECTRUM_5GHZ;
- }
-
- header.SetChannelFrequencyAndFlags (channelFreqMhz, channelFlags);
-
- if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT)
- {
- uint8_t mcsKnown = RadiotapHeader::MCS_KNOWN_NONE;
- uint8_t mcsFlags = RadiotapHeader::MCS_FLAGS_NONE;
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_INDEX;
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_BANDWIDTH;
- if (txVector.GetChannelWidth () == 40)
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_BANDWIDTH_40;
- }
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_GUARD_INTERVAL;
- if (txVector.GetGuardInterval () == 400)
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_GUARD_INTERVAL;
- }
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_HT_FORMAT;
- if (preamble == WIFI_PREAMBLE_HT_GF)
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_HT_GREENFIELD;
- }
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS;
- if (txVector.GetNess () & 0x01) //bit 1
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_NESS_BIT_0;
- }
- if (txVector.GetNess () & 0x02) //bit 2
- {
- mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS_BIT_1;
- }
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_FEC_TYPE; //only BCC is currently supported
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_STBC;
- if (txVector.IsStbc ())
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_STBC_STREAMS;
- }
-
- header.SetMcsFields (mcsKnown, mcsFlags, txVector.GetMode ().GetMcsValue ());
- }
-
- if (txVector.IsAggregation ())
- {
- uint16_t ampduStatusFlags = RadiotapHeader::A_MPDU_STATUS_NONE;
- ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST_KNOWN;
- /* For PCAP file, MPDU Delimiter and Padding should be removed by the MAC Driver */
- AmpduSubframeHeader hdr;
- uint32_t extractedLength;
- p->RemoveHeader (hdr);
- extractedLength = hdr.GetLength ();
- p = p->CreateFragment (0, static_cast<uint32_t> (extractedLength));
- if (aMpdu.type == LAST_MPDU_IN_AGGREGATE || (hdr.GetEof () == true && hdr.GetLength () > 0))
- {
- ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST;
- }
- header.SetAmpduStatus (aMpdu.mpduRefNumber, ampduStatusFlags, 1 /*CRC*/);
- }
-
- if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT)
- {
- uint16_t vhtKnown = RadiotapHeader::VHT_KNOWN_NONE;
- uint8_t vhtFlags = RadiotapHeader::VHT_FLAGS_NONE;
- uint8_t vhtBandwidth = 0;
- uint8_t vhtMcsNss[4] = {0,0,0,0};
- uint8_t vhtCoding = 0;
- uint8_t vhtGroupId = 0;
- uint16_t vhtPartialAid = 0;
-
- vhtKnown |= RadiotapHeader::VHT_KNOWN_STBC;
- if (txVector.IsStbc ())
- {
- vhtFlags |= RadiotapHeader::VHT_FLAGS_STBC;
- }
-
- vhtKnown |= RadiotapHeader::VHT_KNOWN_GUARD_INTERVAL;
- if (txVector.GetGuardInterval () == 400)
- {
- vhtFlags |= RadiotapHeader::VHT_FLAGS_GUARD_INTERVAL;
- }
-
- vhtKnown |= RadiotapHeader::VHT_KNOWN_BEAMFORMED; //Beamforming is currently not supported
-
- vhtKnown |= RadiotapHeader::VHT_KNOWN_BANDWIDTH;
- //not all bandwidth values are currently supported
- if (txVector.GetChannelWidth () == 40)
- {
- vhtBandwidth = 1;
- }
- else if (txVector.GetChannelWidth () == 80)
- {
- vhtBandwidth = 4;
- }
- else if (txVector.GetChannelWidth () == 160)
- {
- vhtBandwidth = 11;
- }
-
- //only SU PPDUs are currently supported
- vhtMcsNss[0] |= (txVector.GetNss () & 0x0f);
- vhtMcsNss[0] |= ((txVector.GetMode ().GetMcsValue () << 4) & 0xf0);
-
- header.SetVhtFields (vhtKnown, vhtFlags, vhtBandwidth, vhtMcsNss, vhtCoding, vhtGroupId, vhtPartialAid);
- }
-
+ RadiotapHeader header = GetRadiotapHeader (p, channelFreqMhz, txVector, aMpdu);
p->AddHeader (header);
file->Write (Simulator::Now (), p);
return;
@@ -362,8 +201,6 @@
SignalNoiseDbm signalNoise)
{
uint32_t dlt = file->GetDataLinkType ();
- WifiPreamble preamble = txVector.GetPreambleType ();
-
switch (dlt)
{
case PcapHelper::DLT_IEEE802_11:
@@ -377,170 +214,9 @@
case PcapHelper::DLT_IEEE802_11_RADIO:
{
Ptr<Packet> p = packet->Copy ();
- RadiotapHeader header;
- uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE;
- header.SetTsft (Simulator::Now ().GetMicroSeconds ());
-
- //Our capture includes the FCS, so we set the flag to say so.
- frameFlags |= RadiotapHeader::FRAME_FLAG_FCS_INCLUDED;
-
- if (preamble == WIFI_PREAMBLE_SHORT)
- {
- frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE;
- }
-
- if (txVector.GetGuardInterval () == 400)
- {
- frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_GUARD;
- }
-
- header.SetFrameFlags (frameFlags);
-
- uint64_t rate = 0;
- if (txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HT && txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_VHT && txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HE)
- {
- rate = txVector.GetMode ().GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), 1) * txVector.GetNss () / 500000;
- header.SetRate (static_cast<uint8_t> (rate));
- }
-
- uint16_t channelFlags = 0;
- switch (rate)
- {
- case 2: //1Mbps
- case 4: //2Mbps
- case 10: //5Mbps
- case 22: //11Mbps
- channelFlags |= RadiotapHeader::CHANNEL_FLAG_CCK;
- break;
- default:
- channelFlags |= RadiotapHeader::CHANNEL_FLAG_OFDM;
- break;
- }
-
- if (channelFreqMhz < 2500)
- {
- channelFlags |= RadiotapHeader::CHANNEL_FLAG_SPECTRUM_2GHZ;
- }
- else
- {
- channelFlags |= RadiotapHeader::CHANNEL_FLAG_SPECTRUM_5GHZ;
- }
-
- header.SetChannelFrequencyAndFlags (channelFreqMhz, channelFlags);
-
+ RadiotapHeader header = GetRadiotapHeader (p, channelFreqMhz, txVector, aMpdu);
header.SetAntennaSignalPower (signalNoise.signal);
header.SetAntennaNoisePower (signalNoise.noise);
-
- if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT)
- {
- uint8_t mcsKnown = RadiotapHeader::MCS_KNOWN_NONE;
- uint8_t mcsFlags = RadiotapHeader::MCS_FLAGS_NONE;
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_INDEX;
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_BANDWIDTH;
- if (txVector.GetChannelWidth () == 40)
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_BANDWIDTH_40;
- }
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_GUARD_INTERVAL;
- if (txVector.GetGuardInterval () == 400)
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_GUARD_INTERVAL;
- }
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_HT_FORMAT;
- if (preamble == WIFI_PREAMBLE_HT_GF)
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_HT_GREENFIELD;
- }
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS;
- if (txVector.GetNess () & 0x01) //bit 1
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_NESS_BIT_0;
- }
- if (txVector.GetNess () & 0x02) //bit 2
- {
- mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS_BIT_1;
- }
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_FEC_TYPE; //only BCC is currently supported
-
- mcsKnown |= RadiotapHeader::MCS_KNOWN_STBC;
- if (txVector.IsStbc ())
- {
- mcsFlags |= RadiotapHeader::MCS_FLAGS_STBC_STREAMS;
- }
-
- header.SetMcsFields (mcsKnown, mcsFlags, txVector.GetMode ().GetMcsValue ());
- }
-
- if (txVector.IsAggregation ())
- {
- uint16_t ampduStatusFlags = RadiotapHeader::A_MPDU_STATUS_NONE;
- ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_DELIMITER_CRC_KNOWN;
- ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST_KNOWN;
- /* For PCAP file, MPDU Delimiter and Padding should be removed by the MAC Driver */
- AmpduSubframeHeader hdr;
- uint32_t extractedLength;
- p->RemoveHeader (hdr);
- extractedLength = hdr.GetLength ();
- p = p->CreateFragment (0, static_cast<uint32_t> (extractedLength));
- if (aMpdu.type == LAST_MPDU_IN_AGGREGATE || (hdr.GetEof () == true && hdr.GetLength () > 0))
- {
- ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST;
- }
- header.SetAmpduStatus (aMpdu.mpduRefNumber, ampduStatusFlags, 1 /*CRC*/);
- }
-
- if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT)
- {
- uint16_t vhtKnown = RadiotapHeader::VHT_KNOWN_NONE;
- uint8_t vhtFlags = RadiotapHeader::VHT_FLAGS_NONE;
- uint8_t vhtBandwidth = 0;
- uint8_t vhtMcsNss[4] = {0,0,0,0};
- uint8_t vhtCoding = 0;
- uint8_t vhtGroupId = 0;
- uint16_t vhtPartialAid = 0;
-
- vhtKnown |= RadiotapHeader::VHT_KNOWN_STBC;
- if (txVector.IsStbc ())
- {
- vhtFlags |= RadiotapHeader::VHT_FLAGS_STBC;
- }
-
- vhtKnown |= RadiotapHeader::VHT_KNOWN_GUARD_INTERVAL;
- if (txVector.GetGuardInterval () == 400)
- {
- vhtFlags |= RadiotapHeader::VHT_FLAGS_GUARD_INTERVAL;
- }
-
- vhtKnown |= RadiotapHeader::VHT_KNOWN_BEAMFORMED; //Beamforming is currently not supported
-
- vhtKnown |= RadiotapHeader::VHT_KNOWN_BANDWIDTH;
- //not all bandwidth values are currently supported
- if (txVector.GetChannelWidth () == 40)
- {
- vhtBandwidth = 1;
- }
- else if (txVector.GetChannelWidth () == 80)
- {
- vhtBandwidth = 4;
- }
- else if (txVector.GetChannelWidth () == 160)
- {
- vhtBandwidth = 11;
- }
-
- //only SU PPDUs are currently supported
- vhtMcsNss[0] |= (txVector.GetNss () & 0x0f);
- vhtMcsNss[0] |= ((txVector.GetMode ().GetMcsValue () << 4) & 0xf0);
-
- header.SetVhtFields (vhtKnown, vhtFlags, vhtBandwidth, vhtMcsNss, vhtCoding, vhtGroupId, vhtPartialAid);
- }
-
p->AddHeader (header);
file->Write (Simulator::Now (), p);
return;
@@ -550,6 +226,179 @@
}
}
+RadiotapHeader
+WifiPhyHelper::GetRadiotapHeader (
+ Ptr<Packet> packet,
+ uint16_t channelFreqMhz,
+ WifiTxVector txVector,
+ MpduInfo aMpdu)
+{
+ RadiotapHeader header;
+ WifiPreamble preamble = txVector.GetPreambleType ();
+
+ uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE;
+ header.SetTsft (Simulator::Now ().GetMicroSeconds ());
+
+ //Our capture includes the FCS, so we set the flag to say so.
+ frameFlags |= RadiotapHeader::FRAME_FLAG_FCS_INCLUDED;
+
+ if (preamble == WIFI_PREAMBLE_SHORT)
+ {
+ frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE;
+ }
+
+ if (txVector.GetGuardInterval () == 400)
+ {
+ frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_GUARD;
+ }
+
+ header.SetFrameFlags (frameFlags);
+
+ uint64_t rate = 0;
+ if (txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HT
+ && txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_VHT
+ && txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HE)
+ {
+ rate = txVector.GetMode ().GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), 1) * txVector.GetNss () / 500000;
+ header.SetRate (static_cast<uint8_t> (rate));
+ }
+
+ uint16_t channelFlags = 0;
+ switch (rate)
+ {
+ case 2: //1Mbps
+ case 4: //2Mbps
+ case 10: //5Mbps
+ case 22: //11Mbps
+ channelFlags |= RadiotapHeader::CHANNEL_FLAG_CCK;
+ break;
+ default:
+ channelFlags |= RadiotapHeader::CHANNEL_FLAG_OFDM;
+ break;
+ }
+
+ if (channelFreqMhz < 2500)
+ {
+ channelFlags |= RadiotapHeader::CHANNEL_FLAG_SPECTRUM_2GHZ;
+ }
+ else
+ {
+ channelFlags |= RadiotapHeader::CHANNEL_FLAG_SPECTRUM_5GHZ;
+ }
+
+ header.SetChannelFrequencyAndFlags (channelFreqMhz, channelFlags);
+
+ if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT)
+ {
+ uint8_t mcsKnown = RadiotapHeader::MCS_KNOWN_NONE;
+ uint8_t mcsFlags = RadiotapHeader::MCS_FLAGS_NONE;
+
+ mcsKnown |= RadiotapHeader::MCS_KNOWN_INDEX;
+
+ mcsKnown |= RadiotapHeader::MCS_KNOWN_BANDWIDTH;
+ if (txVector.GetChannelWidth () == 40)
+ {
+ mcsFlags |= RadiotapHeader::MCS_FLAGS_BANDWIDTH_40;
+ }
+
+ mcsKnown |= RadiotapHeader::MCS_KNOWN_GUARD_INTERVAL;
+ if (txVector.GetGuardInterval () == 400)
+ {
+ mcsFlags |= RadiotapHeader::MCS_FLAGS_GUARD_INTERVAL;
+ }
+
+ mcsKnown |= RadiotapHeader::MCS_KNOWN_HT_FORMAT;
+ if (preamble == WIFI_PREAMBLE_HT_GF)
+ {
+ mcsFlags |= RadiotapHeader::MCS_FLAGS_HT_GREENFIELD;
+ }
+
+ mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS;
+ if (txVector.GetNess () & 0x01) //bit 1
+ {
+ mcsFlags |= RadiotapHeader::MCS_FLAGS_NESS_BIT_0;
+ }
+ if (txVector.GetNess () & 0x02) //bit 2
+ {
+ mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS_BIT_1;
+ }
+
+ mcsKnown |= RadiotapHeader::MCS_KNOWN_FEC_TYPE; //only BCC is currently supported
+
+ mcsKnown |= RadiotapHeader::MCS_KNOWN_STBC;
+ if (txVector.IsStbc ())
+ {
+ mcsFlags |= RadiotapHeader::MCS_FLAGS_STBC_STREAMS;
+ }
+
+ header.SetMcsFields (mcsKnown, mcsFlags, txVector.GetMode ().GetMcsValue ());
+ }
+
+ if (txVector.IsAggregation ())
+ {
+ uint16_t ampduStatusFlags = RadiotapHeader::A_MPDU_STATUS_NONE;
+ ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST_KNOWN;
+ /* For PCAP file, MPDU Delimiter and Padding should be removed by the MAC Driver */
+ AmpduSubframeHeader hdr;
+ uint32_t extractedLength;
+ packet->RemoveHeader (hdr);
+ extractedLength = hdr.GetLength ();
+ packet = packet->CreateFragment (0, static_cast<uint32_t> (extractedLength));
+ if (aMpdu.type == LAST_MPDU_IN_AGGREGATE || (hdr.GetEof () == true && hdr.GetLength () > 0))
+ {
+ ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST;
+ }
+ header.SetAmpduStatus (aMpdu.mpduRefNumber, ampduStatusFlags, 1 /*CRC*/);
+ }
+
+ if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT)
+ {
+ uint16_t vhtKnown = RadiotapHeader::VHT_KNOWN_NONE;
+ uint8_t vhtFlags = RadiotapHeader::VHT_FLAGS_NONE;
+ uint8_t vhtBandwidth = 0;
+ uint8_t vhtMcsNss[4] = {0,0,0,0};
+ uint8_t vhtCoding = 0;
+ uint8_t vhtGroupId = 0;
+ uint16_t vhtPartialAid = 0;
+
+ vhtKnown |= RadiotapHeader::VHT_KNOWN_STBC;
+ if (txVector.IsStbc ())
+ {
+ vhtFlags |= RadiotapHeader::VHT_FLAGS_STBC;
+ }
+
+ vhtKnown |= RadiotapHeader::VHT_KNOWN_GUARD_INTERVAL;
+ if (txVector.GetGuardInterval () == 400)
+ {
+ vhtFlags |= RadiotapHeader::VHT_FLAGS_GUARD_INTERVAL;
+ }
+
+ vhtKnown |= RadiotapHeader::VHT_KNOWN_BEAMFORMED; //Beamforming is currently not supported
+
+ vhtKnown |= RadiotapHeader::VHT_KNOWN_BANDWIDTH;
+ //not all bandwidth values are currently supported
+ if (txVector.GetChannelWidth () == 40)
+ {
+ vhtBandwidth = 1;
+ }
+ else if (txVector.GetChannelWidth () == 80)
+ {
+ vhtBandwidth = 4;
+ }
+ else if (txVector.GetChannelWidth () == 160)
+ {
+ vhtBandwidth = 11;
+ }
+
+ //only SU PPDUs are currently supported
+ vhtMcsNss[0] |= (txVector.GetNss () & 0x0f);
+ vhtMcsNss[0] |= ((txVector.GetMode ().GetMcsValue () << 4) & 0xf0);
+
+ header.SetVhtFields (vhtKnown, vhtFlags, vhtBandwidth, vhtMcsNss, vhtCoding, vhtGroupId, vhtPartialAid);
+ }
+ return header;
+}
+
void
WifiPhyHelper::SetPcapDataLinkType (SupportedPcapDataLinkTypes dlt)
{
--- a/src/wifi/helper/wifi-helper.h Mon Aug 06 21:55:21 2018 -0700
+++ b/src/wifi/helper/wifi-helper.h Tue Aug 07 10:44:57 2018 +0200
@@ -31,6 +31,7 @@
class WifiNetDevice;
class Node;
+class RadiotapHeader;
/**
* \brief create PHY objects
@@ -115,21 +116,22 @@
* called before EnablePcap(), so that the header of the pcap file can be
* written correctly.
*
- * @see SupportedPcapDataLinkTypes
+ * \see SupportedPcapDataLinkTypes
*
- * @param dlt The data link type of the pcap file (and packets) to be used
+ * \param dlt The data link type of the pcap file (and packets) to be used
*/
void SetPcapDataLinkType (SupportedPcapDataLinkTypes dlt);
/**
* Get the data link type of PCAP traces to be used.
*
- * @see SupportedPcapDataLinkTypes
+ * \see SupportedPcapDataLinkTypes
*
- * @returns The data link type of the pcap file (and packets) to be used
+ * \returns The data link type of the pcap file (and packets) to be used
*/
PcapHelper::DataLinkType GetPcapDataLinkType (void) const;
+
protected:
/**
* \param file the pcap file wrapper
@@ -165,17 +167,33 @@
ObjectFactory m_phy; ///< PHY object
ObjectFactory m_errorRateModel; ///< error rate model
+
private:
/**
- * @brief Enable pcap output the indicated net device.
+ * Get the radiotap header.
+ *
+ * \param packet the packet
+ * \param channelFreqMhz the channel frequency
+ * \param txVector the TXVECTOR
+ * \param aMpdu the A-MPDU information
+ *
+ * \returns the radiotap header
+ */
+ static RadiotapHeader GetRadiotapHeader (Ptr<Packet> packet,
+ uint16_t channelFreqMhz,
+ WifiTxVector txVector,
+ MpduInfo aMpdu);
+
+ /**
+ * \brief Enable pcap output the indicated net device.
*
* NetDevice-specific implementation mechanism for hooking the trace and
* writing to the trace file.
*
- * @param prefix Filename prefix to use for pcap files.
- * @param nd Net device for which you want to enable tracing.
- * @param promiscuous If true capture all possible packets available at the device.
- * @param explicitFilename Treat the prefix as an explicit filename if true
+ * \param prefix Filename prefix to use for pcap files.
+ * \param nd Net device for which you want to enable tracing.
+ * \param promiscuous If true capture all possible packets available at the device.
+ * \param explicitFilename Treat the prefix as an explicit filename if true
*/
virtual void EnablePcapInternal (std::string prefix,
Ptr<NetDevice> nd,
@@ -264,9 +282,9 @@
*/
NetDeviceContainer
virtual Install (const WifiPhyHelper &phy,
- const WifiMacHelper &mac,
- NodeContainer::Iterator first,
- NodeContainer::Iterator last) const;
+ const WifiMacHelper &mac,
+ NodeContainer::Iterator first,
+ NodeContainer::Iterator last) const;
/**
* \param phy the PHY helper to create PHY objects
* \param mac the MAC helper to create MAC objects