bug 285: NetDevice base class should define an attribute Mtu.
1.1 --- a/src/node/net-device.cc Sat Aug 23 22:35:10 2008 +0100
1.2 +++ b/src/node/net-device.cc Mon Aug 25 09:05:41 2008 -0700
1.3 @@ -20,6 +20,7 @@
1.4
1.5 #include "ns3/object.h"
1.6 #include "ns3/log.h"
1.7 +#include "ns3/uinteger.h"
1.8 #include "net-device.h"
1.9
1.10 NS_LOG_COMPONENT_DEFINE ("NetDevice");
1.11 @@ -31,7 +32,15 @@
1.12 TypeId NetDevice::GetTypeId (void)
1.13 {
1.14 static TypeId tid = TypeId ("ns3::NetDevice")
1.15 - .SetParent<Object> ();
1.16 + .SetParent<Object> ()
1.17 + .AddAttribute ("Mtu", "The MAC-level Maximum Transmission Unit",
1.18 + TypeId::ATTR_SET | TypeId::ATTR_GET,
1.19 + UintegerValue (0xffff),
1.20 + MakeUintegerAccessor (&NetDevice::SetMtu,
1.21 + &NetDevice::GetMtu),
1.22 + MakeUintegerChecker<uint16_t> ())
1.23 +
1.24 + ;
1.25 return tid;
1.26 }
1.27