Namespaces | |
| text | |
| xml | |
Classes | |
| class | ChannelModule |
| Provides access to NFD channel dataset. More... | |
| class | CommandArguments |
| Contains named command arguments. More... | |
| class | CommandDefinition |
| Defines 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 &)> |
| A function to execute a command. More... | |
Enumerations | |
| enum class | ArgValueType { NONE , ANY , BOOLEAN , UNSIGNED , STRING , REPORT_FORMAT , NAME , FACE_URI , FACE_ID_OR_URI , FACE_PERSISTENCY , ROUTE_ORIGIN } |
| Indicates argument value type. 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 class | ParseMode : uint8_t { ONE_SHOT = AVAILABLE_IN_ONE_SHOT , BATCH = AVAILABLE_IN_BATCH } |
| Indicates which mode is the parser operated in. More... | |
| enum class | Positional { NO = false , YES = true } |
| Indicates whether an argument can be specified as positional. More... | |
| enum class | ReportFormat { XML = 1 , TEXT = 2 } |
| enum class | Required { NO = false , YES = true } |
| Indicates whether an argument is required. More... | |
Functions | |
| static auto | calculateUptime (const ForwarderStatus &status) |
| std::pair< std::optional< FaceUri >, std::string > | canonize (ExecuteContext &ctx, const FaceUri &uri) |
| Canonize a 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, std::string_view 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, ParseMode mode) |
| std::ostream & | operator<< (std::ostream &os, ReportFormat fmt) |
| static bool | parseBoolean (const std::string &s) |
| static FacePersistency | parseFacePersistency (const std::string &s) |
| static 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 | |
| constexpr int | LIST_COMMAND_NAME_COLUMN_WIDTH = 16 |
| using nfd::tools::nfdc::ExecuteCommand = typedef std::function<void(ExecuteContext&)> |
A function to execute a command.
Definition at line 90 of file execute-command.hpp.
|
strong |
Indicates argument value type.
| Enumerator | |
|---|---|
| NONE | Boolean argument without value. The argument appears in CommandArguments as bool value |
| 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 40 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 39 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 52 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 123 of file command-definition.hpp.
|
strong |
| Enumerator | |
|---|---|
| XML | |
| TEXT | |
Definition at line 38 of file status-report.hpp.
|
strong |
Indicates whether an argument is required.
| Enumerator | |
|---|---|
| NO | argument is optional |
| YES | argument is required |
Definition at line 116 of file command-definition.hpp.
|
static |
Definition at line 49 of file forwarder-general-module.cpp.
| std::pair< std::optional< FaceUri >, std::string > nfd::tools::nfdc::canonize | ( | ExecuteContext & | ctx, |
| const FaceUri & | uri | ||
| ) |
Canonize a FaceUri.
Definition at line 182 of file face-helpers.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 | The FaceUri |
| error | The error string returned by the canonization process |
| field | An optional field identifier to include with the message |
Definition at line 196 of file face-helpers.cpp.
|
static |
Definition at line 70 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, |
||
| std::string_view | 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 39 of file command-definition.cpp.
| std::ostream & nfd::tools::nfdc::operator<< | ( | std::ostream & | os, |
| AvailableIn | modes | ||
| ) |
Definition at line 44 of file command-parser.cpp.
| std::ostream & nfd::tools::nfdc::operator<< | ( | std::ostream & | os, |
| ParseMode | mode | ||
| ) |
Definition at line 64 of file command-parser.cpp.
| std::ostream & nfd::tools::nfdc::operator<< | ( | std::ostream & | os, |
| ReportFormat | fmt | ||
| ) |
Definition at line 31 of file status-report.cpp.
|
static |
Definition at line 223 of file command-definition.cpp.
|
static |
Definition at line 247 of file command-definition.cpp.
|
static |
Definition at line 235 of file command-definition.cpp.
|
static |
Order persistency in NONE < ON_DEMAND < PERSISTENCY < PERMANENT.
Definition at line 139 of file face-module.cpp.
| void nfd::tools::nfdc::registerCommands | ( | CommandParser & | parser | ) |
Definition at line 136 of file command-parser.cpp.
| void nfd::tools::nfdc::registerStatusCommands | ( | CommandParser & | parser | ) |
Registers status commands.
Providing the following commands:
Definition at line 118 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 40 of file status.cpp.
|
static |
The 'status report' command.
Definition at line 108 of file status.cpp.
|
static |
Single-section status command.
Definition at line 98 of file status.cpp.