xorp

XrlQueue< A > Class Template Reference

Helper class to queue route adds and deletes to the RIB. More...

#include <xrl_queue.hh>

List of all members.

Classes

struct  Queued

Public Member Functions

 XrlQueue (RibIpcHandler &rib_ipc_handler, XrlStdRouter &xrl_router, BGPMain &_bgp)
void queue_add_route (string ribname, bool ibgp, Safi, const IPNet< A > &net, const A &nexthop, const PolicyTags &policytags)
void queue_delete_route (string ribname, bool ibgp, Safi, const IPNet< A > &net)
bool busy ()
 XrlQueue (EventLoop &eventloop, XrlRouter &xrl_router)
void set_io (XrlIO *io)
void queue_add_route (string ribname, const IPv4Net &net, const IPv4 &nexthop, uint32_t nexthop_id, uint32_t metric, const PolicyTags &policytags)
 Queue a route add to the RIB.
void queue_delete_route (string ribname, const IPv4Net &net)
 Queue a route delete to the RIB.
bool busy ()
 XrlQueue (EventLoop &eventloop, XrlRouter &xrl_router)
void set_io (XrlIO< A > *io)
void queue_add_route (string ribname, const IPNet< A > &net, const A &nexthop, uint32_t nexthop_id, uint32_t metric, const PolicyTags &policytags)
void queue_delete_route (string ribname, const IPNet< A > &net)
bool busy ()

Private Member Functions

bool flow_controlled ()
 Flow control hysteresis.
void start ()
 Start the transmission of XRLs to tbe RIB.
bool sendit_spec (Queued &q, const char *bgp)
 The specialised method called by sendit to deal with IPv4/IPv6.
EventLoopeventloop () const
void route_command_done (const XrlError &error, const string comment)
EventLoopeventloop () const
bool maximum_number_inflight () const
void start ()
 Start the transmission of XRLs to tbe RIB.
bool sendit_spec (Queued &q, const char *protocol)
 The specialised method called by sendit to deal with IPv4/IPv6.
void route_command_done (const XrlError &error, const string comment)
 Callback method to: signal completion of a RIB command.
bool maximum_number_inflight () const
 Maximum number in flight.
void start ()
 Start the transmission of XRLs to tbe RIB.
bool sendit_spec (Queued &q, const char *protocol)
 The specialised method called by sendit to deal with IPv4/IPv6.
EventLoopeventloop () const
void route_command_done (const XrlError &error, const string comment)

Private Attributes

RibIpcHandler_rib_ipc_handler
XrlStdRouter_xrl_router
BGPMain_bgp
deque< Queued_xrl_queue
size_t _flying
 Number of XRLs currently in flight.
bool _flow_controlled
XrlIO_io
EventLoop_eventloop
XrlRouter_xrl_router
XrlIO< A > * _io

Static Private Attributes

static const size_t XRL_HIWAT = 100
static const size_t XRL_LOWAT = 10
static const size_t WINDOW = 100

Detailed Description

template<class A>
class XrlQueue< A >

Helper class to queue route adds and deletes to the RIB.

XXX - This should be moved to its own file.

Queue route adds and deletes to the RIB.


Member Function Documentation

template<class A>
bool XrlQueue< A >::busy ( )
Returns:
true if RIB commands are currently in flight.
template<class A>
bool XrlQueue< A >::maximum_number_inflight ( ) const [inline, private]
Returns:
true if the maximum number of XRLs flight has been exceeded.
template<class A>
void XrlQueue< A >::queue_add_route ( string  ribname,
const IPv4Net net,
const IPv4 nexthop,
uint32_t  nexthop_id,
uint32_t  metric,
const PolicyTags policytags 
)

Queue a route add to the RIB.

Parameters:
ribnamethe name of the RIB XRL target to send to.
netthe destination.
nexthopthe next hop.
nexthop_idthe libfeaclient ID of the outward interface.
metricthe route metric.
policytagsThe policy tags for the route.
template<class A>
void XrlQueue< A >::queue_delete_route ( string  ribname,
const IPv4Net net 
)

Queue a route delete to the RIB.

Parameters:
ribnamethe name of the RIB XRL target to send to.
netthe destination.
template<class A>
void XrlQueue< A >::route_command_done ( const XrlError error,
const string  comment 
) [private]

Callback method to: signal completion of a RIB command.

Parameters:
errorreference to an XrlError containing command status.
commenta textual description of the error.
template<class A>
bool XrlQueue< A >::sendit_spec ( Queued q,
const char *  protocol 
) [private]

The specialised method called by sendit to deal with IPv4/IPv6.

Parameters:
qthe queued command.
protocol"ospf"
Returns:
True if the add/delete was queued.
template<class A>
bool XrlQueue< A >::sendit_spec ( Queued q,
const char *  bgp 
) [private]

The specialised method called by sendit to deal with IPv4/IPv6.

Parameters:
qthe queued command.
bgp"ibg"p or "ebgp".
Returns:
True if the add/delete was queued.
template<class A>
bool XrlQueue< A >::sendit_spec ( Queued q,
const char *  protocol 
) [private]

The specialised method called by sendit to deal with IPv4/IPv6.

Parameters:
qthe queued command.
protocol"olsr"
Returns:
True if the add/delete was queued.

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