nfd::TablesConfigSection Class Reference

Handles the tables configuration file section. More...

#include <daemon/mgmt/tables-config-section.hpp>

+ Inheritance diagram for nfd::TablesConfigSection:
+ Collaboration diagram for nfd::TablesConfigSection:

Public Member Functions

 TablesConfigSection (Forwarder &forwarder)
 
void ensureConfigured ()
 Apply default configuration, if tables section was omitted in configuration file. More...
 
void setConfigFile (ConfigFile &configFile)
 

Detailed Description

Handles the tables configuration file section.

This class recognizes a config section that looks like

tables
{
cs_max_packets 65536
cs_policy lru
cs_unsolicited_policy drop-all
strategy_choice
{
/ /localhost/nfd/strategy/best-route
/localhost /localhost/nfd/strategy/multicast
/localhost/nfd /localhost/nfd/strategy/best-route
/ndn/broadcast /localhost/nfd/strategy/multicast
}
network_region
{
/example/region1
/example/region2
}
}

During a configuration reload,

  • cs_max_packets, cs_policy, and cs_unsolicited_policy are applied; defaults are used if an option is omitted.
  • strategy_choice entries are inserted, but old entries are not deleted.
  • network_region is applied; it's kept unchanged if the section is omitted.

It's necessary to call ensureConfigured() after initial configuration and configuration reload, so that the correct defaults are applied in case tables section is omitted.

Definition at line 70 of file tables-config-section.hpp.

Constructor & Destructor Documentation

◆ TablesConfigSection()

nfd::TablesConfigSection::TablesConfigSection ( Forwarder forwarder)
explicit

Definition at line 35 of file tables-config-section.cpp.

Member Function Documentation

◆ ensureConfigured()

void nfd::TablesConfigSection::ensureConfigured ( )

Apply default configuration, if tables section was omitted in configuration file.

Definition at line 50 of file tables-config-section.cpp.

◆ setConfigFile()

void nfd::TablesConfigSection::setConfigFile ( ConfigFile configFile)

Definition at line 42 of file tables-config-section.cpp.