nfd Namespace Reference

Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents, Colorado State University, University Pierre & Marie Curie, Sorbonne University, Washington University in St. More...

Namespaces

 cs
 
 face
 
 fib
 
 fw
 
 general
 
 measurements
 
 name_tree
 
 pit
 
 rib
 
 scheduler
 
 scope_prefix
 contain Name prefix that affects namespace-based scope control
 
 strategy_choice
 
 tcp
 
 tlv
 
 tools
 
 udp
 
 unix_stream
 
 websocket
 

Classes

class  ByteCounter
 represents a counter of number of bytes More...
 
class  Channel
 
class  CommandAuthenticator
 provides ControlCommand authorization according to NFD configuration file More...
 
class  ConfigFile
 configuration file parsing utility More...
 
class  DeadNonceList
 represents the Dead Nonce list More...
 
class  EthernetFactory
 
class  FaceManager
 implement the Face Management of NFD Management Protocol. More...
 
class  FaceTable
 container of all faces More...
 
class  FibManager
 implement the FIB Management of NFD Management Protocol. More...
 
class  Forwarder
 main class of NFD More...
 
class  ForwarderCounters
 counters provided by Forwarder More...
 
class  ForwarderStatusManager
 implement the Forwarder Status of NFD Management Protocol. More...
 
class  Logger
 provides logging for a module More...
 
class  LoggerFactory
 
struct  LoggerTimestamp
 a tag that writes a timestamp upon stream output More...
 
class  ManagerBase
 a collection of common functions shared by all NFD managers and RIB manager, such as communicating with the dispatcher and command validator. More...
 
class  Network
 
class  NetworkInterfaceInfo
 contains information about a network interface More...
 
class  NetworkRegionTable
 stores a collection of producer region names More...
 
class  Nfd
 Class representing NFD instance This class can be used to initialize all components of NFD. More...
 
class  NfdManagerBase
 a collection of common functions shared by all NFD managers, such as communicating with the dispatcher and command validator. More...
 
class  PacketCounter
 represents a counter of number of packets More...
 
class  PrivilegeHelper
 
class  ProtocolFactory
 Abstract base class for all protocol factories. More...
 
class  RttEstimator
 implements the Mean-Deviation RTT estimator More...
 
class  SimpleCounter
 represents a counter that encloses an integer value More...
 
class  SizeCounter
 provides a counter that observes the size of a table More...
 
class  StrategyChoiceManager
 implement the Strategy Choice Management of NFD Management Protocol. More...
 
class  StrategyInfoHost
 base class for an entity onto which StrategyInfo items may be placed More...
 
class  TablesConfigSection
 handles 'tables' config section More...
 
class  TcpChannel
 Class implementing TCP-based channel to create faces. More...
 
class  TcpFactory
 
class  UdpChannel
 Class implementing UDP-based channel to create faces. More...
 
class  UdpFactory
 
class  UnixStreamChannel
 Class implementing a local channel to create faces. More...
 
class  UnixStreamFactory
 
class  WebSocketChannel
 Class implementing WebSocket-based channel to create faces. More...
 
class  WebSocketFactory
 

Typedefs

typedef boost::property_tree::ptree ConfigSection
 
typedef function< void(const ConfigSection &, bool, const std::string &)> ConfigSectionHandler
 callback for config file sections More...
 
typedef function< void(const std::string &, const std::string &, const ConfigSection &, bool)> UnknownConfigSectionHandler
 callback for config file sections without a subscribed handler More...
 
typedef function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
 Prototype for the callback that is invoked when the face is created (as a response to incoming connection or after connection is established) More...
 
typedef function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
 Prototype for the callback that is invoked when the face fails to be created. More...
 

Enumerations

enum  LogLevel {
  LOG_FATAL = -1, LOG_NONE = 0, LOG_ERROR = 1, LOG_WARN = 2,
  LOG_INFO = 3, LOG_DEBUG = 4, LOG_TRACE = 5, LOG_ALL = 255
}
 indicates a log level More...
 

Functions

template<typename It , typename Pred >
It find_last_if (It first, It last, Pred p)
 finds the last element satisfying a predicate More...
 
template<typename E >
std::string getExtendedErrorMessage (const E &exception)
 
boost::asio::io_service & getGlobalIoService ()
 
void resetGlobalIoService ()
 
