xorp

IfMgrXrlMirror Class Reference

Maintainer of a local mirror of central IfMgr configuration state via Xrls sent by the IfMgr. More...

#include <ifmgr_xrl_mirror.hh>

Inheritance diagram for IfMgrXrlMirror:
ServiceBase IfMgrXrlMirrorRouterObserver IfMgrHintObserver BugCatcher

List of all members.

Public Types

typedef IfMgrCommandSinkBase::Cmd Cmd

Public Member Functions

 IfMgrXrlMirror (EventLoop &e, const char *rtarget, IPv4 finder_addr, uint16_t finder_port)
 Constructor.
 IfMgrXrlMirror (EventLoop &e, const char *rtarget, const char *finder_hostname, uint16_t finder_port)
 Constructor.
int startup ()
 Start running.
int shutdown ()
 Stop running and shutdown.
const IfMgrIfTreeiftree () const
bool attach_hint_observer (IfMgrHintObserver *o)
 Attach an observer interested in receiving IfMgr hints.
bool detach_hint_observer (IfMgrHintObserver *o)
 Detach an observer interested in receiving IfMgr hints.
void delay_updates (const TimeVal &delay)
 Delay the interface configuration tree updates.

Protected Member Functions

void finder_ready_event ()
void finder_disconnect_event ()
void register_with_ifmgr ()
void unregister_with_ifmgr ()
void tree_complete ()
void updates_made ()
void register_cb (const XrlError &e)
void unregister_cb (const XrlError &e)

Protected Attributes

EventLoop_e
IPv4 _finder_addr
string _finder_hostname
uint16_t _finder_port
IfMgrIfTree _iftree
IfMgrCommandDispatcher _dispatcher
string _rtarget
IfMgrXrlMirrorRouter_rtr
IfMgrXrlMirrorTarget_xrl_tgt
list< IfMgrHintObserver * > _hint_observers
XorpTimer _reg_timer

Private Member Functions

void do_updates ()
 Perform the interface configuration tree updates.

Private Attributes

TimeVal _updates_delay
XorpTimer _updates_timer

Detailed Description

Maintainer of a local mirror of central IfMgr configuration state via Xrls sent by the IfMgr.

The IfMgrXrlMirror contains a copy of the central interface configuration state. The IfMgrXrlMirror class implements the ServiceBase interface. When startup() is called it attempts to register with the IfMgrXrlReplicationManager instance running within the FEA. If registration succeeds it will receive the complete configuration tree and receive future configuration tree. Once the configuration tree is received it transitions into the SERVICE_RUNNING state and is considered operational.

When the status of the IfMgrXrlMirror is SERVICE_RUNNING, then a copy of the interface configuration state is accessible through the iftree() method. If the instance is another state then configuration tree available through the IfMgrXrlMirror will be empty.

For parties that are interested in receiving synchronous configuration tree change notifications, they can register as hint observers. Hints provide coarse indication that a change has occured - they announce the which item in the tree has changed and should be checked. Hint observers express interest through the attach_hint_observer() and detach_hint_observer() methods.


Constructor & Destructor Documentation

IfMgrXrlMirror::IfMgrXrlMirror ( EventLoop e,
const char *  rtarget,
IPv4  finder_addr,
uint16_t  finder_port 
)

Constructor.

Parameters:
eventloopto use for events.
rtargetname of Xrl class or target to supply interface configuration updates.
finder_addraddress to route finder messages to.
finder_portport to direct finder messages to.
IfMgrXrlMirror::IfMgrXrlMirror ( EventLoop e,
const char *  rtarget,
const char *  finder_hostname,
uint16_t  finder_port 
)

Constructor.

Parameters:
eventloopto use for events.
rtargetname of Xrl class or target to supply interface configuration updates.
finder_hostnamehost name to route finder messages to.
finder_portport to direct finder messages to.

Member Function Documentation

bool IfMgrXrlMirror::attach_hint_observer ( IfMgrHintObserver o)

Attach an observer interested in receiving IfMgr hints.

Parameters:
oobserver to be attached.
Returns:
true on success, false if observer is already registered.
void IfMgrXrlMirror::delay_updates ( const TimeVal delay)

Delay the interface configuration tree updates.

Parameters:
delaythe delay.
bool IfMgrXrlMirror::detach_hint_observer ( IfMgrHintObserver o)

Detach an observer interested in receiving IfMgr hints.

Parameters:
oobserver to be detached.
Returns:
true on success, false if observer was not registered.
const IfMgrIfTree& IfMgrXrlMirror::iftree ( ) const [inline]
Returns:
interface configuration tree. Should only be trusted when status() is SERVICE_READY.
int IfMgrXrlMirror::shutdown ( ) [virtual]

Stop running and shutdown.

Deregister with the registration target and transition to SERVICE_SHUTDOWN state when complete.

Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements ServiceBase.

int IfMgrXrlMirror::startup ( ) [virtual]

Start running.

Attempt to register instance with the registration target supplied in the constructor and await interface configuration tree data. When data is received transition into the SERVICE_RUNNING state (see ServiceBase for states).

Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements ServiceBase.


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