merge
authorNicola Baldo <nicola@baldo.biz>
Sun, 13 Nov 2011 13:50:50 +0100
changeset 7589 7c3b61fc7f97
parent 7560 34f80491b369 (current diff)
parent 7588 3ae0a64434f0 (diff)
child 7590 c600783e8983
merge
src/lte/model/lte-spectrum-phy.cc
src/lte/model/lte-spectrum-phy.h
src/spectrum/model/half-duplex-ideal-phy.cc
src/spectrum/model/half-duplex-ideal-phy.h
src/spectrum/model/multi-model-spectrum-channel.cc
src/spectrum/model/multi-model-spectrum-channel.h
src/spectrum/model/single-model-spectrum-channel.cc
src/spectrum/model/single-model-spectrum-channel.h
src/spectrum/model/spectrum-analyzer.cc
src/spectrum/model/spectrum-analyzer.h
src/spectrum/model/spectrum-phy.h
src/spectrum/model/waveform-generator.cc
src/spectrum/model/waveform-generator.h
--- a/CHANGES.html	Mon Oct 03 23:03:42 2011 +0200
+++ b/CHANGES.html	Sun Nov 13 13:50:50 2011 +0100
@@ -86,6 +86,13 @@
 <li> WIFI_PHY_STANDARD_80211_10Mhz was changed to WIFI_PHY_STANDARD_80211_10MHZ
 <li> WIFI_PHY_STANDARD_80211_5Mhz was changed to WIFI_PHY_STANDARD_80211_5MHZ
 </ul>
+<li> In the SpectrumPhy base class, the methods to get/set the
+  MobilityModel and the NetDevice were previously working with
+  opaque Ptr&#60;Object&#62;. Now all these methods have been
+  changed so that they work with Ptr&#60;NetDevice&#62;
+  and Ptr&#60;MobilityModel&#62; as appropriate. See <A href="https://www.nsnam.org/bugzilla/show_bug.cgi?id=1271">Bug 1271</A> on
+  bugzilla for the motivation.
+</li>
 </ul>
 
 <h2>Changed behavior:</h2>
--- a/bindings/python/wscript	Mon Oct 03 23:03:42 2011 +0200
+++ b/bindings/python/wscript	Sun Nov 13 13:50:50 2011 +0100
@@ -430,7 +430,7 @@
 
     if Options.options.apiscan:
         if not env['ENABLE_PYTHON_SCANNING']:
-            raise Utils.WafError("Cannot re-scan python bindings: (py)gccxml not available")
+            raise WafError("Cannot re-scan python bindings: (py)gccxml not available")
         scan_targets = []
         if sys.platform == 'cygwin':
             scan_targets.append(('gcc_cygwin', ''))
@@ -441,7 +441,7 @@
             elif struct.calcsize('I') == 4 and struct.calcsize('L') == 4 and struct.calcsize('P') == 4:
                 scan_targets.append(('gcc_ILP32', ''))
             else:
-                raise Utils.WafError("Cannot scan python bindings for unsupported data model")
+                raise WafError("Cannot scan python bindings for unsupported data model")
 
         test_module_path = bld.path.find_dir("../../src/test")
         if Options.options.apiscan == 'all':
--- a/doc/manual/source/index.rst	Mon Oct 03 23:03:42 2011 +0200
+++ b/doc/manual/source/index.rst	Sun Nov 13 13:50:50 2011 +0100
@@ -7,9 +7,7 @@
 available in five forms:
 
 * `ns-3 Doxygen <http://www.nsnam.org/doxygen/index.html>`_: Documentation of the public APIs of the simulator
-* `Tutorial <http://www.nsnam.org/tutorials.html>`_
-* `Manual <http://www.nsnam.org/tutorials.html>`_: *(this document)*
-* `Model Library <http://www.nsnam.org/tutorials.html>`_
+* Tutorial, Manual *(this document)*, and Model Library for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
 * `ns-3 wiki <http://www.nsnam.org/wiki/index.php/Main_Page>`_
 
 This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
--- a/doc/manual/source/object-model.rst	Mon Oct 03 23:03:42 2011 +0200
+++ b/doc/manual/source/object-model.rst	Sun Nov 13 13:50:50 2011 +0100
@@ -257,10 +257,10 @@
     // subsequently created objects
     factory.Set ("SystemLoss", DoubleValue (2.0));
     // Create one such object
-    Ptr<Object> object = m_factory.Create (); 
+    Ptr<Object> object = factory.Create (); 
     factory.Set ("SystemLoss", DoubleValue (3.0));
-    // Create another object
-    Ptr<Object> object = m_factory.Create (); 
+    // Create another object with a different SystemLoss
+    Ptr<Object> object = factory.Create (); 
 
 Downcasting
 ***********
--- a/doc/models/source/index.rst	Mon Oct 03 23:03:42 2011 +0200
+++ b/doc/models/source/index.rst	Sun Nov 13 13:50:50 2011 +0100
@@ -7,9 +7,7 @@
 available in five forms:
 
 * `ns-3 Doxygen <http://www.nsnam.org/doxygen/index.html>`_: Documentation of the public APIs of the simulator
-* `Tutorial <http://www.nsnam.org/tutorials.html>`_
-* `Manual <http://www.nsnam.org/tutorials.html>`_
-* `Model Library <http://www.nsnam.org/tutorials.html>`_: *(this document)*
+* Tutorial, Manual, and Model Library *(this document)* for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
 * `ns-3 wiki <http://www.nsnam.org/wiki/index.php/Main_Page>`_ 
 
 This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
--- a/doc/tutorial/source/index.rst	Mon Oct 03 23:03:42 2011 +0200
+++ b/doc/tutorial/source/index.rst	Sun Nov 13 13:50:50 2011 +0100
@@ -7,9 +7,7 @@
 available in five forms:
 
 * `ns-3 Doxygen <http://www.nsnam.org/doxygen/index.html>`_: Documentation of the public APIs of the simulator
-* `Tutorial <http://www.nsnam.org/tutorials.html>`_: *(this document)*
-* `Manual <http://www.nsnam.org/tutorials.html>`_:
-* `Model Library <http://www.nsnam.org/tutorials.html>`_:
+* Tutorial *(this document)*, Manual, and Model Library for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
 * `ns-3 wiki <http://www.nsnam.org/wiki/index.php/Main_Page>`_
 
 This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
--- a/src/click/model/ipv4-click-routing.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/click/model/ipv4-click-routing.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -261,6 +261,8 @@
 {
   m_simNode->curtime.tv_sec = Simulator::Now ().GetSeconds ();
   m_simNode->curtime.tv_usec = Simulator::Now ().GetMicroSeconds () % 1000000;
+  NS_LOG_DEBUG ("RunClickEvent at " << m_simNode->curtime.tv_sec << " " << 
+                                       m_simNode->curtime.tv_usec << " " << Simulator::Now ());
   simclick_click_run (m_simNode);
 }
 
@@ -269,10 +271,10 @@
 {
   NS_LOG_DEBUG ("HandleScheduleFromClick at " << when->tv_sec << " " << when->tv_usec << " " << Simulator::Now ());
 
-  double simtime = when->tv_sec + (when->tv_usec / 1.0e6);
-  double simdelay = simtime - Simulator::Now ().GetMicroSeconds () / 1.0e6;
+  Time simtime  = Time::FromInteger(when->tv_sec, Time::S) + Time::FromInteger(when->tv_usec, Time::US);
+  Time simdelay = simtime - Simulator::Now();
 
-  Simulator::Schedule (Seconds (simdelay), &Ipv4ClickRouting::RunClickEvent, this);
+  Simulator::Schedule (simdelay, &Ipv4ClickRouting::RunClickEvent, this);
 }
 
 void
@@ -640,7 +642,7 @@
         clickInstance->HandleScheduleFromClick (when);
 
         retval = 0;
-        NS_LOG_DEBUG (clickInstance->GetNodeName () << " SIMCLICK_SCHEDULE: " << when->tv_sec << "s and " << when->tv_usec << "usecs later.");
+        NS_LOG_DEBUG (clickInstance->GetNodeName () << " SIMCLICK_SCHEDULE at " << when->tv_sec << "s and " << when->tv_usec << "usecs.");
 
         break;
       }
--- a/src/core/model/object-base.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/core/model/object-base.h	Sun Nov 13 13:50:50 2011 +0100
@@ -60,7 +60,7 @@
   virtual ~ObjectBase ();
 
   /**
-   * \returns the TypeId associated to the most-derived type
+   * \return the TypeId associated to the most-derived type
    *          of this instance.
    *
    * This method is typically implemented by ns3::Object::GetInstanceTypeId
@@ -80,14 +80,14 @@
   /**
    * \param name the name of the attribute to set
    * \param value the name of the attribute to set
-   * \returns true if the requested attribute exists and could be set, 
+   * \return true if the requested attribute exists and could be set, 
    * false otherwise.
    */
   bool SetAttributeFailSafe (std::string name, const AttributeValue &value);
   /**
    * \param name the name of the attribute to read
    * \param value a reference to the value where the result should be stored.
-   * \returns the attribute read.
+   * \return the attribute read.
    *
    * If the input attribute name does not exist, this method crashes.
    */
@@ -95,9 +95,7 @@
   /**
    * \param name the name of the attribute to read
    * \param attribute the attribute where the result value should be stored
-   * \returns true if the requested attribute was found, false otherwise.
-   *
-   * If the input attribute name does not exist, this method crashes.
+   * \return true if the requested attribute was found, false otherwise.
    */
   bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const;
 
