src/devices/point-to-point/point-to-point-net-device.cc
changeset 2600 6c389d0c717d
parent 2502 50d0da37f02f
child 2602 d9262bff6df2
equal deleted inserted replaced
2599:fcc1728eb669 2600:6c389d0c717d
    40 PointToPointNetDevice::GetTypeId (void)
    40 PointToPointNetDevice::GetTypeId (void)
    41 {
    41 {
    42   static TypeId tid = TypeId ("PointToPointNetDevice")
    42   static TypeId tid = TypeId ("PointToPointNetDevice")
    43     .SetParent<NetDevice> ()
    43     .SetParent<NetDevice> ()
    44     .AddConstructor<PointToPointNetDevice> ()
    44     .AddConstructor<PointToPointNetDevice> ()
    45     .AddAttribute ("Node", "The node with which this device is associated",
       
    46                    TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
       
    47                    Ptr<Node> (0),
       
    48                    MakePtrAccessor (&PointToPointNetDevice::m_node),
       
    49                    MakePtrChecker<Node> ())
       
    50     .AddAttribute ("Address", "The address of this device.",
    45     .AddAttribute ("Address", "The address of this device.",
    51                    Mac48Address ("ff:ff:ff:ff:ff:ff"),
    46                    Mac48Address ("ff:ff:ff:ff:ff:ff"),
    52                    MakeMac48AddressAccessor (&PointToPointNetDevice::m_address),
    47                    MakeMac48AddressAccessor (&PointToPointNetDevice::m_address),
    53                    MakeMac48AddressChecker ())
    48                    MakeMac48AddressChecker ())
    54     .AddAttribute ("DataRate", "The default data rate for point to point links",
    49     .AddAttribute ("DataRate", "The default data rate for point to point links",
   377 Ptr<Node> 
   372 Ptr<Node> 
   378 PointToPointNetDevice::GetNode (void) const
   373 PointToPointNetDevice::GetNode (void) const
   379 {
   374 {
   380   return m_node;
   375   return m_node;
   381 }
   376 }
       
   377 void 
       
   378 PointToPointNetDevice::SetNode (Ptr<Node> node)
       
   379 {
       
   380   m_node = node;
       
   381 }
   382 bool 
   382 bool 
   383 PointToPointNetDevice::NeedsArp (void) const
   383 PointToPointNetDevice::NeedsArp (void) const
   384 {
   384 {
   385   return false;
   385   return false;
   386 }
   386 }