xorp

xrl_target.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 // vim:set sts=4 ts=8 sw=4:
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/contrib/olsr/xrl_target.hh,v 1.3 2008/10/02 21:56:37 bms Exp $
00022 
00023 #ifndef __OLSR_XRL_TARGET_HH__
00024 #define __OLSR_XRL_TARGET_HH__
00025 
00026 #include "xrl/targets/olsr4_base.hh"
00027 
00028 #include "olsr.hh"
00029 
00033 class XrlOlsr4Target : public XrlOlsr4TargetBase {
00034 public:
00038     XrlOlsr4Target(XrlRouter* r, Olsr& olsr, XrlIO& xrl_io);
00039 
00043     XrlCmdError common_0_1_get_target_name(
00044     // Output values,
00045     string& name);
00046 
00050     XrlCmdError common_0_1_get_version(
00051     // Output values,
00052     string& version);
00053 
00057     XrlCmdError common_0_1_get_status(
00058     // Output values,
00059     uint32_t&   status,
00060     string&     reason);
00061 
00065     XrlCmdError common_0_1_shutdown();
00066 
00067     XrlCmdError common_0_1_startup() { return XrlCmdError::OKAY(); }
00068 
00075     XrlCmdError finder_event_observer_0_1_xrl_target_birth(
00076     // Input values,
00077     const string&   target_class,
00078     const string&   target_instance);
00079 
00086     XrlCmdError finder_event_observer_0_1_xrl_target_death(
00087     // Input values,
00088     const string&   target_class,
00089     const string&   target_instance);
00090 
00105     XrlCmdError socket4_user_0_1_recv_event(
00106     // Input values,
00107     const string&   sockid,
00108     const string&   if_name,
00109     const string&   vif_name,
00110     const IPv4& src_host,
00111     const uint32_t& src_port,
00112     const vector<uint8_t>&  data);
00113 
00128     XrlCmdError socket4_user_0_1_inbound_connect_event(
00129     // Input values,
00130     const string&   sockid,
00131     const IPv4& src_host,
00132     const uint32_t& src_port,
00133     const string&   new_sockid,
00134     // Output values,
00135     bool&   accept);
00136 
00146     XrlCmdError socket4_user_0_1_outgoing_connect_event(
00147     // Input values,
00148     const string&   sockid);
00149 
00158     XrlCmdError socket4_user_0_1_error_event(
00159     // Input values,
00160     const string&   sockid,
00161     const string&   error,
00162     const bool& fatal);
00163 
00172     XrlCmdError socket4_user_0_1_disconnect_event(
00173     // Input values,
00174     const string&   sockid);
00175 
00182     XrlCmdError policy_backend_0_1_configure(
00183     // Input values,
00184     const uint32_t& filter,
00185     const string&   conf);
00186 
00192     XrlCmdError policy_backend_0_1_reset(
00193     // Input values,
00194     const uint32_t& filter);
00195 
00199     XrlCmdError policy_backend_0_1_push_routes();
00200 
00211     XrlCmdError policy_redist4_0_1_add_route4(
00212     // Input values,
00213     const IPv4Net&  network,
00214     const bool& unicast,
00215     const bool& multicast,
00216     const IPv4& nexthop,
00217     const uint32_t& metric,
00218     const XrlAtomList&  policytags);
00219 
00227     XrlCmdError policy_redist4_0_1_delete_route4(
00228     // Input values,
00229     const IPv4Net&  network,
00230     const bool& unicast,
00231     const bool& multicast);
00232 
00238      XrlCmdError profile_0_1_enable(
00239     // Input values,
00240     const string&   pname);
00241 
00247      XrlCmdError profile_0_1_disable(
00248     // Input values,
00249     const string&   pname);
00250 
00257      XrlCmdError profile_0_1_get_entries(
00258     // Input values,
00259     const string&   pname,
00260     const string&   instance_name);
00261 
00267      XrlCmdError profile_0_1_clear(
00268     // Input values,
00269     const string&   pname);
00270 
00274      XrlCmdError profile_0_1_list(
00275     // Output values,
00276     string& info);
00277 
00284     XrlCmdError olsr4_0_1_trace(
00285     // Input values,
00286     const string&   tvar,
00287     const bool& enable);
00288 
00292     XrlCmdError olsr4_0_1_clear_database();
00293 
00299     XrlCmdError olsr4_0_1_set_willingness(
00300     // Input values,
00301     const uint32_t& willingness);
00302 
00306     XrlCmdError olsr4_0_1_get_willingness(
00307     // Output values,
00308     uint32_t&   willingness);
00309 
00315     XrlCmdError olsr4_0_1_set_mpr_coverage(
00316     // Input values,
00317     const uint32_t& coverage);
00318 
00322     XrlCmdError olsr4_0_1_get_mpr_coverage(
00323     // Output values,
00324     uint32_t&   coverage);
00325 
00329     XrlCmdError olsr4_0_1_set_tc_redundancy(
00330     // Input values,
00331     const string&   redundancy);
00332 
00336     XrlCmdError olsr4_0_1_get_tc_redundancy(
00337     // Output values,
00338     string& redundancy);
00339 
00345     XrlCmdError olsr4_0_1_set_tc_fisheye(
00346     // Input values,
00347     const bool& enabled);
00348 
00352     XrlCmdError olsr4_0_1_get_tc_fisheye(
00353     // Output values,
00354     bool&   enabled);
00355 
00359     XrlCmdError olsr4_0_1_set_hna_base_cost(
00360     // Input values,
00361     const uint32_t& metric);
00362 
00366     XrlCmdError olsr4_0_1_get_hna_base_cost(
00367     // Output values,
00368     uint32_t&   metric);
00369 
00375     XrlCmdError olsr4_0_1_set_hello_interval(
00376     // Input values,
00377     const uint32_t& interval);
00378 
00382     XrlCmdError olsr4_0_1_get_hello_interval(
00383     // Output values,
00384     uint32_t&   interval);
00385 
00391     XrlCmdError olsr4_0_1_set_refresh_interval(
00392     // Input values,
00393     const uint32_t& interval);
00394 
00398     XrlCmdError olsr4_0_1_get_refresh_interval(
00399     // Output values,
00400     uint32_t&   interval);
00401 
00407     XrlCmdError olsr4_0_1_set_tc_interval(
00408     // Input values,
00409     const uint32_t& interval);
00410 
00414     XrlCmdError olsr4_0_1_get_tc_interval(
00415     // Output values,
00416     uint32_t&   interval);
00417 
00423     XrlCmdError olsr4_0_1_set_mid_interval(
00424     // Input values,
00425     const uint32_t& interval);
00426 
00430     XrlCmdError olsr4_0_1_get_mid_interval(
00431     // Output values,
00432     uint32_t&   interval);
00433 
00439     XrlCmdError olsr4_0_1_set_hna_interval(
00440     // Input values,
00441     const uint32_t& interval);
00442 
00446     XrlCmdError olsr4_0_1_get_hna_interval(
00447     // Output values,
00448     uint32_t&   interval);
00449 
00455     XrlCmdError olsr4_0_1_set_dup_hold_time(
00456     // Input values,
00457     const uint32_t& dup_hold_time);
00458 
00462     XrlCmdError olsr4_0_1_get_dup_hold_time(
00463     // Output values,
00464     uint32_t&   dup_hold_time);
00465 
00471     XrlCmdError olsr4_0_1_set_main_address(
00472     // Input values,
00473     const IPv4& addr);
00474 
00478     XrlCmdError olsr4_0_1_get_main_address(
00479     // Output values,
00480     IPv4&       addr);
00481 
00505     XrlCmdError olsr4_0_1_bind_address(
00506     // Input values,
00507     const string&   ifname,
00508     const string&   vifname,
00509     const IPv4& local_addr,
00510     const uint32_t& local_port,
00511     const IPv4& all_nodes_addr,
00512     const uint32_t& all_nodes_port);
00513 
00520     XrlCmdError olsr4_0_1_unbind_address(
00521     // Input values,
00522     const string&   ifname,
00523     const string&   vifname);
00524 
00533     XrlCmdError olsr4_0_1_set_binding_enabled(
00534     // Input values,
00535     const string&   ifname,
00536     const string&   vifname,
00537     const bool& enabled);
00538 
00547     XrlCmdError olsr4_0_1_get_binding_enabled(
00548     // Input values,
00549     const string&   ifname,
00550     const string&   vifname,
00551     // Output values,
00552     bool&       enabled);
00553 
00564     XrlCmdError olsr4_0_1_change_local_addr_port(
00565     // Input values,
00566     const string&   ifname,
00567     const string&   vifname,
00568     const IPv4& local_addr,
00569     const uint32_t& local_port);
00570 
00581     XrlCmdError olsr4_0_1_change_all_nodes_addr_port(
00582     // Input values,
00583     const string&   ifname,
00584     const string&   vifname,
00585     const IPv4& all_nodes_addr,
00586     const uint32_t& all_nodes_port);
00587 
00593     XrlCmdError olsr4_0_1_get_interface_list(
00594     // Output values,
00595     XrlAtomList&    interfaces);
00596 
00608     XrlCmdError olsr4_0_1_get_interface_info(
00609     // Input values,
00610     const uint32_t& faceid,
00611     // Output values,
00612     string&     ifname,
00613     string&     vifname,
00614     IPv4&       local_addr,
00615     uint32_t&   local_port,
00616     IPv4&       all_nodes_addr,
00617     uint32_t&   all_nodes_port);
00618 
00626     XrlCmdError olsr4_0_1_set_interface_cost(
00627     // Input values,
00628     const string&   ifname,
00629     const string&   vifname,
00630     const uint32_t& cost);
00631 
00648     XrlCmdError olsr4_0_1_get_interface_stats(
00649     // Input values,
00650     const string&   ifname,
00651     const string&   vifname,
00652     // Output values,
00653     uint32_t&   bad_packets,
00654     uint32_t&   bad_messages,
00655     uint32_t&   messages_from_self,
00656     uint32_t&   unknown_messages,
00657     uint32_t&   duplicates,
00658     uint32_t&   forwarded);
00659 
00664     XrlCmdError olsr4_0_1_get_link_list(
00665     // Output values,
00666     XrlAtomList&    links);
00667 
00684     XrlCmdError olsr4_0_1_get_link_info(
00685     // Input values,
00686     const uint32_t& linkid,
00687     // Output values,
00688     IPv4&       local_addr,
00689     IPv4&       remote_addr,
00690     IPv4&       main_addr,
00691     uint32_t&   link_type,
00692     uint32_t&   sym_time,
00693     uint32_t&   asym_time,
00694     uint32_t&   hold_time);
00695 
00701     XrlCmdError olsr4_0_1_get_neighbor_list(
00702     // Output values,
00703     XrlAtomList&    neighbors);
00704 
00723     XrlCmdError olsr4_0_1_get_neighbor_info(
00724     // Input values,
00725     const uint32_t& nid,
00726     // Output values,
00727     IPv4&       main_addr,
00728     uint32_t&   willingness,
00729     uint32_t&   degree,
00730     uint32_t&   link_count,
00731     uint32_t&   twohop_link_count,
00732     bool&       is_advertised,
00733     bool&       is_sym,
00734     bool&       is_mpr,
00735     bool&       is_mpr_selector);
00736 
00742     XrlCmdError olsr4_0_1_get_twohop_link_list(
00743     // Output values,
00744     XrlAtomList&    twohop_links);
00745 
00758     XrlCmdError olsr4_0_1_get_twohop_link_info(
00759     // Input values,
00760     const uint32_t& tlid,
00761     // Output values,
00762     uint32_t&   last_face_id,
00763     IPv4&       nexthop_addr,
00764     IPv4&       dest_addr,
00765     uint32_t&   hold_time);
00766 
00772     XrlCmdError olsr4_0_1_get_twohop_neighbor_list(
00773     // Output values,
00774     XrlAtomList&    twohop_neighbors);
00775 
00790     XrlCmdError olsr4_0_1_get_twohop_neighbor_info(
00791     // Input values,
00792     const uint32_t& tnid,
00793     // Output values,
00794     IPv4&       main_addr,
00795     bool&       is_strict,
00796     uint32_t&   link_count,
00797     uint32_t&   reachability,
00798     uint32_t&   coverage);
00799 
00805     XrlCmdError olsr4_0_1_get_mid_entry_list(
00806     // Output values,
00807     XrlAtomList&    mid_entries);
00808 
00819     XrlCmdError olsr4_0_1_get_mid_entry(
00820     // Input values,
00821     const uint32_t& midid,
00822     // Output values,
00823     IPv4&       main_addr,
00824     IPv4&       iface_addr,
00825     uint32_t&   distance,
00826     uint32_t&   hold_time);
00827 
00833     XrlCmdError olsr4_0_1_get_tc_entry_list(
00834     // Output values,
00835     XrlAtomList&    tc_entries);
00836 
00848     XrlCmdError olsr4_0_1_get_tc_entry(
00849     // Input values,
00850     const uint32_t& tcid,
00851     // Output values,
00852     IPv4&       destination,
00853     IPv4&       lasthop,
00854     uint32_t&   distance,
00855     uint32_t&   seqno,
00856     uint32_t&   hold_time);
00857 
00863     XrlCmdError olsr4_0_1_get_hna_entry_list(
00864     // Output values,
00865     XrlAtomList&    hna_entries);
00866 
00877     XrlCmdError olsr4_0_1_get_hna_entry(
00878     // Input values,
00879     const uint32_t& hnaid,
00880     // Output values,
00881     IPv4Net&    destination,
00882     IPv4&       lasthop,
00883     uint32_t&   distance,
00884     uint32_t&   hold_time);
00885 
00886 private:
00887     Olsr&   _olsr;
00888     XrlIO&  _xrl_io;
00889 };
00890 
00891 #endif // __OLSR_XRL_TARGET_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations