xorp

XrlRibNotifier< A > Class Template Reference

Class to send RIP updates to RIB process. More...

#include <xrl_rib_notifier.hh>

Inheritance diagram for XrlRibNotifier< A >:
RibNotifierBase< A > ServiceBase BugCatcher

List of all members.

Public Types

typedef RibNotifierBase< A > Super

Public Member Functions

 XrlRibNotifier (EventLoop &e, UpdateQueue< A > &uq, XrlRouter &xr, uint32_t max_inflight=DEFAULT_INFLIGHT, uint32_t poll_ms=Super::DEFAULT_POLL_MS)
 Constructor.
 XrlRibNotifier (EventLoop &e, UpdateQueue< A > &uq, XrlSender &xs, const string &class_name, const string &intance_name, uint32_t max_inflight=DEFAULT_INFLIGHT, uint32_t poll_ms=Super::DEFAULT_POLL_MS)
 Constructor taking an XrlSender, a class name, and an instance name as arguments.
int startup ()
 Request RIB instantiates a RIP routing table and once instantiated start passing route updates to RIB.
int shutdown ()
 Stop forwarding route updates to RIB and request RIB unregisters RIP routing table.
uint32_t xrls_inflight () const
 Accessor returning the current number of Xrls inflight.
uint32_t max_xrls_inflight () const
 Accessor returning the maximum number of Xrls inflight.

Static Public Attributes

static const uint32_t DEFAULT_INFLIGHT = 20

Protected Member Functions

void updates_available ()

Protected Attributes

XrlSender_xs
string _cname
string _iname
const uint32_t _max_inflight
uint32_t _inflight
set< IPNet< A > > _ribnets

Private Member Functions

void add_igp_cb (const XrlError &e)
void delete_igp_cb (const XrlError &e)
void send_add_route (const RouteEntry< A > &re)
void send_delete_route (const RouteEntry< A > &re)
void send_route_cb (const XrlError &e)
void incr_inflight ()
void decr_inflight ()

Detailed Description

template<typename A>
class XrlRibNotifier< A >

Class to send RIP updates to RIB process.

This class periodically checks the UpdateQueue for updates and sends them to the RIB. Once an instance has been created, the startup() method should be called to register a routing table for RIP and begin checking for updates. Before being destructed, shutdown() should be called to remove the RIP routing table from the RIB.

The XrlRibNotifier may be in one of several states enumerated by RunStatus. Before startup(), an instances state is SERVICE_READY. Then when startup is called it transitions into INSTALLING_RIP_TABLE and transitions into SERVICE_RUNNING. When in SERVICE_RUNNING state updates are sent to the RIB. When shutdown() is called it enters UNINSTALLING_RIP_TABLE before entering SERVICE_SHUTDOWN. At any time it may fall into state SERVICE_FAILED if communication with the RIB fails.


Constructor & Destructor Documentation

template<typename A >
XrlRibNotifier< A >::XrlRibNotifier ( EventLoop e,
UpdateQueue< A > &  uq,
XrlSender xs,
const string &  class_name,
const string &  intance_name,
uint32_t  max_inflight = DEFAULT_INFLIGHT,
uint32_t  poll_ms = Super::DEFAULT_POLL_MS 
)

Constructor taking an XrlSender, a class name, and an instance name as arguments.

These arguments are broken out for debugging instances, ie a fake XrlSender can be used to test behaviour of this class.


Member Function Documentation

template<typename A >
int XrlRibNotifier< A >::shutdown ( ) [virtual]

Stop forwarding route updates to RIB and request RIB unregisters RIP routing table.

Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements ServiceBase.

template<typename A >
int XrlRibNotifier< A >::startup ( ) [virtual]

Request RIB instantiates a RIP routing table and once instantiated start passing route updates to RIB.

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