|
|
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 RUNNING state and is considered operational.
When the status of the IfMgrXrlMirror is 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.
typedef IfMgrCommandSinkBase::Cmd Cmd | Cmd |
static const char* DEFAULT_REGISTRATION_TARGET | DEFAULT_REGISTRATION_TARGET |
IfMgrXrlMirror (EventLoop& e,
const char* reg_tgt = DEFAULT_REGISTRATION_TARGET,
IPv4 finder_host = FINDER_DEFAULT_HOST,
uint16_t finder_port = FINDER_DEFAULT_PORT)
| IfMgrXrlMirror |
Constructor
Parameters:
eventloop | to use for events. |
reg_tgt | name of Xrl class or target to supply interface configuration updates. |
finder_host | address to route finder messages to. |
finder_port | port to direct finder messages to. |
~IfMgrXrlMirror ()
| ~IfMgrXrlMirror |
bool startup ()
| startup |
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 RUNNING state (see ServiceBase for states).
Returns: true on success, false on failure.
Reimplemented from ServiceBase.
bool shutdown ()
| shutdown |
Stop running and shutdown. Deregister with the registration target and transition to SHUTDOWN state when complete.
Returns: true on success, false on failure.
Reimplemented from ServiceBase.
inline const IfMgrIfTree& iftree ()
| iftree |
[const]
Returns: interface configuration tree. Should only be trusted when status() is READY.
bool attach_hint_observer (IfMgrHintObserver* o)
| attach_hint_observer |
Attach an observer interested in receiving IfMgr hints.
Parameters:
o | observer to be attached. |
Returns: true on success, false if observer is already registered.
bool detach_hint_observer (IfMgrHintObserver* o)
| detach_hint_observer |
Detach an observer interested in receiving IfMgr hints.
Parameters:
o | observer to be detached. |
Returns: true on success, false if observer was not registered.
void finder_ready_event ()
| finder_ready_event |
[protected]
Reimplemented from IfMgrXrlMirrorRouterObserver.
void finder_disconnect_event ()
| finder_disconnect_event |
[protected]
Reimplemented from IfMgrXrlMirrorRouterObserver.
void register_with_ifmgr ()
| register_with_ifmgr |
[protected]
void unregister_with_ifmgr ()
| unregister_with_ifmgr |
[protected]
void tree_complete ()
| tree_complete |
[protected]
Reimplemented from IfMgrHintObserver.
void updates_made ()
| updates_made |
[protected]
Reimplemented from IfMgrHintObserver.
void register_cb (const XrlError& e)
| register_cb |
[protected]
void unregister_cb (const XrlError& e)
| unregister_cb |
[protected]
EventLoop& _e | _e |
[protected]
IPv4 _finder_host | _finder_host |
[protected]
uint16_t _finder_port | _finder_port |
[protected]
IfMgrIfTree _iftree | _iftree |
[protected]
IfMgrCommandDispatcher _dispatcher | _dispatcher |
[protected]
string _rtarget | _rtarget |
[protected]
IfMgrXrlMirrorRouter* _rtr | _rtr |
[protected]
IfMgrXrlMirrorTarget* _xrl_tgt | _xrl_tgt |
[protected]
list<IfMgrHintObserver*> _hint_observers | _hint_observers |
[protected]
XorpTimer _reg_timer | _reg_timer |
[protected]