src/internet-stack/ipv4-interface.cc
changeset 5681 795c049199c5
parent 5677 81bd758dd7f4
child 6393 f7e1f9dfa08d
equal deleted inserted replaced
5678:1aca9b0ebe8b 5681:795c049199c5
    40   static TypeId tid = TypeId ("ns3::Ipv4Interface")
    40   static TypeId tid = TypeId ("ns3::Ipv4Interface")
    41     .SetParent<Object> ()
    41     .SetParent<Object> ()
    42     .AddAttribute ("ArpCache",
    42     .AddAttribute ("ArpCache",
    43                    "The arp cache for this ipv4 interface",
    43                    "The arp cache for this ipv4 interface",
    44                    PointerValue (0),
    44                    PointerValue (0),
    45                    MakePointerAccessor (&Ipv4Interface::m_cache),
    45                    MakePointerAccessor (&Ipv4Interface::SetArpCache, 
       
    46                                         &Ipv4Interface::GetArpCache),
    46                    MakePointerChecker<ArpCache> ())
    47                    MakePointerChecker<ArpCache> ())
    47     ;
    48     ;
    48     ;
    49     ;
    49   return tid;
    50   return tid;
    50 }
    51 }
   124 uint16_t
   125 uint16_t
   125 Ipv4Interface::GetMetric (void) const
   126 Ipv4Interface::GetMetric (void) const
   126 {
   127 {
   127   NS_LOG_FUNCTION_NOARGS ();
   128   NS_LOG_FUNCTION_NOARGS ();
   128   return m_metric;
   129   return m_metric;
       
   130 }
       
   131 
       
   132 void
       
   133 Ipv4Interface::SetArpCache (Ptr<ArpCache> a)
       
   134 {
       
   135   m_cache = a;
       
   136 }
       
   137 
       
   138 Ptr<ArpCache>
       
   139 Ipv4Interface::GetArpCache () const
       
   140 {
       
   141   return m_cache;
   129 }
   142 }
   130 
   143 
   131 /**
   144 /**
   132  * These are IP interface states and may be distinct from 
   145  * These are IP interface states and may be distinct from 
   133  * NetDevice states, such as found in real implementations
   146  * NetDevice states, such as found in real implementations