nfd::TablesConfigSection Class Reference

handles 'tables' config 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 'tables' config section

This class recognizes a config section that looks like

1 tables
2 {
3  cs_max_packets 65536
4  cs_policy priority_fifo
5  cs_unsolicited_policy drop-all
6 
7  strategy_choice
8  {
9  / /localhost/nfd/strategy/best-route
10  /localhost /localhost/nfd/strategy/multicast
11  /localhost/nfd /localhost/nfd/strategy/best-route
12  /ndn/broadcast /localhost/nfd/strategy/multicast
13  }
14 
15  network_region
16  {
17  /example/region1
18  /example/region2
19  }
20 }

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

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

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

Member Function Documentation

void nfd::TablesConfigSection::ensureConfigured ( )

apply default configuration, if tables section was omitted in configuration file

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

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

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