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... | |
class | CsModule |
provides access to NFD CS management More... | |
class | ExecuteContext |
context for command execution More... | |
class | FaceModule |
provides access to NFD face management More... | |
class | FibModule |
provides access to NFD FIB management More... | |
class | FindFace |
procedure to find a face More... | |
class | ForwarderGeneralModule |
provides access to NFD forwarder general status More... | |
class | Module |
provides access to an NFD management module 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 | |
using | ExecuteCommand = std::function< void(ExecuteContext &ctx)> |
a function to execute a command More... | |
Functions | |
static time::system_clock::Duration | calculateUptime (const ForwarderStatus &status) |
std::pair< optional< FaceUri >, std::string > | canonize (ExecuteContext &ctx, const FaceUri &uri) |
canonize FaceUri More... | |
std::pair< FindFace::Code, std::string > | canonizeErrorHelper (const FaceUri &uri, const std::string &error, const std::string &field="") |
helper to generate exit code and error message for face canonization failures More... | |
static std::string | getMetavarFromType (ArgValueType vt) |
int | help (std::ostream &os, const CommandParser &parser, std::vector< std::string > args) |
tries to help the user, if requested on the command line More... | |
static void | helpCommand (const std::string &noun, const std::string &verb) |
void | helpList (std::ostream &os, const CommandParser &parser, ParseMode mode=ParseMode::ONE_SHOT, const std::string &noun="") |
writes the list of available commands to a stream More... | |
static int | main (int argc, char **argv) |
NDN_LOG_INIT (nfdc.CommandDefinition) | |
std::ostream & | operator<< (std::ostream &os, ArgValueType vt) |
std::ostream & | operator<< (std::ostream &os, AvailableIn modes) |
std::ostream & | operator<< (std::ostream &os, ReportFormat fmt) |
std::ostream & | operator<< (std::ostream &os, ParseMode mode) |
static bool | parseBoolean (const std::string &s) |
static FacePersistency | parseFacePersistency (const std::string &s) |
ReportFormat | parseReportFormat (const std::string &s) |
static bool | persistencyLessThan (FacePersistency x, FacePersistency y) |
order persistency in NONE < ON_DEMAND < PERSISTENCY < PERMANENT More... | |
void | registerCommands (CommandParser &parser) |
void | registerStatusCommands (CommandParser &parser) |
registers status commands More... | |
void | reportStatus (ExecuteContext &ctx, const StatusReportOptions &options) |
collect a status report and write to stdout More... | |
static void | reportStatusComprehensive (ExecuteContext &ctx) |
the 'status report' command More... | |
static void | reportStatusSingleSection (ExecuteContext &ctx, bool StatusReportOptions::*wantSection) |
single-section status command More... | |
Variables | |
const int | LIST_COMMAND_NAME_COLUMN_WIDTH = 16 |
using nfd::tools::nfdc::ExecuteCommand = typedef std::function<void(ExecuteContext& ctx)> |
a function to execute a command
Definition at line 91 of file execute-command.hpp.
|
strong |
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. |
BOOLEAN | boolean The argument appears in CommandArguments as bool. |
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::FaceUri. |
FACE_ID_OR_URI | FaceId or FaceUri. The argument appears in CommandArguments as either uint64_t or ndn::FaceUri. |
FACE_PERSISTENCY | face persistency 'persistent' or 'permanent' The argument appears in CommandArguments as ndn::nfd::FacePersistency. |
ROUTE_ORIGIN | route origin The argument appears in CommandArguments as ndn::nfd::RouteOrigin. |
Definition at line 37 of file command-definition.hpp.
enum nfd::tools::nfdc::AvailableIn : uint8_t |
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 40 of file command-parser.hpp.
|
strong |
indicates which mode is the parser operated in
Enumerator | |
---|---|
ONE_SHOT | one-shot mode |
BATCH | batch mode |
Definition at line 53 of file command-parser.hpp.
|
strong |
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 120 of file command-definition.hpp.
|
strong |
Enumerator | |
---|---|
XML | |
TEXT |
Definition at line 42 of file status-report.hpp.
|
strong |
indicates whether an argument is required
Enumerator | |
---|---|
NO | argument is optional |
YES | argument is required |
Definition at line 113 of file command-definition.hpp.
|
static |
Definition at line 50 of file forwarder-general-module.cpp.
std::pair< optional< FaceUri >, std::string > nfd::tools::nfdc::canonize | ( | ExecuteContext & | ctx, |
const FaceUri & | uri | ||
) |
canonize FaceUri
Definition at line 33 of file canonizer.cpp.
std::pair< FindFace::Code, std::string > nfd::tools::nfdc::canonizeErrorHelper | ( | const FaceUri & | uri, |
const std::string & | error, | ||
const std::string & | field = "" |
||
) |
helper to generate exit code and error message for face canonization failures
uri | FaceUri |
error | error string returned by canonization process |
field | optional field identifier to include with message |
Definition at line 47 of file canonizer.cpp.
|
static |
Definition at line 67 of file command-definition.cpp.
int nfd::tools::nfdc::help | ( | std::ostream & | os, |
const CommandParser & | parser, | ||
std::vector< std::string > | args | ||
) |
tries to help the user, if requested on the command line
Depending on the provided command line arguments args
, this function can either open the man page for a specific command, or list all commands available in parser
. In the former case, this function never returns if successful.
0 | a list of available commands was successfully written to os |
1 | help was requested, but an error was encountered while exec'ing the man binary |
2 | help was not provided because args did not contain any help-related options |
|
static |
void nfd::tools::nfdc::helpList | ( | std::ostream & | os, |
const CommandParser & | parser, | ||
ParseMode | mode = ParseMode::ONE_SHOT , |
||
const std::string & | noun = "" |
||
) |
writes the list of available commands to a stream
os | the output stream to write the list to |
parser | instance of CommandParser containing the commands to list |
mode | only the commands available in this mode are listed |
noun | if not empty, only the commands starting with this noun are listed |
|
static |
nfd::tools::nfdc::NDN_LOG_INIT | ( | nfdc. | CommandDefinition | ) |
std::ostream & nfd::tools::nfdc::operator<< | ( | std::ostream & | os, |
ArgValueType | vt | ||
) |
Definition at line 37 of file command-definition.cpp.
std::ostream & nfd::tools::nfdc::operator<< | ( | std::ostream & | os, |
AvailableIn | modes | ||
) |
Definition at line 42 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 62 of file command-parser.cpp.
|
static |
Definition at line 220 of file command-definition.cpp.
|
static |
Definition at line 232 of file command-definition.cpp.
ReportFormat nfd::tools::nfdc::parseReportFormat | ( | const std::string & | s | ) |
Definition at line 34 of file status-report.cpp.
|
static |
order persistency in NONE < ON_DEMAND < PERSISTENCY < PERMANENT
Definition at line 138 of file face-module.cpp.
void nfd::tools::nfdc::registerCommands | ( | CommandParser & | parser | ) |
Definition at line 38 of file available-commands.cpp.
void nfd::tools::nfdc::registerStatusCommands | ( | CommandParser & | parser | ) |
registers status commands
Providing the following commands:
Definition at line 120 of file status.cpp.
void nfd::tools::nfdc::reportStatus | ( | ExecuteContext & | ctx, |
const StatusReportOptions & | options | ||
) |
collect a status report and write to stdout
Definition at line 42 of file status.cpp.
|
static |
the 'status report' command
Definition at line 110 of file status.cpp.
|
static |
single-section status command
Definition at line 100 of file status.cpp.