blob: d320c9a9882ce9a676d1a981260231d631ea8130 [file] [log] [blame]
#ifndef NLSR_FE_HPP
#define NLSR_FE_HPP
#include <list>
#include <iostream>
#include <ndn-cxx/util/scheduler.hpp>
#include "nexthop.hpp"
#include "nexthop-list.hpp"
namespace nlsr {
using namespace std;
class FibEntry
{
public:
FibEntry()
: m_name()
, m_timeToRefresh(0)
, m_seqNo(0)
, m_nhl()
{
}
FibEntry(string n)
: m_timeToRefresh(0)
, m_seqNo(0)
, m_nhl()
{
m_name = n;
}
std::string
getName() const
{
return m_name;
}
NexthopList&
getNhl()
{
return m_nhl;
}
int
getTimeToRefresh() const
{
return m_timeToRefresh;
}
void
setTimeToRefresh(int ttr)
{
m_timeToRefresh = ttr;
}
void
setExpiringEventId(ndn::EventId feid)
{
m_expiringEventId = feid;
}
ndn::EventId
getExpiringEventId() const
{
return m_expiringEventId;
}
void
setSeqNo(int fsn)
{
m_seqNo = fsn;
}
int
getSeqNo()
{
return m_seqNo;
}
bool
isEqualNextHops(NexthopList& nhlOther);
private:
std::string m_name;
int m_timeToRefresh;
ndn::EventId m_expiringEventId;
int m_seqNo;
NexthopList m_nhl;
};
std::ostream&
operator<<(std::ostream& os, FibEntry fe);
} //namespace nlsr
#endif //NLSR_FE_HPP