nfd::tools::nfdc Namespace Reference

Namespaces

 text
 
 xml
 

Classes

class  ChannelModule
 provides access to NFD channel dataset More...
 
class  CommandArguments
 contains named command arguments More...
 
class  CommandDefinition
 declares semantics of a command More...
 
class  CommandParser
 parses a command More...
 
struct  ExecuteContext
 context for command execution More...
 
class  FaceIdFetcher
 
class  FaceModule
 provides access to NFD face management More...
 
class  FibModule
 provides access to NFD FIB management More...
 
class  ForwarderGeneralModule
 provides access to NFD forwarder general status More...
 
class  LegacyNfdc
 
class  Module
 provides access to an NFD management module More...
 
class  NfdIdCollector
 a validator that can collect NFD's signing certificate name More...
 
class  RibModule
 provides access to NFD RIB management More...
 
class  StatusReport
 collects and prints NFD status report More...
 
struct  StatusReportOptions
 
class  StrategyChoiceModule
 provides access to NFD Strategy Choice management More...
 

Typedefs

typedef std::function< int(ExecuteContext &ctx)> ExecuteCommand
 a function to execute a command More...
 

Enumerations

enum  ArgValueType {
  ArgValueType::NONE, ArgValueType::ANY, ArgValueType::UNSIGNED, ArgValueType::STRING,
  ArgValueType::REPORT_FORMAT, ArgValueType::NAME, ArgValueType::FACE_URI, ArgValueType::FACE_ID_OR_URI,
  ArgValueType::FACE_PERSISTENCY
}
 indicates argument value type More...
 
enum  Required { Required::NO = false, Required::YES = true }
 indicates whether an argument is required More...
 
enum  Positional { Positional::NO = false, Positional::YES = true }
 indicates whether an argument can be specified as positional More...
 
enum  AvailableIn : uint8_t {
  AVAILABLE_IN_NONE = 0, AVAILABLE_IN_ONE_SHOT = 1 << 0, AVAILABLE_IN_BATCH = 1 << 1, AVAILABLE_IN_HELP = 1 << 7,
  AVAILABLE_IN_ALL = 0xff
}
 indicates which modes is a command allowed More...
 
enum  ParseMode : uint8_t { ParseMode::ONE_SHOT = AVAILABLE_IN_ONE_SHOT, ParseMode::BATCH = AVAILABLE_IN_BATCH }
 indicates which mode is the parser operated in More...
 
enum  ReportFormat { ReportFormat::XML = 1, ReportFormat::TEXT = 2 }
 

Functions

void registerCommands (CommandParser &parser)
 
 NDN_LOG_INIT (nfdc.CommandDefinition)
 
std::ostream & operator<< (std::ostream &os, ArgValueType vt)
 
static std::string getMetavarFromType (ArgValueType vt)
 
static ndn::nfd::FacePersistency parseFacePersistency (const std::string &s)
 
std::ostream & operator<< (std::ostream &os, AvailableIn modes)
 
std::ostream & operator<< (std::ostream &os, ParseMode mode)
 
static time::system_clock::Duration calculateUptime (const ForwarderStatus &status)
 
void helpList (std::ostream &os, const CommandParser &parser, ParseMode mode, const std::string &noun)
 
static int helpSingle (const std::string &noun, const std::string &verb)
 
int help (ExecuteContext &ctx, const CommandParser &parser, std::ostream &os)
 the 'help' command More...
 
void registerHelpCommand (CommandParser &parser)
 registers 'help' command More...
 
void legacyNfdcUsage ()
 
int legacyNfdcMain (ExecuteContext &ctx)
 
static void showUsage (std::ostream &os, const boost::program_options::options_description &cmdOptions)
 
static std::tuple< int, StatusReportOptionsparseCommandLine (const std::vector< std::string > &args)
 parse legacy nfd-status command line, and show usage if necessary More...
 
static int legacyNfdStatus (ExecuteContext &ctx)
 the 'legacy-nfd-status' command More...
 
void registerLegacyStatusCommand (CommandParser &parser)
 registers 'legacy-nfd-status' command More...
 
static int main (int argc, char **argv)
 
ReportFormat parseReportFormat (const std::string &s)
 
std::ostream & operator<< (std::ostream &os, ReportFormat fmt)
 
int reportStatus (ExecuteContext &ctx, const StatusReportOptions &options)
 collect a status report and write to stdout More...
 
static int reportStatusSingleSection (ExecuteContext &ctx, bool StatusReportOptions::*wantSection)
 single-section status command More...
 
static int reportStatusComprehensive (ExecuteContext &ctx)
 the 'status report' command More...
 
void registerStatusCommands (CommandParser &parser)
 registers status commands More...
 

Variables

const int LIST_COMMAND_NAME_COLUMN_WIDTH = 16
 

Typedef Documentation

typedef std::function<int(ExecuteContext& ctx)> nfd::tools::nfdc::ExecuteCommand

a function to execute a command

Returns
exit code

Definition at line 56 of file execute-command.hpp.

Enumeration Type Documentation

indicates argument value type

Enumerator
NONE 

boolean argument without value

The argument appears in CommandArguments as bool value 'true'. It must not be declared as positional.

ANY 

any arguments

The argument appears in CommandArguments as std::vector<std::string>. It must be declared as positional, and will consume all subsequent tokens.

UNSIGNED 

non-negative integer

The argument appears in CommandArguments as uint64_t. Acceptable input range is [0, std::numeric_limits<int64_t>::max()].

STRING 

arbitrary string

The argument appears in CommandArguments as std::string.

REPORT_FORMAT 

report format 'xml' or 'text'

The argument appears in CommandArguments as nfd::tools::nfdc::ReportFormat.

NAME 

Name prefix.

The argument appears in CommandArguments as ndn::Name.

FACE_URI 

FaceUri.

The argument appears in CommandArguments as ndn::util::FaceUri.

FACE_ID_OR_URI 

FaceId or FaceUri.

The argument appears in CommandArguments as either uint64_t or ndn::util::FaceUri.

FACE_PERSISTENCY 

face persistency 'persistent' or 'permanent'

The argument appears in CommandArguments as ndn::nfd::FacePersistency.

Definition at line 37 of file command-definition.hpp.

indicates which modes is a command allowed

Enumerator
AVAILABLE_IN_NONE 
AVAILABLE_IN_ONE_SHOT 

one-shot mode

AVAILABLE_IN_BATCH 

batch mode

AVAILABLE_IN_HELP 

visible in help listing

AVAILABLE_IN_ALL 

Definition at line 39 of file command-parser.hpp.

enum nfd::tools::nfdc::ParseMode : uint8_t
strong

indicates which mode is the parser operated in

Enumerator
ONE_SHOT 

one-shot mode

BATCH 

batch mode

Definition at line 52 of file command-parser.hpp.

indicates whether an argument can be specified as positional

Enumerator
NO 

argument must be named

YES 

argument can be specified as positional

Definition at line 108 of file command-definition.hpp.

Enumerator
XML 
TEXT 

Definition at line 39 of file status-report.hpp.

indicates whether an argument is required

Enumerator
NO 

argument is optional

YES 

argument is required

Definition at line 101 of file command-definition.hpp.

Function Documentation

static time::system_clock::Duration nfd::tools::nfdc::calculateUptime ( const ForwarderStatus &  status)
static

Definition at line 53 of file forwarder-general-module.cpp.

static std::string nfd::tools::nfdc::getMetavarFromType ( ArgValueType  vt)
static

Definition at line 65 of file command-definition.cpp.

int nfd::tools::nfdc::help ( ExecuteContext ctx,
const CommandParser parser,
std::ostream &  os 
)

the 'help' command

Definition at line 77 of file help.cpp.

void nfd::tools::nfdc::helpList ( std::ostream &  os,
const CommandParser parser,
ParseMode  mode,
const std::string &  noun 
)