--- a/src/core/model/time.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/core/model/time.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -33,7 +33,7 @@
 
 Time::Time (const std::string& s)
 {
-  std::string::size_type n = s.find_first_not_of ("0123456789.");
+  std::string::size_type n = s.find_first_not_of ("+-0123456789.");
   if (n != std::string::npos)
     { // Found non-numeric
       std::istringstream iss;
--- a/src/core/test/time-test-suite.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/core/test/time-test-suite.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -78,6 +78,61 @@
   Time::SetResolution (m_originalResolution);
 }
 
+class TimesWithSignsTestCase : public TestCase
+{
+public:
+  TimesWithSignsTestCase ();
+private:
+  virtual void DoSetup (void);
+  virtual void DoRun (void);
+  virtual void DoTeardown (void);
+};
+
+TimesWithSignsTestCase::TimesWithSignsTestCase ()
+  : TestCase ("Checks times that have plus or minus signs")
+{
+}
+
+void
+TimesWithSignsTestCase::DoSetup (void)
+{
+}
+
+void
+TimesWithSignsTestCase::DoRun (void)
+{
+  Time timePositive          ("+1000.0");
+  Time timePositiveWithUnits ("+1000.0ms");
+
+  Time timeNegative          ("-1000.0");
+  Time timeNegativeWithUnits ("-1000.0ms");
+
+  NS_TEST_ASSERT_MSG_EQ_TOL (timePositive.GetSeconds (),
+                             +1000.0,
+                             1.0e-8,
+                             "Positive time not parsed correctly.");
+
+  NS_TEST_ASSERT_MSG_EQ_TOL (timePositiveWithUnits.GetSeconds (),
+                             +1.0,
+                             1.0e-8,
+                             "Positive time with units not parsed correctly.");
+
+  NS_TEST_ASSERT_MSG_EQ_TOL (timeNegative.GetSeconds (),
+                             -1000.0,
+                             1.0e-8,
+                             "Negative time not parsed correctly.");
+
+  NS_TEST_ASSERT_MSG_EQ_TOL (timeNegativeWithUnits.GetSeconds (),
+                             -1.0,
+                             1.0e-8,
+                             "Negative time with units not parsed correctly.");
+}
+
+void 
+TimesWithSignsTestCase::DoTeardown (void)
+{
+}
+
 static class TimeTestSuite : public TestSuite
 {
 public:
@@ -85,6 +140,7 @@
     : TestSuite ("time", UNIT)
   {
     AddTestCase (new TimeSimpleTestCase (Time::US));
+    AddTestCase (new TimesWithSignsTestCase ());
   }
 } g_timeTestSuite;
 
--- a/src/internet/model/ipv4-header.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/internet/model/ipv4-header.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -77,6 +77,106 @@
 {
   m_tos = tos;
 }
+
+void
+Ipv4Header::SetDscp (DscpType dscp)
+{
+  m_tos &= 0x3; // Clear out the DSCP part, retain 2 bits of ECN
+  m_tos |= dscp;
+}
+
+void
+Ipv4Header::SetEcn (EcnType ecn)
+{
+  m_tos &= 0xFC; // Clear out the ECN part, retain 6 bits of DSCP
+  m_tos |= ecn;
+}
+
+Ipv4Header::DscpType 
+Ipv4Header::GetDscp (void) const
+{
+  // Extract only first 6 bits of TOS byte, i.e 0xFC
+  return DscpType (m_tos & 0xFC);
+}
+
+std::string 
+Ipv4Header::DscpTypeToString (DscpType dscp) const
+{
+  switch (dscp)
+    {
+      case DscpDefault:
+        return "Default";
+      case CS1:
+        return "CS1";
+      case AF11:
+        return "AF11";
+      case AF12:
+        return "AF12";
+      case AF13:
+        return "AF13";
+      case CS2:
+        return "CS2";
+      case AF21:
+        return "AF21";
+      case AF22:
+        return "AF22";
+      case AF23:
+        return "AF23";
+      case CS3:
+        return "CS3";
+      case AF31:
+        return "AF31";
+      case AF32:
+        return "AF32";
+      case AF33:
+        return "AF33";
+      case CS4:
+        return "CS4";
+      case AF41:
+        return "AF41";
+      case AF42:
+        return "AF42";
+      case AF43:
+        return "AF43";
+      case CS5:
+        return "CS5";
+      case EF:
+        return "EF";
+      case CS6:
+        return "CS6";
+      case CS7:
+        return "CS7";
+      default:
+        return "Unrecognized DSCP";
+    };
+}
+
+
+Ipv4Header::EcnType 
+Ipv4Header::GetEcn (void) const
+{
+  // Extract only last 2 bits of TOS byte, i.e 0x3
+  return EcnType (m_tos & 0x3);
+}
+
+std::string 
+Ipv4Header::EcnTypeToString (EcnType ecn) const
+{
+  switch (ecn)
+    {
+      case NotECT:
+        return "Not-ECT";
+      case ECT1:
+        return "ECT (1)";
+      case ECT0:
+        return "ECT (0)";
+      case CE:
+        return "CE";      
+      default:
+        return "Unknown ECN";
+    };
+}
+
 uint8_t 
 Ipv4Header::GetTos (void) const
 {
@@ -224,6 +324,8 @@
       flags = "XX";
     }
   os << "tos 0x" << std::hex << m_tos << std::dec << " "
+     << "DSCP " << DscpTypeToString (GetDscp ()) << " "
+     << "ECN " << EcnTypeToString (GetEcn ()) << " "
      << "ttl " << m_ttl << " "
      << "id " << m_identification << " "
      << "protocol " << m_protocol << " "
--- a/src/internet/model/ipv4-header.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/internet/model/ipv4-header.h	Sun Nov 13 13:50:50 2011 +0100
@@ -54,6 +54,67 @@
    */
   void SetTos (uint8_t tos);
   /**
+   * \enum DscpType
+   * \brief DiffServ Code Points 
+   * Code Points defined in
+   * Assured Forwarding (AF) RFC 2597
+   * Expedited Forwarding (EF) RFC 2598
+   * Default and Class Selector (CS) RFC 2474
+   */
+  enum DscpType
+    {
+      DscpDefault = 0x00,
+
+      CS1 = 0x20,
+      AF11 = 0x28,
+      AF12 = 0x30,
+      AF13 = 0x38,
+
+      CS2 = 0x40,
+      AF21 = 0x48,
+      AF22 = 0x50,
+      AF23 = 0x58,
+
+      CS3 = 0x60,
+      AF31 = 0x68,
+      AF32 = 0x70,
+      AF33 = 0x78,
+
+      CS4 = 0x80,
+      AF41 = 0x88,
+      AF42 = 0x90,
+      AF43 = 0x98,
+
+      CS5 = 0xA0,
+      EF = 0xB8,
+      
+      CS6 = 0xC0,
+      CS7 = 0xE0
+      
+    };
+  /**
+   * \brief Set DSCP Field
+   * \param dscp DSCP value
+   */
+  void SetDscp (DscpType dscp);
+
+  /**
+   * \enum EcnType
+   * \brief ECN Type defined in RFC 3168
+   */
+  enum EcnType
+    {
+      NotECT = 0x00,
+      ECT1 = 0x01,
+      ECT0 = 0x02,
+      CE = 0x03
+    }; 
+  /**
+   * \brief Set ECN Field
+   * \param ECN Type
+   */
+  void SetEcn (EcnType ecn);
+  /**
    * This packet is not the last packet of a fragmented ipv4 packet.
    */
   void SetMoreFragments (void);
@@ -105,6 +166,22 @@
    */
   uint8_t GetTos (void) const;
   /**
+   * \returns the DSCP field of this packet.
+   */
+  DscpType GetDscp (void) const;
+  /**
+   * \returns std::string of DSCPType
+   */
+  std::string DscpTypeToString (DscpType dscp) const;
+  /**
+   * \returns the ECN field of this packet.
+   */
+  EcnType GetEcn (void) const;
+  /**
+   * \returns std::string of ECNType
+   */
+  std::string EcnTypeToString (EcnType ecn) const;
+  /**
    * \returns true if this is the last fragment of a packet, false otherwise.
    */
   bool IsLastFragment (void) const;
@@ -158,7 +235,7 @@
 
   uint16_t m_payloadSize;
   uint16_t m_identification;
-  uint32_t m_tos : 8;
+  uint32_t m_tos : 8; //Also used as DSCP + ECN value
   uint32_t m_ttl : 8;
   uint32_t m_protocol : 8;
   uint32_t m_flags : 3;
--- a/src/internet/model/ipv4-l3-protocol.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/internet/model/ipv4-l3-protocol.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -1168,6 +1168,11 @@
       fragmentHeader.SetFragmentOffset (offset);
       fragmentHeader.SetPayloadSize (currentFragmentablePartSize);
 
+      if (Node::ChecksumEnabled ())
+        {
+          fragmentHeader.EnableChecksum ();
+        }
+
       NS_LOG_LOGIC ("Fragment check - " << fragmentHeader.GetFragmentOffset ()  );
 
       NS_LOG_LOGIC ("New fragment Header " << fragmentHeader);
--- a/src/internet/model/ipv6-interface-address.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/internet/model/ipv6-interface-address.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -89,7 +89,7 @@
       /* localhost address is always /128 prefix */
       m_prefix = Ipv6Prefix (128);
     }
-  if (address.IsLinkLocal ())
+  else if (address.IsLinkLocal ())
     {
       m_scope = LINKLOCAL;
       /* link-local address is always /64 prefix */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/internet/test/ipv4-header-test.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -0,0 +1,270 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2010 Hajime Tazaki
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: John Abraham <john.abraham@gatech.edu>
+ * Adapted from: ipv4-raw-test.cc
+ */
+
+#include "ns3/test.h"
+#include "ns3/socket-factory.h"
+#include "ns3/ipv4-raw-socket-factory.h"
+#include "ns3/simulator.h"
+#include "ns3/simple-channel.h"
+#include "ns3/simple-net-device.h"
+#include "ns3/drop-tail-queue.h"
+#include "ns3/socket.h"
+
+#include "ns3/log.h"
+#include "ns3/node.h"
+#include "ns3/inet-socket-address.h"
+#include "ns3/boolean.h"
+
+#include "ns3/arp-l3-protocol.h"
+#include "ns3/ipv4-l3-protocol.h"
+#include "ns3/icmpv4-l4-protocol.h"
+#include "ns3/ipv4-list-routing.h"
+#include "ns3/ipv4-static-routing.h"
+
+#include <string>
+#include <sstream>
+#include <limits>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+namespace ns3 {
+
+static void
+AddInternetStack (Ptr<Node> node)
+{
+  //ARP
+  Ptr<ArpL3Protocol> arp = CreateObject<ArpL3Protocol> ();
+  node->AggregateObject (arp);
+  //IPV4
+  Ptr<Ipv4L3Protocol> ipv4 = CreateObject<Ipv4L3Protocol> ();
+  //Routing for Ipv4
+  Ptr<Ipv4ListRouting> ipv4Routing = CreateObject<Ipv4ListRouting> ();
+  ipv4->SetRoutingProtocol (ipv4Routing);
+  Ptr<Ipv4StaticRouting> ipv4staticRouting = CreateObject<Ipv4StaticRouting> ();
+  ipv4Routing->AddRoutingProtocol (ipv4staticRouting, 0);
+  node->AggregateObject (ipv4);
+  //ICMP
+  Ptr<Icmpv4L4Protocol> icmp = CreateObject<Icmpv4L4Protocol> ();
+  node->AggregateObject (icmp);
+  // //Ipv4Raw
+  // Ptr<Ipv4UdpL4Protocol> udp = CreateObject<UdpL4Protocol> ();
+  // node->AggregateObject(udp); 
+}
+
+
+class Ipv4HeaderTest : public TestCase
+{
+  Ptr<Packet> m_receivedPacket;
+  Ipv4Header m_receivedHeader;
+  void DoSendData_IpHdr_Dscp (Ptr<Socket> socket, std::string to, Ipv4Header::DscpType dscp,Ipv4Header::EcnType);
+  void SendData_IpHdr_Dscp (Ptr<Socket> socket, std::string to, Ipv4Header::DscpType dscp, Ipv4Header::EcnType);
+
+public:
+  virtual void DoRun (void);
+  Ipv4HeaderTest ();
+
+  void ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from);
+  void ReceivePkt (Ptr<Socket> socket);
+};
+
+
+Ipv4HeaderTest::Ipv4HeaderTest ()
+  : TestCase ("IPv4 Header Test") 
+{
+}
+
+void Ipv4HeaderTest::ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from)
+{
+  m_receivedPacket = packet;
+}
+
+
+void Ipv4HeaderTest::ReceivePkt (Ptr<Socket> socket)
+{
+  uint32_t availableData;
+  availableData = socket->GetRxAvailable ();
+  m_receivedPacket = socket->Recv (2, MSG_PEEK);
+  NS_ASSERT (m_receivedPacket->GetSize () == 2);
+  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
+  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
+  //cast availableData to void, to suppress 'availableData' set but not used
+  //compiler warning
+  (void) availableData;
+  m_receivedPacket->PeekHeader (m_receivedHeader);
+}
+
+
+
+void
+Ipv4HeaderTest::DoSendData_IpHdr_Dscp (Ptr<Socket> socket, std::string to, Ipv4Header::DscpType dscp, Ipv4Header::EcnType ecn)
+{
+  Address realTo = InetSocketAddress (Ipv4Address (to.c_str ()), 0);
+  socket->SetAttribute ("IpHeaderInclude", BooleanValue (true));
+  Ptr<Packet> p = Create<Packet> (123);
+  Ipv4Header ipHeader;
+  ipHeader.SetSource (Ipv4Address ("10.0.0.2"));
+  ipHeader.SetDestination (Ipv4Address (to.c_str ()));
+  ipHeader.SetProtocol (0);
+  ipHeader.SetPayloadSize (p->GetSize ());
+  ipHeader.SetTtl (255);
+  ipHeader.SetDscp (dscp);
+  ipHeader.SetEcn (ecn);
+  p->AddHeader (ipHeader);
+
+  NS_TEST_EXPECT_MSG_EQ (socket->SendTo (p, 0, realTo),
+                         143, to);
+  socket->SetAttribute ("IpHeaderInclude", BooleanValue (false));
+}
+
+void
+Ipv4HeaderTest::SendData_IpHdr_Dscp (Ptr<Socket> socket, std::string to, Ipv4Header::DscpType dscp, Ipv4Header::EcnType ecn)
+{
+  m_receivedPacket = Create<Packet> ();
+  Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), Seconds (0),
+                                  &Ipv4HeaderTest::DoSendData_IpHdr_Dscp, this, socket, to, dscp, ecn);
+  Simulator::Run ();
+}
+
+void
+Ipv4HeaderTest::DoRun (void)
+{
+  // Create topology
+
+  // Receiver Node
+  Ptr<Node> rxNode = CreateObject<Node> ();
+  AddInternetStack (rxNode);
+  Ptr<SimpleNetDevice> rxDev1, rxDev2;
+  { // first interface
+    rxDev1 = CreateObject<SimpleNetDevice> ();
+    rxDev1->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
+    rxNode->AddDevice (rxDev1);
+    Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
+    uint32_t netdev_idx = ipv4->AddInterface (rxDev1);
+    Ipv4InterfaceAddress ipv4Addr = Ipv4InterfaceAddress (Ipv4Address ("10.0.0.1"), Ipv4Mask (0xffff0000U));
+    ipv4->AddAddress (netdev_idx, ipv4Addr);
+    ipv4->SetUp (netdev_idx);
+  }
+
+
+  // Sender Node
+  Ptr<Node> txNode = CreateObject<Node> ();
+  AddInternetStack (txNode);
+  Ptr<SimpleNetDevice> txDev1;
+  {
+    txDev1 = CreateObject<SimpleNetDevice> ();
+    txDev1->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
+    txNode->AddDevice (txDev1);
+    Ptr<Ipv4> ipv4 = txNode->GetObject<Ipv4> ();
+    uint32_t netdev_idx = ipv4->AddInterface (txDev1);
+    Ipv4InterfaceAddress ipv4Addr = Ipv4InterfaceAddress (Ipv4Address ("10.0.0.2"), Ipv4Mask (0xffff0000U));
+    ipv4->AddAddress (netdev_idx, ipv4Addr);
+    ipv4->SetUp (netdev_idx);
+  }
+
+  // link the two nodes
+  Ptr<SimpleChannel> channel1 = CreateObject<SimpleChannel> ();
+  rxDev1->SetChannel (channel1);
+  txDev1->SetChannel (channel1);
+
+
+  // Create the IPv4 Raw sockets
+  Ptr<SocketFactory> rxSocketFactory = rxNode->GetObject<Ipv4RawSocketFactory> ();
+  Ptr<Socket> rxSocket = rxSocketFactory->CreateSocket ();
+  NS_TEST_EXPECT_MSG_EQ (rxSocket->Bind (InetSocketAddress (Ipv4Address ("0.0.0.0"), 0)), 0, "trivial");
+  rxSocket->SetRecvCallback (MakeCallback (&Ipv4HeaderTest::ReceivePkt, this));
+
+
+  Ptr<SocketFactory> txSocketFactory = txNode->GetObject<Ipv4RawSocketFactory> ();
+  Ptr<Socket> txSocket = txSocketFactory->CreateSocket ();
+
+  // ------ Now the tests ------------
+
+  // Dscp Tests
+  std::cout << "Dscp Test\n";
+
+  std::vector <Ipv4Header::DscpType> vDscpTypes;
+  vDscpTypes.push_back (Ipv4Header::DscpDefault);
+  vDscpTypes.push_back (Ipv4Header::CS1);
+  vDscpTypes.push_back (Ipv4Header::AF11);
+  vDscpTypes.push_back (Ipv4Header::AF12);
+  vDscpTypes.push_back (Ipv4Header::AF13);
+  vDscpTypes.push_back (Ipv4Header::CS2);
+  vDscpTypes.push_back (Ipv4Header::AF21);
+  vDscpTypes.push_back (Ipv4Header::AF22);
+  vDscpTypes.push_back (Ipv4Header::AF23);
+  vDscpTypes.push_back (Ipv4Header::CS3);
+  vDscpTypes.push_back (Ipv4Header::AF31);
+  vDscpTypes.push_back (Ipv4Header::AF32);
+  vDscpTypes.push_back (Ipv4Header::AF33);
+  vDscpTypes.push_back (Ipv4Header::CS4);
+  vDscpTypes.push_back (Ipv4Header::AF41);
+  vDscpTypes.push_back (Ipv4Header::AF42);
+  vDscpTypes.push_back (Ipv4Header::AF43);
+  vDscpTypes.push_back (Ipv4Header::CS5);
+  vDscpTypes.push_back (Ipv4Header::EF);
+  vDscpTypes.push_back (Ipv4Header::CS6);
+  vDscpTypes.push_back (Ipv4Header::CS7);
+
+  for (uint32_t i = 0; i < vDscpTypes.size (); i++)
+    {
+      SendData_IpHdr_Dscp (txSocket, "10.0.0.1", vDscpTypes [i], Ipv4Header::ECT1);
+      NS_TEST_EXPECT_MSG_EQ (m_receivedPacket->GetSize (), 143, "recv(hdrincl): 10.0.0.1");
+      NS_TEST_EXPECT_MSG_EQ (m_receivedHeader.GetDscp (), vDscpTypes [i], "recv(hdrincl): 10.0.0.1");
+      m_receivedHeader.Print (std::cout);
+      std::cout << std::endl;
+      m_receivedPacket->RemoveAllByteTags ();
+      m_receivedPacket = 0;
+    }
+ 
+  // Ecn tests
+  std::cout << "Ecn Test\n";
+  std::vector <Ipv4Header::EcnType> vEcnTypes;
+  vEcnTypes.push_back (Ipv4Header::NotECT);
+  vEcnTypes.push_back (Ipv4Header::ECT1);
+  vEcnTypes.push_back (Ipv4Header::ECT0);
+  vEcnTypes.push_back (Ipv4Header::CE);
+  
+  for (uint32_t i = 0; i < vEcnTypes.size (); i++)
+    {
+      SendData_IpHdr_Dscp (txSocket, "10.0.0.1", Ipv4Header::DscpDefault, vEcnTypes [i]);
+      NS_TEST_EXPECT_MSG_EQ (m_receivedPacket->GetSize (), 143, "recv(hdrincl): 10.0.0.1");
+      NS_TEST_EXPECT_MSG_EQ (m_receivedHeader.GetEcn (), vEcnTypes [i], "recv(hdrincl): 10.0.0.1");
+      m_receivedHeader.Print (std::cout);
+      std::cout << std::endl;
+      m_receivedPacket->RemoveAllByteTags ();
+      m_receivedPacket = 0;
+    }
+
+
+ 
+  Simulator::Destroy ();
+}
+//-----------------------------------------------------------------------------
+class Ipv4HeaderTestSuite : public TestSuite
+{
+public:
+  Ipv4HeaderTestSuite () : TestSuite ("ipv4-header", UNIT)
+  {
+    AddTestCase (new Ipv4HeaderTest);
+  }
+} g_ipv4HeaderTestSuite;
+
+} // namespace ns3
--- a/src/internet/wscript	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/internet/wscript	Sun Nov 13 13:50:50 2011 +0100
@@ -193,6 +193,7 @@
         'test/ipv4-list-routing-test-suite.cc',
         'test/ipv4-packet-info-tag-test-suite.cc',
         'test/ipv4-raw-test.cc',
