--- a/examples/wireless/wifi-simple-adhoc-grid.cc Thu Jun 30 03:00:47 2011 -0400
+++ b/examples/wireless/wifi-simple-adhoc-grid.cc Sat Jul 02 05:57:45 2011 -0400
@@ -174,8 +174,8 @@
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode",StringValue (phyMode),
"ControlMode",StringValue (phyMode));
- // Set it to adhoc mode
- wifiMac.SetType ("ns3::AdhocWifiMac");
+ // Set it to monitor mode
+ wifiMac.SetType ("ns3::MonitorMacHigh");
NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c);
MobilityHelper mobility;
--- a/src/click/model/ipv4-l3-click-protocol.cc Thu Jun 30 03:00:47 2011 -0400
+++ b/src/click/model/ipv4-l3-click-protocol.cc Sat Jul 02 05:57:45 2011 -0400
@@ -30,14 +30,12 @@
#include "ns3/net-device.h"
#include "ns3/uinteger.h"
#include "ns3/object-vector.h"
-#include "ns3/simulator.h"
#include "ns3/ipv4-raw-socket-impl.h"
#include "ns3/arp-l3-protocol.h"
#include "ns3/ipv4-l4-protocol.h"
#include "ns3/icmpv4-l4-protocol.h"
#include "ns3/loopback-net-device.h"
-#include "ns3/interference-helper.h"
NS_LOG_COMPONENT_DEFINE ("Ipv4L3ClickProtocol");
--- a/src/wifi/model/monitor-mac-high.cc Thu Jun 30 03:00:47 2011 -0400
+++ b/src/wifi/model/monitor-mac-high.cc Sat Jul 02 05:57:45 2011 -0400
@@ -40,6 +40,15 @@
NS_OBJECT_ENSURE_REGISTERED (MonitorMacHigh);
+TypeId
+MonitorMacHigh::GetTypeId (void)
+{
+ static TypeId tid = TypeId ("ns3::MonitorMacHigh")
+ .SetParent<WifiMac> ()
+ ;
+ return tid;
+}
+
MonitorMacHigh::MonitorMacHigh ()
{
NS_LOG_FUNCTION (this);
@@ -380,6 +389,11 @@
default:
NS_FATAL_ERROR ("Unsupported Action frame received");
}
+ if (hdr->IsData ())
+ {
+ packet->AddHeader (radiotaphdr);
+ ForwardUp (packet, from, to);
+ }
}
NS_FATAL_ERROR ("Don't know how to handle frame (type=" << hdr->GetType ());
}
@@ -453,32 +467,6 @@
reqHdr->GetStartingSequence ());
}
-TypeId
-MonitorMacHigh::GetTypeId (void)
-{
- static TypeId tid = TypeId ("ns3::MonitorMacHigh")
- .SetParent<WifiMac> ()
- .AddAttribute ("QosSupported",
- "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA",
- BooleanValue (false),
- MakeBooleanAccessor (&MonitorMacHigh::SetQosSupported,
- &MonitorMacHigh::GetQosSupported),
- MakeBooleanChecker ())
- .AddAttribute ("DcaTxop", "The DcaTxop object",
- PointerValue (),
- MakePointerAccessor (&MonitorMacHigh::GetDcaTxop),
- MakePointerChecker<DcaTxop> ())
- .AddTraceSource ( "TxOkHeader",
- "The header of successfully transmitted packet",
- MakeTraceSourceAccessor (&MonitorMacHigh::m_txOkCallback))
- .AddTraceSource ("TxErrHeader",
- "The header of unsuccessfully transmitted packet",
- MakeTraceSourceAccessor (&MonitorMacHigh::m_txErrCallback))
- ;
-
- return tid;
-}
-
void
MonitorMacHigh::FinishConfigureStandard (enum WifiPhyStandard standard)
{
--- a/src/wifi/model/monitor-mac-high.h Thu Jun 30 03:00:47 2011 -0400
+++ b/src/wifi/model/monitor-mac-high.h Sat Jul 02 05:57:45 2011 -0400
@@ -39,11 +39,10 @@
class DcfManager;
/**
- * \brief base class for all MAC-level wifi objects.
+ * \brief base class for all MonitorMacHigh
*
- * This class encapsulates all the low-level MAC functionality
- * DCA, EDCA, etc) and all the high-level MAC functionality
- * (association/disassociation state machines).
+ * This class encapsulates the Non-QoS functionality
+ * of RegularWifiMac
*
*/
class MonitorMacHigh : public WifiMac
--- a/src/wifi/model/wifi-net-device.cc Thu Jun 30 03:00:47 2011 -0400
+++ b/src/wifi/model/wifi-net-device.cc Sat Jul 02 05:57:45 2011 -0400
@@ -288,9 +288,13 @@
WifiNetDevice::ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to)
{
LlcSnapHeader llc;
- Ptr<Packet> p;
- p = packet->Copy ();
- p->RemoveHeader (llc);
+ m_monitor = true;
+ if (!m_monitor)
+ {
+ Ptr<Packet> p;
+ p = packet->Copy ();
+ p->RemoveHeader (llc);
+ }
enum NetDevice::PacketType type;
if (to.IsBroadcast ())
{
@@ -308,13 +312,11 @@
{
type = NetDevice::PACKET_OTHERHOST;
}
-
if (type != NetDevice::PACKET_OTHERHOST)
{
m_mac->NotifyRx (packet);
m_forwardUp (this, packet, llc.GetType (), from);
}
-
if (!m_promiscRx.IsNull ())
{
m_mac->NotifyPromiscRx (packet);
@@ -361,6 +363,12 @@
m_mac->SetPromisc ();
}
+void
+WifiNetDevice::SetMonitorMode ()
+{
+ m_monitor = true;
+}
+
bool
WifiNetDevice::SupportsSendFrom (void) const
{
--- a/src/wifi/model/wifi-net-device.h Thu Jun 30 03:00:47 2011 -0400
+++ b/src/wifi/model/wifi-net-device.h Sat Jul 02 05:57:45 2011 -0400
@@ -80,7 +80,10 @@
* \returns the remote station manager we are currently using.
*/
Ptr<WifiRemoteStationManager> GetRemoteStationManager (void) const;
-
+ /**
+ * \param monitor sets mode as monitor mode
+ */
+ void SetMonitorMode (void);
// inherited from NetDevice base class.
virtual void SetIfIndex (const uint32_t index);
@@ -135,6 +138,7 @@
uint32_t m_ifIndex;
bool m_linkUp;
+ bool m_monitor;
TracedCallback<> m_linkChanges;
mutable uint16_t m_mtu;
bool m_configComplete;