blob: 8518b12ef990c3349a8dea2a7c4fde7318008883 [file] [log] [blame]
#ifndef NLSR_RT_HPP
#define NLSR_RT_HPP
#include <iostream>
#include <utility>
#include <string>
#include "routing-table-entry.hpp"
namespace nlsr {
class Nlsr;
class NextHop;
class RoutingTable
{
public:
RoutingTable()
: m_NO_NEXT_HOP(-12345)
{
}
void
calculate(Nlsr& pnlsr);
void
addNextHop(std::string destRouter, NextHop& nh);
void
printRoutingTable();
void
addNextHopToDryTable(std::string destRouter, NextHop& nh);
void
printDryRoutingTable();
RoutingTableEntry*
findRoutingTableEntry(const std::string destRouter);
void
scheduleRoutingTableCalculation(Nlsr& pnlsr);
int
getNoNextHop()
{
return m_NO_NEXT_HOP;
}
private:
void
calculateLsRoutingTable(Nlsr& pnlsr);
void
calculateHypRoutingTable(Nlsr& pnlsr);
void
calculateHypDryRoutingTable(Nlsr& pnlsr);
void
clearRoutingTable();
void
clearDryRoutingTable();
const int m_NO_NEXT_HOP;
std::list<RoutingTableEntry> m_rTable;
std::list<RoutingTableEntry> m_dryTable;
};
}//namespace nlsr
#endif //NLSR_RT_HPP