security: Cleaning up all security stuff...
diff --git a/src/sync-logic.h b/src/sync-logic.h
index d3e70c1..5efb81e 100644
--- a/src/sync-logic.h
+++ b/src/sync-logic.h
@@ -31,15 +31,14 @@
#include <map>
#include <ndn-cpp-dev/face.hpp>
-#include <ndn-cpp-dev/security/verifier.hpp>
+#include <ndn-cpp-dev/security/validator.hpp>
#include <ndn-cpp-dev/security/key-chain.hpp>
+#include <ndn-cpp-dev/util/scheduler.hpp>
#include "sync-interest-table.h"
#include "sync-diff-state.h"
#include "sync-full-state.h"
#include "sync-std-name-info.h"
-#include "sync-scheduler.h"
-#include "sec-policy-sync.h"
#include "sync-diff-state-container.h"
@@ -88,14 +87,14 @@
* the app data when new remote names are learned
*/
SyncLogic (const ndn::Name& syncPrefix,
- ndn::ptr_lib::shared_ptr<SecPolicySync> syncPolicyManager,
- ndn::ptr_lib::shared_ptr<ndn::Face> face,
+ ndn::shared_ptr<ndn::Validator> validator,
+ ndn::shared_ptr<ndn::Face> face,
LogicUpdateCallback onUpdate,
LogicRemoveCallback onRemove);
SyncLogic (const ndn::Name& syncPrefix,
- ndn::ptr_lib::shared_ptr<SecPolicySync> syncPolicyManager,
- ndn::ptr_lib::shared_ptr<ndn::Face> face,
+ ndn::shared_ptr<ndn::Validator> validator,
+ ndn::shared_ptr<ndn::Face> face,
LogicPerBranchCallback onUpdateBranch);
~SyncLogic ();
@@ -103,20 +102,20 @@
/**
* a wrapper for the same func in SyncApp
*/
- void addLocalNames (const ndn::Name &prefix, uint32_t session, uint32_t seq);
+ void addLocalNames (const ndn::Name &prefix, uint64_t session, uint64_t seq);
/**
* @brief respond to the Sync Interest; a lot of logic needs to go in here
* @param interest the Sync Interest in string format
*/
- void respondSyncInterest (ndn::ptr_lib::shared_ptr<ndn::Interest> interest);
+ void respondSyncInterest (ndn::shared_ptr<ndn::Interest> interest);
/**
* @brief process the fetched sync data
* @param name the data name
* @param dataBuffer the sync data
*/
- void respondSyncData (ndn::ptr_lib::shared_ptr<ndn::Data> data);
+ void respondSyncData (ndn::shared_ptr<ndn::Data> data);
/**
* @brief remove a participant's subtree from the sync tree
@@ -128,7 +127,7 @@
getRootDigest();
#ifdef _DEBUG
- Scheduler &
+ ndn::Scheduler &
getScheduler () { return m_scheduler; }
#endif
@@ -146,46 +145,31 @@
std::map<std::string, bool>
getBranchPrefixes() const;
-private:
- // void
- // connectToDaemon();
-
- // void
- // onConnectionData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest,
- // const ndn::ptr_lib::shared_ptr<ndn::Data>& data);
-
- // void
- // onConnectionDataTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest);
-
+private:
void
delayedChecksLoop ();
void
- onSyncInterest (const ndn::ptr_lib::shared_ptr<const ndn::Name>& prefix,
- const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest,
- ndn::Transport& transport,
- uint64_t registeredPrefixId);
+ onSyncInterest (const ndn::shared_ptr<const ndn::Name>& prefix,
+ const ndn::shared_ptr<const ndn::Interest>& interest);
void
- onSyncRegisterFailed(const ndn::ptr_lib::shared_ptr<const ndn::Name>& prefix);
+ onSyncRegisterFailed(const ndn::shared_ptr<const ndn::Name>& prefix);
void
- onSyncData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest,
- const ndn::ptr_lib::shared_ptr<ndn::Data>& data,
- const ndn::OnVerified& onVerified,
- const ndn::OnVerifyFailed& onVerifyFailed);
+ onSyncData(const ndn::shared_ptr<const ndn::Interest>& interest,
+ const ndn::shared_ptr<ndn::Data>& data,
+ const ndn::OnDataValidated& onValidated,
+ const ndn::OnDataValidationFailed& onValidationFailed);
void
- onSyncDataTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest,
- int retry,
- const ndn::OnVerified& onVerified,
- const ndn::OnVerifyFailed& onVerifyFailed);
+ onSyncTimeout(const ndn::shared_ptr<const ndn::Interest>& interest);
void
- onSyncDataVerifyFailed(const ndn::ptr_lib::shared_ptr<ndn::Data>& data);
+ onSyncDataValidationFailed(const ndn::shared_ptr<const ndn::Data>& data);
void
- onSyncDataVerified(const ndn::ptr_lib::shared_ptr<ndn::Data>& data);
+ onSyncDataValidated(const ndn::shared_ptr<const ndn::Data>& data);
void
processSyncInterest (const ndn::Name &name,
@@ -238,13 +222,12 @@
LogicRemoveCallback m_onRemove;
LogicPerBranchCallback m_onUpdateBranch;
bool m_perBranch;
- ndn::ptr_lib::shared_ptr<SecPolicySync> m_policy;
- ndn::ptr_lib::shared_ptr<ndn::Verifier> m_verifier;
+ ndn::ptr_lib::shared_ptr<ndn::Validator> m_validator;
ndn::ptr_lib::shared_ptr<ndn::KeyChain> m_keyChain;
ndn::ptr_lib::shared_ptr<ndn::Face> m_face;
- uint64_t m_syncRegisteredPrefixId;
+ const ndn::RegisteredPrefixId* m_syncRegisteredPrefixId;
- Scheduler m_scheduler;
+ ndn::Scheduler m_scheduler;
#ifndef NS3_MODULE
boost::mt19937 m_randomGenerator;
@@ -268,12 +251,9 @@
static const int m_defaultRecoveryRetransmitInterval = 200; // milliseconds
uint32_t m_recoveryRetransmissionInterval; // milliseconds
- enum EventLabels
- {
- DELAYED_INTEREST_PROCESSING = 1,
- REEXPRESSING_INTEREST = 2,
- REEXPRESSING_RECOVERY_INTEREST = 3
- };
+ ndn::EventId m_delayedInterestProcessingId;
+ ndn::EventId m_reexpressingInterestId;
+ ndn::EventId m_reexpressingRecoveryInterestId;
};