Includes cleanup + layer 2 link failure detection (untested)

This commit is contained in:
Pavel Boyko
2009-08-18 15:07:25 +04:00
parent 04a0d79e09
commit 522bd8dbcc
7 changed files with 122 additions and 16 deletions

View File

@@ -42,7 +42,8 @@ Ipv4Interface::GetTypeId (void)
.AddAttribute ("ArpCache",
"The arp cache for this ipv4 interface",
PointerValue (0),
MakePointerAccessor (&Ipv4Interface::m_cache),
MakePointerAccessor (&Ipv4Interface::SetArpCache,
&Ipv4Interface::GetArpCache),
MakePointerChecker<ArpCache> ())
;
;
@@ -128,6 +129,18 @@ Ipv4Interface::GetMetric (void) const
return m_metric;
}
void
Ipv4Interface::SetArpCache (Ptr<ArpCache> a)
{
m_cache = a;
}
Ptr<ArpCache>
Ipv4Interface::GetArpCache () const
{
return m_cache;
}
/**
* These are IP interface states and may be distinct from
* NetDevice states, such as found in real implementations

View File

@@ -56,12 +56,17 @@ public:
void SetNode (Ptr<Node> node);
void SetDevice (Ptr<NetDevice> device);
void SetArpCache (Ptr<ArpCache>);
/**
* \returns the underlying NetDevice. This method cannot return zero.
*/
Ptr<NetDevice> GetDevice (void) const;
/**
* \return ARP cache used by this interface
*/
Ptr<ArpCache> GetArpCache () const;
/**
* \param metric configured routing metric (cost) of this interface
*

View File

@@ -108,6 +108,11 @@ def build(bld):
'tcp-header.h',
'sequence-number.h',
'icmpv4.h',
# used by routing
'ipv4-interface.h',
'ipv4-l3-protocol.h',
'arp-cache.h',
'sgi-hashmap.h',
]
if bld.env['NSC_ENABLED']: