src/devices/wifi/wifi-net-device.cc
changeset 2965 4b28e9740e3b
parent 2961 2bcb3435483b
child 3435 1d704c128f1f
child 3480 a920df6b9f02
child 3878 3b7d0c1fce02
--- a/src/devices/wifi/wifi-net-device.cc	Mon Apr 14 16:19:17 2008 -0700
+++ b/src/devices/wifi/wifi-net-device.cc	Thu Apr 17 13:42:25 2008 -0700
@@ -39,22 +39,22 @@
   static TypeId tid = TypeId ("ns3::WifiNetDevice")
     .SetParent<NetDevice> ()
     .AddAttribute ("Channel", "The channel attached to this device",
-                   Pointer (),
+                   PointerValue (),
                    MakePointerAccessor (&WifiNetDevice::DoGetChannel,
                                         &WifiNetDevice::SetChannel),
                    MakePointerChecker<WifiChannel> ())
     .AddAttribute ("Phy", "The PHY layer attached to this device.",
-                   Pointer (),
+                   PointerValue (),
                    MakePointerAccessor (&WifiNetDevice::GetPhy,
                                         &WifiNetDevice::SetPhy),
                    MakePointerChecker<WifiPhy> ())
     .AddAttribute ("Mac", "The MAC layer attached to this device.",
-                   Pointer (),
+                   PointerValue (),
                    MakePointerAccessor (&WifiNetDevice::GetMac,
                                         &WifiNetDevice::SetMac),
                    MakePointerChecker<WifiMac> ())
     .AddAttribute ("RemoteStationManager", "The station manager attached to this device.",
-                   Pointer (),
+                   PointerValue (),
                    MakePointerAccessor (&WifiNetDevice::SetRemoteStationManager,
                                         &WifiNetDevice::GetRemoteStationManager),
                    MakePointerChecker<WifiRemoteStationManager> ())
@@ -207,8 +207,9 @@
 bool 
 WifiNetDevice::SetMtu (const uint16_t mtu)
 {
-  Uinteger maxMsduSize = m_mac->GetAttribute ("MaxMsduSize");
-  if (mtu > maxMsduSize && mtu > 0)
+  UintegerValue maxMsduSize;
+  m_mac->GetAttribute ("MaxMsduSize", maxMsduSize);
+  if (mtu > maxMsduSize.Get () || mtu == 0)
     {
       return false;
     }
@@ -220,8 +221,9 @@
 {
   if (m_mtu == 0)
     {
-      Uinteger maxMsduSize = m_mac->GetAttribute ("MaxMsduSize");
-      m_mtu = maxMsduSize;
+      UintegerValue maxMsduSize;
+      m_mac->GetAttribute ("MaxMsduSize", maxMsduSize);
+      m_mtu = maxMsduSize.Get ();
     }
   return m_mtu;
 }