xorp

RibManager Class Reference

Main top-level class containing RIBs and main eventloop. More...

#include <rib_manager.hh>

Inheritance diagram for RibManager:
ProtoState ServiceBase BugCatcher

List of all members.

Public Member Functions

 RibManager (EventLoop &eventloop, XrlStdRouter &xrl_std_router, const string &fea_target)
 RibManager constructor.
 ~RibManager ()
 RibManager destructor.
int start ()
 Start operation.
int stop ()
 Stop operation.
bool status_updater ()
 Periodic Status Update.
ProcessStatus status (string &reason) const
 Check status of RIB process.
int new_vif (const string &vifname, const Vif &vif, string &err)
 new_vif is called to inform all the RIBs that a new virtual interface has been created.
int delete_vif (const string &vifname, string &err)
 delete_vif is called to inform all the RIBs that a virtual interface that they previously knew about has been deleted.
int set_vif_flags (const string &vifname, bool is_p2p, bool is_loopback, bool is_multicast, bool is_broadcast, bool is_up, uint32_t mtu, string &err)
 Set the vif flags of a configured vif.
int add_vif_address (const string &vifname, const IPv4 &addr, const IPv4Net &subnet, const IPv4 &broadcast_addr, const IPv4 &peer_addr, string &err)
 add_vif_address is called to inform all the RIBs that a new IPv4 address has been added to a virtual interface.
int delete_vif_address (const string &vifname, const IPv4 &addr, string &err)
 delete_vif_address is called to inform all the RIBs that an IPv4 address that they previously know about has been deleted from a specific VIF.
void make_errors_fatal ()
 Make some errors we'd normally mask fatal.
void register_interest_in_target (const string &target_class)
 Register Interest in an XRL target so we can monitor process births and deaths and clean up appropriately when things die.
void register_interest_in_target_done (const XrlError &e)
 Called in response to registering interest in an XRL target.
void deregister_interest_in_target (const string &target_class)
 Deregister Interest in an XRL target so we can stop monitor process births and deaths.
void deregister_interest_in_target_done (const XrlError &e)
 Called in response to deregistering interest in an XRL target.
void target_death (const string &target_class, const string &target_instance)
 Target Death is called when an XRL target that we've registered an interest in dies.
int add_redist_xrl_output4 (const string &target_name, const string &from_protocol, bool unicast, bool multicast, const IPv4Net &network_prefix, const string &cookie, bool is_xrl_transaction_output)
 Add Route Redistributor that generates updates with redist4 XRL interface.
int delete_redist_xrl_output4 (const string &target_name, const string &from_protocol, bool unicast, bool multicast, const string &cookie, bool is_xrl_transaction_output)
 Remove Route Redistributor that generates updates with redist4 XRL interface.
XrlStdRouterxrl_router ()
void push_routes ()
 Push the connected routes through the policy filter for re-filtering.
void configure_filter (const uint32_t &filter, const string &conf)
 Configure a policy filter.
void reset_filter (const uint32_t &filter)
 Reset a policy filter.
PolicyFilterspolicy_filters ()
PolicyRedistMappolicy_redist_map ()
void insert_policy_redist_tags (const string &protocol, const PolicyTags &tags)
 Insert [old ones are kept] policy-tags for a protocol.
void reset_policy_redist_tags ()
 Reset the policy redistribution map.
Profileprofile ()
RIB< IPv4 > & urib4 ()
RIB< IPv4 > & mrib4 ()
XrlRibTargetxrl_rib_target ()

Private Attributes

ProcessStatus _status_code
string _status_reason
EventLoop_eventloop
XrlStdRouter_xrl_router
RegisterServer _register_server
RIB< IPv4_urib4
RIB< IPv4_mrib4
VifManager _vif_manager
XrlRibTarget _xrl_rib_target
set< string > _targets_of_interest
XorpTimer _status_update_timer
const string _fea_target
PolicyFilters _policy_filters
PolicyRedistMap _policy_redist_map
Profile _profile

