| #ifndef NLSR_NPTE_HPP |
| #define NLSR_NPTE_HPP |
| |
| #include <list> |
| #include <utility> |
| #include "nlsr_rte.hpp" |
| |
| namespace nlsr |
| { |
| |
| using namespace std; |
| |
| class Npte |
| { |
| public: |
| Npte() |
| : namePrefix() |
| , nhl() |
| { |
| } |
| Npte(string np) |
| : nhl() |
| { |
| namePrefix=np; |
| } |
| |
| string getNamePrefix() |
| { |
| return namePrefix; |
| } |
| |
| std::list<RoutingTableEntry>& getRteList() |
| { |
| return rteList; |
| } |
| |
| void resetRteListNextHop() |
| { |
| if (rteList.size() > 0 ) |
| { |
| for( std::list<RoutingTableEntry>::iterator it=rteList.begin(); |
| it != rteList.end(); ++it ) |
| { |
| (*it).getNhl().resetNhl(); |
| } |
| } |
| } |
| |
| int getRteListSize() |
| { |
| return rteList.size(); |
| } |
| |
| Nhl& getNhl() |
| { |
| return nhl; |
| } |
| void generateNhlfromRteList(); |
| void removeRoutingTableEntry(RoutingTableEntry& rte); |
| void addRoutingTableEntry(RoutingTableEntry &rte); |
| |
| private: |
| string namePrefix; |
| std::list<RoutingTableEntry> rteList; |
| Nhl nhl; |
| }; |
| |
| ostream& |
| operator<<(ostream& os, Npte& npte); |
| |
| }//namespace nlsr |
| |
| #endif |