All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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)
 
bool addOrDeletePrefix (const ndn::Name &prefix, bool addPrefix)
 Add or delete an advertise or withdrawn prefix to the nlsr configuration file. More...
 
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. More...
 
std::optional< bool > afterAdvertise (const ndn::Name &prefix) override
 Save an advertised prefix to the nlsr configuration file. More...
 
std::optional< bool > afterWithdraw (const ndn::Name &prefix) override
 Save an advertised prefix to the nlsr configuration file. More...
 
bool checkForPrefixInFile (const std::string prefix)
 Check if a prefix exists in the nlsr configuration file. More...
 
ndn::security::ValidatorConfig & getValidator ()
 
void loadValidator (ConfigSection section, const std::string &filename)
 Load the validator's configuration from a section of a configuration file. More...
 
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. More...
 

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 51 of file prefix-update-processor.cpp.

Member Function Documentation

◆ addOrDeletePrefix()

bool nlsr::update::PrefixUpdateProcessor::addOrDeletePrefix ( const ndn::Name &  prefix,
bool  addPrefix 
)

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

Definition at line 118 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::optional< bool > nlsr::update::PrefixUpdateProcessor::afterAdvertise ( const ndn::Name &  prefix)
overridevirtual

Save an advertised prefix to the nlsr configuration file.

Returns
bool from the overridden function while nullopt here

Reimplemented from nlsr::update::CommandProcessor.

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

◆ afterWithdraw()

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

Save an advertised prefix to the nlsr configuration file.

Returns
bool from the overridden function while nullopt here

Reimplemented from nlsr::update::CommandProcessor.

Definition at line 178 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 100 of file prefix-update-processor.cpp.

◆ getValidator()

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

Definition at line 74 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 93 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 82 of file command-processor.cpp.

Member Data Documentation

◆ m_dispatcher

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

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

◆ m_lsdb

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

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

◆ m_namePrefixList

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

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