/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2014-2016,  Regents of the University of California,
 *                           Arizona Board of Regents,
 *                           Colorado State University,
 *                           University Pierre & Marie Curie, Sorbonne University,
 *                           Washington University in St. Louis,
 *                           Beijing Institute of Technology,
 *                           The University of Memphis.
 *
 * This file is part of NFD (Named Data Networking Forwarding Daemon).
 * See AUTHORS.md for complete list of NFD authors and contributors.
 *
 * NFD is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef NFD_MGMT_TABLES_CONFIG_SECTION_HPP
#define NFD_MGMT_TABLES_CONFIG_SECTION_HPP

#include "fw/forwarder.hpp"
#include "core/config-file.hpp"

namespace nfd {

/** \brief handles 'tables' config section
 *
 *  This class recognizes a config section that looks like
 *  \code{.unparsed}
 *  tables
 *  {
 *    cs_max_packets 65536
 *
 *    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
 *    }
 *  }
 *  \endcode
 */
class TablesConfigSection : noncopyable
{
public:
  explicit
  TablesConfigSection(Forwarder& forwarder);

  void
  setConfigFile(ConfigFile& configFile);

  /** \brief apply default configuration, if tables section was omitted in configuration file
   */
  void
  ensureConfigured();

private:
  void
  processConfig(const ConfigSection& section, bool isDryRun);

  void
  processStrategyChoiceSection(const ConfigSection& section, bool isDryRun);

  void
  processNetworkRegionSection(const ConfigSection& section, bool isDryRun);

private:
private:
  static const size_t DEFAULT_CS_MAX_PACKETS;

  Forwarder& m_forwarder;

  bool m_isConfigured;
};

} // namespace nfd

#endif // NFD_MGMT_TABLES_CONFIG_SECTION_HPP