+        'test/ipv4-header-test.cc',
         'test/ipv4-fragmentation-test.cc',
         'test/error-channel.cc',
         'test/error-net-device.cc',
--- a/src/lte/bindings/callbacks_list.py	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/lte/bindings/callbacks_list.py	Sun Nov 13 13:50:50 2011 +0100
@@ -1,9 +1,9 @@
 callback_classes = [
+    ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
-    ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
 ]
--- a/src/lte/bindings/modulegen__gcc_ILP32.py	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/lte/bindings/modulegen__gcc_ILP32.py	Sun Nov 13 13:50:50 2011 +0100
@@ -440,6 +440,9 @@
     module.add_container('std::list< ns3::PdcchMapIdealControlMessage::IdealPdcchRecord >', 'ns3::PdcchMapIdealControlMessage::IdealPdcchRecord', container_type='list')
     module.add_container('std::list< ns3::CqiIdealControlMessage::CqiFeedback >', 'ns3::CqiIdealControlMessage::CqiFeedback', container_type='list')
     module.add_container('std::vector< ns3::Ptr< ns3::SpectrumPhy > >', 'ns3::Ptr< ns3::SpectrumPhy >', container_type='vector')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndOkCallback')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndOkCallback*')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndOkCallback&')
@@ -470,18 +473,15 @@
     typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter')
     typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*')
     typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndErrorCallback')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndErrorCallback*')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndErrorCallback&')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >', 'ns3::Values')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >*', 'ns3::Values*')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >&', 'ns3::Values&')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&')
     
     ## Register a nested module for the namespace FatalImpl
     
@@ -4071,14 +4071,14 @@
     cls.add_constructor([])
     ## spectrum-phy.h (module 'spectrum'): ns3::SpectrumPhy::SpectrumPhy(ns3::SpectrumPhy const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SpectrumPhy const &', 'arg0')])
-    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumPhy::GetDevice() [member function]
+    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::SpectrumPhy::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumPhy::GetMobility() [member function]
+    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::SpectrumPhy::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
     ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::SpectrumModel const> ns3::SpectrumPhy::GetRxSpectrumModel() const [member function]
@@ -4096,15 +4096,15 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_pure_virtual=True, is_virtual=True)
     ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::StartRx(ns3::Ptr<ns3::PacketBurst> p, ns3::Ptr<ns3::SpectrumValue const> rxPsd, ns3::SpectrumType st, ns3::Time duration) [member function]
     cls.add_method('StartRx', 
@@ -5477,14 +5477,14 @@
     cls.add_method('GetChannel', 
                    'ns3::Ptr< ns3::SpectrumChannel >', 
                    [])
-    ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::Object> ns3::LteSpectrumPhy::GetDevice() [member function]
+    ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::NetDevice> ns3::LteSpectrumPhy::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_virtual=True)
-    ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::Object> ns3::LteSpectrumPhy::GetMobility() [member function]
+    ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::MobilityModel> ns3::LteSpectrumPhy::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_virtual=True)
     ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::SpectrumValue const> ns3::LteSpectrumPhy::GetNoisePowerSpectralDensity() [member function]
@@ -5510,10 +5510,10 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_virtual=True)
-    ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_virtual=True)
     ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetGenericPhyRxEndErrorCallback(ns3::GenericPhyRxEndErrorCallback c) [member function]
     cls.add_method('SetGenericPhyRxEndErrorCallback', 
@@ -5531,10 +5531,10 @@
     cls.add_method('SetGenericPhyTxEndCallback', 
                    'void', 
                    [param('ns3::GenericPhyTxEndCallback', 'c')])
-    ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_virtual=True)
     ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetNoisePowerSpectralDensity(ns3::Ptr<ns3::SpectrumValue const> noisePsd) [member function]
     cls.add_method('SetNoisePowerSpectralDensity', 
--- a/src/lte/bindings/modulegen__gcc_LP64.py	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/lte/bindings/modulegen__gcc_LP64.py	Sun Nov 13 13:50:50 2011 +0100
@@ -440,6 +440,9 @@
     module.add_container('std::list< ns3::PdcchMapIdealControlMessage::IdealPdcchRecord >', 'ns3::PdcchMapIdealControlMessage::IdealPdcchRecord', container_type='list')
     module.add_container('std::list< ns3::CqiIdealControlMessage::CqiFeedback >', 'ns3::CqiIdealControlMessage::CqiFeedback', container_type='list')
     module.add_container('std::vector< ns3::Ptr< ns3::SpectrumPhy > >', 'ns3::Ptr< ns3::SpectrumPhy >', container_type='vector')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndOkCallback')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndOkCallback*')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndOkCallback&')
@@ -470,18 +473,15 @@
     typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter')
     typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*')
     typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndErrorCallback')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndErrorCallback*')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndErrorCallback&')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >', 'ns3::Values')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >*', 'ns3::Values*')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >&', 'ns3::Values&')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&')
     
     ## Register a nested module for the namespace FatalImpl
     
@@ -4071,14 +4071,14 @@
     cls.add_constructor([])
     ## spectrum-phy.h (module 'spectrum'): ns3::SpectrumPhy::SpectrumPhy(ns3::SpectrumPhy const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SpectrumPhy const &', 'arg0')])
-    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumPhy::GetDevice() [member function]
+    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::SpectrumPhy::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumPhy::GetMobility() [member function]
+    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::SpectrumPhy::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
     ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::SpectrumModel const> ns3::SpectrumPhy::GetRxSpectrumModel() const [member function]
@@ -4096,15 +4096,15 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_pure_virtual=True, is_virtual=True)
     ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::StartRx(ns3::Ptr<ns3::PacketBurst> p, ns3::Ptr<ns3::SpectrumValue const> rxPsd, ns3::SpectrumType st, ns3::Time duration) [member function]
     cls.add_method('StartRx', 
@@ -5477,14 +5477,14 @@
     cls.add_method('GetChannel', 
                    'ns3::Ptr< ns3::SpectrumChannel >', 
                    [])
-    ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::Object> ns3::LteSpectrumPhy::GetDevice() [member function]
+    ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::NetDevice> ns3::LteSpectrumPhy::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_virtual=True)
-    ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::Object> ns3::LteSpectrumPhy::GetMobility() [member function]
+    ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::MobilityModel> ns3::LteSpectrumPhy::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_virtual=True)
     ## lte-spectrum-phy.h (module 'lte'): ns3::Ptr<ns3::SpectrumValue const> ns3::LteSpectrumPhy::GetNoisePowerSpectralDensity() [member function]