Detailed Description

Main top-level class containing RIBs and main eventloop.

The single RibManager class instance is the top-level class in the RIB process from which everything else is built and run. It contains the four RIBs for IPv4 unicast routes, IPv4 multicast routes, IPv6 unicast routes and IPv6 multicast routes. It also contains the RIB's main eventloop.


Constructor & Destructor Documentation

RibManager::RibManager ( EventLoop eventloop,
XrlStdRouter xrl_std_router,
const string &  fea_target 
)

RibManager constructor.

Parameters:
eventloopthe event loop to user.
xrl_std_routerthe XRL router to use.
fea_targetthe FEA XRL target name.

Member Function Documentation

int RibManager::add_redist_xrl_output4 ( const string &  target_name,
const string &  from_protocol,
bool  unicast,
bool  multicast,
const IPv4Net network_prefix,
const string &  cookie,
bool  is_xrl_transaction_output 
)

Add Route Redistributor that generates updates with redist4 XRL interface.

Parameters:
target_nameXRL target to receive redistributed routes.
from_protocolprotocol routes are redistributed from.
unicastapply to unicast rib.
multicastapply to multicast rib.
network_prefixredistribite only the routes that fall into this prefix address.
cookiecookie passed in route redistribution XRLs.
is_xrl_transaction_outputif true the add/delete route XRLs are grouped into transactions.
Returns:
XORP_OK on success, XORP_ERROR on failure.
int RibManager::add_vif_address ( const string &  vifname,
const IPv4 addr,
const IPv4Net subnet,
const IPv4 broadcast_addr,
const IPv4 peer_addr,
string &  err 
)

add_vif_address is called to inform all the RIBs that a new IPv4 address has been added to a virtual interface.

Parameters:
vifnamethe name of the VIF that the address was added to.
addrthe new address.
subnetthe subnet (masked address) that the new address resides on.
broadcastthe broadcast address to add.
peerthe peer address to add.
errreference to string in which to store the human-readable error message in case anything goes wrong. Used for debugging purposes.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
void RibManager::configure_filter ( const uint32_t &  filter,
const string &  conf 
)

Configure a policy filter.

Will throw an exception on error.

In this case the source match filter of connected routes will be configured.

Parameters:
filterIdentifier of filter to configure.
confConfiguration of the filter.
int RibManager::delete_redist_xrl_output4 ( const string &  target_name,
const string &  from_protocol,
bool  unicast,
bool  multicast,
const string &  cookie,
bool  is_xrl_transaction_output 
)

Remove Route Redistributor that generates updates with redist4 XRL interface.

Parameters:
target_nameXRL target to receive redistributed routes.
from_protocolprotocol routes are redistributed from.
unicastapply to unicast rib.
multicastapply to multicast rib.
cookiecookie passed in route redistribution XRLs.
is_xrl_transaction_outputif true the add/delete route XRLs are grouped into transactions.
Returns:
XORP_OK on success, XORP_ERROR on failure.
int RibManager::delete_vif ( const string &  vifname,
string &  err 
)

delete_vif is called to inform all the RIBs that a virtual interface that they previously knew about has been deleted.

Parameters:
vifnamethe name of the VIF that was deleted.
errreference to string in which to store the human-readable error message in case anything goes wrong. Used for debugging purposes.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int RibManager::delete_vif_address ( const string &  vifname,
const IPv4 addr,
string &  err 
)

delete_vif_address is called to inform all the RIBs that an IPv4 address that they previously know about has been deleted from a specific VIF.

Parameters:
vifnamethe name of the VIF that the address was deleted from.
addrthe address that was deleted.
errreference to string in which to store the human-readable error message in case anything goes wrong. Used for debugging purposes.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
void RibManager::deregister_interest_in_target ( const string &  target_class)

Deregister Interest in an XRL target so we can stop monitor process births and deaths.

Parameters:
target_classthe XRL Target Class we're deregistering interested in.
void RibManager::deregister_interest_in_target_done ( const XrlError e)

