src: Fixing the unreachable faceUri issue
Refs: #1797
Change-Id: I002be1fcd54a0a443df93ed58dc01d335dba18ad
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 5076f5e..c5aea44 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -752,8 +752,10 @@
Lsdb::expressInterest(const ndn::Name& interestName, uint32_t interestLifeTime,
uint32_t timeoutCount)
{
- _LOG_DEBUG("Expressing Interest for LSA(name): " << interestName);
ndn::Interest interest(interestName);
+ uint64_t interestedLsSeqNo = interestName[-1].toNumber();
+ _LOG_DEBUG("Expressing Interest for LSA(name): " << interestName <<
+ " Seq number: " << interestedLsSeqNo );
interest.setInterestLifetime(ndn::time::seconds(interestLifeTime));
interest.setMustBeFresh(true);
m_nlsr.getNlsrFace().expressInterest(interest,
@@ -779,6 +781,7 @@
interest.getName().size() - lsaPosition - 3));
interestedLsType = intName[-2].toUri();
interestedLsSeqNo = intName[-1].toNumber();
+ _LOG_DEBUG("LSA sequence number from interest: " << interestedLsSeqNo);
if (interestedLsType == "name") {
processInterestForNameLsa(interest,
origRouter.append(interestedLsType),
@@ -811,7 +814,10 @@
data->setFreshnessPeriod(ndn::time::seconds(10));
data->setContent(reinterpret_cast<const uint8_t*>(content.c_str()), content.size());
m_nlsr.getKeyChain().sign(*data, m_nlsr.getDefaultCertName());
+ ndn::SignatureSha256WithRsa signature(data->getSignature());
+ ndn::Name signingCertName = signature.getKeyLocator().getName();
_LOG_DEBUG("Sending data for LSA(name): " << interest.getName());
+ _LOG_DEBUG("Data signed with: " << signingCertName);
m_nlsr.getNlsrFace().put(*data);
}
@@ -860,6 +866,12 @@
void
Lsdb::onContent(const ndn::Interest& interest, const ndn::Data& data)
{
+ _LOG_DEBUG("Received data for LSA(name): " << data.getName());
+ if (data.getSignature().hasKeyLocator()) {
+ if (data.getSignature().getKeyLocator().getType() == ndn::KeyLocator::KeyLocator_Name) {
+ _LOG_DEBUG("Data signed with: " << data.getSignature().getKeyLocator().getName());
+ }
+ }
m_nlsr.getValidator().validate(data,
ndn::bind(&Lsdb::onContentValidated, this, _1),
ndn::bind(&Lsdb::onContentValidationFailed, this, _1, _2));
@@ -870,7 +882,7 @@
Lsdb::onContentValidated(const ndn::shared_ptr<const ndn::Data>& data)
{
const ndn::Name& dataName = data->getName();
- _LOG_DEBUG("Data received for LSA(name): " << dataName);
+ _LOG_DEBUG("Data validation successful for LSA(name): " << dataName);
string dataContent(reinterpret_cast<const char*>(data->getContent().value()));
string chkString("LSA");
int32_t lsaPosition = util::getNameComponentPosition(dataName, chkString);