From 57634eb170b918ed67ad1d37b5726b9d5b62cdee Mon Sep 17 00:00:00 2001 From: Kirill Andreev Date: Fri, 24 Jul 2009 07:04:29 -0700 Subject: [PATCH 1/3] back out Radiotap header change causing regression --- src/common/pcap-writer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/pcap-writer.cc b/src/common/pcap-writer.cc index e2cc36eb5..3fbc9bd5d 100644 --- a/src/common/pcap-writer.cc +++ b/src/common/pcap-writer.cc @@ -254,7 +254,7 @@ void PcapWriter::WriteWifiMonitorPacket(Ptr packet, uint16_t chann Write16(PRISM_ITEM_LENGTH); // convert from frequency to channel number. This conversion is // correct only for IEEE 802.11b/g channels 1-13. - Write32((channelFreqMhz - 2407) / 5); + Write32((2437 - 2407) / 5); Write32(PRISM_DID_RSSI); Write16(PRISM_STATUS_PRESENT); @@ -388,7 +388,7 @@ void PcapWriter::WriteWifiMonitorPacket(Ptr packet, uint16_t chann Write8(rate); - Write16((uint16_t) channelFreqMhz); + Write16((uint16_t) 2437); // we might want to make this setting depend on the WifiMode and // on the ChannelFrequency at some time in the future. But for now From 61672f39a8b2a3dcb3a3cfa86acb4560cd868d87 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Sun, 26 Jul 2009 07:25:19 -0700 Subject: [PATCH 2/3] Fix first.py example --- examples/first.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/first.py b/examples/first.py index af8c6f5ba..fbd823785 100644 --- a/examples/first.py +++ b/examples/first.py @@ -18,8 +18,6 @@ import ns3 ns3.LogComponentEnable("UdpEchoClientApplication", ns3.LOG_LEVEL_INFO) ns3.LogComponentEnable("UdpEchoServerApplication", ns3.LOG_LEVEL_INFO) -ns3.RandomVariable.UseGlobalSeed(1, 1, 2, 3, 5, 8) - nodes = ns3.NodeContainer() nodes.Create(2) From c4145809c90e219870cc71739da3c7ad3548bc7c Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Mon, 27 Jul 2009 23:04:19 -0700 Subject: [PATCH 3/3] bug 642: allow multiple InternetStackHelpers to be instantiated --- src/helper/internet-stack-helper.cc | 10 ++++++++-- src/helper/internet-stack-helper.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/helper/internet-stack-helper.cc b/src/helper/internet-stack-helper.cc index 833836e6e..ad65850e4 100644 --- a/src/helper/internet-stack-helper.cc +++ b/src/helper/internet-stack-helper.cc @@ -171,6 +171,7 @@ namespace ns3 { std::vector InternetStackHelper::m_traces; std::string InternetStackHelper::m_pcapBaseFilename; +bool InternetStackHelper::m_isInitialized = false; InternetStackHelper::InternetStackHelper () { @@ -178,8 +179,13 @@ InternetStackHelper::InternetStackHelper () static Ipv4StaticRoutingHelper staticRouting; static Ipv4GlobalRoutingHelper globalRouting; static Ipv4ListRoutingHelper listRouting; - listRouting.Add (staticRouting, 0); - listRouting.Add (globalRouting, -10); + if (m_isInitialized == false) + { + // Only add these once + listRouting.Add (staticRouting, 0); + listRouting.Add (globalRouting, -10); + m_isInitialized = true; + } SetRoutingHelper (listRouting); } diff --git a/src/helper/internet-stack-helper.h b/src/helper/internet-stack-helper.h index 8e0a4e4ec..396b564d4 100644 --- a/src/helper/internet-stack-helper.h +++ b/src/helper/internet-stack-helper.h @@ -173,6 +173,7 @@ private: static std::string m_pcapBaseFilename; static uint32_t GetNodeIndex (std::string context); static std::vector m_traces; + static bool m_isInitialized; }; } // namespace ns3