blob: 82cb877df54c78a3a271aee521a129895db5eb39 [file] [log] [blame]
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -06001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Vince Lehman63ab1bb2015-09-04 17:06:58 -05003 * Copyright (c) 2014-2015, Regents of the University of California,
4 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology,
9 * The University of Memphis.
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060010 *
11 * This file is part of NFD (Named Data Networking Forwarding Daemon).
12 * See AUTHORS.md for complete list of NFD authors and contributors.
13 *
14 * NFD is free software: you can redistribute it and/or modify it under the terms
15 * of the GNU General Public License as published by the Free Software Foundation,
16 * either version 3 of the License, or (at your option) any later version.
17 *
18 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20 * PURPOSE. See the GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along with
23 * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24 */
25
26#ifndef NFD_MGMT_TABLES_CONFIG_SECTION_HPP
27#define NFD_MGMT_TABLES_CONFIG_SECTION_HPP
28
29#include "table/fib.hpp"
30#include "table/pit.hpp"
31#include "table/cs.hpp"
32#include "table/measurements.hpp"
Vince Lehman63ab1bb2015-09-04 17:06:58 -050033#include "table/network-region-table.hpp"
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060034#include "table/strategy-choice.hpp"
35
36#include "core/config-file.hpp"
37
38namespace nfd {
39
Vince Lehman63ab1bb2015-09-04 17:06:58 -050040/**
41 * \brief Provides parsing for `tables` configuration file section.
42 *
43 * This class enables configuration of CS, PIT, FIB, Strategy Choice, Measurements, and
44 * Network Region tables.
45 */
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060046class TablesConfigSection
47{
48public:
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060049 TablesConfigSection(Cs& cs,
50 Pit& pit,
51 Fib& fib,
52 StrategyChoice& strategyChoice,
Vince Lehman63ab1bb2015-09-04 17:06:58 -050053 Measurements& measurements,
54 NetworkRegionTable& networkRegionTable);
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060055
56 void
57 setConfigFile(ConfigFile& configFile);
58
59 void
Steve DiBenedetto9bcc88f2014-07-08 09:52:13 -060060 ensureTablesAreConfigured();
61
62private:
63
64 void
Vince Lehman63ab1bb2015-09-04 17:06:58 -050065 processConfig(const ConfigSection& configSection,
66 bool isDryRun,
67 const std::string& filename);
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060068
Steve DiBenedettoc0640f52014-11-03 15:55:43 -070069 void
Vince Lehman63ab1bb2015-09-04 17:06:58 -050070 processStrategyChoiceSection(const ConfigSection& configSection,
Steve DiBenedettoc0640f52014-11-03 15:55:43 -070071 bool isDryRun);
72
Vince Lehman63ab1bb2015-09-04 17:06:58 -050073 void
74 processNetworkRegionSection(const ConfigSection& configSection,
75 bool isDryRun);
76
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060077private:
78 Cs& m_cs;
79 // Pit& m_pit;
80 // Fib& m_fib;
Steve DiBenedettoc0640f52014-11-03 15:55:43 -070081 StrategyChoice& m_strategyChoice;
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060082 // Measurements& m_measurements;
Vince Lehman63ab1bb2015-09-04 17:06:58 -050083 NetworkRegionTable& m_networkRegionTable;
Steve DiBenedetto9bcc88f2014-07-08 09:52:13 -060084
85 bool m_areTablesConfigured;
86
87private:
88
89 static const size_t DEFAULT_CS_MAX_PACKETS;
Steve DiBenedetto3a4f83d2014-06-02 14:58:54 -060090};
91
92} // namespace nfd
93
94#endif // NFD_MGMT_TABLES_CONFIG_SECTION_HPP