|
|
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.
typedef IfMgrCommandSinkBase::Cmd Cmd | Cmd |
IfMgrXrlMirror (EventLoop& e,
const char* rtarget,
IPv4 finder_addr,
uint16_t finder_port)
| IfMgrXrlMirror |
Constructor
Parameters:
eventloop | to use for events. |
rtarget | name of Xrl class or target to supply interface configuration updates. |
finder_addr | address to route finder messages to. |
finder_port | port to direct finder messages to. |
IfMgrXrlMirror (EventLoop& e,
const char* rtarget,
const char* finder_hostname,
uint16_t finder_port)
| IfMgrXrlMirror |
Constructor
Parameters:
eventloop | to use for events. |
rtarget | name of Xrl class or target to supply interface configuration updates. |
finder_hostname | host name to route finder messages to. |
finder_port | port to direct finder messages to. |
~IfMgrXrlMirror ()
| ~IfMgrXrlMirror |
int 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 SERVICE_RUNNING state (see ServiceBase for states).
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ServiceBase.
int shutdown ()
| shutdown |
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.
Reimplemented from ServiceBase.
const IfMgrIfTree& iftree ()
| iftree |
[const]
Returns: interface configuration tree. Should only be trusted when status() is SERVICE_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 delay_updates (const TimeVal& delay)
| delay_updates |
Delay the interface configuration tree updates.
Parameters:
delay | the delay. |
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_addr | _finder_addr |
[protected]
string _finder_hostname | _finder_hostname |
[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]