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