xorp

xrl_target_rip.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 
00022 #ifndef __RIP_XRL_TARGET_RIP_HH__
00023 #define __RIP_XRL_TARGET_RIP_HH__
00024 
00025 #include "libxorp/status_codes.h"
00026 #include "xrl/targets/rip_base.hh"
00027 
00028 class XrlRouter;
00029 class XrlProcessSpy;
00030 
00031 template<typename A> class System;
00032 template<typename A> class XrlPortManager;
00033 template<typename A> class XrlRipCommonTarget;
00034 template<typename A> class XrlRedistManager;
00035 
00036 class XrlRipTarget : public XrlRipTargetBase {
00037 public:
00038     XrlRipTarget(EventLoop&         e,
00039          XrlRouter&             xr,
00040          XrlProcessSpy&         xps,
00041          XrlPortManager<IPv4>&      xpm,
00042          XrlRedistManager<IPv4>&    xrm,
00043          System<IPv4>&          rip_system);
00044     ~XrlRipTarget();
00045 
00046     void set_status(ProcessStatus ps, const string& annotation = "");
00047 
00048     XrlCmdError common_0_1_get_target_name(string& name);
00049     XrlCmdError common_0_1_get_version(string& version);
00050     XrlCmdError common_0_1_get_status(uint32_t& status, string& reason);
00051     XrlCmdError common_0_1_shutdown();
00052     XrlCmdError common_0_1_startup();
00053 
00054     XrlCmdError
00055     finder_event_observer_0_1_xrl_target_birth(const string& class_name,
00056                            const string& instance_name);
00057 
00058     XrlCmdError
00059     finder_event_observer_0_1_xrl_target_death(const string& class_name,
00060                            const string& instance_name);
00061 
00062     XrlCmdError
00063     rip_0_1_add_rip_address(const string&   ifname,
00064                 const string&   vifname,
00065                 const IPv4&     addr);
00066 
00067     XrlCmdError
00068     rip_0_1_remove_rip_address(const string&    ifname,
00069                    const string&    vifname,
00070                    const IPv4&  addr);
00071 
00072     XrlCmdError
00073     rip_0_1_set_rip_address_enabled(const string&   ifname,
00074                     const string&   vifname,
00075                     const IPv4&     addr,
00076                     const bool&     enabled);
00077 
00078     XrlCmdError
00079     rip_0_1_rip_address_enabled(const string&   ifname,
00080                 const string&   vifname,
00081                 const IPv4& addr,
00082                 bool&       enabled);
00083 
00084     XrlCmdError rip_0_1_set_cost(const string&      ifname,
00085                  const string&      vifname,
00086                  const IPv4&        addr,
00087                  const uint32_t&    cost);
00088 
00089     XrlCmdError rip_0_1_cost(const string&  ifname,
00090                  const string&  vifname,
00091                  const IPv4&    addr,
00092                  uint32_t&      cost);
00093 
00094     XrlCmdError rip_0_1_set_horizon(const string&   ifname,
00095                     const string&   vifname,
00096                     const IPv4&     addr,
00097                     const string&   horizon);
00098 
00099     XrlCmdError rip_0_1_horizon(const string&   ifname,
00100                 const string&   vifname,
00101                 const IPv4& addr,
00102                 string&     horizon);
00103 
00104     XrlCmdError rip_0_1_set_passive(const string&   ifname,
00105                     const string&   vifname,
00106                     const IPv4&     addr,
00107                     const bool&     passive);
00108 
00109     XrlCmdError rip_0_1_passive(const string&   ifname,
00110                 const string&   vifname,
00111                 const IPv4& addr,
00112                 bool&       passive);
00113 
00114     XrlCmdError
00115     rip_0_1_set_accept_non_rip_requests(const string&   ifname,
00116                     const string&   vifname,
00117                     const IPv4& addr,
00118                     const bool& accept);
00119 
00120     XrlCmdError rip_0_1_accept_non_rip_requests(const string&   ifname,
00121                         const string&   vifname,
00122                         const IPv4& addr,
00123                         bool&       accept);
00124 
00125     XrlCmdError rip_0_1_set_accept_default_route(const string&  ifname,
00126                          const string&  vifname,
00127                          const IPv4&    addr,
00128                          const bool&    accept);
00129 
00130     XrlCmdError rip_0_1_accept_default_route(const string&  ifname,
00131                          const string&  vifname,
00132                          const IPv4&    addr,
00133                          bool&      accept);
00134 
00135     XrlCmdError
00136     rip_0_1_set_advertise_default_route(const string&   ifname,
00137                     const string&   vifname,
00138                     const IPv4& addr,
00139                     const bool& advertise);
00140 
00141     XrlCmdError rip_0_1_advertise_default_route(const string&   ifname,
00142                         const string&   vifname,
00143                         const IPv4& addr,
00144                         bool&       advertise);
00145 
00146     XrlCmdError
00147     rip_0_1_set_route_timeout(const string& ifname,
00148                   const string& vifname,
00149                   const IPv4&   addr,
00150                   const uint32_t&   t_secs);
00151 
00152     XrlCmdError
00153     rip_0_1_route_timeout(const string& ifname,
00154               const string& vifname,
00155               const IPv4&   addr,
00156               uint32_t& t_secs);
00157 
00158     XrlCmdError
00159     rip_0_1_set_deletion_delay(const string&    ifname,
00160                    const string&    vifname,
00161                    const IPv4&  addr,
00162                    const uint32_t&  t_secs);
00163 
00164     XrlCmdError
00165     rip_0_1_deletion_delay(const string&    ifname,
00166                const string&    vifname,
00167                const IPv4&      addr,
00168                uint32_t&        t_secs);
00169 
00170     XrlCmdError
00171     rip_0_1_set_request_interval(const string&      ifname,
00172                  const string&      vifname,
00173                  const IPv4&        addr,
00174                  const uint32_t&    t_secs);
00175 
00176     XrlCmdError
00177     rip_0_1_request_interval(const string&  ifname,
00178                  const string&  vifname,
00179                  const IPv4&    addr,
00180                  uint32_t&      t_secs);
00181 
00182     XrlCmdError
00183     rip_0_1_set_update_interval(const string&   ifname,
00184                 const string&   vifname,
00185                 const IPv4& addr,
00186                 const uint32_t& t_secs);
00187 
00188     XrlCmdError
00189     rip_0_1_update_interval(const string&   ifname,
00190                 const string&   vifname,
00191                 const IPv4&     addr,
00192                 uint32_t&       t_secs);
00193 
00194     XrlCmdError
00195     rip_0_1_set_update_jitter(const string& ifname,
00196                   const string& vifname,
00197                   const IPv4&   addr,
00198                   const uint32_t&   t_jitter);
00199 
00200     XrlCmdError
00201     rip_0_1_update_jitter(const string&     ifname,
00202               const string&     vifname,
00203               const IPv4&       addr,
00204               uint32_t&     t_jitter);
00205 
00206     XrlCmdError
00207     rip_0_1_set_triggered_update_delay(const string&    ifname,
00208                        const string&    vifname,
00209                        const IPv4&  addr,
00210                        const uint32_t&  t_secs);
00211 
00212     XrlCmdError
00213     rip_0_1_triggered_update_delay(const string&    ifname,
00214                    const string&    vifname,
00215                    const IPv4&      addr,
00216                    uint32_t&        t_secs);
00217 
00218     XrlCmdError
00219     rip_0_1_set_triggered_update_jitter(const string&   ifname,
00220                     const string&   vifname,
00221                     const IPv4& addr,
00222                     const uint32_t& t_jitter);
00223 
00224     XrlCmdError
00225     rip_0_1_triggered_update_jitter(const string&   ifname,
00226                     const string&   vifname,
00227                     const IPv4&     addr,
00228                     uint32_t&       t_jitter);
00229 
00230     XrlCmdError
00231     rip_0_1_set_interpacket_delay(const string&     ifname,
00232                   const string&     vifname,
00233                   const IPv4&       addr,
00234                   const uint32_t&   t_msecs);
00235 
00236     XrlCmdError
00237     rip_0_1_interpacket_delay(const string& ifname,
00238                   const string& vifname,
00239                   const IPv4&   addr,
00240                   uint32_t&     t_msecs);
00241 
00242     XrlCmdError rip_0_1_set_simple_authentication_key(
00243     // Input values,
00244     const string&   ifname,
00245     const string&   vifname,
00246     const IPv4& addr,
00247     const string&   password);
00248 
00249     XrlCmdError rip_0_1_delete_simple_authentication_key(
00250     // Input values,
00251     const string&   ifname,
00252     const string&   vifname,
00253     const IPv4& addr);
00254 
00255     XrlCmdError rip_0_1_set_md5_authentication_key(
00256     // Input values,
00257     const string&   ifname,
00258     const string&   vifname,
00259     const IPv4& addr,
00260     const uint32_t& key_id,
00261     const string&   password,
00262     const string&   start_time,
00263     const string&   end_time);
00264 
00265     XrlCmdError rip_0_1_delete_md5_authentication_key(
00266     // Input values,
00267     const string&   ifname,
00268     const string&   vifname,
00269     const IPv4& addr,
00270     const uint32_t& key_id);
00271 
00272     XrlCmdError rip_0_1_rip_address_status(const string&    ifname,
00273                        const string&    vifname,
00274                        const IPv4&      addr,
00275                        string&      status);
00276 
00277     XrlCmdError rip_0_1_get_all_addresses(XrlAtomList&  ifnames,
00278                       XrlAtomList&  vifnames,
00279                       XrlAtomList&  addrs);
00280 
00281     XrlCmdError rip_0_1_get_peers(const string&     ifname,
00282                   const string&     vifname,
00283                   const IPv4&       addr,
00284                   XrlAtomList&      peers);
00285 
00286     XrlCmdError rip_0_1_get_all_peers(XrlAtomList&  peers,
00287                       XrlAtomList&  ifnames,
00288                       XrlAtomList&  vifnames,
00289                       XrlAtomList&  addrs);
00290 
00291     XrlCmdError rip_0_1_get_counters(const string&  ifname,
00292                      const string&  vifname,
00293                      const IPv4&    addr,
00294                      XrlAtomList&   descriptions,
00295                      XrlAtomList&   values);
00296 
00297     XrlCmdError rip_0_1_get_peer_counters(const string& ifname,
00298                       const string& vifname,
00299                       const IPv4&   addr,
00300                       const IPv4&   peer,
00301                       XrlAtomList&  descriptions,
00302                       XrlAtomList&  values,
00303                       uint32_t& peer_last_active);
00304 
00305     XrlCmdError rip_0_1_trace(const string& tvar,
00306                   const bool& enable);
00307 
00308     XrlCmdError socket4_user_0_1_recv_event(const string&   sockid,
00309                         const string&   if_name,
00310                         const string&   vif_name,
00311                         const IPv4&     src_host,
00312                         const uint32_t& src_port,
00313                         const vector<uint8_t>& pdata);
00314 
00315     XrlCmdError socket4_user_0_1_inbound_connect_event(
00316     const string&   sockid,
00317     const IPv4& src_host,
00318     const uint32_t& src_port,
00319     const string&   new_sockid,
00320     bool&       accept);
00321 
00322     XrlCmdError socket4_user_0_1_outgoing_connect_event(
00323     const string&   sockid);
00324 
00325     XrlCmdError socket4_user_0_1_error_event(const string&  sockid,
00326                          const string&  reason,
00327                          const bool&    fatal);
00328 
00329     XrlCmdError socket4_user_0_1_disconnect_event(const string& sockid);
00330 
00331 
00332     XrlCmdError policy_backend_0_1_configure(
00333         // Input values,
00334         const uint32_t& filter,
00335         const string&   conf);
00336 
00337     XrlCmdError policy_backend_0_1_reset(
00338         // Input values,
00339         const uint32_t& filter);
00340 
00341     XrlCmdError policy_backend_0_1_push_routes();
00342 
00343     XrlCmdError policy_redist4_0_1_add_route4(
00344         // Input values,
00345         const IPv4Net&  network,
00346         const bool&     unicast,
00347         const bool&     multicast,
00348         const IPv4&     nexthop,
00349         const uint32_t& metric,
00350         const XrlAtomList&      policytags);
00351 
00352     XrlCmdError policy_redist4_0_1_delete_route4(
00353         // Input values,
00354         const IPv4Net&  network,
00355         const bool&     unicast,
00356         const bool&     multicast);
00357 
00358 protected:
00359     EventLoop&          _e;
00360     XrlRipCommonTarget<IPv4>*   _ct;
00361 };
00362 
00363 #endif // __RIP_XRL_TARGET_RIP_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations