xorp

RouterCLI Class Reference

Inheritance diagram for RouterCLI:
NONCOPYABLE

List of all members.

Public Types

typedef XorpCallback1< void,
const string & >::RefPtr 
OpModePrintCallback
typedef XorpCallback2< void,
bool, const string & >::RefPtr 
OpModeDoneCallback

Public Member Functions

 RouterCLI (XorpShellBase &xorpsh, CliNode &cli_node, XorpFd cli_client_input_fd, XorpFd cli_client_output_fd, bool verbose) throw (InitError)
bool done () const
bool is_config_mode () const
void clear_command_set ()
int configure_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
void enter_config_done (const XrlError &e)
void got_config_users (const XrlError &e, const XrlAtomList *users)
void new_config_user (uid_t user_id)
void leave_config_done (const XrlError &e)
void notify_user (const string &alert, bool urgent)
void config_changed_by_other_user ()
int op_help_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int conf_help_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int logout_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int exit_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int edit_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int extract_leaf_node_operator_and_value (const TemplateTreeNode &ttn, const vector< string > &argv, ConfigOperator &node_operator, string &value, string &error_msg)
map< string, CliCommandMatchtext_entry_children_func (const vector< string > &vector_path) const
int text_entry_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int delete_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int commit_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
void commit_done (bool success, string error_msg)
int show_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int op_mode_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
int save_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
void save_communicated (const XrlError &e)
void save_done (bool success, string error_msg)
int load_func (const string &, const string &, uint32_t, const vector< string > &command_global_name, const vector< string > &argv)
void load_communicated (const XrlError &e)
void load_done (bool success, string error_msg)
map< string, CliCommandMatchop_mode_help (const vector< string > &command_global_name) const
map< string, CliCommandMatchconfigure_mode_help (const vector< string > &command_global_name) const
void op_mode_cmd_print (const string &result)
 Callback: partial output generated by the operational command.
void op_mode_cmd_done (bool success, const string &error_msg)
 Callback: called when the operational command completes.
void op_mode_cmd_interrupt (const string &server_name, const string &cli_term_name, uint32_t cli_session_id, const vector< string > &command_global_name, const vector< string > &command_args)
 Callback: called when a user send an interrupt terminate the operational mode command if there is one running.
void op_mode_cmd_tidy ()
 Tidy up operational mode command.

Private Member Functions

CliClientcli_client () const
void reset_path ()
void set_path (string path)
void apply_path_change ()
int add_static_configure_mode_commands (string &error_msg)
void set_prompt (const string &line1, const string &line2)
void config_mode_prompt ()
void idle_ui ()
void reenable_ui ()
void silent_reenable_ui ()
string pathstr () const
string pathstr2 () const
void operational_mode ()
int add_op_mode_commands (CliCommand *root, string &error_msg)
void configure_mode ()
void text_entry_mode ()
void add_command_subtree (CliCommand &current_cli_node, const CommandTreeNode &current_ctn, const CLI_PROCESS_CALLBACK &cli_process_callback, vector< string > vector_path, size_t depth, bool can_pipe, bool include_allowed_values)
void add_text_entry_commands (CliCommand *com0)
void add_edit_subtree ()
void add_create_subtree ()
void add_delete_subtree ()
void add_set_subtree ()
void add_show_subtree ()
void display_config_mode_users () const
void display_alerts ()
bool check_for_rtrmgr_restart ()
void verify_rtrmgr_restart (const XrlError &e, const uint32_t *pid)
string get_help_o (const string &s) const
string get_help_c (const string &s) const
string makepath (const list< string > &parts) const
string makepath (const vector< string > &parts) const
const TemplateTreetemplate_tree () const
SlaveConfigTreeconfig_tree ()
const SlaveConfigTreeconfig_tree () const
OpCommandListop_cmd_list () const
uint32_t clientid () const
void add_allowed_values_and_ranges (const TemplateTreeNode *ttn, bool is_executable, bool can_pipe, map< string, CliCommandMatch > &children) const

Private Attributes

XorpShellBase_xorpsh
CliNode_cli_node
CliClient_cli_client_ptr
CliClient_removed_cli_client_ptr
bool _verbose
string _operational_mode_prompt
string _configuration_mode_prompt
CliModeType _mode
CliCommand_set_node
CliCommand_show_node
CliCommand_edit_node
CliCommand_create_node
CliCommand_delete_node
CliCommand_run_node
list< string > _path
list< uint32_t > _braces
list< uint32_t > _config_mode_users
list< string > _alerts
bool _changes_made
map< string, string > _help_o
map< string, string > _help_long_o
map< string, string > _help_c
map< string, string > _help_long_c
OpInstance_op_mode_cmd

Static Private Attributes

static const string DEFAULT_XORP_PROMPT_OPERATIONAL = "Xorp> "
static const string DEFAULT_XORP_PROMPT_CONFIGURATION = "XORP# "

Member Function Documentation

void RouterCLI::op_mode_cmd_done ( bool  success,
const string &  error_msg 
)

Callback: called when the operational command completes.

Parameters:
successtrue if the command suceeded
error_msgif the command failed the error message
void RouterCLI::op_mode_cmd_interrupt ( const string &  server_name,
const string &  cli_term_name,
uint32_t  cli_session_id,
const vector< string > &  command_global_name,
const vector< string > &  command_args 
)

Callback: called when a user send an interrupt terminate the operational mode command if there is one running.

Parameters:
server_namethe name of the server that returned the result.
cli_term_namethe name of the terminal that originated the command.
cli_session_idthe session ID of the terminal that originated the command.
command_global_namethe name of the command that is interrupted.
command_argsthe arguments to the command that is interrupted.
void RouterCLI::op_mode_cmd_print ( const string &  result)

Callback: partial output generated by the operational command.

Parameters:
resultpartial output
void RouterCLI::op_mode_cmd_tidy ( )

Tidy up operational mode command.

Can safely be called multiple times.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations