xorp

XrlRtrmgrInterface Class Reference

Inheritance diagram for XrlRtrmgrInterface:
XrlRtrmgrTargetBase

List of all members.

Public Member Functions

 XrlRtrmgrInterface (XrlRouter &r, UserDB &db, EventLoop &eventloop, RandomGen &randgen, Rtrmgr &rtrmgr)
void set_master_config_tree (MasterConfigTree *v)
XrlCmdError common_0_1_get_target_name (string &name)
 Pure-virtual function that needs to be implemented to:
XrlCmdError common_0_1_get_version (string &version)
 Pure-virtual function that needs to be implemented to:
XrlCmdError common_0_1_get_status (uint32_t &status, string &reason)
 Get status from Xrl Target.
XrlCmdError common_0_1_shutdown ()
 Request clean shutdown.
XrlCmdError common_0_1_startup ()
 Pure-virtual function that needs to be implemented to:
XrlCmdError rtrmgr_0_1_get_pid (uint32_t &pid)
XrlCmdError rtrmgr_0_1_register_client (const uint32_t &user_id, const string &clientname, string &filename, uint32_t &pid, uint32_t &clientid)
 Pure-virtual function that needs to be implemented to:
XrlCmdError rtrmgr_0_1_unregister_client (const string &token)
XrlCmdError rtrmgr_0_1_authenticate_client (const uint32_t &user_id, const string &clientname, const string &token)
XrlCmdError rtrmgr_0_1_enter_config_mode (const string &token, const bool &exclusive)
XrlCmdError rtrmgr_0_1_leave_config_mode (const string &token)
XrlCmdError rtrmgr_0_1_get_config_users (const string &token, XrlAtomList &users)
XrlCmdError rtrmgr_0_1_get_running_config (const string &token, bool &ready, string &config)
 This interface is deprecated as the main way for xorpsh to get the running config from the router manager.
XrlCmdError rtrmgr_0_1_apply_config_change (const string &token, const string &target, const string &deltas, const string &deletions)
void apply_config_change_done (bool success, string error_msg, string deltas, string deletions, uid_t user_id, string target)
void config_saved_done_cb (const XrlError &)
void apply_config_change_done_cb (const XrlError &)
void client_updated (const XrlError &e, uid_t user_id, UserInstance *user)
void module_status_changed (const string &modname, GenericModule::ModuleStatus status)
XrlCmdError rtrmgr_0_1_lock_config (const string &token, const uint32_t &timeout, bool &success, uint32_t &holder)
XrlCmdError rtrmgr_0_1_unlock_config (const string &token)
XrlCmdError rtrmgr_0_1_lock_node (const string &token, const string &node, const uint32_t &timeout, bool &success, uint32_t &holder)
XrlCmdError rtrmgr_0_1_unlock_node (const string &token, const string &node)
XrlCmdError rtrmgr_0_1_save_config (const string &token, const string &target, const string &filename)
XrlCmdError rtrmgr_0_1_load_config (const string &token, const string &target, const string &filename)
XrlCmdError rtrmgr_0_1_set_config_directory (const string &config_directory)
 Set the name of the directory with the configuration files.
XrlCmdError finder_event_observer_0_1_xrl_target_birth (const string &target_class, const string &target_instance)
 Pure-virtual function that needs to be implemented to:
XrlCmdError finder_event_observer_0_1_xrl_target_death (const string &target_class, const string &target_instance)
 Pure-virtual function that needs to be implemented to:
void finder_register_done (const XrlError &e, string clientname)

Private Types

typedef XorpCallback2< void,
bool, string >::RefPtr 
CallBack
typedef XorpCallback4< void,
bool, string, string, string >
::RefPtr 
ConfigChangeCallBack
typedef XorpCallback2< void,
bool, string >::RefPtr 
ConfigSaveCallBack
typedef XorpCallback4< void,
bool, string, string, string >
::RefPtr 
ConfigLoadCallBack
typedef XorpCallback1< void,
const XrlError & >::RefPtr 
GENERIC_CALLBACK

Private Member Functions

void save_config_done (bool success, string error_msg, string filename, uid_t user_id, string target)
void load_config_done (bool success, string error_msg, string deltas, string deletions, string filename, uid_t user_id, string target)
UserInstancefind_user_instance (uid_t user_id, const string &clientname)
string generate_auth_token (uid_t user_id, const string &clientname)
bool verify_token (const string &token) const
uid_t get_user_id_from_token (const string &token) const
void lock_timeout ()
void initialize_client_state (uid_t user_id, UserInstance *user)
void send_client_state (uid_t user_id, string clientname)
uint32_t allocate_clientid ()
void deallocate_clientid (uint32_t clientid)

Private Attributes

XrlRouter_xrl_router
XrlRtrmgrClientV0p2Client _client_interface
XrlFinderEventNotifierV0p1Client _finder_notifier_interface
multimap< uid_t, UserInstance * > _users
multimap< uid_t, UserInstance * > _config_users
set< uint32_t > _clientids
UserDB_userdb
MasterConfigTree_master_config_tree
EventLoop_eventloop
RandomGen_randgen
Rtrmgr_rtrmgr
bool _exclusive
string _exclusive_username
bool _config_locked
string _lock_holder_token
XorpTimer _lock_timer
list< XorpTimer_background_tasks
bool _verbose

Member Function Documentation

XrlCmdError XrlRtrmgrInterface::common_0_1_get_target_name ( string &  name) [virtual]

Pure-virtual function that needs to be implemented to:

Get name of Xrl Target

Implements XrlRtrmgrTargetBase.

XrlCmdError XrlRtrmgrInterface::common_0_1_get_version ( string &  version) [virtual]

Pure-virtual function that needs to be implemented to:

Get version string from Xrl Target

Implements XrlRtrmgrTargetBase.

XrlCmdError XrlRtrmgrInterface::common_0_1_startup ( ) [inline, virtual]

Pure-virtual function that needs to be implemented to:

Request a startup of Xrl Target

Implements XrlRtrmgrTargetBase.

XrlCmdError XrlRtrmgrInterface::finder_event_observer_0_1_xrl_target_birth ( const string &  target_class,
const string &  target_instance 
) [virtual]

Pure-virtual function that needs to be implemented to:

Announce target birth to observer.

Parameters:
target_classthe target class name.
target_instancethe target instance name.

Implements XrlRtrmgrTargetBase.

XrlCmdError XrlRtrmgrInterface::finder_event_observer_0_1_xrl_target_death ( const string &  target_class,
const string &  target_instance 
) [virtual]

Pure-virtual function that needs to be implemented to:

Announce target death to observer.

Parameters:
target_classthe target class name.
target_instancethe target instance name.

Implements XrlRtrmgrTargetBase.

XrlCmdError XrlRtrmgrInterface::rtrmgr_0_1_get_running_config ( const string &  token,
bool &  ready,
string &  config 
) [virtual]

This interface is deprecated as the main way for xorpsh to get the running config from the router manager.

It is retained for debugging purposes. xorpsh now gets its config automatically immediatedly after registering which removes a potential timing hole where the client could be told about a change to the config before it has asked what the current config is.

Implements XrlRtrmgrTargetBase.

XrlCmdError XrlRtrmgrInterface::rtrmgr_0_1_register_client ( const uint32_t &  userid,
const string &  clientname,
string &  filename,
uint32_t &  pid,
uint32_t &  clientid 
) [virtual]

Pure-virtual function that needs to be implemented to:

Register a user and client process with the rtrmgr.

Parameters:
clientnamename of xrl entity supporting rtrmgr_client.xif methods.

Implements XrlRtrmgrTargetBase.

XrlCmdError XrlRtrmgrInterface::rtrmgr_0_1_set_config_directory ( const string &  config_directory) [virtual]

Set the name of the directory with the configuration files.

Parameters:
config_directorythe name of the directory with the configuration files.

Implements XrlRtrmgrTargetBase.


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