NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
face-system.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014-2018, 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.
10  *
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_DAEMON_FACE_FACE_SYSTEM_HPP
27 #define NFD_DAEMON_FACE_FACE_SYSTEM_HPP
28 
29 #include "channel.hpp"
30 #include "core/config-file.hpp"
32 #include <ndn-cxx/net/network-address.hpp>
33 #include <ndn-cxx/net/network-interface.hpp>
34 #include <ndn-cxx/net/network-monitor.hpp>
35 
36 namespace nfd {
37 
38 class FaceTable;
39 
40 namespace face {
41 
42 class ProtocolFactory;
43 struct ProtocolFactoryCtorParams;
44 
50 class FaceSystem : noncopyable
51 {
52 public:
53  FaceSystem(FaceTable& faceTable, shared_ptr<ndn::net::NetworkMonitor> netmon);
54 
55  ~FaceSystem();
56 
59  std::set<const ProtocolFactory*>
60  listProtocolFactories() const;
61 
65  getFactoryById(const std::string& id);
66 
70  getFactoryByScheme(const std::string& scheme);
71 
72  FaceTable&
74  {
75  return m_faceTable;
76  }
77 
80  void
81  setConfigFile(ConfigFile& configFile);
82 
86  {
87  bool wantCongestionMarking = true;
88  };
89 
92  class ConfigContext : noncopyable
93  {
94  public:
96  bool isDryRun;
97  };
98 
101  makePFCtorParams();
102 
103 private:
104  void
105  processConfig(const ConfigSection& configSection, bool isDryRun,
106  const std::string& filename);
107 
111  std::map<std::string, unique_ptr<ProtocolFactory>> m_factories;
112 
113 private:
118  std::map<std::string, ProtocolFactory*> m_factoryByScheme;
119 
120  FaceTable& m_faceTable;
121 
122  shared_ptr<ndn::net::NetworkMonitor> m_netmon;
123 };
124 
125 } // namespace face
126 
127 using face::FaceSystem;
128 
129 } // namespace nfd
130 
131 #endif // NFD_DAEMON_FACE_FACE_SYSTEM_HPP
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition: common.hpp:40
configuration options from "general" section
Definition: face-system.hpp:85
ProtocolFactory * getFactoryById(const std::string &id)
Definition: face-system.cpp:67
configuration file parsing utility
Definition: config-file.hpp:58
ProtocolFactory * getFactoryByScheme(const std::string &scheme)
Definition: face-system.cpp:74
entry point of the face system
Definition: face-system.hpp:50
FaceTable & getFaceTable()
Definition: face-system.hpp:73
std::set< const ProtocolFactory * > listProtocolFactories() const
Definition: face-system.cpp:57
FaceSystem(FaceTable &faceTable, shared_ptr< ndn::net::NetworkMonitor > netmon)
Definition: face-system.cpp:36
Provides support for an underlying protocol.
container of all faces
Definition: face-table.hpp:37
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
void setConfigFile(ConfigFile &configFile)
register handler for face_system section of NFD configuration file
Definition: face-system.cpp:81
Parameters to ProtocolFactory constructor.
boost::property_tree::ptree ConfigSection
a config file section
FaceTable
Definition: face-table.cpp:36
context for processing a config section in ProtocolFactory
Definition: face-system.hpp:92