akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 1 | #ifndef NLSR_NAME_PREFIX_TABLE_HPP |
2 | #define NLSR_NAME_PREFIX_TABLE_HPP | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 3 | |
4 | #include <list> | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 5 | #include <boost/cstdint.hpp> |
6 | |||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 7 | #include "name-prefix-table-entry.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 8 | #include "routing-table-entry.hpp" |
9 | |||||
10 | namespace nlsr { | ||||
11 | class Nlsr; | ||||
12 | |||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 13 | class NamePrefixTable |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 14 | { |
15 | public: | ||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 16 | NamePrefixTable() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 17 | { |
18 | } | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 19 | |
20 | void | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 21 | 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); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 25 | |
26 | void | ||||
27 | updateWithNewRoute(Nlsr& pnlsr); | ||||
28 | |||||
29 | void | ||||
30 | print(); | ||||
31 | |||||
32 | private: | ||||
33 | void | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 34 | addEntry(const std::string& name, RoutingTableEntry& rte, Nlsr& pnlsr); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 35 | |
36 | void | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 37 | removeEntry(const std::string& name, RoutingTableEntry& rte, Nlsr& pnlsr); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 38 | |
39 | private: | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 40 | std::list<NamePrefixTableEntry> m_table; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 41 | }; |
42 | |||||
43 | }//namespace nlsr | ||||
44 | |||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 45 | #endif //NLSR_NAME_PREFIX_TABLE_HPP |