Loading...
Searching...
No Matches
nlsr::update::PrefixUpdateProcessor Class Reference

#include <prefix-update-processor.hpp>

+ Inheritance diagram for nlsr::update::PrefixUpdateProcessor:
+ Collaboration diagram for nlsr::update::PrefixUpdateProcessor:

Public Member Functions

 PrefixUpdateProcessor (ndn::mgmt::Dispatcher &dispatcher, ndn::security::ValidatorConfig &validator, NamePrefixList &namePrefixList, Lsdb &lsdb, const std::string &configFileName)
 
std::tuple< bool, std::string > addOrDeletePrefix (const ndn::Name &prefix, uint64_t cost, bool addPrefix)
 Add or delete an advertise or withdrawn prefix to the nlsr configuration file.
 
void advertiseAndInsertPrefix (const ndn::mgmt::ControlParametersBase &parameters, const ndn::mgmt::CommandContinuation &done)
 Add desired name prefix to the advertised name prefix list or insert a prefix into the FIB if parameters is valid.
 
std::tuple< bool, std::string > afterAdvertise (const ndn::Name &prefix, uint64_t cost) override
 Save an advertised prefix to the nlsr configuration file.
 
std::tuple< bool, std::string > afterWithdraw (const ndn::Name &prefix) override
 Remove an advertised prefix from the nlsr configuration file.
 
bool checkForPrefixInFile (const std::string prefix)
 Check if a prefix exists in the nlsr configuration file.
 
ndn::security::ValidatorConfig & getValidator ()
 
void loadValidator (ConfigSection section, const std::string &filename)
 Load the validator's configuration from a section of a configuration file.
 
void withdrawAndRemovePrefix (const ndn::mgmt::ControlParametersBase &parameters, const ndn::mgmt::CommandContinuation &done)
 Remove desired name prefix from the advertised name prefix list or remove a prefix from the FIB if parameters is valid.
 

Protected Attributes

ndn::mgmt::Dispatcher & m_dispatcher
 
Lsdbm_lsdb
 
NamePrefixListm_namePrefixList
 

Detailed Description

Definition at line 35 of file prefix-update-processor.hpp.

Constructor & Destructor Documentation

◆ PrefixUpdateProcessor()

nlsr::update::PrefixUpdateProcessor::PrefixUpdateProcessor ( ndn::mgmt::Dispatcher &  dispatcher,
ndn::security::ValidatorConfig &  validator,
NamePrefixList namePrefixList,
Lsdb lsdb,
const std::string &  configFileName 
)

Definition at line 52 of file prefix-update-processor.cpp.

Member Function Documentation

◆ addOrDeletePrefix()

std::tuple< bool, std::string > nlsr::update::PrefixUpdateProcessor::addOrDeletePrefix ( const ndn::Name &  prefix,
uint64_t  cost,
bool  addPrefix 
)

Add or delete an advertise or withdrawn prefix to the nlsr configuration file.

Definition at line 119 of file prefix-update-processor.cpp.

◆ advertiseAndInsertPrefix()

void nlsr::update::CommandProcessor::advertiseAndInsertPrefix ( const ndn::mgmt::ControlParametersBase &  parameters,
const ndn::mgmt::CommandContinuation &  done 
)
inherited

Add desired name prefix to the advertised name prefix list or insert a prefix into the FIB if parameters is valid.

Definition at line 43 of file command-processor.cpp.

◆ afterAdvertise()

std::tuple< bool, std::string > nlsr::update::PrefixUpdateProcessor::afterAdvertise ( const ndn::Name &  prefix,
uint64_t  cost 
)
overridevirtual

Save an advertised prefix to the nlsr configuration file.

Returns
tuple {bool indicating success/failure, message string}.

Reimplemented from nlsr::update::CommandProcessor.

Definition at line 155 of file prefix-update-processor.cpp.

◆ afterWithdraw()

std::tuple< bool, std::string > nlsr::update::PrefixUpdateProcessor::afterWithdraw ( const ndn::Name &  prefix)
overridevirtual

Remove an advertised prefix from the nlsr configuration file.

Returns
tuple {bool indicating success/failure, message string}.

Reimplemented from nlsr::update::CommandProcessor.

Definition at line 161 of file prefix-update-processor.cpp.

◆ checkForPrefixInFile()

bool nlsr::update::PrefixUpdateProcessor::checkForPrefixInFile ( const std::string  prefix)

Check if a prefix exists in the nlsr configuration file.

Definition at line 101 of file prefix-update-processor.cpp.

◆ getValidator()

ndn::security::ValidatorConfig & nlsr::update::PrefixUpdateProcessor::getValidator ( )
inline

Definition at line 80 of file prefix-update-processor.hpp.

◆ loadValidator()

void nlsr::update::PrefixUpdateProcessor::loadValidator ( ConfigSection  section,
const std::string &  filename 
)

Load the validator's configuration from a section of a configuration file.

See also
ConfFileProcessor::processConfFile
ConfFileProcessor::processConfSectionSecurity

Loads the state of the validator for prefix update commands by reading a section from a configuration file. This function is expecting the section to be from a Boost property tree object.

Exceptions
PrefixUpdateProcessor::ErrorIf configuration fails to load successfully

Definition at line 94 of file prefix-update-processor.cpp.

◆ withdrawAndRemovePrefix()

void nlsr::update::CommandProcessor::withdrawAndRemovePrefix ( const ndn::mgmt::ControlParametersBase &  parameters,
const ndn::mgmt::CommandContinuation &  done 
)
inherited

Remove desired name prefix from the advertised name prefix list or remove a prefix from the FIB if parameters is valid.

Definition at line 89 of file command-processor.cpp.

Member Data Documentation

◆ m_dispatcher

ndn::mgmt::Dispatcher& nlsr::update::CommandProcessor::m_dispatcher
protectedinherited

Definition at line 89 of file command-processor.hpp.

◆ m_lsdb

Lsdb& nlsr::update::CommandProcessor::m_lsdb
protectedinherited

Definition at line 91 of file command-processor.hpp.

◆ m_namePrefixList

NamePrefixList& nlsr::update::CommandProcessor::m_namePrefixList
protectedinherited

Definition at line 90 of file command-processor.hpp.