void FibHelper::RemoveRoute(Ptr<Node> node, const Name& prefix, Ptr<Node> otherNode) { for (uint32_t deviceId = 0; deviceId < node->GetNDevices(); deviceId++) { Ptr<PointToPointNetDevice> netDevice = DynamicCast<PointToPointNetDevice>(node->GetDevice(deviceId)); if (netDevice == 0) continue; Ptr<Channel> channel = netDevice->GetChannel(); if (channel == 0) continue; if (channel->GetDevice(0)->GetNode() == otherNode || channel->GetDevice(1)->GetNode() == otherNode) { Ptr<L3Protocol> ndn = node->GetObject<L3Protocol>(); NS_ASSERT_MSG(ndn != 0, "Ndn stack should be installed on the node"); shared_ptr<Face> face = ndn->getFaceByNetDevice(netDevice); NS_ASSERT_MSG(face != 0, "There is no face associated with the p2p link"); RemoveRoute(node, prefix, face); return; } } NS_FATAL_ERROR("Cannot remove route: Node# " << node->GetId() << " and Node# " << otherNode->GetId() << " are not connected"); }
void FibHelper::RemoveRoute(const std::string& nodeName, const Name& prefix, const std::string& otherNodeName) { Ptr<Node> node = Names::Find<Node>(nodeName); Ptr<Node> otherNode = Names::Find<Node>(otherNodeName); RemoveRoute(node, prefix, otherNode); }
void FibHelper::RemoveRoute(Ptr<Node> node, const Name& prefix, uint32_t faceId) { Ptr<L3Protocol> ndn = node->GetObject<L3Protocol>(); NS_ASSERT_MSG(ndn != 0, "Ndn stack should be installed on the node"); shared_ptr<Face> face = ndn->getFaceById(faceId); NS_ASSERT_MSG(face != 0, "Face with ID [" << faceId << "] does not exist on node [" << node->GetId() << "]"); RemoveRoute(node, prefix, face); }
void DXMNodeDagAdapter::Destroy() { if( g_DebugBasic ) { MFnDependencyNode depNode(GetNode()->GetSite()); MString name= depNode.name(); DXCC_DPFA_REPORT("%s", name.asChar()); } for(POSITION position= Routes.GetHeadPosition(); position != NULL;) { DXMRoute* route= Routes.GetValueAt(position); Routes.GetNext(position); RemoveRoute(route, true); } DXMNodeAdapter::Destroy(); }
void DXMNodeDagAdapter::RemoveRoute(MDagPath& path, bool deleteIt) { DXMRoute* route= FindRoute(path); if(route) RemoveRoute(route, deleteIt); }