|
|
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.
RibManager ()
| RibManager |
~RibManager ()
| ~RibManager |
int start ()
| start |
Start operation.
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoState.
int stop ()
| stop |
Stop operation.
Gracefully stop the RIB.
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoState.
bool status_updater ()
| status_updater |
Periodic Status Update
Returns: true to reschedule next status check.
ProcessStatus status (string& reason)
| status |
[const]
Check status of RIB process.
Returns: process status code.
int new_vif (const string& vifname, const Vif& vif, string& err)
| new_vif |
Inform the RIB about the existence of a Virtual Interface. Note that it is an error to add twice a vif with the same vifname.
Parameters:
vifname | the name of the VIF, as understood by the FEA. |
vif | Vif class instance giving the information about this vif. |
err | reference 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.
See also: Vif
int delete_vif (const string& vifname, string& err)
| delete_vif |
delete_vif is called to inform all the RIBs that a virtual interface that they previously knew about has been deleted.
Parameters:
vifname | the name of the VIF that was deleted. |
err | reference 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 set_vif_flags (const string& vifname,
bool is_p2p,
bool is_loopback,
bool is_multicast,
bool is_broadcast,
bool is_up,
string& err)
| set_vif_flags |
Set the vif flags of a configured vif.
Parameters:
vifname | the name of the vif. |
is_pim_register | true if the vif is a PIM Register interface. |
is_p2p | true if the vif is point-to-point interface. |
is_loopback | true if the vif is a loopback interface. |
is_multicast | true if the vif is multicast capable. |
is_broadcast | true if the vif is broadcast capable. |
is_up | true if the underlying vif is UP. |
err | reference 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 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 |
add_vif_address is called to inform all the RIBs that a new IPv4 address has been added to a virtual interface.
Parameters:
vifname | the name of the VIF that the address was added to. |
addr | the new address. |
subnet | the subnet (masked address) that the new address resides on. |
broadcast | the broadcast address to add. |
peer | the peer address to add. |
err | reference 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 delete_vif_address (const string& vifname,
const IPv4& addr,
string& err)
| delete_vif_address |
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:
vifname | the name of the VIF that the address was deleted from. |
addr | the address that was deleted. |
err | reference 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 add_vif_address (const string& vifname,
const IPv6& addr,
const IPv6Net& subnet,
const IPv6& peer,
string& err)
| add_vif_address |
add_vif_address is called to inform all the RIBs that a new IPv6 address has been added to a virtual interface.
Parameters:
vifname | the name of the VIF that the address was added to. |
addr | the new address. |
subnet | the subnet (masked address) that the new address resides on. |
peer | the peer address to add. |
err | reference 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 delete_vif_address (const string& vifname,
const IPv6& addr,
string& err)
| delete_vif_address |
delete_vif_address is called to inform all the RIBs that an IPv6 address that they previously know about has been deleted from a specific VIF.
Parameters:
vifname | the name of the VIF that the address was deleted from. |
addr | the address that was deleted. |
err | reference 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.
RibClient* find_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| find_rib_client |
Find a RIB client.
Find a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: a pointer to a valid RibClient if found, otherwise NULL.
int add_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| add_rib_client |
Add a RIB client.
Add a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| delete_rib_client |
Delete a RIB client.
Delete a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int enable_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| enable_rib_client |
Enable a RIB client.
Enable a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int disable_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| disable_rib_client |
Disable a RIB client.
Disable a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
void make_errors_fatal ()
| make_errors_fatal |
Make some errors we'd normally mask fatal. Should be used for testing only.
void register_interest_in_target (const string& target_class)
| register_interest_in_target |
Register Interest in an XRL target so we can monitor process births and deaths and clean up appropriately when things die.
Parameters:
target_class | the XRL Target Class we're interested in. |
void register_interest_in_target_done (const XrlError& e)
| register_interest_in_target_done |
Called in response to registering interest in an XRL target
Parameters:
e | XRL Response code. |
void target_death (const string& target_class,
const string& target_instance)
| target_death |
Target Death is called when an XRL target that we've registered an interest in dies.
Parameters:
target_class | the XRL Class of the target that died. |
target_instance | the XRL Class Instance of the target that died. |
int add_redist_xrl_output4 (const string& target_name,
const string& from_protocol,
bool unicast,
bool multicast,
const string& cookie,
bool is_xrl_transaction_output)
| add_redist_xrl_output4 |
Add Route Redistributor that generates updates with redist4 XRL interface.
Parameters:
target_name | XRL target to receive redistributed routes. |
from_protocol | protocol routes are redistributed from. |
unicast | apply to unicast rib. |
multicast | apply to multicast rib. |
cookie | cookie passed in route redistribution XRLs. |
is_xrl_transaction_output | if true the add/delete route XRLs are grouped into transactions. |
Returns: XORP_OK on success, XORP_ERROR on failure.
int add_redist_xrl_output6 (const string& target_name,
const string& from_protocol,
bool unicast,
bool multicast,
const string& cookie,
bool is_xrl_transaction_output)
| add_redist_xrl_output6 |
Add Route Redistributor that generates updates with redist6 XRL interface.
Parameters:
target_name | XRL target to receive redistributed routes. |
from_protocol | protocol routes are redistributed from. |
unicast | apply to unicast rib. |
multicast | apply to multicast rib. |
cookie | cookie passed in route redistribution XRLs. |
is_xrl_transaction_output | if true the add/delete route XRLs are grouped into transactions. |
Returns: XORP_OK on success, XORP_ERROR on failure.
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)
| delete_redist_xrl_output4 |
Remove Route Redistributor that generates updates with redist4 XRL interface.
Parameters:
target_name | XRL target to receive redistributed routes. |
from_protocol | protocol routes are redistributed from. |
unicast | apply to unicast rib. |
multicast | apply to multicast rib. |
cookie | cookie passed in route redistribution XRLs. |
is_xrl_transaction_output | if true the add/delete route XRLs are grouped into transactions. |
Returns: XORP_OK on success, XORP_ERROR on failure.
int delete_redist_xrl_output6 (const string& target_name,
const string& from_protocol,
bool unicast,
bool multicast,
const string& cookie,
bool is_xrl_transaction_output)
| delete_redist_xrl_output6 |
Remove Route Redistributor that generates updates with redist6 XRL interface.
Parameters:
target_name | XRL target to receive redistributed routes. |
from_protocol | protocol routes are redistributed from. |
unicast | apply to unicast rib. |
multicast | apply to multicast rib. |
cookie | cookie passed in route redistribution XRLs. |
is_xrl_transaction_output | if true the add/delete route XRLs are grouped into transactions. |
Returns: XORP_OK on success, XORP_ERROR on failure.
RibManager (EventLoop& eventloop, XrlStdRouter& xrl_std_router,
const string& fea_target)
| RibManager |
RibManager constructor
Parameters:
eventloop | the event loop to user. |
xrl_std_router | the XRL router to use. |
fea_target | the FEA XRL target name. |
~RibManager ()
| ~RibManager |
int start ()
| start |
Start operation.
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoState.
int stop ()
| stop |
Stop operation.
Gracefully stop the RIB.
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ProtoState.
bool status_updater ()
| status_updater |
Periodic Status Update
Returns: true to reschedule next status check.
ProcessStatus status (string& reason)
| status |
[const]
Check status of RIB process.
Returns: the process status code.
See also: ProcessStatus.
int new_vif (const string& vifname, const Vif& vif, string& err)
| new_vif |
new_vif is called to inform all the RIBs that a new virtual interface has been created.
Parameters:
vifname | the name of the new VIF. |
vif | the Vif class instance holding information about the new VIF. |
err | reference 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 delete_vif (const string& vifname, string& err)
| delete_vif |
delete_vif is called to inform all the RIBs that a virtual interface that they previously knew about has been deleted.
Parameters:
vifname | the name of the VIF that was deleted. |
err | reference 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 set_vif_flags (const string& vifname,
bool is_p2p,
bool is_loopback,
bool is_multicast,
bool is_broadcast,
bool is_up,
string& err)
| set_vif_flags |
Set the vif flags of a configured vif.
Parameters:
vifname | the name of the vif. |
is_pim_register | true if the vif is a PIM Register interface. |
is_p2p | true if the vif is point-to-point interface. |
is_loopback | true if the vif is a loopback interface. |
is_multicast | true if the vif is multicast capable. |
is_broadcast | true if the vif is broadcast capable. |
is_up | true if the underlying vif is UP. |
err | reference 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 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 |
add_vif_address is called to inform all the RIBs that a new IPv4 address has been added to a virtual interface.
Parameters:
vifname | the name of the VIF that the address was added to. |
addr | the new address. |
subnet | the subnet (masked address) that the new address resides on. |
broadcast | the broadcast address to add. |
peer | the peer address to add. |
err | reference 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 delete_vif_address (const string& vifname,
const IPv4& addr,
string& err)
| delete_vif_address |
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:
vifname | the name of the VIF that the address was deleted from. |
addr | the address that was deleted. |
err | reference 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 add_vif_address (const string& vifname,
const IPv6& addr,
const IPv6Net& subnet,
const IPv6& peer,
string& err)
| add_vif_address |
add_vif_address is called to inform all the RIBs that a new IPv6 address has been added to a virtual interface.
Parameters:
vifname | the name of the VIF that the address was added to. |
addr | the new address. |
subnet | the subnet (masked address) that the new address resides on. |
peer | the peer address to add. |
err | reference 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 delete_vif_address (const string& vifname,
const IPv6& addr,
string& err)
| delete_vif_address |
delete_vif_address is called to inform all the RIBs that an IPv6 address that they previously know about has been deleted from a specific VIF.
Parameters:
vifname | the name of the VIF that the address was deleted from. |
addr | the address that was deleted. |
err | reference 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.
RibClient* find_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| find_rib_client |
Find a RIB client.
Find a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: a pointer to a valid RibClient if found, otherwise NULL.
int add_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| add_rib_client |
Add a RIB client.
Add a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| delete_rib_client |
Delete a RIB client.
Delete a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int enable_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| enable_rib_client |
Enable a RIB client.
Enable a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int disable_rib_client (const string& target_name, int family,
bool unicast, bool multicast)
| disable_rib_client |
Disable a RIB client.
Disable a RIB client for a given target name, address family, and unicast/multicast flags.
Parameters:
target_name | the target name of the RIB client. |
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
unicast | true if a client for the unicast RIB. |
multicast | true if a client for the multicast RIB. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
void make_errors_fatal ()
| make_errors_fatal |
Make some errors we'd normally mask fatal. Should be used for testing only.
void register_interest_in_target (const string& target_class)
| register_interest_in_target |
Register Interest in an XRL target so we can monitor process births and deaths and clean up appropriately when things die.
Parameters:
target_class | the XRL Target Class we're interested in. |
void register_interest_in_target_done (const XrlError& e)
| register_interest_in_target_done |
Called in response to registering interest in an XRL target
Parameters:
e | XRL Response code. |
void target_death (const string& target_class,
const string& target_instance)
| target_death |
Target Death is called when an XRL target that we've registered an interest in dies.
Parameters:
target_class | the XRL Class of the target that died. |
target_instance | the XRL Class Instance of the target that died. |
int add_redist_xrl_output4 (const string& target_name,
const string& from_protocol,
bool unicast,
bool multicast,
const string& cookie,
bool is_xrl_transaction_output)
| add_redist_xrl_output4 |
Add Route Redistributor that generates updates with redist4 XRL interface.
Parameters:
target_name | XRL target to receive redistributed routes. |
from_protocol | protocol routes are redistributed from. |
unicast | apply to unicast rib. |
multicast | apply to multicast rib. |
cookie | cookie passed in route redistribution XRLs. |
is_xrl_transaction_output | if true the add/delete route XRLs are grouped into transactions. |
Returns: XORP_OK on success, XORP_ERROR on failure.
int add_redist_xrl_output6 (const string& target_name,
const string& from_protocol,
bool unicast,
bool multicast,
const string& cookie,
bool is_xrl_transaction_output)
| add_redist_xrl_output6 |
Add Route Redistributor that generates updates with redist6 XRL interface.
Parameters:
target_name | XRL target to receive redistributed routes. |
from_protocol | protocol routes are redistributed from. |
unicast | apply to unicast rib. |
multicast | apply to multicast rib. |
cookie | cookie passed in route redistribution XRLs. |
is_xrl_transaction_output | if true the add/delete route XRLs are grouped into transactions. |
Returns: XORP_OK on success, XORP_ERROR on failure.
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)
| delete_redist_xrl_output4 |
Remove Route Redistributor that generates updates with redist4 XRL interface.
Parameters:
target_name | XRL target to receive redistributed routes. |
from_protocol | protocol routes are redistributed from. |
unicast | apply to unicast rib. |
multicast | apply to multicast rib. |
cookie | cookie passed in route redistribution XRLs. |
is_xrl_transaction_output | if true the add/delete route XRLs are grouped into transactions. |
Returns: XORP_OK on success, XORP_ERROR on failure.
int delete_redist_xrl_output6 (const string& target_name,
const string& from_protocol,
bool unicast,
bool multicast,
const string& cookie,
bool is_xrl_transaction_output)
| delete_redist_xrl_output6 |
Remove Route Redistributor that generates updates with redist6 XRL interface.
Parameters:
target_name | XRL target to receive redistributed routes. |
from_protocol | protocol routes are redistributed from. |
unicast | apply to unicast rib. |
multicast | apply to multicast rib. |
cookie | cookie passed in route redistribution XRLs. |
is_xrl_transaction_output | if true the add/delete route XRLs are grouped into transactions. |
Returns: XORP_OK on success, XORP_ERROR on failure.