std::ostream & operator<< (std::ostream &os, const LoggerTimestamp &)
 write a timestamp to os More...
 
std::ostream & operator<< (std::ostream &output, const Logger &logger)
 
std::vector< NetworkInterfaceInfolistNetworkInterfaces ()
 List configured network interfaces on the system and their info. More...
 
std::ostream & operator<< (std::ostream &os, const Network &network)
 
std::istream & operator>> (std::istream &is, Network &network)
 
boost::random::mt19937 & getGlobalRng ()
 
void resetGlobalRng ()
 
void connectFaceClosedSignal (Face &face, const std::function< void()> &f)
 invokes a callback when the face is closed More...
 
static bool compare_InRecord_expiry (const pit::InRecord &a, const pit::InRecord &b)
 
static void insertNonceToDnl (DeadNonceList &dnl, const pit::Entry &pitEntry, const pit::OutRecord &outRecord)
 
static const time::milliseconds STATUS_FRESHNESS (5000)
 
static ndn::util::NetworkMonitor * makeNetworkMonitor ()
 
static void ignoreRibAndLogSections (const std::string &filename, const std::string &sectionName, const ConfigSection &section, bool isDryRun)
 
void cleanupOnFaceRemoval (NameTree &nt, Fib &fib, Pit &pit, const Face &face)
 cleanup tables when a face is destroyed More...
 

Variables

static boost::thread_specific_ptr< boost::asio::io_service > g_ioService
 
static boost::thread_specific_ptr< boost::random::mt19937 > g_rng
 
static const std::string INTERNAL_CONFIG = "internal://nfd.conf"
 

Detailed Description

Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents, Colorado State University, University Pierre & Marie Curie, Sorbonne University, Washington University in St.

Copyright (c) 2014, Regents of the University of California, Arizona Board of Regents, Colorado State University, University Pierre & Marie Curie, Sorbonne University, Washington University in St.

Copyright (c) 2014 Regents of the University of California, Arizona Board of Regents, Colorado State University, University Pierre & Marie Curie, Sorbonne University, Washington University in St.

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/.

Louis, Beijing Institute of Technology

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/.

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/.

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/. This file declares the global random number generator All random numbers in NFD should use this global random number generator, so that the generator can be properly seeded when necessary.

This random number generator is not suitable for security purposes; security-critical code should use CryptoPP random number generator instead.

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/.

Todo:
#2542 plans to merge nfd-status with nfdc. FaceModule class should be changed as follows: (1) move into ndn::nfd::nfdc namespace (2) assuming command syntax is similar to Windows NT netsh , this class can handle command argument parsing as soon as 'face' sub-command is detected (3) introduce methods to create and destroy faces, and update face attributes
Todo:
#3444 aims at improving output texts of nfdc. Assuming it's worked with or after #2542: (1) introduce an style parameter on formatItemText method to specify desired text style, such as human friendly style vs. porcelain style for script consumption (2) upon successful command execute, convert the command result into FaceStatus type, and use formatItemText to render the result, so that output from status retrieval and command execution have consistent styles }

Typedef Documentation

typedef boost::property_tree::ptree nfd::ConfigSection

Definition at line 35 of file config-file.hpp.

typedef function<void(const ConfigSection& , bool , const std::string& )> nfd::ConfigSectionHandler

callback for config file sections

Definition at line 40 of file config-file.hpp.

typedef function<void(const shared_ptr<Face>& newFace)> nfd::FaceCreatedCallback

Prototype for the callback that is invoked when the face is created (as a response to incoming connection or after connection is established)

Definition at line 38 of file channel.hpp.

typedef function<void(uint32_t status, const std::string& reason)> nfd::FaceCreationFailedCallback

Prototype for the callback that is invoked when the face fails to be created.

Definition at line 44 of file channel.hpp.

typedef function<void(const std::string& , const std::string& , const ConfigSection& , bool )> nfd::UnknownConfigSectionHandler

callback for config file sections without a subscribed handler

Definition at line 46 of file config-file.hpp.

Enumeration Type Documentation

indicates a log level

Note
This type is internal. Logger should be accessed through NFD_LOG_* macros.
Enumerator
LOG_FATAL 
LOG_NONE 
LOG_ERROR 
LOG_WARN 
LOG_INFO 
LOG_DEBUG 
LOG_TRACE 
LOG_ALL 