@@ -5510,10 +5510,10 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_virtual=True)
-    ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_virtual=True)
     ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetGenericPhyRxEndErrorCallback(ns3::GenericPhyRxEndErrorCallback c) [member function]
     cls.add_method('SetGenericPhyRxEndErrorCallback', 
@@ -5531,10 +5531,10 @@
     cls.add_method('SetGenericPhyTxEndCallback', 
                    'void', 
                    [param('ns3::GenericPhyTxEndCallback', 'c')])
-    ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_virtual=True)
     ## lte-spectrum-phy.h (module 'lte'): void ns3::LteSpectrumPhy::SetNoisePowerSpectralDensity(ns3::Ptr<ns3::SpectrumValue const> noisePsd) [member function]
     cls.add_method('SetNoisePowerSpectralDensity', 
--- a/src/lte/model/lte-spectrum-phy.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/lte/model/lte-spectrum-phy.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -105,7 +105,7 @@
 
 
 
-Ptr<Object>
+Ptr<NetDevice>
 LteSpectrumPhy::GetDevice ()
 {
   NS_LOG_FUNCTION (this);
@@ -113,7 +113,7 @@
 }
 
 
-Ptr<Object>
+Ptr<MobilityModel>
 LteSpectrumPhy::GetMobility ()
 {
   NS_LOG_FUNCTION (this);
@@ -122,7 +122,7 @@
 
 
 void
-LteSpectrumPhy::SetDevice (Ptr<Object> d)
+LteSpectrumPhy::SetDevice (Ptr<NetDevice> d)
 {
   NS_LOG_FUNCTION (this << d);
   m_device = d;
@@ -130,7 +130,7 @@
 
 
 void
-LteSpectrumPhy::SetMobility (Ptr<Object> m)
+LteSpectrumPhy::SetMobility (Ptr<MobilityModel> m)
 {
   NS_LOG_FUNCTION (this << m);
   m_mobility = m;
--- a/src/lte/model/lte-spectrum-phy.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/lte/model/lte-spectrum-phy.h	Sun Nov 13 13:50:50 2011 +0100
@@ -64,10 +64,10 @@
 
   // inherited from SpectrumPhy
   void SetChannel (Ptr<SpectrumChannel> c);
-  void SetMobility (Ptr<Object> m);
-  void SetDevice (Ptr<Object> d);
-  Ptr<Object> GetMobility ();
-  Ptr<Object> GetDevice ();
+  void SetMobility (Ptr<MobilityModel> m);
+  void SetDevice (Ptr<NetDevice> d);
+  Ptr<MobilityModel> GetMobility ();
+  Ptr<NetDevice> GetDevice ();
   Ptr<const SpectrumModel> GetRxSpectrumModel () const;
   void StartRx (Ptr<SpectrumSignalParameters> params);
 
@@ -164,9 +164,9 @@
 
   EventId m_endRxEventId;
 
-  Ptr<Object> m_mobility;
+  Ptr<MobilityModel> m_mobility;
 
-  Ptr<Object> m_device;
+  Ptr<NetDevice> m_device;
 
   Ptr<SpectrumChannel> m_channel;
 
--- a/src/netanim/examples/dumbbell-animation.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/netanim/examples/dumbbell-animation.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -36,7 +36,7 @@
   uint32_t    nLeftLeaf = 5;
   uint32_t    nRightLeaf = 5;
   uint32_t    nLeaf = 0; // If non-zero, number of both left and right
-  std::string animFile;  // Name of file for animation output
+  std::string animFile = "dumbbell-animation.xml" ;  // Name of file for animation output
 
   CommandLine cmd;
   cmd.AddValue ("nLeftLeaf", "Number of left side leaf nodes", nLeftLeaf);
@@ -95,15 +95,8 @@
   d.BoundingBox (1, 1, 100, 100);
 
   // Create the animation object and configure for specified output
-  AnimationInterface anim;
-  if (!animFile.empty ())
-    {
-      anim.SetOutputFile (animFile);
-    }
-
-  anim.SetXMLOutput ();
-  anim.StartAnimation ();
-
+  AnimationInterface anim (animFile);
+  
   // Set up the acutal simulation
   Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
--- a/src/netanim/examples/grid-animation.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/netanim/examples/grid-animation.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -35,7 +35,7 @@
 
   uint32_t xSize = 5;
   uint32_t ySize = 5;
-  std::string animFile;
+  std::string animFile = "grid-animation.xml";
 
   CommandLine cmd;
   cmd.AddValue ("xSize", "Number of rows of nodes", xSize);
@@ -83,13 +83,7 @@
   grid.BoundingBox (1, 1, 100, 100);
 
   // Create the animation object and configure for specified output
-  AnimationInterface anim;
-  if (!animFile.empty ())
-    {
-      anim.SetOutputFile (animFile);
-    }
-  anim.SetXMLOutput ();
-  anim.StartAnimation ();
+  AnimationInterface anim (animFile);
 
   // Set up the actual simulation
   Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
--- a/src/netanim/examples/star-animation.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/netanim/examples/star-animation.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -55,7 +55,7 @@
   // Default number of nodes in the star.  Overridable by command line argument.
   //
   uint32_t nSpokes = 8;
-  std::string animFile;
+  std::string animFile = "star-animation.xml";
 
   CommandLine cmd;
   cmd.AddValue ("nSpokes", "Number of spoke nodes to place in the star", nSpokes);
@@ -115,13 +115,7 @@
   star.BoundingBox (1, 1, 100, 100);
 
   // Create the animation object and configure for specified output
-  AnimationInterface anim;
-  if (!animFile.empty ())
-    {
-      anim.SetOutputFile (animFile);
-    }
-  anim.SetXMLOutput ();
-  anim.StartAnimation ();
+  AnimationInterface anim (animFile);
 
   NS_LOG_INFO ("Run Simulation.");
   Simulator::Run ();
--- a/src/netanim/model/animation-interface.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/netanim/model/animation-interface.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -22,7 +22,6 @@
 
 // ns3 includes
 #include "ns3/animation-interface.h"
-#include "ns3/netanim-config.h"
 #include "ns3/channel.h"
 #include "ns3/config.h"
 #include "ns3/node.h"
@@ -33,6 +32,7 @@
 #include "ns3/animation-interface-helper.h"
 #include "ns3/wifi-mac-header.h"
 #include "ns3/wimax-mac-header.h"
+#include "ns3/constant-position-mobility-model.h"
 
 #include <stdio.h>
 #include <sstream>
@@ -59,6 +59,7 @@
     OutputFileSet (false), ServerPortSet (false), gAnimUid (0),randomPosition (true),
     m_writeCallback (0)
 {
+  StartAnimation ();
 }
 
 AnimationInterface::AnimationInterface (const std::string fn, bool usingXML)
@@ -67,6 +68,7 @@
     OutputFileSet (false), ServerPortSet (false), gAnimUid (0), randomPosition (true),
     m_writeCallback (0)
 {
+  StartAnimation ();
 }
 
 AnimationInterface::AnimationInterface (const uint16_t port, bool usingXML)
@@ -75,6 +77,7 @@
     OutputFileSet (false), ServerPortSet (false), gAnimUid (0), randomPosition (true),
     m_writeCallback (0)
 {
+  StartAnimation ();
 }
 
 AnimationInterface::~AnimationInterface ()
@@ -460,7 +463,7 @@
     } 
 }
 
-int AnimationInterface::WriteN (int h, const char* data, uint32_t count)
+int AnimationInterface::WriteN (HANDLETYPE h, const char* data, uint32_t count)
 { 
   if (h < 0)
     {
@@ -932,6 +935,21 @@
   WriteN (m_fHandle, oss.str ());
 }
 
+void AnimationInterface::SetConstantPosition (Ptr <Node> n, double x, double y, double z)
+{
+  NS_ASSERT (n);
+  Ptr<ConstantPositionMobilityModel> hubLoc =  n->GetObject<ConstantPositionMobilityModel> ();
+  if (hubLoc == 0)
+    {
+      hubLoc = CreateObject<ConstantPositionMobilityModel> ();
+      n->AggregateObject (hubLoc);
+    }
+  Vector hubVec (x, y, z);
+  hubLoc->SetPosition (hubVec);
+  NS_LOG_INFO ("Node:" << n->GetId () << " Position set to:(" << x << "," << y << "," << z << ")");
+
+}
+
 
 // XML Private Helpers
 
--- a/src/netanim/model/animation-interface.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/netanim/model/animation-interface.h	Sun Nov 13 13:50:50 2011 +0100
@@ -34,6 +34,21 @@
 #include "ns3/animation-interface-helper.h"
 #include "ns3/mac48-address.h"
 
+#ifdef WIN32
+#include <winsock2.h>
+#include <io.h>
+#define STDOUT_FILENO (SOCKET)GetStdHandle(STD_OUTPUT_HANDLE)
+#define close _close
+#define write _write
+#undef GetObject
+#undef min
+#undef max
+#define HANDLETYPE SOCKET
+#else
+#include "ns3/netanim-config.h"
+#define HANDLETYPE int
+#endif
+
 namespace ns3 {
 
 /**
@@ -178,10 +193,26 @@
    */
   void ResetAnimWriteCallback ();
 
+  /**
+   * \brief Helper function to set Constant Position for a given node
+   * \param n Ptr to the node
+   * \param x X co-ordinate of the node
+   * \param y Y co-ordinate of the node
+   * \param z Z co-ordinate of the node
+   *
+   */
+  void SetConstantPosition (Ptr <Node> n, double x, double y, double z=0);
+
 private:
-  
-  int       m_fHandle;  // File handle for output (-1 if none)
-  bool      m_xml;      // True if xml format desired
+#ifndef WIN32
+  int m_fHandle;  // File handle for output (-1 if none)
+  // Write specified amount of data to the specified handle
+  int WriteN (int, const char*, uint32_t);
+#else
+  SOCKET m_fHandle;  // File handle for output (-1 if none)
+  int  WriteN (SOCKET, const char*, uint32_t);
+#endif
+  bool m_xml;      // True if xml format desired
   Time mobilitypollinterval;
   bool usingSockets;
   uint16_t mport;
@@ -224,9 +255,6 @@
                        Ptr<const Packet> p);
   void MobilityCourseChangeTrace (Ptr <const MobilityModel> mob);
 
-  // Write specified amount of data to the specified handle
-  int  WriteN (int, const char*, uint32_t);
-
   // Write a string to the specified handle;
   int  WriteN (int, const std::string&);
 
--- a/src/netanim/wscript	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/netanim/wscript	Sun Nov 13 13:50:50 2011 +0100
@@ -1,6 +1,7 @@
 ## -*-Mode : python; py-indent-offset : 4; indent-tabs-mode : nil; coding : utf-8; -*-
 
 def build (bld) :
+        bld.install_files('${PREFIX}/include/ns3', '../../ns3/netanim-config.h')
 	module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma'])
 	module.includes = '.'
 	module.source = [
--- a/src/network/model/buffer.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/network/model/buffer.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -758,9 +758,9 @@
       uint32_t tmpsize = std::min (m_zeroAreaStart-m_start, size);
       memcpy (buffer, (const char*)(m_data->m_data + m_start), tmpsize);
       buffer += tmpsize;
-      if (size > tmpsize) 
+      size -= tmpsize;
+      if (size > 0) 
         { 
-          size -= m_zeroAreaStart-m_start;
           tmpsize = std::min (m_zeroAreaEnd - m_zeroAreaStart, size);
           uint32_t left = tmpsize;
           while (left > 0)
@@ -770,11 +770,12 @@
               left -= toWrite;
               buffer += toWrite;
             }
-          if (size > tmpsize)
+          size -= tmpsize;
+          if (size > 0)
             {
-              size -= tmpsize;
               tmpsize = std::min (m_end - m_zeroAreaEnd, size);
               memcpy (buffer, (const char*)(m_data->m_data + m_zeroAreaStart), tmpsize);
+              size -= tmpsize;
             }
         }
     }
--- a/src/network/model/node.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/network/model/node.h	Sun Nov 13 13:50:50 2011 +0100
@@ -111,9 +111,7 @@
    * \returns the index of the Application within the Node's list
    *          of Application.
    *
-   * Associated this Application to this Node. This method is called
-   * automatically from Application::Application so the user
-   * has little reasons to call this method directly.
+   * Associated this Application to this Node. 
    */
   uint32_t AddApplication (Ptr<Application> application);
   /**
--- a/src/network/test/buffer-test.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/network/test/buffer-test.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -298,6 +298,26 @@
   i = other.Begin ();
   i.Write (buffer.Begin (), buffer.End ());
   ENSURE_WRITTEN_BYTES (other, 9, 0x1, 0x2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3, 0x4);
+
+  // BUG #1001
+  std::string ct ("This is the next content of the buffer.");
+  buffer = Buffer ();
+  buffer.AddAtStart (ct.size ());
+  i = buffer.Begin ();
+  i.Write ((const uint8_t*)ct.c_str (), ct.size ());
+  uint32_t sizeBuffer = buffer.GetSize ();
+  NS_TEST_ASSERT_MSG_EQ (sizeBuffer, ct.size(), "Buffer bad size");
+  uint8_t const* evilBuffer = buffer.PeekData ();
+  NS_TEST_ASSERT_MSG_NE( evilBuffer, 0, "Buffer PeekData failed");
+  uint8_t *cBuf = (uint8_t*) malloc ( sizeBuffer );
+  uint32_t copyLen = buffer.CopyData (cBuf, sizeBuffer);
+  NS_TEST_ASSERT_MSG_EQ (copyLen, sizeBuffer, "CopyData return bad size");
+  for (uint8_t i=0; i < sizeBuffer ; i++ )
+    {
+      NS_TEST_ASSERT_MSG_EQ ( cBuf [i], *(((const uint8_t*)ct.c_str ()) + i), "Bad buffer copied data");
+      NS_TEST_ASSERT_MSG_EQ ( evilBuffer [i], cBuf [i] , "Bad buffer peeked");
+    }
+  free (cBuf);
 }
 //-----------------------------------------------------------------------------
 class BufferTestSuite : public TestSuite
--- a/src/network/utils/generic-phy.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/network/utils/generic-phy.h	Sun Nov 13 13:50:50 2011 +0100
@@ -55,13 +55,13 @@
 
 /**
  * This method is used by the PHY to notify the MAC that a
- * previously started TX attempt has terminated without success.
+ * previously started RX attempt has terminated without success.
  */
 typedef Callback< void > GenericPhyRxEndErrorCallback;
 
 /**
  * This method is used by the PHY to notify the MAC that a
- * previously started TX attempt has been successfully completed.
+ * previously started RX attempt has been successfully completed.
  *
  * @param packet the received Packet
  */
--- a/src/spectrum/bindings/callbacks_list.py	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/bindings/callbacks_list.py	Sun Nov 13 13:50:50 2011 +0100
@@ -1,7 +1,7 @@
 callback_classes = [
+    ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
-    ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
--- a/src/spectrum/bindings/modulegen__gcc_ILP32.py	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/bindings/modulegen__gcc_ILP32.py	Sun Nov 13 13:50:50 2011 +0100
@@ -20,8 +20,6 @@
 def register_types(module):
     root_module = module.get_root()
     
-    ## log.h (module 'core'): ns3::LogLevel [enumeration]
-    module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE'], import_from_module='ns.core')
     ## address.h (module 'network'): ns3::Address [class]
     module.add_class('Address', import_from_module='ns.network')
     ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
@@ -66,8 +64,6 @@
     root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
     ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
     module.add_class('Ipv6Prefix', import_from_module='ns.network')
-    ## log.h (module 'core'): ns3::LogComponent [class]
-    module.add_class('LogComponent', import_from_module='ns.core')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
     module.add_class('Mac48Address', import_from_module='ns.network')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
@@ -375,22 +371,19 @@
     module.add_container('std::vector< double >', 'double', container_type='vector')
     module.add_container('ns3::Bands', 'ns3::BandInfo', container_type='vector')
     module.add_container('std::vector< ns3::Ptr< ns3::SpectrumPhy > >', 'ns3::Ptr< ns3::SpectrumPhy >', container_type='vector')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndOkCallback')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndOkCallback*')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndOkCallback&')
     typehandlers.add_type_alias('std::vector< ns3::BandInfo, std::allocator< ns3::BandInfo > >', 'ns3::Bands')
     typehandlers.add_type_alias('std::vector< ns3::BandInfo, std::allocator< ns3::BandInfo > >*', 'ns3::Bands*')
     typehandlers.add_type_alias('std::vector< ns3::BandInfo, std::allocator< ns3::BandInfo > >&', 'ns3::Bands&')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&')
     typehandlers.add_type_alias('ns3::Vector3DValue', 'ns3::VectorValue')
     typehandlers.add_type_alias('ns3::Vector3DValue*', 'ns3::VectorValue*')
     typehandlers.add_type_alias('ns3::Vector3DValue&', 'ns3::VectorValue&')
     module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogNodePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogNodePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogNodePrinter&')
     typehandlers.add_type_alias('ns3::Vector3D', 'ns3::Vector')
     typehandlers.add_type_alias('ns3::Vector3D*', 'ns3::Vector*')
     typehandlers.add_type_alias('ns3::Vector3D&', 'ns3::Vector&')
@@ -411,18 +404,15 @@
     typehandlers.add_type_alias('ns3::Vector3DChecker*', 'ns3::VectorChecker*')
     typehandlers.add_type_alias('ns3::Vector3DChecker&', 'ns3::VectorChecker&')
     module.add_typedef(root_module['ns3::Vector3DChecker'], 'VectorChecker')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndErrorCallback')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndErrorCallback*')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndErrorCallback&')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >', 'ns3::Values')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >*', 'ns3::Values*')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >&', 'ns3::Values&')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&')
     typehandlers.add_type_alias('std::map< unsigned int, ns3::SpectrumConverter, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::SpectrumConverter > > >', 'ns3::SpectrumConverterMap_t')
     typehandlers.add_type_alias('std::map< unsigned int, ns3::SpectrumConverter, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::SpectrumConverter > > >*', 'ns3::SpectrumConverterMap_t*')
     typehandlers.add_type_alias('std::map< unsigned int, ns3::SpectrumConverter, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::SpectrumConverter > > >&', 'ns3::SpectrumConverterMap_t&')
