Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(770)

Unified Diff: src/wifi/model/mac-low.cc

Issue 4685048: Monitor mode support in ns-3
Patch Set: Undoing redundant params, changed GetMonitorMode to IsMonitorMode Created 12 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wifi/model/mac-low.h ('k') | src/wifi/model/mac-rx-middle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wifi/model/mac-low.cc
===================================================================
--- a/src/wifi/model/mac-low.cc
+++ b/src/wifi/model/mac-low.cc
@@ -575,7 +575,7 @@
}
void
-MacLow::SetRxCallback (Callback<void,Ptr<Packet>,const WifiMacHeader *> callback)
+MacLow::SetRxCallback (Callback<void,Ptr<Packet>,const WifiMacHeader *,const RadiotapHeader *> callback)
{
m_rxCallback = callback;
}
@@ -662,7 +662,7 @@
}
void
-MacLow::ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiMode txMode, WifiPreamble preamble)
+MacLow::ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiMode txMode, WifiPreamble preamble, RadiotapHeader radiotaphdr)
{
NS_LOG_FUNCTION (this << packet << rxSnr << txMode << preamble);
/* A packet is received from the PHY.
@@ -672,6 +672,7 @@
*/
WifiMacHeader hdr;
packet->RemoveHeader (hdr);
+ m_currentRadiotapHdr = &radiotaphdr;
bool isPrevNavZero = IsNavZero ();
NS_LOG_DEBUG ("duration/id=" << hdr.GetDuration ());
@@ -904,7 +905,7 @@
NS_ASSERT (hdr.GetAddr1 () != m_self);
if (hdr.IsData ())
{
- goto rxPacket;
+ goto rxPacket;
}
}
else
@@ -915,7 +916,7 @@
rxPacket:
WifiMacTrailer fcs;
packet->RemoveTrailer (fcs);
- m_rxCallback (packet, &hdr);
+ m_rxCallback (packet, &hdr, &radiotaphdr);
return;
}
@@ -1642,10 +1643,10 @@
{
while (last != i)
{
- m_rxCallback ((*last).first, &(*last).second);
+ m_rxCallback ((*last).first, &(*last).second, m_currentRadiotapHdr);
last++;
}
- m_rxCallback ((*last).first, &(*last).second);
+ m_rxCallback ((*last).first, &(*last).second, m_currentRadiotapHdr);
last++;
/* go to next packet */
while (i != (*it).second.second.end () && ((guard >> 4) & 0x0fff) == (*i).second.GetSequenceNumber ())
@@ -1698,10 +1699,10 @@
{
while (lastComplete != i)
{
- m_rxCallback ((*lastComplete).first, &(*lastComplete).second);
+ m_rxCallback ((*lastComplete).first, &(*lastComplete).second, m_currentRadiotapHdr);
lastComplete++;
}
- m_rxCallback ((*lastComplete).first, &(*lastComplete).second);
+ m_rxCallback ((*lastComplete).first, &(*lastComplete).second, m_currentRadiotapHdr);
lastComplete++;
}
guard = (*i).second.IsMoreFragments () ? (guard + 1) : ((guard + 16) & 0xfff0);
« no previous file with comments | « src/wifi/model/mac-low.h ('k') | src/wifi/model/mac-rx-middle.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b