|
xorp
|
Implement RIB Xrl target methods. More...
#include <xrl_target.hh>
Public Member Functions | |
| XrlRibTarget (XrlRouter *xrl_router, RIB< IPv4 > &urib4, RIB< IPv4 > &mrib4, VifManager &vif_manager, RibManager *rib_manager) | |
| XrlRibTarget constructor. | |
| ~XrlRibTarget () | |
| XrlRibTarget destructor. | |
Protected Member Functions | |
| XrlCmdError | common_0_1_get_target_name (string &name) |
| Get name of Xrl Target. | |
| XrlCmdError | common_0_1_get_version (string &version) |
| Get version string from Xrl Target. | |
| XrlCmdError | common_0_1_get_status (uint32_t &status, string &reason) |
| Get status of Xrl Target. | |
| XrlCmdError | common_0_1_shutdown () |
| Request clean shutdown of Xrl Target. | |
| XrlCmdError | common_0_1_startup () |
| Pure-virtual function that needs to be implemented to: | |
| XrlCmdError | rib_0_1_enable_rib () |
| Enable/disable/start/stop RIB. | |
| XrlCmdError | rib_0_1_disable_rib () |
| XrlCmdError | rib_0_1_start_rib () |
| XrlCmdError | rib_0_1_stop_rib () |
| XrlCmdError | rib_0_1_make_errors_fatal () |
| Make errors fatal; used to detect errors we'd normally mask. | |
| XrlCmdError | rib_0_1_get_registered_protocols (const bool &ipv4, const bool &ipv6, const bool &unicast, const bool &multicast, XrlAtomList &ipv4_unicast_protocols, XrlAtomList &ipv6_unicast_protocols, XrlAtomList &ipv4_multicast_protocols, XrlAtomList &ipv6_multicast_protocols) |
| Get the list of registered protocols. | |
| XrlCmdError | rib_0_1_add_igp_table4 (const string &protocol, const string &target_class, const string &target_instance, const bool &unicast, const bool &multicast) |
| Add/delete an IGP or EGP table. | |
| XrlCmdError | rib_0_1_delete_igp_table4 (const string &protocol, const string &target_class, const string &target_instance, const bool &unicast, const bool &multicast) |
| XrlCmdError | rib_0_1_add_egp_table4 (const string &protocol, const string &target_class, const string &target_instance, const bool &unicast, const bool &multicast) |
| XrlCmdError | rib_0_1_delete_egp_table4 (const string &protocol, const string &target_class, const string &target_instance, const bool &unicast, const bool &multicast) |
| XrlCmdError | rib_0_1_add_route4 (const string &protocol, const bool &unicast, const bool &multicast, const IPv4Net &network, const IPv4 &nexthop, const uint32_t &metric, const XrlAtomList &policytags) |
| Add/replace/delete a route. | |
| XrlCmdError | rib_0_1_replace_route4 (const string &protocol, const bool &unicast, const bool &multicast, const IPv4Net &network, const IPv4 &nexthop, const uint32_t &metric, const XrlAtomList &policytags) |
| XrlCmdError | rib_0_1_delete_route4 (const string &protocol, const bool &unicast, const bool &multicast, const IPv4Net &network) |
| XrlCmdError | rib_0_1_add_interface_route4 (const string &protocol, const bool &unicast, const bool &multicast, const IPv4Net &network, const IPv4 &nexthop, const string &ifname, const string &vifname, const uint32_t &metric, const XrlAtomList &policytags) |
| Add/replace a route by explicitly specifying the network interface toward the destination. | |
| XrlCmdError | rib_0_1_replace_interface_route4 (const string &protocol, const bool &unicast, const bool &multicast, const IPv4Net &network, const IPv4 &nexthop, const string &ifname, const string &vifname, const uint32_t &metric, const XrlAtomList &policytags) |
| XrlCmdError | rib_0_1_lookup_route_by_dest4 (const IPv4 &addr, const bool &unicast, const bool &multicast, IPv4 &nexthop) |
| Lookup nexthop. | |
| XrlCmdError | rib_0_1_new_vif (const string &name) |
| Add a vif or a vif address to the RIB. | |
| XrlCmdError | rib_0_1_add_vif_addr4 (const string &name, const IPv4 &addr, const IPv4Net &subnet) |
| Add a vif address to the RIB. | |
| XrlCmdError | rib_0_1_redist_enable4 (const string &to_xrl_target, const string &from_protocol, const bool &unicast, const bool &multicast, const IPv4Net &network_prefix, const string &cookie) |
| Enable route redistribution from one routing protocol to another. | |
| XrlCmdError | rib_0_1_redist_disable4 (const string &to_xrl_target, const string &from_protocol, const bool &unicast, const bool &multicast, const string &cookie) |
| Disable route redistribution from one routing protocol to another. | |
| XrlCmdError | rib_0_1_redist_transaction_enable4 (const string &to_xrl_target, const string &from_protocol, const bool &unicast, const bool &multicast, const IPv4Net &network_prefix, const string &cookie) |
| Enable transaction-based route redistribution from one routing protocol to another. | |
| XrlCmdError | rib_0_1_redist_transaction_disable4 (const string &to_xrl_target, const string &from_protocol, const bool &unicast, const bool &multicast, const string &cookie) |
| Disable transaction-based route redistribution from one routing protocol to another. | |
| XrlCmdError | rib_0_1_register_interest4 (const string &target, const IPv4 &addr, bool &resolves, IPv4 &base_addr, uint32_t &prefix_len, uint32_t &real_prefix_len, IPv4 &nexthop, uint32_t &metric) |
| Register an interest in a route. | |
| XrlCmdError | rib_0_1_deregister_interest4 (const string &target, const IPv4 &addr, const uint32_t &prefix_len) |
| De-register an interest in a route. | |
| XrlCmdError | rib_0_1_get_protocol_admin_distances (const bool &ipv4, const bool &unicast, XrlAtomList &protocols, XrlAtomList &admin_distances) |
| Get the configured admin distances from a selected RIB for all routing protocols configured with one. | |
| XrlCmdError | rib_0_1_get_protocol_admin_distance (const string &protocol, const bool &unicast, const bool &multicast, uint32_t &admin_distance) |
| Get the configured admin distance for a routing protocol from a selected RIB. | |
| XrlCmdError | rib_0_1_set_protocol_admin_distance (const string &protocol, const bool &ipv4, const bool &ipv6, const bool &unicast, const bool &multicast, const uint32_t &admin_distance) |
| Set the configured admin distance for a routing protocol in one or many RIBs. | |
| XrlCmdError | finder_event_observer_0_1_xrl_target_birth (const string &target_class, const string &target_instance) |
| Announce target birth. | |
| XrlCmdError | finder_event_observer_0_1_xrl_target_death (const string &target_class, const string &target_instance) |
| Announce target death. | |
| XrlCmdError | policy_backend_0_1_configure (const uint32_t &filter, const string &conf) |
| Configure a policy filter. | |
| XrlCmdError | policy_backend_0_1_reset (const uint32_t &filter) |
| Reset a policy filter. | |
| XrlCmdError | policy_backend_0_1_push_routes () |
| Push routes through policy filters for re-filtering. | |
| XrlCmdError | rib_0_1_insert_policy_redist_tags (const string &protocol, const XrlAtomList &policytags) |
| Redistribute to a protocol based on policy-tags. | |
| XrlCmdError | rib_0_1_reset_policy_redist_tags () |
| Reset policy redistribution map. | |
| XrlCmdError | profile_0_1_enable (const string &pname) |
| Enable profiling. | |
| XrlCmdError | profile_0_1_disable (const string &pname) |
| Disable profiling. | |
| XrlCmdError | profile_0_1_get_entries (const string &pname, const string &instance_name) |
| Get log entries. | |
| XrlCmdError | profile_0_1_clear (const string &pname) |
| Clear the profiling entries. | |
| XrlCmdError | profile_0_1_list (string &info) |
| List all the profiling variables registered with this target. | |
Protected Attributes | |
| RIB< IPv4 > & | _urib4 |
| RIB< IPv4 > & | _mrib4 |
| VifManager & | _vif_manager |
| RibManager * | _rib_manager |
Implement RIB Xrl target methods.
XrlRibTarget implements the auto-generated sub methods to handle XRL requests from the routing protocols to the RIB.
| XrlRibTarget::XrlRibTarget | ( | XrlRouter * | xrl_router, |
| RIB< IPv4 > & | urib4, | ||
| RIB< IPv4 > & | mrib4, | ||
| VifManager & | vif_manager, | ||
| RibManager * | rib_manager | ||
| ) | [inline] |
XrlRibTarget constructor.
| xrl_router | the XrlRouter instance handling sending and receiving XRLs for this process. |
| urib4 | the IPv4 unicast RIB. |
| mrib4 | the IPv4 multicast RIB. |
| urib6 | the IPv6 unicast RIB. |
| mrib6 | the IPv6 multicast RIB. |
| vif_manager | the VifManager for this process handling communication with the FEA regarding VIF changes. |
| rib_manager | the RibManager for this process. |
| XrlCmdError XrlRibTarget::common_0_1_startup | ( | ) | [inline, protected, virtual] |
Pure-virtual function that needs to be implemented to:
Request a startup of Xrl Target
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::policy_backend_0_1_configure | ( | const uint32_t & | filter, |
| const string & | conf | ||
| ) | [protected, virtual] |
Configure a policy filter.
| filter | id of filter to configure. |
| conf | configuration of filter. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::policy_backend_0_1_reset | ( | const uint32_t & | filter | ) | [protected, virtual] |
| XrlCmdError XrlRibTarget::profile_0_1_clear | ( | const string & | pname | ) | [protected, virtual] |
| XrlCmdError XrlRibTarget::profile_0_1_disable | ( | const string & | pname | ) | [protected, virtual] |
| XrlCmdError XrlRibTarget::profile_0_1_enable | ( | const string & | pname | ) | [protected, virtual] |
| XrlCmdError XrlRibTarget::profile_0_1_get_entries | ( | const string & | pname, |
| const string & | instance_name | ||
| ) | [protected, virtual] |
Get log entries.
| pname | profile variable |
| instance_name | to send the profiling info to. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_add_igp_table4 | ( | const string & | protocol, |
| const string & | target_class, | ||
| const string & | target_instance, | ||
| const bool & | unicast, | ||
| const bool & | multicast | ||
| ) | [protected, virtual] |
Add/delete an IGP or EGP table.
| protocol | the name of the protocol. |
| target_class | the target class of the protocol. |
| target_instance | the target instance of the protocol. |
| unicast | true if the table is for the unicast RIB. |
| multicast | true if the table is for the multicast RIB. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_add_interface_route4 | ( | const string & | protocol, |
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| const IPv4Net & | network, | ||
| const IPv4 & | nexthop, | ||
| const string & | ifname, | ||
| const string & | vifname, | ||
| const uint32_t & | metric, | ||
| const XrlAtomList & | policytags | ||
| ) | [protected, virtual] |
Add/replace a route by explicitly specifying the network interface toward the destination.
| protocol | the name of the protocol this route comes from. |
| unicast | true if the route is for the unicast RIB. |
| multicast | true if the route is for the multicast RIB. |
| network | the network address prefix of the route. |
| nexthop | the address of the next-hop router toward the destination. |
| ifname | of the name of the physical interface toward the destination. |
| vifname | of the name of the virtual interface toward the destination. |
| metric | the routing metric. |
| policytags | the policy-tags for this route. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_add_route4 | ( | const string & | protocol, |
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| const IPv4Net & | network, | ||
| const IPv4 & | nexthop, | ||
| const uint32_t & | metric, | ||
| const XrlAtomList & | policytags | ||
| ) | [protected, virtual] |
Add/replace/delete a route.
| protocol | the name of the protocol this route comes from. |
| unicast | true if the route is for the unicast RIB. |
| multicast | true if the route is for the multicast RIB. |
| network | the network address prefix of the route. |
| nexthop | the address of the next-hop router toward the destination. |
| metric | the routing metric. |
| policytags | the policy-tags for this route. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_add_vif_addr4 | ( | const string & | name, |
| const IPv4 & | addr, | ||
| const IPv4Net & | subnet | ||
| ) | [protected, virtual] |
| XrlCmdError XrlRibTarget::rib_0_1_deregister_interest4 | ( | const string & | target, |
| const IPv4 & | addr, | ||
| const uint32_t & | prefix_len | ||
| ) | [protected, virtual] |
De-register an interest in a route.
| target | the name of the XRL module that registered the interest. |
| addr | the address of the previous registered interest. addr should be the base address of the add/prefix_len subnet. |
| prefix_len | the prefix length of the registered interest, as given in the response from register_interest. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_get_protocol_admin_distance | ( | const string & | protocol, |
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| uint32_t & | admin_distance | ||
| ) | [protected, virtual] |
| XrlCmdError XrlRibTarget::rib_0_1_get_protocol_admin_distances | ( | const bool & | ipv4, |
| const bool & | unicast, | ||
| XrlAtomList & | protocols, | ||
| XrlAtomList & | admin_distances | ||
| ) | [protected, virtual] |
Get the configured admin distances from a selected RIB for all routing protocols configured with one.
| ipv4 | true if we're looking in the ipv4 RIB. false if we're looking in the ipv6 RIB. |
| unicast | true if we're looking in the unicast RIB. false if we're looking in the multicast RIB. |
| protocols | the name of the protocols. |
| admin_distance | the returned admin distances. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_get_registered_protocols | ( | const bool & | ipv4, |
| const bool & | ipv6, | ||
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| XrlAtomList & | ipv4_unicast_protocols, | ||
| XrlAtomList & | ipv6_unicast_protocols, | ||
| XrlAtomList & | ipv4_multicast_protocols, | ||
| XrlAtomList & | ipv6_multicast_protocols | ||
| ) | [protected, virtual] |
Get the list of registered protocols.
| ipv4 | if true, then include the IPv4 protocols. |
| ipv6 | if true, then include the IPv6 protocols. |
| unicast | if true, then include the protocols registered with the unicast RIB. |
| multicast | if true, then include the protocols registered with the multicast RIB. |
| ipv4_unicast_protocols | the list of IPv4 protocols registered with the unicast RIB. |
| ipv6_unicast_protocols | the list of IPv6 protocols registered with the unicast RIB. |
| ipv4_multicast_protocols | the list of IPv4 protocols registered with the multicast RIB. |
| ipv6_multicast_protocols | the list of IPv6 protocols registered with the multicast RIB. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_insert_policy_redist_tags | ( | const string & | protocol, |
| const XrlAtomList & | policytags | ||
| ) | [protected, virtual] |
Redistribute to a protocol based on policy-tags.
| protocol | protocol to redistribute to |
| policytags | policy-tags of routes which need to be redistributed. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_lookup_route_by_dest4 | ( | const IPv4 & | addr, |
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| IPv4 & | nexthop | ||
| ) | [protected, virtual] |
Lookup nexthop.
| addr | address to lookup. |
| unicast | look in unicast RIB. |
| multicast | look in multicast RIB. |
| nexthop | contains the resolved nexthop if successful, IPv4::ZERO otherwise. It is an error for the unicast and multicast fields to both be true or both false. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_new_vif | ( | const string & | name | ) | [protected, virtual] |
Add a vif or a vif address to the RIB.
This interface should be used only for testing purpose.
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_redist_disable4 | ( | const string & | to_xrl_target, |
| const string & | from_protocol, | ||
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| const string & | cookie | ||
| ) | [protected, virtual] |
Disable route redistribution from one routing protocol to another.
| to_xrl_target | the XRL Target instance name of the caller. The caller must implement redist4/0.1 and previously called redist_enable4. |
| unicast | disable for unicast RIBs matching from and to. |
| multicast | disable for multicast RIBs matching from and to. |
| cookie | a text value passed back to creator in each call from the RIB. This allows creators to identity the source of updates it receives through the redist4/0.1 interface. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_redist_enable4 | ( | const string & | to_xrl_target, |
| const string & | from_protocol, | ||
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| const IPv4Net & | network_prefix, | ||
| const string & | cookie | ||
| ) | [protected, virtual] |
Enable route redistribution from one routing protocol to another.
| to_xrl_target | the XRL Target instance name of the caller. The caller must implement redist4/0.1. |
| from_protocol | the name of the routing process routes are to be redistributed from. |
| unicast | enable for unicast RIBs matching from and to. |
| multicast | enable for multicast RIBs matching from and to. |
| network_prefix | redistribite only the routes that fall into this prefix address. |
| cookie | a text value passed back to creator in each call from the RIB. This allows creators to identity the source of updates it receives through the redist4/0.1 interface. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_redist_transaction_disable4 | ( | const string & | to_xrl_target, |
| const string & | from_protocol, | ||
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| const string & | cookie | ||
| ) | [protected, virtual] |
Disable transaction-based route redistribution from one routing protocol to another.
| to_xrl_target | the XRL Target instance name of the caller. The caller must implement redist_transaction4/0.1 and previously called redist_transaction_enable4. |
| unicast | disable for unicast RIBs matching from and to. |
| multicast | disable for multicast RIBs matching from and to. |
| cookie | a text value passed back to creator in each call from the RIB. This allows creators to identity the source of updates it receives through the redist_transaction4/0.1 interface. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_redist_transaction_enable4 | ( | const string & | to_xrl_target, |
| const string & | from_protocol, | ||
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| const IPv4Net & | network_prefix, | ||
| const string & | cookie | ||
| ) | [protected, virtual] |
Enable transaction-based route redistribution from one routing protocol to another.
| to_xrl_target | the XRL Target instance name of the caller. The caller must implement redist_transaction4/0.1. |
| from_protocol | the name of the routing process routes are to be redistributed from. |
| unicast | enable for unicast RIBs matching from and to. |
| multicast | enable for multicast RIBs matching from and to. |
| network_prefix | redistribite only the routes that fall into this prefix address. |
| cookie | a text value passed back to creator in each call from the RIB. This allows creators to identity the source of updates it receives through the redist_transaction4/0.1 interface. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_register_interest4 | ( | const string & | target, |
| const IPv4 & | addr, | ||
| bool & | resolves, | ||
| IPv4 & | base_addr, | ||
| uint32_t & | prefix_len, | ||
| uint32_t & | real_prefix_len, | ||
| IPv4 & | nexthop, | ||
| uint32_t & | metric | ||
| ) | [protected, virtual] |
Register an interest in a route.
| target | the name of the XRL module to notify when the information returned by this call becomes invalid. |
| addr | address of interest. |
| resolves | returns whether or not the address resolves to a route that can be used for forwarding. |
| base_addr | returns the address of interest (actually the base address of the subnet covered by addr/prefix_len). |
| prefix_len | returns the prefix length that the registration covers. This response applies to all addresses in addr/prefix_len. |
| real_prefix_len | returns the actual prefix length of the route that will be used to route addr. If real_prefix_len is not the same as prefix_len, this is because there are some more specific routes that overlap addr/real_prefix_len. real_prefix_len is primarily given for debugging reasons. |
| nexthop | returns the address of the next hop for packets sent to addr. |
| metric | returns the IGP metric for this route. |
Implements XrlRibTargetBase.
| XrlCmdError XrlRibTarget::rib_0_1_set_protocol_admin_distance | ( | const string & | protocol, |
| const bool & | ipv4, | ||
| const bool & | ipv6, | ||
| const bool & | unicast, | ||
| const bool & | multicast, | ||
| const uint32_t & | admin_distance | ||
| ) | [protected, virtual] |
Set the configured admin distance for a routing protocol in one or many RIBs.
| protocol | the name of the protocol. |
| ipv4 | true if we should set it for the ipv4 RIBs. |
| ipv6 | true if we should set it for the ipv6 RIBs. |
| unicast | true if we should set it for the unicast RIBs. |
| multicast | true if we should set it for the multicast RIBs. |
| admin_distance | the admin distance. |
Implements XrlRibTargetBase.