Definition at line 40 of file help.cpp.

static int nfd::tools::nfdc::helpSingle ( const std::string &  noun,
const std::string &  verb 
)
static

Definition at line 67 of file help.cpp.

int nfd::tools::nfdc::legacyNfdcMain ( ExecuteContext ctx)

Definition at line 329 of file legacy-nfdc.cpp.

void nfd::tools::nfdc::legacyNfdcUsage ( )

Definition at line 290 of file legacy-nfdc.cpp.

static int nfd::tools::nfdc::legacyNfdStatus ( ExecuteContext ctx)
static

the 'legacy-nfd-status' command

Definition at line 100 of file legacy-status.cpp.

static int nfd::tools::nfdc::main ( int  argc,
char **  argv 
)
static

Definition at line 35 of file tools/nfdc/main.cpp.

nfd::tools::nfdc::NDN_LOG_INIT ( nfdc.  CommandDefinition)
std::ostream & nfd::tools::nfdc::operator<< ( std::ostream &  os,
ArgValueType  vt 
)

Definition at line 39 of file command-definition.cpp.

std::ostream & nfd::tools::nfdc::operator<< ( std::ostream &  os,
AvailableIn  modes 
)

Definition at line 41 of file command-parser.cpp.

std::ostream & nfd::tools::nfdc::operator<< ( std::ostream &  os,
ReportFormat  fmt 
)

Definition at line 46 of file status-report.cpp.

std::ostream & nfd::tools::nfdc::operator<< ( std::ostream &  os,
ParseMode  mode 
)

Definition at line 61 of file command-parser.cpp.

static std::tuple<int, StatusReportOptions> nfd::tools::nfdc::parseCommandLine ( const std::vector< std::string > &  args)
static

parse legacy nfd-status command line, and show usage if necessary

Returns
if first item is -1, caller should retrieve and display StatusReport; otherwise, caller should immediately exit with the specified exit code

Definition at line 48 of file legacy-status.cpp.

static ndn::nfd::FacePersistency nfd::tools::nfdc::parseFacePersistency ( const std::string &  s)
static

Definition at line 215 of file command-definition.cpp.

ReportFormat nfd::tools::nfdc::parseReportFormat ( const std::string &  s)

Definition at line 34 of file status-report.cpp.

void nfd::tools::nfdc::registerCommands ( CommandParser parser)

Definition at line 37 of file available-commands.cpp.

void nfd::tools::nfdc::registerHelpCommand ( CommandParser parser)

registers 'help' command

Definition at line 92 of file help.cpp.

void nfd::tools::nfdc::registerLegacyStatusCommand ( CommandParser parser)

registers 'legacy-nfd-status' command

Definition at line 115 of file legacy-status.cpp.

void nfd::tools::nfdc::registerStatusCommands ( CommandParser parser)

registers status commands

Providing the following commands:

  • status report
  • status show
  • face list
  • channel list
  • strategy list
  • fib list
  • route list

Definition at line 121 of file status.cpp.

int nfd::tools::nfdc::reportStatus ( ExecuteContext ctx,
const StatusReportOptions options 
)

collect a status report and write to stdout

Definition at line 41 of file status.cpp.

static int nfd::tools::nfdc::reportStatusComprehensive ( ExecuteContext ctx)
static

the 'status report' command

Definition at line 111 of file status.cpp.

static int nfd::tools::nfdc::reportStatusSingleSection ( ExecuteContext ctx,
bool StatusReportOptions::*  wantSection 
)
static

single-section status command

Definition at line 101 of file status.cpp.

static void nfd::tools::nfdc::showUsage ( std::ostream &  os,
const boost::program_options::options_description &  cmdOptions 
)
static

Definition at line 36 of file legacy-status.cpp.

Variable Documentation

const int nfd::tools::nfdc::LIST_COMMAND_NAME_COLUMN_WIDTH = 16

Definition at line 37 of file help.cpp.