29 #include <ndn-cxx/security/signing-helpers.hpp> 36 const ndn::time::seconds Lsdb::GRACE_PERIOD = ndn::time::seconds(10);
37 const ndn::time::steady_clock::TimePoint Lsdb::DEFAULT_LSA_RETRIEVAL_DEADLINE =
38 ndn::time::steady_clock::TimePoint::min();
41 ndn::security::SigningInfo& signingInfo,
ConfParameter& confParam,
44 , m_scheduler(face.getIoService())
45 , m_signingInfo(signingInfo)
46 , m_confParam(confParam)
47 , m_namePrefixTable(namePrefixTable)
48 , m_routingTable(routingTable)
50 [this] (const
ndn::Name& routerName, const
Lsa::Type& lsaType,
51 const uint64_t& sequenceNumber) {
52 return isLsaNew(routerName, lsaType, sequenceNumber);
54 , m_lsaStorage(m_scheduler)
59 , m_onNewLsaConnection(m_sync.
onNewLsa->connect(
60 [
this] (
const ndn::Name& updateName, uint64_t sequenceNumber) {
61 ndn::Name lsaInterest{updateName};
62 lsaInterest.appendNumber(sequenceNumber);
65 , m_segmentPublisher(m_face, keyChain)
66 , m_isBuildAdjLsaSheduled(
false)
73 for (
const auto& sp : m_fetchers) {
79 Lsdb::onFetchLsaError(uint32_t errorCode,
80 const std::string& msg,
81 const ndn::Name& interestName,
82 uint32_t retransmitNo,
83 const ndn::time::steady_clock::TimePoint& deadline,
87 NLSR_LOG_DEBUG(
"Failed to fetch LSA: " << lsaName <<
", Error code: " << errorCode
88 <<
", Message: " << msg);
90 if (ndn::time::steady_clock::now() < deadline) {
91 SequenceNumberMap::const_iterator it = m_highestSeqNo.find(lsaName);
93 if (it != m_highestSeqNo.end() && it->second == seqNo) {
100 if (errorCode == ndn::util::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT) {
101 delay = ndn::time::seconds(0);
105 interestName, retransmitNo + 1, deadline));
111 Lsdb::afterFetchLsa(
const ndn::ConstBufferPtr& bufferPtr,
const ndn::Name& interestName)
113 std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(ndn::Name(interestName));
114 data->setContent(ndn::Block(bufferPtr));
116 NLSR_LOG_DEBUG(
"Received data for LSA(name): " << data->getName());
118 ndn::Name lsaName = interestName.getSubName(0, interestName.size()-1);
119 uint64_t seqNo = interestName[-1].toNumber();
121 if (m_highestSeqNo.find(lsaName) == m_highestSeqNo.end()) {
122 m_highestSeqNo[lsaName] = seqNo;
124 else if (seqNo > m_highestSeqNo[lsaName]) {
125 m_highestSeqNo[lsaName] = seqNo;
126 NLSR_LOG_TRACE(
"SeqNo for LSA(name): " << data->getName() <<
" updated");
128 else if (seqNo < m_highestSeqNo[lsaName]) {
132 onContentValidated(data);
136 Lsdb::cancelScheduleLsaExpiringEvent(ndn::EventId eid)
138 m_scheduler.cancelEvent(eid);
149 return nlsa1.
getKey() == key;
157 getLsaExpirationTimePoint(),
170 std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
173 if (it != m_nameLsdb.end()) {
184 if (nameLsaCheck != 0) {
197 Lsdb::scheduleNameLsaExpiration(
const ndn::Name& key,
int seqNo,
198 const ndn::time::seconds& expTime)
200 return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
201 std::bind(&Lsdb::expireOrRefreshNameLsa,
this, key, seqNo));
208 ndn::time::seconds timeToExpire = m_lsaRefreshTime;
211 if (chkNameLsa == 0) {
233 ndn::time::system_clock::now();
234 timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
257 std::list<ndn::Name> namesToAdd;
258 std::set_difference(newNames.begin(), newNames.end(), oldNames.begin(), oldNames.end(),
259 std::inserter(namesToAdd, namesToAdd.begin()));
260 for (
const auto& name : namesToAdd) {
272 std::list<ndn::Name> namesToRemove;
273 std::set_difference(oldNames.begin(), oldNames.end(), newNames.begin(), newNames.end(),
274 std::inserter(namesToRemove, namesToRemove.begin()));
275 for (
const auto& name : namesToRemove) {
276 NLSR_LOG_DEBUG(
"Removing name LSA no longer advertised: " << name);
287 ndn::time::system_clock::now();
288 timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
302 Lsdb::addNameLsa(
NameLsa& nlsa)
304 std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
308 if (it == m_nameLsdb.end()) {
309 m_nameLsdb.push_back(nlsa);
318 std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
321 if (it != m_nameLsdb.end()) {
327 m_namePrefixTable.
removeEntry((*it).getOrigRouter(), (*it).getOrigRouter());
329 for (
const auto& name : it->getNpl().getNames()) {
331 m_namePrefixTable.
removeEntry(name, it->getOrigRouter());
335 m_nameLsdb.erase(it);
342 Lsdb::doesNameLsaExist(
const ndn::Name& key)
344 std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
347 if (it == m_nameLsdb.end()) {
357 for (
const auto& nlsa : m_nameLsdb) {
362 const std::list<NameLsa>&
377 return clsa.
getKey() == key;
385 getLsaExpirationTimePoint(),
404 std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
407 if (it != m_corLsdb.end()) {
435 Lsdb::scheduleCoordinateLsaExpiration(
const ndn::Name& key,
int seqNo,
436 const ndn::time::seconds& expTime)
438 return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
439 std::bind(&Lsdb::expireOrRefreshCoordinateLsa,
446 ndn::time::seconds timeToExpire = m_lsaRefreshTime;
449 if (chkCorLsa == 0) {
453 addCoordinateLsa(clsa);
466 ndn::time::system_clock::now();
467 timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
469 scheduleCoordinateLsaExpiration(clsa.
getKey(),
491 ndn::time::system_clock::now();
492 timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
508 std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
512 if (it == m_corLsdb.end()) {
513 m_corLsdb.push_back(clsa);
522 std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
526 if (it != m_corLsdb.end()) {
531 m_namePrefixTable.
removeEntry(it->getOrigRouter(), it->getOrigRouter());
541 Lsdb::doesCoordinateLsaExist(
const ndn::Name& key)
543 std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
547 if (it == m_corLsdb.end()) {
557 for (
const auto& corLsa : m_corLsdb) {
562 const std::list<CoordinateLsa>&
577 return alsa.
getKey() == key;
587 NLSR_LOG_DEBUG(
"Adjacency LSA not built. Currently in hyperbolic routing state.");
591 if (m_isBuildAdjLsaSheduled ==
false) {
592 NLSR_LOG_DEBUG(
"Scheduling Adjacency LSA build in " << m_adjLsaBuildInterval);
594 m_scheduler.scheduleEvent(m_adjLsaBuildInterval, std::bind(&Lsdb::buildAdjLsa,
this));
595 m_isBuildAdjLsaSheduled =
true;
604 m_isBuildAdjLsaSheduled =
false;
608 int adjBuildCount = m_adjBuildCount;
610 if (adjBuildCount > 0) {
633 m_adjBuildCount = m_adjBuildCount - adjBuildCount;
640 m_isBuildAdjLsaSheduled =
true;
643 m_scheduler.scheduleEvent(ndn::time::seconds(schedulingTime),
644 std::bind(&Lsdb::buildAdjLsa,
this));
649 Lsdb::addAdjLsa(
AdjLsa& alsa)
651 std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
655 if (it == m_adjLsdb.end()) {
656 m_adjLsdb.push_back(alsa);
672 std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
675 if (it != m_adjLsdb.end()) {
686 if (adjLsaCheck != 0) {
699 Lsdb::scheduleAdjLsaExpiration(
const ndn::Name& key,
int seqNo,
700 const ndn::time::seconds& expTime)
702 return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
703 std::bind(&Lsdb::expireOrRefreshAdjLsa,
this, key, seqNo));
709 ndn::time::seconds timeToExpire = m_lsaRefreshTime;
712 if (chkAdjLsa == 0) {
721 ndn::time::system_clock::now();
722 timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
724 scheduleAdjLsaExpiration(alsa.
getKey(),
745 ndn::time::system_clock::now();
746 timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
764 getLsaExpirationTimePoint(),
781 std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
784 if (it != m_adjLsdb.end()) {
788 m_namePrefixTable.
removeEntry(it->getOrigRouter(), it->getOrigRouter());
797 Lsdb::doesAdjLsaExist(
const ndn::Name& key)
799 std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
802 if (it == m_adjLsdb.end()) {
808 const std::list<AdjLsa>&
822 Lsdb::expireOrRefreshNameLsa(
const ndn::Name& lsaKey, uint64_t seqNo)
828 if (chkNameLsa != 0) {
865 Lsdb::expireOrRefreshAdjLsa(
const ndn::Name& lsaKey, uint64_t seqNo)
871 if (chkAdjLsa != 0) {
912 Lsdb::expireOrRefreshCoordinateLsa(
const ndn::Name& lsaKey,
919 if (chkCorLsa != 0) {
960 ndn::time::steady_clock::TimePoint deadline)
965 if (deadline == DEFAULT_LSA_RETRIEVAL_DEADLINE) {
966 deadline = ndn::time::steady_clock::now() + ndn::time::seconds(static_cast<int>(
LSA_REFRESH_TIME_MAX));
969 ndn::Name lsaName = interestName.getSubName(0, interestName.size()-1);
971 uint64_t seqNo = interestName[-1].toNumber();
974 if (m_highestSeqNo.find(lsaName) == m_highestSeqNo.end()) {
975 m_highestSeqNo[lsaName] = seqNo;
978 else if (seqNo > m_highestSeqNo[lsaName]) {
979 m_highestSeqNo[lsaName] = seqNo;
982 else if (seqNo < m_highestSeqNo[lsaName]) {
986 ndn::Interest interest(interestName);
987 ndn::util::SegmentFetcher::Options options;
990 NLSR_LOG_DEBUG(
"Fetching Data for LSA: " << interestName <<
" Seq number: " << seqNo);
991 auto fetcher = ndn::util::SegmentFetcher::start(m_face, interest,
994 auto it = m_fetchers.insert(fetcher).first;
996 fetcher->onComplete.connect([
this, interestName, it] (ndn::ConstBufferPtr bufferPtr) {
997 afterFetchLsa(bufferPtr, interestName);
998 m_fetchers.erase(it);
1001 fetcher->onError.connect([
this, interestName, timeoutCount, deadline, lsaName, seqNo, it]
1002 (uint32_t errorCode,
const std::string& msg) {
1003 onFetchLsaError(errorCode, msg, interestName,
1004 timeoutCount, deadline, lsaName, seqNo);
1005 m_fetchers.erase(it);
1009 fetcher->afterSegmentValidated.connect([
this] (
const ndn::Data& data) {
1015 std::istringstream(interestName[-2].toUri()) >> lsaType;
1027 NLSR_LOG_ERROR(
"lsaType " << lsaType <<
" not recognized; failed Statistics::PacketType conversion");
1034 ndn::Name interestName(interest.getName());
1037 if (interestName[-2].isVersion()) {
1039 if (m_segmentPublisher.replyFromStore(interestName)) {
1044 interestName = interestName.getSubName(0, interestName.size() - 2);
1045 NLSR_LOG_TRACE(
"Interest w/o segment and version: " << interestName);
1051 std::string chkString(
"LSA");
1055 ndn::Name originRouter = m_confParam.
getNetwork();
1056 originRouter.append(interestName.getSubName(lsaPosition + 1,
1057 interestName.size() - lsaPosition - 3));
1060 if (originRouter == m_confParam.
getRouterPrefix() && lsaPosition >= 0) {
1061 uint64_t seqNo = interestName[-1].toNumber();
1064 std::string lsaType = interestName[-2].toUri();
1066 std::istringstream(lsaType) >> interestedLsType;
1069 processInterestForNameLsa(interest, originRouter.append(lsaType), seqNo);
1072 processInterestForAdjacencyLsa(interest, originRouter.append(lsaType), seqNo);
1075 processInterestForCoordinateLsa(interest, originRouter.append(lsaType), seqNo);
1078 NLSR_LOG_WARN(
"Received unrecognized LSA type: " << interestedLsType);
1083 const ndn::Data* lsaSegment = m_lsaStorage.
getLsaSegment(interest);
1084 if (lsaSegment !=
nullptr) {
1085 NLSR_LOG_TRACE(
"Found data in lsa storage. Sending the data for " << interest.getName());
1086 m_face.put(*lsaSegment);
1089 NLSR_LOG_TRACE(interest <<
" was not found in this lsa storage.");
1100 Lsdb::processInterestForNameLsa(
const ndn::Interest& interest,
1101 const ndn::Name& lsaKey,
1108 if (nameLsa !=
nullptr) {
1109 NLSR_LOG_TRACE(
"Verifying SeqNo for NameLsa is same as requested.");
1111 std::string content = nameLsa->
serialize();
1112 m_segmentPublisher.publish(interest.getName(), interest.getName(),
1113 ndn::encoding::makeStringBlock(ndn::tlv::Content, content),
1114 m_lsaRefreshTime, m_signingInfo);
1133 Lsdb::processInterestForAdjacencyLsa(
const ndn::Interest& interest,
1134 const ndn::Name& lsaKey,
1138 NLSR_LOG_ERROR(
"Received interest for an adjacency LSA when hyperbolic routing is enabled");
1144 if (adjLsa !=
nullptr) {
1145 NLSR_LOG_TRACE(
"Verifying SeqNo for AdjLsa is same as requested.");
1147 std::string content = adjLsa->
serialize();
1148 m_segmentPublisher.publish(interest.getName(), interest.getName(),
1149 ndn::encoding::makeStringBlock(ndn::tlv::Content, content),
1150 m_lsaRefreshTime, m_signingInfo);
1169 Lsdb::processInterestForCoordinateLsa(
const ndn::Interest& interest,
1170 const ndn::Name& lsaKey,
1174 NLSR_LOG_ERROR(
"Received Interest for a coordinate LSA when link-state routing is enabled");
1178 NLSR_LOG_DEBUG(
"CoordinateLsa interest " << interest <<
" received");
1180 if (corLsa !=
nullptr) {
1181 NLSR_LOG_TRACE(
"Verifying SeqNo for CoordinateLsa is same as requested.");
1183 std::string content = corLsa->
serialize();
1184 m_segmentPublisher.publish(interest.getName(), interest.getName(),
1185 ndn::encoding::makeStringBlock(ndn::tlv::Content, content),
1186 m_lsaRefreshTime, m_signingInfo);
1200 Lsdb::onContentValidated(
const std::shared_ptr<const ndn::Data>& data)
1202 const ndn::Name& dataName = data->getName();
1203 NLSR_LOG_DEBUG(
"Data validation successful for LSA: " << dataName);
1205 std::string chkString(
"LSA");
1208 if (lsaPosition >= 0) {
1211 ndn::Name originRouter = m_confParam.
getNetwork();
1212 originRouter.append(dataName.getSubName(lsaPosition + 1, dataName.size() - lsaPosition - 3));
1214 uint64_t seqNo = dataName[-1].toNumber();
1215 std::string dataContent(reinterpret_cast<const char*>(data->getContent().value()),
1216 data->getContent().value_size());
1219 std::istringstream(dataName[-2].toUri()) >> interestedLsType;
1222 processContentNameLsa(originRouter.append(std::to_string(interestedLsType)), seqNo,
1226 processContentAdjacencyLsa(originRouter.append(std::to_string(interestedLsType)), seqNo,
1230 processContentCoordinateLsa(originRouter.append(std::to_string(interestedLsType)), seqNo,
1234 NLSR_LOG_WARN(
"Received unrecognized LSA Type: " << interestedLsType);
1242 Lsdb::processContentNameLsa(
const ndn::Name& lsaKey,
1243 uint64_t lsSeqNo, std::string& dataContent)
1258 Lsdb::processContentAdjacencyLsa(
const ndn::Name& lsaKey,
1259 uint64_t lsSeqNo, std::string& dataContent)
1274 Lsdb::processContentCoordinateLsa(
const ndn::Name& lsaKey,
1275 uint64_t lsSeqNo, std::string& dataContent)
1289 ndn::time::system_clock::TimePoint
1290 Lsdb::getLsaExpirationTimePoint()
1292 ndn::time::system_clock::TimePoint expirationTimePoint = ndn::time::system_clock::now();
1293 expirationTimePoint = expirationTimePoint +
1295 return expirationTimePoint;
1302 for (
const auto& adj : m_adjLsdb) {
1313 return doesAdjLsaExist(key);
1315 return doesCoordinateLsaExist(key);
1317 return doesNameLsaExist(key);
1325 const uint64_t& sequenceNumber) {
1326 ndn::Name lsaKey = routerName;
1327 lsaKey.append(std::to_string(lsaType));
bool installAdjLsa(AdjLsa &alsa)
Installs an adj. LSA into the LSDB.
const std::list< NameLsa > & getNameLsdb() const
uint32_t getInterestResendTime() const
ndn::security::ValidatorConfig & getValidator()
A class to house all the configuration parameters for NLSR.
void setAdjLsaSeq(uint64_t alsn)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void scheduleAdjLsaBuild()
Schedules a build of this router's LSA.
bool removeNameLsa(const ndn::Name &key)
Remove a name LSA from the LSDB.
static bool corLsaCompareByKey(const CoordinateLsa &clsa, const ndn::Name &key)
Compares whether an LSA object is the same as a key.
const ndn::time::system_clock::TimePoint & getExpirationTimePoint() const
std::string serialize() const override
Returns the data this adjacency LSA has.
std::list< ndn::Name > getNames() const
bool isLsaNew(const ndn::Name &routerName, const Lsa::Type &lsaType, const uint64_t &sequenceNumber)
void setLsSeqNo(uint32_t lsn)
uint64_t getCorLsaSeq() const
bool deserialize(const std::string &content) noexceptoverride
Initializes this LSA object with content's data.
void scheduleRoutingTableCalculation()
Schedules a calculation event in the event scheduler only if one isn't already scheduled.
void writeLog() const override
std::unique_ptr< OnNewLsa > onNewLsa
static bool nameLsaCompareByKey(const NameLsa &nlsa1, const ndn::Name &key)
Compares if a name LSA is the same as the one specified by key.
NamePrefixList & getNpl()
AdjacencyList & getAdjacencyList()
uint64_t getAdjLsaSeq() const
ndn::EventId getExpiringEventId() const
#define NLSR_LOG_DEBUG(x)
const ndn::Name & getRouterPrefix() const
uint64_t getNameLsaSeq() const
void writeLog() const override
bool deserialize(const std::string &content) noexceptoverride
Initializes this adj. LSA from the supplied content.
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
bool isAdjLsaBuildable(const uint32_t interestRetryNo) const
Determines whether this list can be used to build an adj. LSA.
void setExpirationTimePoint(const ndn::time::system_clock::TimePoint <)
const ndn::time::seconds & getLsaInterestLifetime() const
#define INIT_LOGGER(name)
void removeEntry(const ndn::Name &name, const ndn::Name &destRouter)
Removes a destination from a name prefix table entry.
const std::list< CoordinateLsa > & getCoordinateLsdb() const
const ndn::Name & getOrigRouter() const
uint32_t getInterestRetryNumber() const
bool isCoordinateLsaNew(const ndn::Name &key, uint64_t seqNo)
Returns whether a cor. LSA from a router is new or not.
uint32_t getLsSeqNo() const
std::vector< double > getCorTheta() const
void writeLog() const override
const std::string & getStateFileDir() const
CoordinateLsa * findCoordinateLsa(const ndn::Name &key)
Finds a cor. LSA in the LSDB.
ndn::util::signal::Signal< Lsdb, const ndn::Data & > afterSegmentValidatedSignal
bool isNameLsaNew(const ndn::Name &key, uint64_t seqNo)
void connectToFetcher(ndn::util::SegmentFetcher &fetcher)
Get connected to the signal emitted by SegmentFetcher.
Lsdb(ndn::Face &face, ndn::KeyChain &keyChain, ndn::security::SigningInfo &signingInfo, ConfParameter &confParam, NamePrefixTable &namePrefixTable, RoutingTable &routingTable)
bool installCoordinateLsa(CoordinateLsa &clsa)
Installs a cor. LSA into the LSDB.
NameLsa * findNameLsa(const ndn::Name &key)
Returns the name LSA with the given key.
void processInterest(const ndn::Name &name, const ndn::Interest &interest)
void expressInterest(const ndn::Name &interestName, uint32_t timeoutCount, ndn::time::steady_clock::TimePoint deadline=DEFAULT_LSA_RETRIEVAL_DEADLINE)
uint32_t getLsaRefreshTime() const
bool doesLsaExist(const ndn::Name &key, const Lsa::Type &lsType)
bool isEqualContent(const AdjLsa &alsa) const
static int32_t getNameComponentPosition(const ndn::Name &name, const std::string &searchString)
search a name component in ndn::Name and return the position of the component
std::string serialize() const override
Returns the data that this name LSA has.
bool isAdjLsaNew(const ndn::Name &key, uint64_t seqNo)
Returns whether an LSA is new.
bool removeAdjLsa(const ndn::Name &key)
Removes an adj. LSA from the LSDB.
void setNameLsaSeq(uint64_t nlsn)
void setExpiringEventId(const ndn::EventId leei)
bool isEqualContent(const CoordinateLsa &clsa) const
void setCorTheta(std::vector< double > ct)
const ndn::Data * getLsaSegment(const ndn::Interest &interest)
Returns an LSA segment for an interest from LsaSegmentStorage.
#define NLSR_LOG_ERROR(x)
static const ndn::Name::Component NAME_COMPONENT
void removeName(const ndn::Name &name)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
uint32_t getAdjLsaBuildInterval() const
NamePrefixList & getNamePrefixList()
ndn::util::signal::Signal< Lsdb, Statistics::PacketType > lsaIncrementSignal
bool installNameLsa(NameLsa &nlsa)
Installs a name LSA into the LSDB.
void setCorRadius(double cr)
const std::vector< double > getCorTheta() const
int32_t getNumOfActiveNeighbor() const
const ndn::Name & getNetwork() const
void writeSeqNoToFile() const
static bool adjLsaCompareByKey(AdjLsa &alsa, const ndn::Name &key)
Returns whether an adj. LSA object is from some router.
void setCorLsaSeq(uint64_t clsn)
const ndn::Name getKey() const
Gets the key for this LSA.
bool buildAndInstallOwnNameLsa()
Builds a name LSA for this router and then installs it into the LSDB.
bool buildAndInstallOwnCoordinateLsa()
Builds a cor. LSA for this router and installs it into the LSDB.
void addName(const ndn::Name &name)
int32_t getHyperbolicState() const
bool deserialize(const std::string &content) noexceptoverride
Initializes this coordinate LSA with the data in content.
void addAdjacents(AdjacencyList &adl)
Copies the adjacencies in a list to this one.
std::string serialize() const override
Returns the data that this coordinate LSA represents.
const std::list< AdjLsa > & getAdjLsdb() const
AdjLsa * findAdjLsa(const ndn::Name &key)
Finds an adj. LSA in the LSDB.
uint32_t getRouterDeadInterval() const
bool buildAndInstallOwnAdjLsa()
Wrapper event to build and install an adj. LSA for this router.
bool removeCoordinateLsa(const ndn::Name &key)
Removes a cor. LSA from the LSDB.
#define NLSR_LOG_TRACE(x)
void increaseNameLsaSeq()
void publishRoutingUpdate(const Lsa::Type &type, const uint64_t &seqNo)
Instruct ChronoSync to publish an update.
double getCorRadius() const
void addEntry(const ndn::Name &name, const ndn::Name &destRouter)
Adds a destination to the specified name prefix.