@@ -467,7 +457,6 @@
     register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
     register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
     register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
-    register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent'])
     register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
     register_Ns3MicrowaveOvenSpectrumValueHelper_methods(root_module, root_module['ns3::MicrowaveOvenSpectrumValueHelper'])
     register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
@@ -1606,40 +1595,6 @@
                    is_const=True)
     return
 
-def register_Ns3LogComponent_methods(root_module, cls):
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(ns3::LogComponent const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::LogComponent const &', 'arg0')])
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(char const * name) [constructor]
-    cls.add_constructor([param('char const *', 'name')])
-    ## log.h (module 'core'): void ns3::LogComponent::Disable(ns3::LogLevel level) [member function]
-    cls.add_method('Disable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::Enable(ns3::LogLevel level) [member function]
-    cls.add_method('Enable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::EnvVarCheck(char const * name) [member function]
-    cls.add_method('EnvVarCheck', 
-                   'void', 
-                   [param('char const *', 'name')])
-    ## log.h (module 'core'): bool ns3::LogComponent::IsEnabled(ns3::LogLevel level) const [member function]
-    cls.add_method('IsEnabled', 
-                   'bool', 
-                   [param('ns3::LogLevel', 'level')], 
-                   is_const=True)
-    ## log.h (module 'core'): bool ns3::LogComponent::IsNoneEnabled() const [member function]
-    cls.add_method('IsNoneEnabled', 
-                   'bool', 
-                   [], 
-                   is_const=True)
-    ## log.h (module 'core'): char const * ns3::LogComponent::Name() const [member function]
-    cls.add_method('Name', 
-                   'char const *', 
-                   [], 
-                   is_const=True)
-    return
-
 def register_Ns3Mac48Address_methods(root_module, cls):
     cls.add_binary_comparison_operator('<')
     cls.add_binary_comparison_operator('!=')
@@ -3622,14 +3577,14 @@
     cls.add_constructor([])
     ## spectrum-phy.h (module 'spectrum'): ns3::SpectrumPhy::SpectrumPhy(ns3::SpectrumPhy const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SpectrumPhy const &', 'arg0')])
-    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumPhy::GetDevice() [member function]
+    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::SpectrumPhy::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumPhy::GetMobility() [member function]
+    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::SpectrumPhy::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
     ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::SpectrumModel const> ns3::SpectrumPhy::GetRxSpectrumModel() const [member function]
@@ -3647,15 +3602,15 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_pure_virtual=True, is_virtual=True)
     ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::StartRx(ns3::Ptr<ns3::PacketBurst> p, ns3::Ptr<ns3::SpectrumValue const> rxPsd, ns3::SpectrumType st, ns3::Time duration) [member function]
     cls.add_method('StartRx', 
@@ -4051,9 +4006,9 @@
     cls.add_constructor([param('ns3::WaveformGenerator const &', 'arg0')])
     ## waveform-generator.h (module 'spectrum'): ns3::WaveformGenerator::WaveformGenerator() [constructor]
     cls.add_constructor([])
-    ## waveform-generator.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::WaveformGenerator::GetDevice() [member function]
+    ## waveform-generator.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::WaveformGenerator::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_virtual=True)
     ## waveform-generator.h (module 'spectrum'): double ns3::WaveformGenerator::GetDutyCycle() const [member function]
@@ -4061,9 +4016,9 @@
                    'double', 
                    [], 
                    is_const=True)
-    ## waveform-generator.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::WaveformGenerator::GetMobility() [member function]
+    ## waveform-generator.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::WaveformGenerator::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_virtual=True)
     ## waveform-generator.h (module 'spectrum'): ns3::Time ns3::WaveformGenerator::GetPeriod() const [member function]
@@ -4090,19 +4045,19 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_virtual=True)
-    ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_virtual=True)
     ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetDutyCycle(double value) [member function]
     cls.add_method('SetDutyCycle', 
                    'void', 
                    [param('double', 'value')])
-    ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_virtual=True)
     ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetPeriod(ns3::Time period) [member function]
     cls.add_method('SetPeriod', 
@@ -4563,14 +4518,14 @@
     cls.add_constructor([param('ns3::HalfDuplexIdealPhy const &', 'arg0')])
     ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::HalfDuplexIdealPhy::HalfDuplexIdealPhy() [constructor]
     cls.add_constructor([])
-    ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::HalfDuplexIdealPhy::GetDevice() [member function]
+    ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::HalfDuplexIdealPhy::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_virtual=True)
-    ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::HalfDuplexIdealPhy::GetMobility() [member function]
+    ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::HalfDuplexIdealPhy::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_virtual=True)
     ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::DataRate ns3::HalfDuplexIdealPhy::GetRate() const [member function]
@@ -4597,10 +4552,10 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_virtual=True)
-    ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_virtual=True)
     ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetGenericPhyRxEndErrorCallback(ns3::GenericPhyRxEndErrorCallback c) [member function]
     cls.add_method('SetGenericPhyRxEndErrorCallback', 
@@ -4618,10 +4573,10 @@
     cls.add_method('SetGenericPhyTxEndCallback', 
                    'void', 
                    [param('ns3::GenericPhyTxEndCallback', 'c')])
-    ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_virtual=True)
     ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetNoisePowerSpectralDensity(ns3::Ptr<ns3::SpectrumValue const> noisePsd) [member function]
     cls.add_method('SetNoisePowerSpectralDensity', 
@@ -5670,14 +5625,14 @@
     cls.add_constructor([param('ns3::SpectrumAnalyzer const &', 'arg0')])
     ## spectrum-analyzer.h (module 'spectrum'): ns3::SpectrumAnalyzer::SpectrumAnalyzer() [constructor]
     cls.add_constructor([])
-    ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumAnalyzer::GetDevice() [member function]
+    ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::SpectrumAnalyzer::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_virtual=True)
-    ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumAnalyzer::GetMobility() [member function]
+    ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::SpectrumAnalyzer::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_virtual=True)
     ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::SpectrumModel const> ns3::SpectrumAnalyzer::GetRxSpectrumModel() const [member function]
@@ -5695,15 +5650,15 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_virtual=True)
-    ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_virtual=True)
-    ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_virtual=True)
     ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetRxSpectrumModel(ns3::Ptr<ns3::SpectrumModel> m) [member function]
     cls.add_method('SetRxSpectrumModel', 
--- a/src/spectrum/bindings/modulegen__gcc_LP64.py	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/bindings/modulegen__gcc_LP64.py	Sun Nov 13 13:50:50 2011 +0100
@@ -20,8 +20,6 @@
 def register_types(module):
     root_module = module.get_root()
     
-    ## log.h (module 'core'): ns3::LogLevel [enumeration]
-    module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE'], import_from_module='ns.core')
     ## address.h (module 'network'): ns3::Address [class]
     module.add_class('Address', import_from_module='ns.network')
     ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
@@ -66,8 +64,6 @@
     root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
     ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
     module.add_class('Ipv6Prefix', import_from_module='ns.network')
-    ## log.h (module 'core'): ns3::LogComponent [class]
-    module.add_class('LogComponent', import_from_module='ns.core')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
     module.add_class('Mac48Address', import_from_module='ns.network')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
@@ -375,22 +371,19 @@
     module.add_container('std::vector< double >', 'double', container_type='vector')
     module.add_container('ns3::Bands', 'ns3::BandInfo', container_type='vector')
     module.add_container('std::vector< ns3::Ptr< ns3::SpectrumPhy > >', 'ns3::Ptr< ns3::SpectrumPhy >', container_type='vector')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*')
+    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndOkCallback')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndOkCallback*')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndOkCallback&')
     typehandlers.add_type_alias('std::vector< ns3::BandInfo, std::allocator< ns3::BandInfo > >', 'ns3::Bands')
     typehandlers.add_type_alias('std::vector< ns3::BandInfo, std::allocator< ns3::BandInfo > >*', 'ns3::Bands*')
     typehandlers.add_type_alias('std::vector< ns3::BandInfo, std::allocator< ns3::BandInfo > >&', 'ns3::Bands&')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&')
     typehandlers.add_type_alias('ns3::Vector3DValue', 'ns3::VectorValue')
     typehandlers.add_type_alias('ns3::Vector3DValue*', 'ns3::VectorValue*')
     typehandlers.add_type_alias('ns3::Vector3DValue&', 'ns3::VectorValue&')
     module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogNodePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogNodePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogNodePrinter&')
     typehandlers.add_type_alias('ns3::Vector3D', 'ns3::Vector')
     typehandlers.add_type_alias('ns3::Vector3D*', 'ns3::Vector*')
     typehandlers.add_type_alias('ns3::Vector3D&', 'ns3::Vector&')
