xorp

xrl_target.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 // vim:set sts=4 ts=8:
00003 
00004 // Copyright (c) 2001-2011 XORP, Inc and Others
00005 //
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License, Version 2, June
00008 // 1991 as published by the Free Software Foundation. Redistribution
00009 // and/or modification of this program under the terms of any other
00010 // version of the GNU General Public License is not permitted.
00011 // 
00012 // This program is distributed in the hope that it will be useful, but
00013 // WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00015 // see the GNU General Public License, Version 2, a copy of which can be
00016 // found in the XORP LICENSE.gpl file.
00017 // 
00018 // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00019 // http://xorp.net
00020 
00021 // $XORP: xorp/rib/xrl_target.hh,v 1.38 2008/10/02 21:58:14 bms Exp $
00022 
00023 #ifndef __RIB_XRL_TARGET_HH__
00024 #define __RIB_XRL_TARGET_HH__
00025 
00026 #include "libxipc/xrl_router.hh"
00027 
00028 #include "xrl/targets/rib_base.hh"
00029 
00030 #include "rib.hh"
00031 #include "vifmanager.hh"
00032 
00033 
00040 class XrlRibTarget : public XrlRibTargetBase {
00041 public:
00055     XrlRibTarget(XrlRouter* xrl_router,
00056          RIB<IPv4>& urib4, RIB<IPv4>& mrib4,
00057 #ifdef HAVE_IPV6
00058          RIB<IPv6>& urib6, RIB<IPv6>& mrib6,
00059 #endif
00060          VifManager& vif_manager, RibManager* rib_manager)
00061     : XrlRibTargetBase(xrl_router),
00062       _urib4(urib4), _mrib4(mrib4),
00063 #ifdef HAVE_IPV6
00064       _urib6(urib6), _mrib6(mrib6),
00065 #endif
00066       _vif_manager(vif_manager), _rib_manager(rib_manager) {}
00070     ~XrlRibTarget() {}
00071 
00072 protected:
00073     RIB<IPv4>&  _urib4;
00074     RIB<IPv4>&  _mrib4;
00075 #ifdef HAVE_IPV6
00076     RIB<IPv6>&  _urib6;
00077     RIB<IPv6>&  _mrib6;
00078 #endif
00079     VifManager& _vif_manager;
00080     RibManager* _rib_manager;
00081 
00082 protected:
00083 
00087     XrlCmdError common_0_1_get_target_name(
00088     // Output values,
00089     string& name);
00090 
00094     XrlCmdError common_0_1_get_version(
00095     // Output values,
00096     string& version);
00097 
00101     XrlCmdError common_0_1_get_status(
00102     // Output values,
00103         uint32_t& status,
00104     string& reason);
00105 
00109     XrlCmdError common_0_1_shutdown();
00110 
00111     XrlCmdError common_0_1_startup() { return rib_0_1_start_rib(); }
00112 
00116     XrlCmdError rib_0_1_enable_rib();
00117 
00118     XrlCmdError rib_0_1_disable_rib();
00119 
00120     XrlCmdError rib_0_1_start_rib();
00121 
00122     XrlCmdError rib_0_1_stop_rib();
00123 
00127     XrlCmdError rib_0_1_make_errors_fatal();
00128 
00154     XrlCmdError rib_0_1_get_registered_protocols(
00155     // Input values,
00156     const bool& ipv4,
00157     const bool& ipv6,
00158     const bool& unicast,
00159     const bool& multicast,
00160     // Output values,
00161     XrlAtomList&    ipv4_unicast_protocols,
00162     XrlAtomList&    ipv6_unicast_protocols,
00163     XrlAtomList&    ipv4_multicast_protocols,
00164     XrlAtomList&    ipv6_multicast_protocols);
00165 
00179     XrlCmdError rib_0_1_add_igp_table4(
00180     // Input values,
00181     const string&   protocol,
00182     const string&   target_class,
00183     const string&   target_instance,
00184     const bool& unicast,
00185     const bool& multicast);
00186 
00187     XrlCmdError rib_0_1_delete_igp_table4(
00188     // Input values,
00189     const string&   protocol,
00190     const string&   target_class,
00191     const string&   target_instance,
00192     const bool& unicast,
00193     const bool& multicast);
00194 
00195     XrlCmdError rib_0_1_add_egp_table4(
00196     // Input values,
00197     const string&   protocol,
00198     const string&   target_class,
00199     const string&   target_instance,
00200     const bool& unicast,
00201     const bool& multicast);
00202 
00203     XrlCmdError rib_0_1_delete_egp_table4(
00204     // Input values,
00205     const string&   protocol,
00206     const string&   target_class,
00207     const string&   target_instance,
00208     const bool& unicast,
00209     const bool& multicast);
00210 
00229     XrlCmdError rib_0_1_add_route4(
00230     // Input values,
00231     const string&   protocol,
00232     const bool& unicast,
00233     const bool& multicast,
00234     const IPv4Net&  network,
00235     const IPv4&     nexthop,
00236     const uint32_t& metric,
00237     const XrlAtomList&  policytags);
00238 
00239     XrlCmdError rib_0_1_replace_route4(
00240     // Input values,
00241     const string&   protocol,
00242     const bool& unicast,
00243     const bool& multicast,
00244     const IPv4Net&  network,
00245     const IPv4&     nexthop,
00246     const uint32_t& metric,
00247     const XrlAtomList&  policytags);
00248 
00249     XrlCmdError rib_0_1_delete_route4(
00250     // Input values,
00251     const string&   protocol,
00252     const bool& unicast,
00253     const bool& multicast,
00254     const IPv4Net&  network);
00255 
00281     XrlCmdError rib_0_1_add_interface_route4(
00282     // Input values,
00283     const string&       protocol,
00284     const bool&     unicast,
00285     const bool&     multicast,
00286     const IPv4Net&      network,
00287     const IPv4&     nexthop,
00288     const string&       ifname,
00289     const string&       vifname,
00290     const uint32_t&     metric,
00291     const XrlAtomList&  policytags);
00292 
00293     XrlCmdError rib_0_1_replace_interface_route4(
00294     // Input values,
00295     const string&       protocol,
00296     const bool&     unicast,
00297     const bool&     multicast,
00298     const IPv4Net&      network,
00299     const IPv4&     nexthop,
00300     const string&       ifname,
00301     const string&       vifname,
00302     const uint32_t&     metric,
00303     const XrlAtomList&  policytags);
00304 
00318     XrlCmdError rib_0_1_lookup_route_by_dest4(
00319     // Input values,
00320     const IPv4& addr,
00321     const bool& unicast,
00322     const bool& multicast,
00323     // Output values,
00324     IPv4&       nexthop);
00325 
00332     XrlCmdError rib_0_1_new_vif(
00333     // Input values,
00334     const string&   name);
00335 
00346     XrlCmdError rib_0_1_add_vif_addr4(
00347     // Input values,
00348     const string&   name,
00349     const IPv4& addr,
00350     const IPv4Net&  subnet);
00351 
00372     XrlCmdError rib_0_1_redist_enable4(
00373     // Input values,
00374     const string&   to_xrl_target,
00375     const string&   from_protocol,
00376     const bool& unicast,
00377     const bool& multicast,
00378     const IPv4Net&  network_prefix,
00379     const string&   cookie);
00380 
00395     XrlCmdError rib_0_1_redist_disable4(
00396     // Input values,
00397     const string&   to_xrl_target,
00398     const string&   from_protocol,
00399     const bool& unicast,
00400     const bool& multicast,
00401     const string&   cookie);
00402 
00424     XrlCmdError rib_0_1_redist_transaction_enable4(
00425     // Input values,
00426     const string&   to_xrl_target,
00427     const string&   from_protocol,
00428     const bool& unicast,
00429     const bool& multicast,
00430     const IPv4Net&  network_prefix,
00431     const string&   cookie);
00432 
00449     XrlCmdError rib_0_1_redist_transaction_disable4(
00450     // Input values,
00451     const string&   to_xrl_target,
00452     const string&   from_protocol,
00453     const bool& unicast,
00454     const bool& multicast,
00455     const string&   cookie);
00456 
00485     XrlCmdError rib_0_1_register_interest4(
00486     // Input values,
00487         const string&   target,
00488     const IPv4& addr,
00489     // Output values,
00490     bool&       resolves,
00491     IPv4&       base_addr,
00492     uint32_t&   prefix_len,
00493     uint32_t&   real_prefix_len,
00494     IPv4&       nexthop,
00495     uint32_t&   metric);
00496 
00508     XrlCmdError rib_0_1_deregister_interest4(
00509     // Input values,
00510         const string&   target,
00511     const IPv4& addr,
00512     const uint32_t& prefix_len);
00513 
00525     XrlCmdError rib_0_1_get_protocol_admin_distances(
00526     // Input values,
00527     const bool& ipv4,
00528     const bool& unicast,
00529     // Output values,
00530     XrlAtomList&    protocols,
00531     XrlAtomList&    admin_distances);
00532 
00542     XrlCmdError rib_0_1_get_protocol_admin_distance(
00543     // Input values,
00544     const string&   protocol,
00545     const bool& unicast,
00546     const bool& multicast,
00547     // Output values,
00548     uint32_t&   admin_distance);
00549 
00561     XrlCmdError rib_0_1_set_protocol_admin_distance(
00562     // Input values,
00563     const string&   protocol,
00564     const bool& ipv4,
00565     const bool& ipv6,
00566     const bool& unicast,
00567     const bool& multicast,
00568     const uint32_t& admin_distance);
00569 
00573     XrlCmdError finder_event_observer_0_1_xrl_target_birth(
00574     // Input values,
00575     const string&   target_class,
00576     const string&   target_instance);
00577 
00581     XrlCmdError finder_event_observer_0_1_xrl_target_death(
00582     // Input values,
00583     const string&   target_class,
00584     const string&   target_instance);
00585 
00586 
00593     XrlCmdError policy_backend_0_1_configure(
00594         // Input values,
00595         const uint32_t& filter,
00596         const string&   conf);
00597       
00603     XrlCmdError policy_backend_0_1_reset(
00604         // Input values,
00605         const uint32_t& filter);
00606 
00610     XrlCmdError policy_backend_0_1_push_routes();
00611 
00612     
00619     XrlCmdError rib_0_1_insert_policy_redist_tags(
00620         // Input values,
00621         const string&   protocol,
00622         const XrlAtomList&      policytags);
00623 
00627     XrlCmdError rib_0_1_reset_policy_redist_tags();
00628 
00629 #ifdef HAVE_IPV6
00630 
00631     XrlCmdError rib_0_1_add_igp_table6(
00632     // Input values,
00633     const string&   protocol,
00634     const string&   target_class,
00635     const string&   target_instance,
00636     const bool& unicast,
00637     const bool& multicast);
00638 
00639 
00640     XrlCmdError rib_0_1_delete_igp_table6(
00641     // Input values,
00642     const string&   protocol,
00643     const string&   target_class,
00644     const string&   target_instance,
00645     const bool& unicast,
00646     const bool& multicast);
00647 
00648     XrlCmdError rib_0_1_add_egp_table6(
00649     // Input values,
00650     const string&   protocol,
00651     const string&   target_class,
00652     const string&   target_instance,
00653     const bool& unicast,
00654     const bool& multicast);
00655 
00656     XrlCmdError rib_0_1_delete_egp_table6(
00657     // Input values,
00658     const string&   protocol,
00659     const string&   target_class,
00660     const string&   target_instance,
00661     const bool& unicast,
00662     const bool& multicast);
00663 
00664     XrlCmdError rib_0_1_add_route6(
00665     // Input values,
00666     const string&   protocol,
00667     const bool& unicast,
00668     const bool& multicast,
00669     const IPv6Net&  network,
00670     const IPv6& nexthop,
00671     const uint32_t& metric,
00672     const XrlAtomList&  policytags);
00673 
00674     XrlCmdError rib_0_1_replace_route6(
00675     // Input values,
00676     const string&   protocol,
00677     const bool& unicast,
00678     const bool& multicast,
00679     const IPv6Net&  network,
00680     const IPv6& nexthop,
00681     const uint32_t& metric,
00682     const XrlAtomList&  policytags);
00683 
00684     XrlCmdError rib_0_1_delete_route6(
00685     // Input values,
00686     const string&   protocol,
00687     const bool& unicast,
00688     const bool& multicast,
00689     const IPv6Net&  network);
00690 
00691     XrlCmdError rib_0_1_add_interface_route6(
00692     // Input values,
00693     const string&       protocol,
00694     const bool&     unicast,
00695     const bool&     multicast,
00696     const IPv6Net&      network,
00697     const IPv6&     nexthop,
00698     const string&       ifname,
00699     const string&       vifname,
00700     const uint32_t&     metric,
00701     const XrlAtomList&  policytags);
00702 
00703     XrlCmdError rib_0_1_replace_interface_route6(
00704     // Input values,
00705     const string&       protocol,
00706     const bool&     unicast,
00707     const bool&     multicast,
00708     const IPv6Net&      network,
00709     const IPv6&     nexthop,
00710     const string&       ifname,
00711     const string&       vifname,
00712     const uint32_t&     metric,
00713     const XrlAtomList&  policytags);
00714 
00728     XrlCmdError rib_0_1_lookup_route_by_dest6(
00729     // Input values,
00730     const IPv6& addr,
00731     const bool& unicast,
00732     const bool& multicast,
00733     // Output values,
00734     IPv6&       nexthop);
00735 
00736     XrlCmdError rib_0_1_add_vif_addr6(
00737     // Input values,
00738     const string&   name,
00739     const IPv6& addr,
00740     const IPv6Net&  subnet);
00741 
00762     XrlCmdError rib_0_1_redist_enable6(
00763     // Input values,
00764     const string&   to_xrl_target,
00765     const string&   from_protocol,
00766     const bool& unicast,
00767     const bool& multicast,
00768     const IPv6Net&  network_prefix,
00769     const string&   cookie);
00770 
00785     XrlCmdError rib_0_1_redist_disable6(
00786     // Input values,
00787     const string&   to_xrl_target,
00788     const string&   from_protocol,
00789     const bool& unicast,
00790     const bool& multicast,
00791     const string&   cookie);
00792 
00814     XrlCmdError rib_0_1_redist_transaction_enable6(
00815     // Input values,
00816     const string&   to_xrl_target,
00817     const string&   from_protocol,
00818     const bool& unicast,
00819     const bool& multicast,
00820     const IPv6Net&  network_prefix,
00821     const string&   cookie);
00822 
00839     XrlCmdError rib_0_1_redist_transaction_disable6(
00840     // Input values,
00841     const string&   to_xrl_target,
00842     const string&   from_protocol,
00843     const bool& unicast,
00844     const bool& multicast,
00845     const string&   cookie);
00846 
00875     XrlCmdError rib_0_1_register_interest6(
00876     // Input values,
00877         const string&   target,
00878     const IPv6& addr,
00879     // Output values,
00880     bool&       resolves,
00881     IPv6&       base_addr,
00882     uint32_t&   prefix_len,
00883     uint32_t&   real_prefix_len,
00884     IPv6&       nexthop,
00885     uint32_t&   metric);
00886 
00898     XrlCmdError rib_0_1_deregister_interest6(
00899     // Input values,
00900         const string&   target,
00901     const IPv6& addr,
00902     const uint32_t& prefix_len);
00903 
00904 #endif //ipv6
00905 
00906 #ifndef XORP_DISABLE_PROFILE
00907 
00912      XrlCmdError profile_0_1_enable(
00913     // Input values,
00914     const string&   pname);
00915 
00921     XrlCmdError profile_0_1_disable(
00922     // Input values,
00923     const string&   pname);
00924 
00932     XrlCmdError profile_0_1_get_entries(
00933     // Input values,
00934     const string&   pname,
00935     const string&   instance_name);
00936 
00942     XrlCmdError profile_0_1_clear(
00943     // Input values,
00944     const string&   pname);
00945 
00949     XrlCmdError profile_0_1_list(
00950     // Output values,
00951     string& info);
00952 #endif
00953 };
00954 
00955 #endif // __RIB_XRL_TARGET_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations