class ProtoNodeCli

Base class for Protocol node CLI access. More...

Contains pure virtuals
Definition#include <proto_node_cli.hh>
InheritsProtoUnit [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

 ProtoNodeCli (int init_family, xorp_module_id init_module_id)

ProtoNodeCli

Constructor for a given address family and module ID.

Parameters:
init_familythe address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively).
init_module_idthe module ID XORP_MODULE_* (xorp_module_id).

 ~ProtoNodeCli ()

~ProtoNodeCli

[virtual]

Destructor

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_namethe directory name to add.
dir_command_helpthe 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_namethe directory name to add.
dir_command_helpthe help message for the directory.
is_allow_cdif true, allow user to "cd" to that directory.
dir_cd_promptif 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_namethe command name to add.
command_helpthe command help.
cli_process_callbackthe 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_namethe 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_namethe processor name for this command.
cli_term_namethe terminal name the command was entered from.
cli_session_idthe CLI session ID the command was entered from.
command_namethe command name to process.
command_argsthe command arguments to process.
ret_processor_namethe processor name to return back to the CLI.
ret_cli_term_namethe terminal name to return back.
ret_cli_session_idthe CLI session ID to return back.
ret_command_outputthe 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:
msgthe 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_namethe command name to add.
command_helpthe help message for the command.
is_command_cdif true, this is a directory level that allows user to "cd" to that directory.
command_cd_promptif this is a directory user can "cd" to it, the prompt to appear after the "cd".
is_command_processorif 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_namethe command name to delete.

Returns: XORP_OK on success, otherwise XORP_ERROR.


Generated by: pavlin on possum.icir.org on Mon Jun 9 13:23:51 2003, using kdoc 2.0a54+XORP.