class CliNode

The class for the CLI node. More...

Definition#include <cli_node.hh>
InheritsProtoNode (libproto) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods


Detailed Description

There should one node per CLI instance. There should be one CLI instance per router.

 CliNode (int init_family, x_module_id init_module_id, EventLoop& init_event_loop)

CliNode

Constructor for a given address family, module ID, and event loop.

Parameters:
init_familythe address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). Note that this argument may disappear in the future, and a single Cli node would provide access for both IPv4 and IPv6.
init_module_idthe module ID (x_module_id). Should be equal to X_MODULE_CLI.
init_event_loopthe event loop to use.

 ~CliNode ()

~CliNode

[virtual]

Destructor

int  start ()

start

Start the node operation.

Returns: XORP_OK on success, otherwise XORP_ERROR.

Reimplemented from ProtoNode.

int  stop ()

stop

Stop the node operation.

Returns: XORP_OK on success, otherwise XORP_ERROR.

Reimplemented from ProtoNode.

void  set_cli_port (unsigned short v)

set_cli_port

Set the CLI access port.

The access port is the TCP port the CLI node listens to for network access (e.g., telnet xorp_host <port_number>).

Parameters:
vthe access port number (in host order).

void  add_enable_cli_access_from_subnet (const IPvXNet& subnet_addr)

add_enable_cli_access_from_subnet

Add a subnet address to the list of subnet addresses enabled for CLI access.

This method can be called more than once to add a number of subnet addresses.

Parameters:
subnet_addrthe subnet address to add.

int  delete_enable_cli_access_from_subnet (const IPvXNet& subnet_addr)

delete_enable_cli_access_from_subnet

Delete a subnet address from the list of subnet addresses enabled for CLI access.

Parameters:
subnet_addrthe subnet address to delete.

Returns: XORP_OK on success, otherwise XORP_ERROR (e.g., if the subnet address was not added before).

void  add_disable_cli_access_from_subnet (const IPvXNet& subnet_addr)

add_disable_cli_access_from_subnet

Add a subnet address to the list of subnet addresses disabled for CLI access.

This method can be called more than once to add a number of subnet addresses.

Parameters:
subnet_addrthe subnet address to add.

int  delete_disable_cli_access_from_subnet (const IPvXNet& subnet_addr)

delete_disable_cli_access_from_subnet

Delete a subnet address from the list of subnet addresses disabled for CLI access.

Parameters:
subnet_addrthe subnet address to delete.

Returns: XORP_OK on success, otherwise XORP_ERROR (e.g., if the subnet address was not added before).

CliCommandcli_command_root ()

cli_command_root

Get the CliCommand entry for the CLI root command.

Returns: a pointer to the CliCommand entry for the CLI root command.

int  xlog_output (void *obj, const char *msg)

xlog_output

[static]

Output a log message to a CliClient object.

Parameters:
objthe CliClient object to apply this method to.
msga C-style string with the message to output.

Returns: on success, the number of characters printed, otherwise %XORP_ERROR.

CliClientfind_cli_by_term_name (const char *term_name)

find_cli_by_term_name

[const]

Find a CLI client CliClient for a given terminal name.

Parameters:
term_nameC-style string with the CLI terminal name to search for.

Returns: the CLI client CliClient with name of term_name on success, otherwise NULL.

CliClientfind_cli_by_session_id (uint32_t session_id)

find_cli_by_session_id

[const]

Find a CLI client CliClient for a given session ID.

Parameters:
session_idthe CLI session ID to search for.

Returns: the CLI client CliClient with session ID of session_id on success, otherwise NULL.

list<CliClient *>&  client_list ()

client_list

Get the list of CLI clients (see CliClient).

Returns: a reference to the list of pointers to CLI clients (see CliClient).

void  add_cli_command ( const string& processor_name, const string& command_name, const string& command_help, const bool& is_command_cd, const string& command_cd_prompt, const bool& is_command_processor, bool& fail, string& reason)

add_cli_command

Add a CLI command to the CLI manager.

Parameters:
processor_namethe name of the module that will process that command.
command_namethe name of the command to add.
command_helpthe help for the command to add.
is_command_cdif true, this is a command that allows "change directory" inside the CLI command-tree.
command_cd_promptif is_command_cd is true, the string that will replace the CLI prompt after we "cd" to that level of the CLI command-tree.
is_command_processorif true, this is a processing command that would be performed by @processor_name.
failtrue if failure has occured.
reasoncontains failure reason if it occured.

void  recv_process_command_output (const string *processor_name, const string *cli_term_name, const uint32_t *cli_session_id, const string *command_output)

recv_process_command_output

Process the response of a command processed by a remote node.

Parameters:
processor_namethe name of the module that has processed that command.
cli_term_namethe terminal name the command was entered from.
cli_session_idthe CLI session ID the command was entered from.
command_outputthe command output to process.

int  proto_recv (const string& , x_module_id , uint16_t , const IPvX& , const IPvX& , int , int , bool , const uint8_t * , size_t )

proto_recv

UNUSED

Reimplemented from ProtoNode.

int  proto_send (const string& , x_module_id , uint16_t , const IPvX& , const IPvX& , int , int , bool , const uint8_t * , size_t )

proto_send

UNUSED

Reimplemented from ProtoNode.

int  signal_message_recv (const string& , x_module_id , int , uint16_t , const IPvX& , const IPvX& , const uint8_t * , size_t )

signal_message_recv

UNUSED

Reimplemented from ProtoNode.

int  signal_message_send (const string& , x_module_id , int , uint16_t , const IPvX& , const IPvX& , const uint8_t * , size_t )

signal_message_send

UNUSED

Reimplemented from ProtoNode.

typedef XorpCallback6<void, const char*, const string&, const string&, uint32_t, const string&, const string& >::RefPtr SenderProcessCallback

SenderProcessCallback

void  set_send_process_command_callback (const SenderProcessCallback& v)

set_send_process_command_callback

Set a callback to send a CLI command to a processing module.

Parameters:
vthe SenderProcessCallback callback to set.

CliClientenable_stdio_access ()

enable_stdio_access

Add a CLI client (CliClient) to the CLI with enabled stdio access.

Returns: a pointer to the CLI client (CliClient) with enabled stdio access on success, otherwise NULL.

typedef XorpCallback1<void, CliClient* >::RefPtr CliClientDeleteCallback

CliClientDeleteCallback

void  set_cli_client_delete_callback (const CliClientDeleteCallback& v)

set_cli_client_delete_callback

Set the callback method that is invoked whenever a CliClient is deleted

Parameters:
vthe CliClientDeleteCallback callback to set.


Generated by: pavlin on possum.icir.org on Mon Mar 10 19:34:52 2003, using kdoc 2.0a54+XORP.