Avoid deprecated ndn-cxx functions
Change-Id: I763368c2ea12902b4ea400f92c23b17ad5a5628e
diff --git a/src/conf-parameter.cpp b/src/conf-parameter.cpp
index fb92aa2..e313b1f 100644
--- a/src/conf-parameter.cpp
+++ b/src/conf-parameter.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, The University of Memphis,
+ * Copyright (c) 2014-2022, The University of Memphis,
* Regents of the University of California
*
* This file is part of NLSR (Named-data Link State Routing).
@@ -156,8 +156,7 @@
certificate->setFreshnessPeriod(365_days);
// set content
- certificate->setContent(nlsrInstanceKey.getPublicKey().data(),
- nlsrInstanceKey.getPublicKey().size());
+ certificate->setContent(nlsrInstanceKey.getPublicKey());
// set signature-info
ndn::SignatureInfo signatureInfo;
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index e11f0e4..fac4458 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, The University of Memphis,
+ * Copyright (c) 2014-2022, The University of Memphis,
* Regents of the University of California
*
* This file is part of NLSR (Named-data Link State Routing).
@@ -103,7 +103,7 @@
ndn::Name interestName = adjacent->getName() ;
interestName.append(NLSR_COMPONENT);
interestName.append(INFO_COMPONENT);
- interestName.append(m_confParam.getRouterPrefix().wireEncode());
+ interestName.append(ndn::tlv::GenericNameComponent, m_confParam.getRouterPrefix().wireEncode());
expressInterest(interestName, m_confParam.getInterestResendTime());
NLSR_LOG_DEBUG("Sending HELLO interest: " << interestName);
}
@@ -136,8 +136,8 @@
std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>();
data->setName(ndn::Name(interest.getName()).appendVersion());
data->setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
- data->setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()),
- INFO_COMPONENT.size());
+ data->setContent(ndn::make_span(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.data()),
+ INFO_COMPONENT.size()));
m_keyChain.sign(*data, m_signingInfo);
@@ -156,7 +156,7 @@
ndn::Name interestName(neighbor);
interestName.append(NLSR_COMPONENT);
interestName.append(INFO_COMPONENT);
- interestName.append(m_confParam.getRouterPrefix().wireEncode());
+ interestName.append(ndn::tlv::GenericNameComponent, m_confParam.getRouterPrefix().wireEncode());
expressInterest(interestName, m_confParam.getInterestResendTime());
}
}
@@ -186,7 +186,7 @@
ndn::Name interestName(neighbor);
interestName.append(NLSR_COMPONENT);
interestName.append(INFO_COMPONENT);
- interestName.append(m_confParam.getRouterPrefix().wireEncode());
+ interestName.append(ndn::tlv::GenericNameComponent, m_confParam.getRouterPrefix().wireEncode());
NLSR_LOG_DEBUG("Resending interest: " << interestName);
expressInterest(interestName, m_confParam.getInterestResendTime());
}
diff --git a/src/lsa/lsa.cpp b/src/lsa/lsa.cpp
index c633549..738607e 100644
--- a/src/lsa/lsa.cpp
+++ b/src/lsa/lsa.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, The University of Memphis,
+ * Copyright (c) 2014-2022, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -52,8 +52,7 @@
ndn::tlv::nlsr::ExpirationTime,
ndn::time::toString(m_expirationTimePoint));
- totalLength += prependNonNegativeIntegerBlock(encoder, ndn::tlv::nlsr::SequenceNumber,
- m_seqNo);
+ totalLength += prependNonNegativeIntegerBlock(encoder, ndn::tlv::nlsr::SequenceNumber, m_seqNo);
totalLength += m_originRouter.wireEncode(encoder);
@@ -105,18 +104,15 @@
operator<<(std::ostream& os, const Lsa::Type& type)
{
switch (type) {
- case nlsr::Lsa::Type::ADJACENCY:
+ case Lsa::Type::ADJACENCY:
os << "ADJACENCY";
break;
-
- case nlsr::Lsa::Type::COORDINATE:
+ case Lsa::Type::COORDINATE:
os << "COORDINATE";
break;
-
- case nlsr::Lsa::Type::NAME:
+ case Lsa::Type::NAME:
os << "NAME";
break;
-
default:
os << "BASE";
break;