blob: fb9a060a783b121daf7dc6da96cd3fab8bfe41d6 [file] [log] [blame]
akmhoqueba094742014-02-28 11:47:21 -06001#ifndef NLSR_RT_HPP
2#define NLSR_RT_HPP
3
4#include<iostream>
5#include<utility>
6#include<string>
7
8#include "nlsr_rte.hpp"
9
10namespace nlsr
11{
12
13 class Nlsr;
14 class NextHop;
15
16 using namespace std;
17
18 class RoutingTable
19 {
20 public:
21 RoutingTable()
22 : NO_NEXT_HOP(-12345)
23 {
24 }
25 void calculate(Nlsr& pnlsr);
26 void addNextHop(string destRouter, NextHop& nh);
27 void printRoutingTable();
28
29 void addNextHopToDryTable(string destRouter, NextHop& nh);
30 void printDryRoutingTable();
31 std::pair<RoutingTableEntry&, bool> findRoutingTableEntry(string destRouter);
32 void scheduleRoutingTableCalculation(Nlsr& pnlsr);
33
34 private:
35 void calculateLsRoutingTable(Nlsr& pnlsr);
36 void calculateHypRoutingTable(Nlsr& pnlsr);
37 void calculateHypDryRoutingTable(Nlsr&pnlsr);
38
39 void clearRoutingTable();
40 void clearDryRoutingTable();
41
42 const int NO_NEXT_HOP;
43
44 std::list< RoutingTableEntry > rTable;
45 std::list< RoutingTableEntry > dryTable;
46 };
47
48}//namespace nlsr
49
50#endif