@@ -411,18 +404,15 @@
     typehandlers.add_type_alias('ns3::Vector3DChecker*', 'ns3::VectorChecker*')
     typehandlers.add_type_alias('ns3::Vector3DChecker&', 'ns3::VectorChecker&')
     module.add_typedef(root_module['ns3::Vector3DChecker'], 'VectorChecker')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*')
-    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndErrorCallback')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndErrorCallback*')
     typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndErrorCallback&')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >', 'ns3::Values')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >*', 'ns3::Values*')
     typehandlers.add_type_alias('std::vector< double, std::allocator< double > >&', 'ns3::Values&')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*')
-    typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*')
+    typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&')
     typehandlers.add_type_alias('std::map< unsigned int, ns3::SpectrumConverter, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::SpectrumConverter > > >', 'ns3::SpectrumConverterMap_t')
     typehandlers.add_type_alias('std::map< unsigned int, ns3::SpectrumConverter, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::SpectrumConverter > > >*', 'ns3::SpectrumConverterMap_t*')
     typehandlers.add_type_alias('std::map< unsigned int, ns3::SpectrumConverter, std::less< unsigned int >, std::allocator< std::pair< unsigned int const, ns3::SpectrumConverter > > >&', 'ns3::SpectrumConverterMap_t&')
@@ -467,7 +457,6 @@
     register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
     register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
     register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
-    register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent'])
     register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
     register_Ns3MicrowaveOvenSpectrumValueHelper_methods(root_module, root_module['ns3::MicrowaveOvenSpectrumValueHelper'])
     register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
@@ -1606,40 +1595,6 @@
                    is_const=True)
     return
 
-def register_Ns3LogComponent_methods(root_module, cls):
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(ns3::LogComponent const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::LogComponent const &', 'arg0')])
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(char const * name) [constructor]
-    cls.add_constructor([param('char const *', 'name')])
-    ## log.h (module 'core'): void ns3::LogComponent::Disable(ns3::LogLevel level) [member function]
-    cls.add_method('Disable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::Enable(ns3::LogLevel level) [member function]
-    cls.add_method('Enable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::EnvVarCheck(char const * name) [member function]
-    cls.add_method('EnvVarCheck', 
-                   'void', 
-                   [param('char const *', 'name')])
-    ## log.h (module 'core'): bool ns3::LogComponent::IsEnabled(ns3::LogLevel level) const [member function]
-    cls.add_method('IsEnabled', 
-                   'bool', 
-                   [param('ns3::LogLevel', 'level')], 
-                   is_const=True)
-    ## log.h (module 'core'): bool ns3::LogComponent::IsNoneEnabled() const [member function]
-    cls.add_method('IsNoneEnabled', 
-                   'bool', 
-                   [], 
-                   is_const=True)
-    ## log.h (module 'core'): char const * ns3::LogComponent::Name() const [member function]
-    cls.add_method('Name', 
-                   'char const *', 
-                   [], 
-                   is_const=True)
-    return
-
 def register_Ns3Mac48Address_methods(root_module, cls):
     cls.add_binary_comparison_operator('<')
     cls.add_binary_comparison_operator('!=')
@@ -3622,14 +3577,14 @@
     cls.add_constructor([])
     ## spectrum-phy.h (module 'spectrum'): ns3::SpectrumPhy::SpectrumPhy(ns3::SpectrumPhy const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SpectrumPhy const &', 'arg0')])
-    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumPhy::GetDevice() [member function]
+    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::SpectrumPhy::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumPhy::GetMobility() [member function]
+    ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::SpectrumPhy::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
     ## spectrum-phy.h (module 'spectrum'): ns3::Ptr<ns3::SpectrumModel const> ns3::SpectrumPhy::GetRxSpectrumModel() const [member function]
@@ -3647,15 +3602,15 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_pure_virtual=True, is_virtual=True)
-    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_pure_virtual=True, is_virtual=True)
     ## spectrum-phy.h (module 'spectrum'): void ns3::SpectrumPhy::StartRx(ns3::Ptr<ns3::PacketBurst> p, ns3::Ptr<ns3::SpectrumValue const> rxPsd, ns3::SpectrumType st, ns3::Time duration) [member function]
     cls.add_method('StartRx', 
@@ -4051,9 +4006,9 @@
     cls.add_constructor([param('ns3::WaveformGenerator const &', 'arg0')])
     ## waveform-generator.h (module 'spectrum'): ns3::WaveformGenerator::WaveformGenerator() [constructor]
     cls.add_constructor([])
-    ## waveform-generator.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::WaveformGenerator::GetDevice() [member function]
+    ## waveform-generator.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::WaveformGenerator::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_virtual=True)
     ## waveform-generator.h (module 'spectrum'): double ns3::WaveformGenerator::GetDutyCycle() const [member function]
@@ -4061,9 +4016,9 @@
                    'double', 
                    [], 
                    is_const=True)
-    ## waveform-generator.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::WaveformGenerator::GetMobility() [member function]
+    ## waveform-generator.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::WaveformGenerator::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_virtual=True)
     ## waveform-generator.h (module 'spectrum'): ns3::Time ns3::WaveformGenerator::GetPeriod() const [member function]
@@ -4090,19 +4045,19 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_virtual=True)
-    ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_virtual=True)
     ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetDutyCycle(double value) [member function]
     cls.add_method('SetDutyCycle', 
                    'void', 
                    [param('double', 'value')])
-    ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_virtual=True)
     ## waveform-generator.h (module 'spectrum'): void ns3::WaveformGenerator::SetPeriod(ns3::Time period) [member function]
     cls.add_method('SetPeriod', 
@@ -4563,14 +4518,14 @@
     cls.add_constructor([param('ns3::HalfDuplexIdealPhy const &', 'arg0')])
     ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::HalfDuplexIdealPhy::HalfDuplexIdealPhy() [constructor]
     cls.add_constructor([])
-    ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::HalfDuplexIdealPhy::GetDevice() [member function]
+    ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::HalfDuplexIdealPhy::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_virtual=True)
-    ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::HalfDuplexIdealPhy::GetMobility() [member function]
+    ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::HalfDuplexIdealPhy::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_virtual=True)
     ## half-duplex-ideal-phy.h (module 'spectrum'): ns3::DataRate ns3::HalfDuplexIdealPhy::GetRate() const [member function]
@@ -4597,10 +4552,10 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_virtual=True)
-    ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_virtual=True)
     ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetGenericPhyRxEndErrorCallback(ns3::GenericPhyRxEndErrorCallback c) [member function]
     cls.add_method('SetGenericPhyRxEndErrorCallback', 
@@ -4618,10 +4573,10 @@
     cls.add_method('SetGenericPhyTxEndCallback', 
                    'void', 
                    [param('ns3::GenericPhyTxEndCallback', 'c')])
-    ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_virtual=True)
     ## half-duplex-ideal-phy.h (module 'spectrum'): void ns3::HalfDuplexIdealPhy::SetNoisePowerSpectralDensity(ns3::Ptr<ns3::SpectrumValue const> noisePsd) [member function]
     cls.add_method('SetNoisePowerSpectralDensity', 
@@ -5670,14 +5625,14 @@
     cls.add_constructor([param('ns3::SpectrumAnalyzer const &', 'arg0')])
     ## spectrum-analyzer.h (module 'spectrum'): ns3::SpectrumAnalyzer::SpectrumAnalyzer() [constructor]
     cls.add_constructor([])
-    ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumAnalyzer::GetDevice() [member function]
+    ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::NetDevice> ns3::SpectrumAnalyzer::GetDevice() [member function]
     cls.add_method('GetDevice', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::NetDevice >', 
                    [], 
                    is_virtual=True)
-    ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::Object> ns3::SpectrumAnalyzer::GetMobility() [member function]
+    ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::MobilityModel> ns3::SpectrumAnalyzer::GetMobility() [member function]
     cls.add_method('GetMobility', 
-                   'ns3::Ptr< ns3::Object >', 
+                   'ns3::Ptr< ns3::MobilityModel >', 
                    [], 
                    is_virtual=True)
     ## spectrum-analyzer.h (module 'spectrum'): ns3::Ptr<ns3::SpectrumModel const> ns3::SpectrumAnalyzer::GetRxSpectrumModel() const [member function]
@@ -5695,15 +5650,15 @@
                    'void', 
                    [param('ns3::Ptr< ns3::SpectrumChannel >', 'c')], 
                    is_virtual=True)
-    ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetDevice(ns3::Ptr<ns3::Object> d) [member function]
+    ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetDevice(ns3::Ptr<ns3::NetDevice> d) [member function]
     cls.add_method('SetDevice', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'd')], 
+                   [param('ns3::Ptr< ns3::NetDevice >', 'd')], 
                    is_virtual=True)
-    ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetMobility(ns3::Ptr<ns3::Object> m) [member function]
+    ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetMobility(ns3::Ptr<ns3::MobilityModel> m) [member function]
     cls.add_method('SetMobility', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Object >', 'm')], 
+                   [param('ns3::Ptr< ns3::MobilityModel >', 'm')], 
                    is_virtual=True)
     ## spectrum-analyzer.h (module 'spectrum'): void ns3::SpectrumAnalyzer::SetRxSpectrumModel(ns3::Ptr<ns3::SpectrumModel> m) [member function]
     cls.add_method('SetRxSpectrumModel', 
--- a/src/spectrum/examples/adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/examples/adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -41,7 +41,7 @@
 #include <ns3/adhoc-aloha-noack-ideal-phy-helper.h>
 
 #ifdef __FreeBSD__
-#define log2(x) (log(x)/M_LN2)
+#define log2(x) (log (x)/M_LN2)
 #endif
 
 NS_LOG_COMPONENT_DEFINE ("TestAdhocOfdmAloha");
@@ -62,6 +62,66 @@
 }
 
 
