blob: 4f7fbb47b7e419b2327c79ad66b39ca543a9a5b7 [file] [log] [blame]
akmhoquefdbddb12014-05-02 18:35:19 -05001#ifndef NLSR_NAME_PREFIX_TABLE_HPP
2#define NLSR_NAME_PREFIX_TABLE_HPP
akmhoque53353462014-04-22 08:43:45 -05003
4#include <list>
akmhoquefdbddb12014-05-02 18:35:19 -05005#include <boost/cstdint.hpp>
6
akmhoquec8a10f72014-04-25 18:42:55 -05007#include "name-prefix-table-entry.hpp"
akmhoque53353462014-04-22 08:43:45 -05008#include "routing-table-entry.hpp"
9
10namespace nlsr {
11class Nlsr;
12
akmhoquec8a10f72014-04-25 18:42:55 -050013class NamePrefixTable
akmhoque53353462014-04-22 08:43:45 -050014{
15public:
akmhoquec8a10f72014-04-25 18:42:55 -050016 NamePrefixTable()
akmhoque53353462014-04-22 08:43:45 -050017 {
18 }
akmhoque53353462014-04-22 08:43:45 -050019
20 void
akmhoquefdbddb12014-05-02 18:35:19 -050021 addEntry(const std::string& name, const std::string& destRouter, Nlsr& pnlsr);
22
23 void
24 removeEntry(const std::string& name, const std::string& destRouter, Nlsr& pnlsr);
akmhoque53353462014-04-22 08:43:45 -050025
26 void
27 updateWithNewRoute(Nlsr& pnlsr);
28
29 void
30 print();
31
32private:
33 void
akmhoquefdbddb12014-05-02 18:35:19 -050034 addEntry(const std::string& name, RoutingTableEntry& rte, Nlsr& pnlsr);
akmhoque53353462014-04-22 08:43:45 -050035
36 void
akmhoquefdbddb12014-05-02 18:35:19 -050037 removeEntry(const std::string& name, RoutingTableEntry& rte, Nlsr& pnlsr);
akmhoque53353462014-04-22 08:43:45 -050038
39private:
akmhoquefdbddb12014-05-02 18:35:19 -050040 std::list<NamePrefixTableEntry> m_table;
akmhoque53353462014-04-22 08:43:45 -050041};
42
43}//namespace nlsr
44
akmhoquefdbddb12014-05-02 18:35:19 -050045#endif //NLSR_NAME_PREFIX_TABLE_HPP