void TunManager::removeIntf(RouterID rid) { auto iter = intfs_.find(rid); if (iter == intfs_.end()) { throw FbossError("Cannot find to be delete interface for router ", rid); } auto& intf = iter->second; // remove the route table removeRouteTable(intf->getIfIndex(), intf->getRouterId()); intf->setDelete(); intfs_.erase(iter); }
void routingHandler::restoreValues(){ debugMessage("Removing the created RoutingTable"); int removeRouteReturnValue = removeRouteTable(); if(removeRouteReturnValue == 0){ debugMessage("OK"); }else{ debugMessage("ERROR"); } debugMessage("Restoring Routing Table"); int restoreRTTReturnValue = restoreRTTTable(); switch(restoreRTTReturnValue){ case -1: debugMessage("Could not read BackupFile"); break; case -2: debugMessage("Could not write "+fileRTTables); break; default: debugMessage("OK"); break; } debugMessage("Restoring IP Tables"); int restoreIPTablesReturnValue = restoreIPTables(); if(restoreIPTablesReturnValue == 0){ debugMessage("OK"); }else{ debugMessage("ERROR"); } debugMessage("Restoring RP Filter"); int restoreRPFilterReturnValue = restoreRpFilter(); if(restoreRPFilterReturnValue == 0){ debugMessage("OK"); }else{ debugMessage("ERROR"); } }