Called in response to deregistering interest in an XRL target.

Parameters:
eXRL Response code.
void RibManager::insert_policy_redist_tags ( const string &  protocol,
const PolicyTags tags 
)

Insert [old ones are kept] policy-tags for a protocol.

All routes which contain at least one of these tags, will be redistributed to the protocol.

Parameters:
protocolDestination protocol for redistribution.
tagsPolicy-tags of routes which need to be redistributed.
void RibManager::make_errors_fatal ( )

Make some errors we'd normally mask fatal.

Should be used for testing only.

RIB<IPv4>& RibManager::mrib4 ( ) [inline]
Returns:
a reference to the IPv4 multicast RIB.
int RibManager::new_vif ( const string &  vifname,
const Vif vif,
string &  err 
)

new_vif is called to inform all the RIBs that a new virtual interface has been created.

Parameters:
vifnamethe name of the new VIF.
vifthe Vif class instance holding information about the new VIF.
errreference to string in which to store the human-readable error message in case anything goes wrong. Used for debugging purposes.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
PolicyFilters& RibManager::policy_filters ( ) [inline]
Returns:
the global instance of policy filters.
PolicyRedistMap& RibManager::policy_redist_map ( ) [inline]
Returns:
the global instance of the policy redistribution map.
Profile& RibManager::profile ( ) [inline]
Returns:
a reference to the profiler.
void RibManager::register_interest_in_target ( const string &  target_class)

Register Interest in an XRL target so we can monitor process births and deaths and clean up appropriately when things die.

Parameters:
target_classthe XRL Target Class we're interested in.
void RibManager::register_interest_in_target_done ( const XrlError e)

Called in response to registering interest in an XRL target.

Parameters:
eXRL Response code.
void RibManager::reset_filter ( const uint32_t &  filter)

Reset a policy filter.

Parameters:
filterIdentifier of filter to reset.
void RibManager::reset_policy_redist_tags ( )

Reset the policy redistribution map.

This map allows policy redistribution to occur by directing routes with specific policy-tags to specific protocols.

int RibManager::set_vif_flags ( const string &  vifname,
bool  is_p2p,
bool  is_loopback,
bool  is_multicast,
bool  is_broadcast,
bool  is_up,
uint32_t  mtu,
string &  err 
)

Set the vif flags of a configured vif.

Parameters:
vifnamethe name of the vif.
is_pim_registertrue if the vif is a PIM Register interface.
is_p2ptrue if the vif is point-to-point interface.
is_loopbacktrue if the vif is a loopback interface.
is_multicasttrue if the vif is multicast capable.
is_broadcasttrue if the vif is broadcast capable.
is_uptrue if the underlying vif is UP.
mtuthe MTU of the vif.
errreference to string in which to store the human-readable error message in case anything goes wrong. Used for debugging purposes.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int RibManager::start ( )

Start operation.

Returns:
XORP_OK on success, otherwise XORP_ERROR.

Reimplemented from ProtoState.

ProcessStatus RibManager::status ( string &  reason) const [inline]

Check status of RIB process.

Returns:
the process status code.
See also:
ProcessStatus.
bool RibManager::status_updater ( )

Periodic Status Update.

Returns:
true to reschedule next status check.
int RibManager::stop ( )

Stop operation.

Gracefully stop the RIB.

Returns:
XORP_OK on success, otherwise XORP_ERROR.

Reimplemented from ProtoState.

void RibManager::target_death ( const string &  target_class,
const string &  target_instance 
)

Target Death is called when an XRL target that we've registered an interest in dies.

Parameters:
target_classthe XRL Class of the target that died.
target_instancethe XRL Class Instance of the target that died.
RIB<IPv4>& RibManager::urib4 ( ) [inline]
Returns:
a reference to the IPv4 unicast RIB.
XrlRibTarget& RibManager::xrl_rib_target ( ) [inline]
Returns:
a reference to the XRL RIB target.

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