blob: 35f563e4f48f647076967723a3d85b08c57f4dcf [file] [log] [blame]
akmhoquefdbddb12014-05-02 18:35:19 -05001#ifndef NLSR_ROUTING_TABLE_HPP
2#define NLSR_ROUTING_TABLE_HPP
akmhoque53353462014-04-22 08:43:45 -05003
4#include <iostream>
5#include <utility>
6#include <string>
akmhoquefdbddb12014-05-02 18:35:19 -05007#include <boost/cstdint.hpp>
akmhoque53353462014-04-22 08:43:45 -05008
9#include "routing-table-entry.hpp"
10
11namespace nlsr {
12
13class Nlsr;
14class NextHop;
15
16class RoutingTable
17{
18public:
19 RoutingTable()
20 : m_NO_NEXT_HOP(-12345)
21 {
22 }
23 void
24 calculate(Nlsr& pnlsr);
25
26 void
27 addNextHop(std::string destRouter, NextHop& nh);
28
29 void
30 printRoutingTable();
31
32 void
33 addNextHopToDryTable(std::string destRouter, NextHop& nh);
34
35 void
36 printDryRoutingTable();
37
akmhoqueb6450b12014-04-24 00:01:03 -050038 RoutingTableEntry*
39 findRoutingTableEntry(const std::string destRouter);
akmhoque53353462014-04-22 08:43:45 -050040
41 void
42 scheduleRoutingTableCalculation(Nlsr& pnlsr);
43
44 int
45 getNoNextHop()
46 {
47 return m_NO_NEXT_HOP;
48 }
49
50private:
51 void
52 calculateLsRoutingTable(Nlsr& pnlsr);
53
54 void
55 calculateHypRoutingTable(Nlsr& pnlsr);
56
57 void
58 calculateHypDryRoutingTable(Nlsr& pnlsr);
59
60 void
61 clearRoutingTable();
62
63 void
64 clearDryRoutingTable();
65
66 const int m_NO_NEXT_HOP;
67
68 std::list<RoutingTableEntry> m_rTable;
69 std::list<RoutingTableEntry> m_dryTable;
70};
71
72}//namespace nlsr
73
akmhoquefdbddb12014-05-02 18:35:19 -050074#endif //NLSR_ROUTING_TABLE_HPP