NFD: Named Data Networking Forwarding Daemon 24.07-28-gdcc0e6e0
Loading...
Searching...
No Matches
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-2024, 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
30
31#include <ndn-cxx/net/network-address.hpp>
32#include <ndn-cxx/net/network-interface.hpp>
33#include <ndn-cxx/net/network-monitor.hpp>
34
35#include <map>
36#include <set>
37
38namespace nfd {
39
40class FaceTable;
41
42namespace face {
43
44class NetdevBound;
45class ProtocolFactory;
46struct ProtocolFactoryCtorParams;
47
54class FaceSystem : noncopyable
55{
56public:
57 FaceSystem(FaceTable& faceTable, shared_ptr<ndn::net::NetworkMonitor> netmon);
58
60
64 [[nodiscard]] std::set<const ProtocolFactory*>
66
71 getFactoryById(const std::string& id) const;
72
77 getFactoryByScheme(const std::string& scheme) const;
78
79 bool
80 hasFactoryForScheme(const std::string& scheme) const;
81
84 {
85 return m_faceTable;
86 }
87
90 void
91 setConfigFile(ConfigFile& configFile);
92
96 {
98 };
99
102 class ConfigContext : noncopyable
103 {
104 public:
107 };
108
111 makePFCtorParams();
112
113private:
114 void
115 processConfig(const ConfigSection& configSection, bool isDryRun,
116 const std::string& filename);
117
121 std::map<std::string, unique_ptr<ProtocolFactory>> m_factories;
122 unique_ptr<NetdevBound> m_netdevBound;
123
124private:
129 std::map<std::string, ProtocolFactory*> m_factoryByScheme;
130
131 FaceTable& m_faceTable;
132 shared_ptr<ndn::net::NetworkMonitor> m_netmon;
133};
134
135} // namespace face
136
137using face::FaceSystem;
138
139} // namespace nfd
140
141#endif // NFD_DAEMON_FACE_FACE_SYSTEM_HPP
Configuration file parsing utility.
Container of all faces.
Context for processing a config section in ProtocolFactory.
Entry point of NFD's face system.
std::set< const ProtocolFactory * > listProtocolFactories() const
Returns all ProtocolFactory objects owned by the face system.
ProtocolFactory * getFactoryById(const std::string &id) const
bool hasFactoryForScheme(const std::string &scheme) const
ProtocolFactory * getFactoryByScheme(const std::string &scheme) const
void setConfigFile(ConfigFile &configFile)
Register handler for the face_system section of NFD's configuration file.
FaceTable & getFaceTable()
Provides support for an underlying protocol.
#define NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition common.hpp:41
Definition common.hpp:71
boost::property_tree::ptree ConfigSection
A configuration file section.
Configuration options from general section.
Parameters to ProtocolFactory constructor.