| #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() |
| : m_namePrefix() |
| , m_nhl() |
| { |
| } |
| Npte(string np) |
| : m_nhl() |
| { |
| m_namePrefix=np; |
| } |
| |
| string getNamePrefix() |
| { |
| return m_namePrefix; |
| } |
| |
| std::list<RoutingTableEntry>& getRteList() |
| { |
| return m_rteList; |
| } |
| |
| void resetRteListNextHop() |
| { |
| if (m_rteList.size() > 0 ) |
| { |
| for( std::list<RoutingTableEntry>::iterator it=m_rteList.begin(); |
| it != m_rteList.end(); ++it ) |
| { |
| (*it).getNhl().reset(); |
| } |
| } |
| } |
| |
| int getRteListSize() |
| { |
| return m_rteList.size(); |
| } |
| |
| Nhl& getNhl() |
| { |
| return m_nhl; |
| } |
| void generateNhlfromRteList(); |
| void removeRoutingTableEntry(RoutingTableEntry& rte); |
| void addRoutingTableEntry(RoutingTableEntry &rte); |
| |
| private: |
| string m_namePrefix; |
| std::list<RoutingTableEntry> m_rteList; |
| Nhl m_nhl; |
| }; |
| |
| ostream& |
| operator<<(ostream& os, Npte& npte); |
| |
| }//namespace nlsr |
| |
| #endif |