|
xorp
|
Maintainer of a local mirror of central IfMgr configuration state via Xrls sent by the IfMgr. More...
#include <ifmgr_xrl_mirror.hh>
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 IfMgrIfTree & | iftree () 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 |
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.
| IfMgrXrlMirror::IfMgrXrlMirror | ( | EventLoop & | e, |
| const char * | rtarget, | ||
| IPv4 | finder_addr, | ||
| uint16_t | finder_port | ||
| ) |
Constructor.
| 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::IfMgrXrlMirror | ( | EventLoop & | e, |
| const char * | rtarget, | ||
| const char * | finder_hostname, | ||
| uint16_t | finder_port | ||
| ) |
Constructor.
| 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. |
| bool IfMgrXrlMirror::attach_hint_observer | ( | IfMgrHintObserver * | o | ) |
Attach an observer interested in receiving IfMgr hints.
| o | observer to be attached. |
| void IfMgrXrlMirror::delay_updates | ( | const TimeVal & | delay | ) |
| bool IfMgrXrlMirror::detach_hint_observer | ( | IfMgrHintObserver * | o | ) |
Detach an observer interested in receiving IfMgr hints.
| o | observer to be detached. |
| const IfMgrIfTree& IfMgrXrlMirror::iftree | ( | ) | const [inline] |
| int IfMgrXrlMirror::shutdown | ( | ) | [virtual] |
Stop running and shutdown.
Deregister with the registration target and transition to SERVICE_SHUTDOWN state when complete.
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).
Implements ServiceBase.