Definition at line 42 of file logger.hpp.

Function Documentation

void nfd::cleanupOnFaceRemoval ( NameTree &  nt,
Fib &  fib,
Pit &  pit,
const Face &  face 
)

cleanup tables when a face is destroyed

This function enumerates the NameTree, calls Fib::removeNextHop for each FIB entry, calls Pit::deleteInOutRecords for each PIT entry, and finally deletes any name tree entries that have become empty.

Note
It's a design choice to let Fib and Pit classes decide what to do with each entry. This function is only responsible for implementing the enumeration procedure. The benefit of having this function instead of doing the enumeration in Fib and Pit classes is to perform both FIB and PIT cleanups in one pass of NameTree enumeration, so as to reduce performance overhead.

Definition at line 31 of file cleanup.cpp.

static bool nfd::compare_InRecord_expiry ( const pit::InRecord a,
const pit::InRecord b 
)
inlinestatic

Definition at line 544 of file forwarder.cpp.

void nfd::connectFaceClosedSignal ( Face &  face,
const std::function< void()> &  f 
)

invokes a callback when the face is closed

Parameters
facethe face
fthe callback to be invoked when the face enters CLOSED state

This function connects a callback to the afterStateChange signal on the face, and invokes f when the state becomes CLOSED.

Definition at line 41 of file channel.cpp.

template<typename It , typename Pred >
It nfd::find_last_if ( It  first,
It  last,
Pred  p 
)

finds the last element satisfying a predicate

Template Parameters
ItBidirectionalIterator
PredUnaryPredicate
Returns
Iterator to the last element satisfying the condition, or last if no such element is found.

Complexity: at most last-first invocations of p

Definition at line 49 of file algorithm.hpp.

template<typename E >
std::string nfd::getExtendedErrorMessage ( const E &  exception)

Definition at line 36 of file extended-error-message.hpp.

boost::asio::io_service & nfd::getGlobalIoService ( )
Returns
the global io_service instance

Definition at line 41 of file global-io.cpp.

boost::random::mt19937 & nfd::getGlobalRng ( )
Returns
the global random number generator instance

Definition at line 34 of file random.cpp.

static void nfd::ignoreRibAndLogSections ( const std::string &  filename,
const std::string &  sectionName,
const ConfigSection section,
bool  isDryRun 
)
inlinestatic

Definition at line 124 of file nfd.cpp.

static void nfd::insertNonceToDnl ( DeadNonceList dnl,
const pit::Entry pitEntry,
const pit::OutRecord outRecord 
)
inlinestatic

Definition at line 585 of file forwarder.cpp.

std::vector< NetworkInterfaceInfo > nfd::listNetworkInterfaces ( )

List configured network interfaces on the system and their info.

Warning
invalid IP addresses (e.g., 0.0.0.0) may be returned in some environments

Definition at line 73 of file network-interface.cpp.

static ndn::util::NetworkMonitor* nfd::makeNetworkMonitor ( )
inlinestatic

Definition at line 49 of file nfd.cpp.

std::ostream & nfd::operator<< ( std::ostream &  os,
const LoggerTimestamp  
)

write a timestamp to os

Note
This function is thread-safe.

Definition at line 46 of file logger.cpp.

std::ostream & nfd::operator<< ( std::ostream &  os,
const Network network 
)

Definition at line 58 of file network.cpp.

std::ostream& nfd::operator<< ( std::ostream &  output,
const Logger logger 
)
inline

Definition at line 96 of file logger.hpp.

std::istream & nfd::operator>> ( std::istream &  is,
Network network 
)

Definition at line 65 of file network.cpp.

void nfd::resetGlobalIoService ( )

Definition at line 50 of file global-io.cpp.

void nfd::resetGlobalRng ( )

Definition at line 43 of file random.cpp.

static const time::milliseconds nfd::STATUS_FRESHNESS ( 5000  )
static

Variable Documentation

boost::thread_specific_ptr<boost::asio::io_service> nfd::g_ioService
static

Definition at line 38 of file global-io.cpp.

boost::thread_specific_ptr<boost::random::mt19937> nfd::g_rng
static

Definition at line 31 of file random.cpp.

const std::string nfd::INTERNAL_CONFIG = "internal://nfd.conf"
static

Definition at line 46 of file nfd.cpp.