From 1f894ae7eb05b5976bf7c98216afa6cedf6cea9f Mon Sep 17 00:00:00 2001 From: Ameya Deshpande Date: Fri, 8 Oct 2021 19:26:47 +0200 Subject: [PATCH] nix-vector-routing: Remove the unused BuildNixVectorLocal () function This commit removes the dead function `BuildNixVectorLocal ()`. This issue is discussed in #466. Signed-off-by: Ameya Deshpande --- .../model/nix-vector-routing.cc | 29 ------------------- .../model/nix-vector-routing.h | 7 ----- 2 files changed, 36 deletions(-) diff --git a/src/nix-vector-routing/model/nix-vector-routing.cc b/src/nix-vector-routing/model/nix-vector-routing.cc index dcd5faf50..3fa360eb9 100644 --- a/src/nix-vector-routing/model/nix-vector-routing.cc +++ b/src/nix-vector-routing/model/nix-vector-routing.cc @@ -269,35 +269,6 @@ NixVectorRouting::GetIpRouteInCache (IpAddress address) return 0; } -template -bool -NixVectorRouting::BuildNixVectorLocal (Ptr nixVector) -{ - NS_LOG_FUNCTION_NOARGS (); - - uint32_t numberOfDevices = m_node->GetNDevices (); - - // here we are building a nix vector to - // ourself, so we need to find the loopback - // interface and add that to the nix vector - - for (uint32_t i = 0; i < numberOfDevices; i++) - { - uint32_t interfaceIndex = (m_ip)->GetInterfaceForDevice (m_node->GetDevice (i)); - IpInterfaceAddress ifAddr = m_ip->GetAddress (interfaceIndex, 0); - IpAddress ifAddrValue = ifAddr.GetAddress (); - if (ifAddrValue.IsLocalhost ()) - { - NS_LOG_LOGIC ("Adding loopback to nix."); - NS_LOG_LOGIC ("Adding Nix: " << i << " with " << nixVector->BitCount (numberOfDevices) - << " bits, for node " << m_node->GetId ()); - nixVector->AddNeighborIndex (i, nixVector->BitCount (numberOfDevices)); - return true; - } - } - return false; -} - template bool NixVectorRouting::BuildNixVector (const std::vector< Ptr > & parentVector, uint32_t source, uint32_t dest, Ptr nixVector) const diff --git a/src/nix-vector-routing/model/nix-vector-routing.h b/src/nix-vector-routing/model/nix-vector-routing.h index 32b8cc173..28991022b 100644 --- a/src/nix-vector-routing/model/nix-vector-routing.h +++ b/src/nix-vector-routing/model/nix-vector-routing.h @@ -218,13 +218,6 @@ private: */ bool BuildNixVector (const std::vector< Ptr > & parentVector, uint32_t source, uint32_t dest, Ptr nixVector) const; - /** - * Special variation of BuildNixVector for when a node is sending to itself - * \param [out] nixVector the NixVector to be used for routing - * \returns true on success, false otherwise. - */ - bool BuildNixVectorLocal (Ptr nixVector); - /** * Simply iterates through the nodes net-devices and determines * how many neighbors the node has.