|
|
ProtoNodeCli (int init_family, xorp_module_id init_module_id)
| ProtoNodeCli |
Constructor for a given address family and module ID.
Parameters:
init_family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
init_module_id | the module ID XORP_MODULE_* (xorp_module_id). |
~ProtoNodeCli ()
| ~ProtoNodeCli |
[virtual]
int add_cli_dir_command (const char *dir_command_name,
const char *dir_command_help)
| add_cli_dir_command |
Add a CLI directory level that does not allow user to move to it.
The added directory level does not allow an user to move to it (i.e., user cannot "cd" to that directory level).
Parameters:
dir_command_name | the directory name to add. |
dir_command_help | the help message for the directory. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_cli_dir_command (const char *dir_command_name,
const char *dir_command_help,
bool is_allow_cd,
const char *dir_cd_prompt)
| add_cli_dir_command |
Add a CLI directory level that may allow user to move to it.
The added directory level may allow an user to move to it (i.e., user can type the directory name to "cd" to that directory level).
Parameters:
dir_command_name | the directory name to add. |
dir_command_help | the help message for the directory. |
is_allow_cd | if true, allow user to "cd" to that directory. |
dir_cd_prompt | if user can "cd" to that directory, the prompt to appear after the "cd". |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_cli_command (const char *command_name,
const char *command_help,
const CLIProcessCallback& cli_process_callback)
| add_cli_command |
Add a CLI command.
Parameters:
command_name | the command name to add. |
command_help | the command help. |
cli_process_callback | the callback function that will be called when this command is executed. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_cli_command (const char *command_name)
| delete_cli_command |
Delete a CLI command.
Parameters:
command_name | the command name to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_all_cli_commands ()
| delete_all_cli_commands |
Delete all CLI commands that were added by this node.
Returns: XORP_OK on success, otherwise XORP_ERROR.
int cli_process_command (const string& processor_name,
const string& cli_term_name,
const uint32_t& cli_session_id,
const string& command_name,
const string& command_args,
string& ret_processor_name,
string& ret_cli_term_name,
uint32_t& ret_cli_session_id,
string& ret_command_output)
| cli_process_command |
Process a CLI command.
This method is invoked when the CLI has detected a valid command has been entered, and that command has been installed by this node.
Parameters:
processor_name | the processor name for this command. |
cli_term_name | the terminal name the command was entered from. |
cli_session_id | the CLI session ID the command was entered from. |
command_name | the command name to process. |
command_args | the command arguments to process. |
ret_processor_name | the processor name to return back to the CLI. |
ret_cli_term_name | the terminal name to return back. |
ret_cli_session_id | the CLI session ID to return back. |
ret_command_output | the command output to return back. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int cli_print (const string& msg)
| cli_print |
Print a message to the CLI interface.
Parameters:
msg | the message string to display. |
Returns: the number of characters printed (not including the trailing '\0').
int add_cli_command_to_cli_manager (const char *command_name,
const char *command_help,
bool is_command_cd,
const char *command_cd_prompt,
bool is_command_processor)
| add_cli_command_to_cli_manager |
[pure virtual]
Add a CLI command to the CLI manager.
This is a pure virtual function, and it must be implemented by the particular protocol node class that inherits this base class.
Parameters:
command_name | the command name to add. |
command_help | the help message for the command. |
is_command_cd | if true, this is a directory level that allows user to "cd" to that directory. |
command_cd_prompt | if this is a directory user can "cd" to it, the prompt to appear after the "cd". |
is_command_processor | if true, this is an oridinary command that can be invoked for processing rather than a directory level. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_cli_command_from_cli_manager (const char *command_name)
| delete_cli_command_from_cli_manager |
[pure virtual]
Delete a CLI command from the CLI manager.
This is a pure virtual function, and it must be implemented by the particular protocol node class that inherits this base class.
Parameters:
command_name | the command name to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.