Do not compile ChronoSync support by default
ChronoSync dependency is now made optional
and is kept for testing purposes only.
Also change sig-type to ecdsa-sha256 in nlsr.conf
as ndn-cxx now has strict checking for it.
refs: #5147
Change-Id: I95c9fb844681ebf2c4e7bbb03cc7796a0795de83
diff --git a/src/communication/sync-protocol-adapter.hpp b/src/communication/sync-protocol-adapter.hpp
index 363f02d..1d56b25 100644
--- a/src/communication/sync-protocol-adapter.hpp
+++ b/src/communication/sync-protocol-adapter.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018, The University of Memphis,
+/*
+ * Copyright (c) 2014-2021, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#ifndef NLSR_SYNC_PROTOCOL_ADAPTER_HPP
#define NLSR_SYNC_PROTOCOL_ADAPTER_HPP
@@ -25,7 +25,9 @@
#include "conf-parameter.hpp"
#include <ndn-cxx/face.hpp>
+#ifdef HAVE_CHRONOSYNC
#include <ChronoSync/logic.hpp>
+#endif
#include <PSync/full-producer.hpp>
namespace nlsr {
@@ -37,7 +39,7 @@
{
public:
SyncProtocolAdapter(ndn::Face& facePtr,
- int32_t syncProtocol,
+ SyncProtocol syncProtocol,
const ndn::Name& syncPrefix,
const ndn::Name& userPrefix,
ndn::time::milliseconds syncInterestLifetime,
@@ -62,6 +64,7 @@
publishUpdate(const ndn::Name& userPrefix, uint64_t seq);
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+#ifdef HAVE_CHRONOSYNC
/*! \brief Hook function to call whenever ChronoSync detects new data.
*
* This function packages the sync information into discrete updates
@@ -72,6 +75,7 @@
*/
void
onChronoSyncUpdate(const std::vector<chronosync::MissingDataInfo>& updates);
+#endif
/*! \brief Hook function to call whenever PSync detects new data.
*
@@ -85,9 +89,11 @@
onPSyncUpdate(const std::vector<psync::MissingDataInfo>& updates);
private:
- int32_t m_syncProtocol;
+ SyncProtocol m_syncProtocol;
SyncUpdateCallback m_syncUpdateCallback;
+#ifdef HAVE_CHRONOSYNC
std::shared_ptr<chronosync::Logic> m_chronoSyncLogic;
+#endif
std::shared_ptr<psync::FullProducer> m_psyncLogic;
};