NLSR-to-ChronoSync interaction point. More...
#include <sync-logic-handler.hpp>
Data Structures | |
class | Error |
Public Types | |
using | IsLsaNew = std::function< bool(const ndn::Name &, const Lsa::Type &lsaType, const uint64_t &)> |
Public Member Functions | |
SyncLogicHandler (ndn::Face &face, const IsLsaNew &isLsaNew, const ConfParameter &conf) | |
void | onChronoSyncUpdate (const std::vector< chronosync::MissingDataInfo > &v) |
Hook function to call whenever sync detects new data. More... | |
void | publishRoutingUpdate (const Lsa::Type &type, const uint64_t &seqNo) |
Instruct ChronoSync to publish an update. More... | |
void | createSyncSocket (const ndn::Name &syncPrefix, const ndn::time::milliseconds &syncInterestLifetime=ndn::time::milliseconds(SYNC_INTEREST_LIFETIME_DEFAULT)) |
Create and configure a socket to enable ChronoSync for this NLSR. More... | |
Data Fields | |
std::unique_ptr< OnNewLsa > | onNewLsa |
NLSR-to-ChronoSync interaction point.
This class serves as the abstraction for the syncing portion of NLSR and its components. NLSR has no particular reliance on ChronoSync, except that the NLSR source would need to be modified for use with other sync protocols.
Definition at line 49 of file sync-logic-handler.hpp.
using nlsr::SyncLogicHandler::IsLsaNew = std::function<bool(const ndn::Name&, const Lsa::Type& lsaType, const uint64_t&)> |
Definition at line 53 of file sync-logic-handler.hpp.
nlsr::SyncLogicHandler::SyncLogicHandler | ( | ndn::Face & | face, |
const IsLsaNew & | isLsaNew, | ||
const ConfParameter & | conf | ||
) |
void nlsr::SyncLogicHandler::createSyncSocket | ( | const ndn::Name & | syncPrefix, |
const ndn::time::milliseconds & | syncInterestLifetime = ndn::time::milliseconds(SYNC_INTEREST_LIFETIME_DEFAULT) |
||
) |
Create and configure a socket to enable ChronoSync for this NLSR.
In a typical situation this only needs to be called once, when NLSR starts.
syncPrefix | The sync prefix you want this ChronoSync to use |
syncInterestLifetime | ChronoSync sends a periodic sync interest every syncInterestLifetime / 2 ms |
Definition at line 56 of file sync-logic-handler.cpp.
void nlsr::SyncLogicHandler::onChronoSyncUpdate | ( | const std::vector< chronosync::MissingDataInfo > & | v | ) |
Hook function to call whenever sync detects new data.
This function packages the sync information into discrete updates and passes those off to another function, processUpdateFromSync.
v | A container with the new information sync has received |
Definition at line 93 of file sync-logic-handler.cpp.
void nlsr::SyncLogicHandler::publishRoutingUpdate | ( | const Lsa::Type & | type, |
const uint64_t & | seqNo | ||
) |
Instruct ChronoSync to publish an update.
This function instructs sync to push an update into the network, based on whatever the state of the sequencing manager is when this is called. Since each ChronoSync instance maintains its own PIT, doing this satisfies those interests so that other routers know a sync update is available.
Definition at line 155 of file sync-logic-handler.cpp.
std::unique_ptr<OnNewLsa> nlsr::SyncLogicHandler::onNewLsa |
Definition at line 131 of file sync-logic-handler.hpp.