routing.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2003, 2004, 2005 Laboratoire de Recherche en Informatique
00002 
00003 // This file is part of Qolyester.
00004 
00005 // Qolyester is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 
00010 // Qolyester is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018 
00019 #ifndef QOLYESTER_DAEMON_SYS_ROUTING_HXX
00020 # define QOLYESTER_DAEMON_SYS_ROUTING_HXX 1
00021 
00022 # include <stdexcept>
00023 # include <ostream>
00024 # include "routing.hh"
00025 # include "utl/log.hh"
00026 
00027 namespace olsr {
00028 
00029   namespace sys {
00030 
00031     void
00032     RoutingActions::print_kernel_routes() {
00033       _rs.print_kernel_routes();
00034     }
00035 
00036     void
00037     RoutingActions::remove_old_routes() {
00038       try {
00039         _rs.remove_old_routes();
00040       } catch (std::runtime_error& e) {
00041         error << e.what() << std::endl;
00042       }
00043     }
00044 
00045     void
00046     RoutingActions::add_local_route(const net::LocalRoute& r) {
00047       try {
00048         _rs.add_local_route(r.dest_addr(), r.prefix(), r.interface_info());
00049       } catch (std::runtime_error& e) {
00050         error << e.what() << std::endl;
00051       }
00052     }
00053 
00054     void
00055     RoutingActions::add_remote_route(const net::RemoteRoute& r) {
00056       try {
00057         _rs.add_remote_route(r.dest_addr(), r.prefix(), r.next_addr());
00058       } catch (std::runtime_error& e) {
00059         error << e.what() << std::endl;
00060       }
00061     }
00062 
00063     void
00064     RoutingActions::remove_local_route(const net::LocalRoute& r) {
00065       try {
00066         _rs.remove_local_route(r.dest_addr(), r.prefix(), r.interface_info());
00067       } catch (std::runtime_error& e) {
00068         error << e.what() << std::endl;
00069       }
00070     }
00071 
00072     void
00073     RoutingActions::remove_remote_route(const net::RemoteRoute& r) {
00074       try {
00075         _rs.remove_remote_route(r.dest_addr(), r.prefix(), r.next_addr());
00076       } catch (std::runtime_error& e) {
00077         error << e.what() << std::endl;
00078       }
00079     }
00080 
00081   } // namespace sys
00082 
00083 } // namespace olsr
00084 
00085 #endif // ! QOLYESTER_DAEMON_SYS_ROUTING_HXX

Generated on Mon Sep 10 17:02:12 2007 for Qolyester daemon by  doxygen 1.5.1