Make OlsrAgentImpl::GetMainAddress const
This commit is contained in:
@@ -643,9 +643,9 @@ OlsrAgentImpl::MprComputation()
|
||||
/// \return the corresponding main address.
|
||||
///
|
||||
Ipv4Address
|
||||
OlsrAgentImpl::GetMainAddress (Ipv4Address iface_addr)
|
||||
OlsrAgentImpl::GetMainAddress (Ipv4Address iface_addr) const
|
||||
{
|
||||
IfaceAssocTuple *tuple =
|
||||
const IfaceAssocTuple *tuple =
|
||||
m_state.FindIfaceAssocTuple (iface_addr);
|
||||
|
||||
if (tuple != NULL)
|
||||
|
||||
@@ -102,7 +102,7 @@ protected:
|
||||
|
||||
void MprComputation ();
|
||||
void RoutingTableComputation ();
|
||||
Ipv4Address GetMainAddress (Ipv4Address iface_addr);
|
||||
Ipv4Address GetMainAddress (Ipv4Address iface_addr) const;
|
||||
|
||||
// Timer handlers
|
||||
Timer m_helloTimer;
|
||||
|
||||
@@ -400,6 +400,18 @@ OlsrState::FindIfaceAssocTuple (Ipv4Address const &ifaceAddr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const IfaceAssocTuple*
|
||||
OlsrState::FindIfaceAssocTuple (Ipv4Address const &ifaceAddr) const
|
||||
{
|
||||
for (IfaceAssocSet::const_iterator it = m_ifaceAssocSet.begin ();
|
||||
it != m_ifaceAssocSet.end (); it++)
|
||||
{
|
||||
if (it->ifaceAddr == ifaceAddr)
|
||||
return &(*it);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
OlsrState::EraseIfaceAssocTuple (const IfaceAssocTuple &tuple)
|
||||
{
|
||||
|
||||
@@ -129,6 +129,7 @@ public:
|
||||
return m_ifaceAssocSet;
|
||||
}
|
||||
IfaceAssocTuple* FindIfaceAssocTuple (const Ipv4Address &ifaceAddr);
|
||||
const IfaceAssocTuple* FindIfaceAssocTuple (const Ipv4Address &ifaceAddr) const;
|
||||
void EraseIfaceAssocTuple (const IfaceAssocTuple &tuple);
|
||||
void InsertIfaceAssocTuple (const IfaceAssocTuple &tuple);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user