+
+/**
+ * Store the last pathloss value for each TX-RX pair. This is an
+ * example of how the PathlossTrace (provided by some SpectrumChannel
+ * implementations) work. 
+ * 
+ */
+class GlobalPathlossDatabase
+{
+public:
+
+  /** 
+   * update the pathloss value
+   * 
+   * \param context 
+   * \param txPhy the transmitting PHY
+   * \param rxPhy the receiving PHY
+   * \param lossDb the loss in dB
+   */
+  void UpdatePathloss (std::string context, Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy, double lossDb);
+
+  /** 
+   * print the stored pathloss values to standard output
+   * 
+   */
+  void Print ();
+
+private:
+  std::map<uint32_t, std::map<uint32_t, double> > m_pathlossMap;
+};
+
+void
+GlobalPathlossDatabase::UpdatePathloss (std::string context, 
+                                        Ptr<SpectrumPhy> txPhy, 
+                                        Ptr<SpectrumPhy> rxPhy, 
+                                        double lossDb)
+{
+  uint32_t txNodeId = txPhy->GetMobility ()->GetObject<Node> ()->GetId ();
+  uint32_t rxNodeId = rxPhy->GetMobility ()->GetObject<Node> ()->GetId ();
+  m_pathlossMap[txNodeId][rxNodeId] = lossDb;
+}
+
+void 
+GlobalPathlossDatabase::Print ()
+{
+  for (std::map<uint32_t, std::map<uint32_t, double> >::const_iterator txit = m_pathlossMap.begin ();
+       txit != m_pathlossMap.end ();
+       ++txit)
+    {
+      for (std::map<uint32_t, double>::const_iterator rxit = txit->second.begin ();
+           rxit != txit->second.end ();
+           ++rxit)
+        {
+          std::cout << txit->first << " --> " << rxit->first << " : " << rxit->second << " dB" << std::endl;
+        }
+    }
+}
+
+
+
 int main (int argc, char** argv)
 {
   CommandLine cmd;
@@ -70,12 +130,14 @@
   uint64_t phyRate = 500000;
   uint32_t pktSize = 1000;
   double simDuration = 0.5;
+  std::string channelType ("ns3::SingleModelSpectrumChannel");
   cmd.AddValue ("verbose", "Print trace information if true", g_verbose);
   cmd.AddValue ("lossDb", "link loss in dB", lossDb);
   cmd.AddValue ("txPowerW", "txPower in Watts", txPowerW);
   cmd.AddValue ("phyRate", "PHY rate in bps", phyRate);
   cmd.AddValue ("pktSize", "packet size in bytes", pktSize);
   cmd.AddValue ("simDuration", "duration of the simulation in seconds", simDuration);
+  cmd.AddValue ("channelType", "which SpectrumChannel implementation to be used", channelType);
   cmd.Parse (argc, argv);
 
   NodeContainer c;
@@ -93,7 +155,7 @@
 
 
   SpectrumChannelHelper channelHelper;
-  channelHelper.SetChannel ("ns3::MultiModelSpectrumChannel");
+  channelHelper.SetChannel (channelType);
   channelHelper.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
   Ptr<MatrixPropagationLossModel> propLoss = CreateObject<MatrixPropagationLossModel> ();
   propLoss->SetLoss (c.Get (0)->GetObject<MobilityModel> (), c.Get (1)->GetObject<MobilityModel> (), lossDb, true);
@@ -140,12 +202,18 @@
 
   Config::Connect ("/NodeList/*/DeviceList/*/Phy/RxEndOk", MakeCallback (&PhyRxEndOkTrace));
 
+  GlobalPathlossDatabase globalPathlossDatabase;
+  Config::Connect ("/ChannelList/*/PropagationLoss",
+                   MakeCallback (&GlobalPathlossDatabase::UpdatePathloss, &globalPathlossDatabase));
+
   g_rxBytes = 0;
   Simulator::Stop (Seconds (simDuration + 0.000001));
   Simulator::Run ();
 
   if (g_verbose)
     {
+      globalPathlossDatabase.Print ();
+
       double throughputBps = (g_rxBytes * 8.0) / simDuration;
       std::cout << "throughput:       " << throughputBps << std::endl;
       std::cout << "throughput:       " << std::setw (20) << std::fixed << throughputBps << " bps" << std::endl;
--- a/src/spectrum/helper/adhoc-aloha-noack-ideal-phy-helper.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/helper/adhoc-aloha-noack-ideal-phy-helper.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -113,7 +113,7 @@
       dev->SetPhy (phy);
 
       NS_ASSERT (node);
-      phy->SetMobility (node);
+      phy->SetMobility (node->GetObject<MobilityModel> ());
 
       NS_ASSERT (dev);
       phy->SetDevice (dev);
--- a/src/spectrum/helper/spectrum-analyzer-helper.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/helper/spectrum-analyzer-helper.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -142,7 +142,7 @@
       dev->SetPhy (phy);
 
       NS_ASSERT (node);
-      phy->SetMobility (node);
+      phy->SetMobility (node->GetObject<MobilityModel> ());
 
       NS_ASSERT (dev);
       phy->SetDevice (dev);
--- a/src/spectrum/helper/spectrum-helper.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/helper/spectrum-helper.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -215,7 +215,7 @@
   NS_ASSERT (m_channel);
   Ptr<SpectrumPhy> phy = (m_phy.Create ())->GetObject<SpectrumPhy> ();
   phy->SetChannel (m_channel);
-  phy->SetMobility (node);
+  phy->SetMobility (node->GetObject<MobilityModel> ());
   phy->SetDevice (device);
   return phy;
 }
--- a/src/spectrum/helper/waveform-generator-helper.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/helper/waveform-generator-helper.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -98,7 +98,7 @@
       dev->SetPhy (phy);
 
       NS_ASSERT (node);
-      phy->SetMobility (node);
+      phy->SetMobility (node->GetObject<MobilityModel> ());
 
       NS_ASSERT (dev);
       phy->SetDevice (dev);
--- a/src/spectrum/model/half-duplex-ideal-phy.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/half-duplex-ideal-phy.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -127,7 +127,7 @@
 
 
 
-Ptr<Object>
+Ptr<NetDevice>
 HalfDuplexIdealPhy::GetDevice ()
 {
   NS_LOG_FUNCTION (this);
@@ -135,7 +135,7 @@
 }
 
 
-Ptr<Object>
+Ptr<MobilityModel>
 HalfDuplexIdealPhy::GetMobility ()
 {
   NS_LOG_FUNCTION (this);
@@ -144,7 +144,7 @@
 
 
 void
-HalfDuplexIdealPhy::SetDevice (Ptr<Object> d)
+HalfDuplexIdealPhy::SetDevice (Ptr<NetDevice> d)
 {
   NS_LOG_FUNCTION (this << d);
   m_netDevice = d;
@@ -152,7 +152,7 @@
 
 
 void
-HalfDuplexIdealPhy::SetMobility (Ptr<Object> m)
+HalfDuplexIdealPhy::SetMobility (Ptr<MobilityModel> m)
 {
   NS_LOG_FUNCTION (this << m);
   m_mobility = m;
--- a/src/spectrum/model/half-duplex-ideal-phy.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/half-duplex-ideal-phy.h	Sun Nov 13 13:50:50 2011 +0100
@@ -92,10 +92,10 @@
 
   // inherited from SpectrumPhy
   void SetChannel (Ptr<SpectrumChannel> c);
-  void SetMobility (Ptr<Object> m);
-  void SetDevice (Ptr<Object> d);
-  Ptr<Object> GetMobility ();
-  Ptr<Object> GetDevice ();
+  void SetMobility (Ptr<MobilityModel> m);
+  void SetDevice (Ptr<NetDevice> d);
+  Ptr<MobilityModel> GetMobility ();
+  Ptr<NetDevice> GetDevice ();
   Ptr<const SpectrumModel> GetRxSpectrumModel () const;
   void StartRx (Ptr<SpectrumSignalParameters> params);
 
@@ -184,8 +184,8 @@
 
   EventId m_endRxEventId;
 
-  Ptr<Object> m_mobility;
-  Ptr<Object> m_netDevice;
+  Ptr<MobilityModel> m_mobility;
+  Ptr<NetDevice> m_netDevice;
   Ptr<SpectrumChannel> m_channel;
 
   Ptr<SpectrumValue> m_txPsd;
--- a/src/spectrum/model/multi-model-spectrum-channel.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/multi-model-spectrum-channel.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -111,6 +111,15 @@
                    DoubleValue (1.0e9),
                    MakeDoubleAccessor (&MultiModelSpectrumChannel::m_maxLossDb),
                    MakeDoubleChecker<double> ())
+    .AddTraceSource ("PropagationLoss",
+                     "If a PropagationLossModel is plugged on the channel, this trace is fired "
+                     "whenever a new path loss value is calculated. The first and second parameters "
+                     "to the trace are pointers respectively to the TX and RX SpectrumPhy instances, "
+                     "whereas the third parameters is the loss value in dB. Note that the loss value "
+                     "reported by this trace is the single-frequency loss value obtained by "
+                     "PropagationLossModel, and is not affected by whether an additional "
+                     "SpectrumPropagationLossModel is being used or not.",
+                     MakeTraceSourceAccessor (&MultiModelSpectrumChannel::m_propagationLossTrace))
   ;
   return tid;
 }
@@ -222,7 +231,7 @@
   NS_ASSERT (txParams->psd);
 
 
-  Ptr<MobilityModel> txMobility = txParams->txPhy->GetMobility ()->GetObject<MobilityModel> ();
+  Ptr<MobilityModel> txMobility = txParams->txPhy->GetMobility ();
   SpectrumModelUid_t txSpectrumModelUid = txParams->psd->GetSpectrumModelUid ();
   NS_LOG_LOGIC (" txSpectrumModelUid " << txSpectrumModelUid);
 
@@ -272,13 +281,14 @@
               rxParams->psd = Copy<SpectrumValue> (convertedTxPowerSpectrum);
               Time delay = MicroSeconds (0); 
 
-              Ptr<MobilityModel> receiverMobility = (*rxPhyIterator)->GetMobility ()->GetObject<MobilityModel> ();
+              Ptr<MobilityModel> receiverMobility = (*rxPhyIterator)->GetMobility ();
 
               if (txMobility && receiverMobility)
                 {
                   if (m_propagationLoss)
                     {
                       double gainDb = m_propagationLoss->CalcRxPower (0, txMobility, receiverMobility);
+                      m_propagationLossTrace (txParams->txPhy, *rxPhyIterator, -gainDb);
                       if ( (-gainDb) > m_maxLossDb)
                         {
                           // beyond range
@@ -299,11 +309,11 @@
                     }
                 }
 
-              Ptr<Object> netDevObj = (*rxPhyIterator)->GetDevice ();
-              if (netDevObj)
+              Ptr<NetDevice> netDev = (*rxPhyIterator)->GetDevice ();
+              if (netDev)
                 {
                   // the receiver has a NetDevice, so we expect that it is attached to a Node
-                  uint32_t dstNode =  netDevObj->GetObject<NetDevice> ()->GetNode ()->GetId ();
+                  uint32_t dstNode =  netDev->GetNode ()->GetId ();
                   Simulator::ScheduleWithContext (dstNode, delay, &MultiModelSpectrumChannel::StartRx, this,
                                                   rxParams, *rxPhyIterator);
                 }
@@ -340,7 +350,7 @@
 Ptr<NetDevice>
 MultiModelSpectrumChannel::GetDevice (uint32_t i) const
 {
-  return m_phyVector.at (i)->GetDevice ()->GetObject<NetDevice> ();
+  return m_phyVector.at (i)->GetDevice ();
 }
 
 
@@ -356,7 +366,7 @@
 void
 MultiModelSpectrumChannel::AddSpectrumPropagationLossModel (Ptr<SpectrumPropagationLossModel> loss)
 {
-  NS_ASSERT (m_propagationLoss == 0);
+  NS_ASSERT (m_spectrumPropagationLoss == 0);
   m_spectrumPropagationLoss = loss;
 }
 
--- a/src/spectrum/model/multi-model-spectrum-channel.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/multi-model-spectrum-channel.h	Sun Nov 13 13:50:50 2011 +0100
@@ -186,6 +186,8 @@
 
 
   double m_maxLossDb;
+
+  TracedCallback<Ptr<SpectrumPhy>, Ptr<SpectrumPhy>, double > m_propagationLossTrace;
 };
 
 
--- a/src/spectrum/model/single-model-spectrum-channel.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/single-model-spectrum-channel.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -80,6 +80,15 @@
                    DoubleValue (1.0e9),
                    MakeDoubleAccessor (&SingleModelSpectrumChannel::m_maxLossDb),
                    MakeDoubleChecker<double> ())
+    .AddTraceSource ("PropagationLoss",
+                     "If a PropagationLossModel is plugged on the channel, this trace is fired "
+                     "whenever a new path loss value is calculated. The first and second parameters "
+                     "to the trace are pointers respectively to the TX and RX SpectrumPhy instances, "
+                     "whereas the third parameters is the loss value in dB. Note that the loss value "
+                     "reported by this trace is the single-frequency loss value obtained by "
+                     "PropagationLossModel, and is not affected by whether an additional "
+                     "SpectrumPropagationLossModel is being used or not.",
+                     MakeTraceSourceAccessor (&SingleModelSpectrumChannel::m_propagationLossTrace))
   ;
   return tid;
 }
@@ -115,7 +124,7 @@
 
 
 
-  Ptr<MobilityModel> senderMobility = txParams->txPhy->GetMobility ()->GetObject<MobilityModel> ();
+  Ptr<MobilityModel> senderMobility = txParams->txPhy->GetMobility ();
 
   for (PhyList::const_iterator rxPhyIterator = m_phyList.begin ();
        rxPhyIterator != m_phyList.end ();
@@ -125,7 +134,7 @@
         {
           Time delay  = MicroSeconds (0);
 
-          Ptr<MobilityModel> receiverMobility = (*rxPhyIterator)->GetMobility ()->GetObject<MobilityModel> ();
+          Ptr<MobilityModel> receiverMobility = (*rxPhyIterator)->GetMobility ();
           NS_LOG_LOGIC ("copying signal parameters " << txParams);
           Ptr<SpectrumSignalParameters> rxParams = txParams->Copy ();
 
@@ -134,6 +143,7 @@
               if (m_propagationLoss)
                 {
                   double gainDb = m_propagationLoss->CalcRxPower (0, senderMobility, receiverMobility);
+                  m_propagationLossTrace (txParams->txPhy, *rxPhyIterator, -gainDb);
                   if ( (-gainDb) > m_maxLossDb)
                     {
                       // beyond range
@@ -155,11 +165,11 @@
             }
 
 
-          Ptr<Object> netDevObj = (*rxPhyIterator)->GetDevice ();
-          if (netDevObj)
+          Ptr<NetDevice> netDev = (*rxPhyIterator)->GetDevice ();
+          if (netDev)
             {
               // the receiver has a NetDevice, so we expect that it is attached to a Node
-              uint32_t dstNode =  netDevObj->GetObject<NetDevice> ()->GetNode ()->GetId ();
+              uint32_t dstNode =  netDev->GetNode ()->GetId ();
               Simulator::ScheduleWithContext (dstNode, delay, &SingleModelSpectrumChannel::StartRx, this, rxParams, *rxPhyIterator);
             }
           else
@@ -211,7 +221,7 @@
 SingleModelSpectrumChannel::AddSpectrumPropagationLossModel (Ptr<SpectrumPropagationLossModel> loss)
 {
   NS_LOG_FUNCTION (this << loss);
-  NS_ASSERT (m_propagationLoss == 0);
+  NS_ASSERT (m_spectrumPropagationLoss == 0);
   m_spectrumPropagationLoss = loss;
 }
 
--- a/src/spectrum/model/single-model-spectrum-channel.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/single-model-spectrum-channel.h	Sun Nov 13 13:50:50 2011 +0100
@@ -24,6 +24,7 @@
 
 #include <ns3/spectrum-channel.h>
 #include <ns3/spectrum-model.h>
+#include <ns3/traced-callback.h>
 
 namespace ns3 {
 
@@ -107,6 +108,8 @@
 
 
   double m_maxLossDb;
+
+  TracedCallback<Ptr<SpectrumPhy>, Ptr<SpectrumPhy>, double > m_propagationLossTrace;
 };
 
 
--- a/src/spectrum/model/spectrum-analyzer.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/spectrum-analyzer.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -89,14 +89,14 @@
 
 
 
-Ptr<Object>
+Ptr<NetDevice>
 SpectrumAnalyzer::GetDevice ()
 {
   return m_netDevice;
 }
 
 
-Ptr<Object>
+Ptr<MobilityModel>
 SpectrumAnalyzer::GetMobility ()
 {
   return m_mobility;
@@ -110,7 +110,7 @@
 }
 
 void
-SpectrumAnalyzer::SetDevice (Ptr<Object> d)
+SpectrumAnalyzer::SetDevice (Ptr<NetDevice> d)
 {
   NS_LOG_FUNCTION (this << d);
   m_netDevice = d;
@@ -118,7 +118,7 @@
 
 
 void
-SpectrumAnalyzer::SetMobility (Ptr<Object> m)
+SpectrumAnalyzer::SetMobility (Ptr<MobilityModel> m)
 {
   NS_LOG_FUNCTION (this << m);
   m_mobility = m;
--- a/src/spectrum/model/spectrum-analyzer.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/spectrum-analyzer.h	Sun Nov 13 13:50:50 2011 +0100
@@ -53,10 +53,10 @@
 
 // inherited from SpectrumPhy
   void SetChannel (Ptr<SpectrumChannel> c);
-  void SetMobility (Ptr<Object> m);
-  void SetDevice (Ptr<Object> d);
-  Ptr<Object> GetMobility ();
-  Ptr<Object> GetDevice ();
+  void SetMobility (Ptr<MobilityModel> m);
+  void SetDevice (Ptr<NetDevice> d);
+  Ptr<MobilityModel> GetMobility ();
+  Ptr<NetDevice> GetDevice ();
   Ptr<const SpectrumModel> GetRxSpectrumModel () const;
   void StartRx (Ptr<SpectrumSignalParameters> params);
 
@@ -86,8 +86,8 @@
   void DoDispose ();
 
 private:
-  Ptr<Object> m_mobility;
-  Ptr<Object> m_netDevice;
+  Ptr<MobilityModel> m_mobility;
+  Ptr<NetDevice> m_netDevice;
   Ptr<SpectrumChannel> m_channel;
 
   virtual void GenerateReport ();
--- a/src/spectrum/model/spectrum-phy.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/spectrum-phy.h	Sun Nov 13 13:50:50 2011 +0100
@@ -54,28 +54,28 @@
    *
    * @param d the NetDevice instance
    */
-  virtual void SetDevice (Ptr<Object> d) = 0;
+  virtual void SetDevice (Ptr<NetDevice> d) = 0;
 
   /**
    * get the associated NetDevice instance
    *
    * @return a Ptr to the associated NetDevice instance
    */
-  virtual Ptr<Object> GetDevice () = 0;
+  virtual Ptr<NetDevice> GetDevice () = 0;
 
   /**
    * Set the mobility model associated with this device.
    *
    * @param m the mobility model
    */
-  virtual void SetMobility (Ptr<Object> m) = 0;
+  virtual void SetMobility (Ptr<MobilityModel> m) = 0;
 
   /**
    * get the associated MobilityModel instance
    *
    * @return a Ptr to the associated NetDevice instance
    */
-  virtual Ptr<Object> GetMobility () = 0;
+  virtual Ptr<MobilityModel> GetMobility () = 0;
 
 
   /**
--- a/src/spectrum/model/waveform-generator.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/waveform-generator.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -89,14 +89,14 @@
 
 
 
-Ptr<Object>
+Ptr<NetDevice>
 WaveformGenerator::GetDevice ()
 {
   return m_netDevice;
 }
 
 
-Ptr<Object>
+Ptr<MobilityModel>
 WaveformGenerator::GetMobility ()
 {
   return m_mobility;
@@ -111,14 +111,14 @@
 }
 
 void
-WaveformGenerator::SetDevice (Ptr<Object> d)
+WaveformGenerator::SetDevice (Ptr<NetDevice> d)
 {
   m_netDevice = d;
 }
 
 
 void
-WaveformGenerator::SetMobility (Ptr<Object> m)
+WaveformGenerator::SetMobility (Ptr<MobilityModel> m)
 {
   m_mobility = m;
 }
--- a/src/spectrum/model/waveform-generator.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/spectrum/model/waveform-generator.h	Sun Nov 13 13:50:50 2011 +0100
@@ -55,10 +55,10 @@
 
   // inherited from SpectrumPhy
   void SetChannel (Ptr<SpectrumChannel> c);
-  void SetMobility (Ptr<Object> m);
-  void SetDevice (Ptr<Object> d);
-  Ptr<Object> GetMobility ();
-  Ptr<Object> GetDevice ();
+  void SetMobility (Ptr<MobilityModel> m);
+  void SetDevice (Ptr<NetDevice> d);
+  Ptr<MobilityModel> GetMobility ();
+  Ptr<NetDevice> GetDevice ();
   Ptr<const SpectrumModel> GetRxSpectrumModel () const;
   void StartRx (Ptr<SpectrumSignalParameters> params);
 
@@ -118,8 +118,8 @@
 private:
   virtual void DoDispose (void);
 
-  Ptr<Object> m_mobility;
-  Ptr<Object> m_netDevice;
+  Ptr<MobilityModel> m_mobility;
+  Ptr<NetDevice> m_netDevice;
   Ptr<SpectrumChannel> m_channel;
 
   virtual void GenerateWaveform ();
--- a/src/uan/model/uan-prop-model-thorp.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/uan/model/uan-prop-model-thorp.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -54,10 +54,10 @@
 double
 UanPropModelThorp::GetPathLossDb (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode mode)
 {
-  double distKyd = a->GetDistanceFrom (b) / 1.093613298; // Convert from dB/km to dB/kyd
+  double dist = a->GetDistanceFrom (b);
 
-  return m_SpreadCoef * 10.0 * log10 (distKyd)
-         + distKyd * GetAttenDbKyd (mode.GetCenterFreqHz () / 1000.0);
+  return m_SpreadCoef * 10.0 * log10 (dist)
+         + dist * GetAttenDbKm (mode.GetCenterFreqHz () / 1000.0);
 }
 
 UanPdp
@@ -76,10 +76,17 @@
 UanPropModelThorp::GetAttenDbKyd (double freqKhz)
 {
 
+  return GetAttenDbKm (freqKhz) / 1.093613298;
+}
+
+double
+UanPropModelThorp::GetAttenDbKm (double freqKhz)
+{
+
   double fsq = freqKhz * freqKhz;
   double atten;
 
-  if (freqKhz < 0.4)
+  if (freqKhz >= 0.4)
     {
       atten = 0.11 * fsq / (1 + fsq) + 44 * fsq / (4100 + freqKhz)
         + 2.75 * 0.0001 * fsq + 0.003;
--- a/src/uan/model/uan-prop-model-thorp.h	Mon Oct 03 23:03:42 2011 +0200
+++ b/src/uan/model/uan-prop-model-thorp.h	Sun Nov 13 13:50:50 2011 +0100
@@ -45,6 +45,7 @@
 
 private:
   double GetAttenDbKyd (double freqKhz);
+  double GetAttenDbKm (double freqKhz);
 
   double m_SpreadCoef;
 };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/uan/test/examples-to-run.py	Sun Nov 13 13:50:50 2011 +0100
@@ -0,0 +1,21 @@
+#! /usr/bin/env python
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# A list of C++ examples to run in order to ensure that they remain
+# buildable and runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run, do_valgrind_run).
+#
+# See test.py for more information.
+cpp_examples = [
+    ("uan-rc-example", "True", "True"),
+    ("uan-cw-example", "True", "True"),
+]
+
+# A list of Python examples to run in order to ensure that they remain
+# runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run).
+#
+# See test.py for more information.
+python_examples = []
--- a/utils/print-introspected-doxygen.cc	Mon Oct 03 23:03:42 2011 +0200
+++ b/utils/print-introspected-doxygen.cc	Sun Nov 13 13:50:50 2011 +0100
@@ -40,6 +40,7 @@
   std::string listLineStart;
   std::string listLineStop;
   std::string reference;
+  std::string temporaryCharacter;
 
 } // anonymous namespace
 
@@ -232,8 +233,9 @@
       if (child.IsChildOf (tid))
         {
           //please take a look at the following note for an explanation 
-          std::string childName = "$%" + child.GetName ();
-          find_and_replace(childName,"::","::%");
+          std::string childName = "$" + temporaryCharacter + child.GetName ();
+          std::string replaceWith = "::" + temporaryCharacter;
+          find_and_replace(childName,"::",replaceWith);
           m_currentPath.push_back (childName);
           m_alreadyProcessed.push_back (tid);
           DoGather (child);
@@ -256,18 +258,20 @@
               other = tmp.first;
             }
           /**
-           * Note: we insert a % in the path below to ensure that doxygen does not
-           * attempt to resolve the typeid names included in the string.
-           * if the name contains ::, using the % sign will remove that sign
-           * resulting for instance in $ns3MobilityModel instead of $ns3::MobilityModel
-           * hence the output must be in the form $%ns3::%MobilityModel in order to
-           * show correctly $ns3::MobilityModel
-           * We add at the beginning of the name $% and we replace all the :: in the
-           * string by ::%.
+           * Note: for the Doxygen version only, we insert a % in the
+           * path below to ensure that doxygen does not attempt to
+           * resolve the typeid names included in the string.  if the
+           * name contains ::, using the % sign will remove that sign
+           * resulting for instance in $ns3MobilityModel instead of
+           * $ns3::MobilityModel hence the output must be in the form
+           * $%ns3::%MobilityModel in order to show correctly
+           * $ns3::MobilityModel We add at the beginning of the name
+           * $% and we replace all the :: in the string by ::%.
            */  
-          std::string name = "$%" + other.GetName ();
-          //finding and replacing :: by ::%
-          find_and_replace(name,"::","::%");
+          std::string name = "$" + temporaryCharacter + other.GetName ();
+          //finding and replacing :: by ::% (for Doxygen version only).
+          std::string replaceWith = "::" + temporaryCharacter;
+          find_and_replace(name,"::",replaceWith);
           m_currentPath.push_back (name);
           m_alreadyProcessed.push_back (tid);
           DoGather (other);
@@ -354,6 +358,7 @@
       listLineStart                = "    * ";
       listLineStop                 = "";
       reference                    = "";
+      temporaryCharacter           = "";
     }
   else
     {
@@ -381,6 +386,7 @@
       listLineStart                = "<li>";
       listLineStop                 = "</li>";
       reference                    = "\\ref ";
+      temporaryCharacter           = "%";
     }
 
   NodeContainer c; c.Create (1);