Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

route.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_NET_ROUTE_HXX
00020 # define QOLYESTER_DAEMON_NET_ROUTE_HXX 1
00021 
00022 # include "route.hh"
00023 
00024 namespace olsr {
00025 
00026   namespace net {
00027 
00028     LocalRoute::LocalRoute()
00029       : _d_addr(),
00030         _prefix(0),
00031         _info(ifaceinfo_t())
00032     {}
00033 
00034     LocalRoute::LocalRoute(const address_t& d, unsigned p,
00035                            const ifaceinfo_t& i)
00036       : _d_addr(address_t::network(d, p)),
00037         _prefix(p),
00038         _info(i) {
00039       assert(_info.index() != 0);
00040     }
00041 
00042     LocalRoute::LocalRoute(const This& other)
00043       : _d_addr(other._d_addr),
00044         _prefix(other._prefix),
00045         _info(other._info) {
00046       assert(_info.index() != 0);
00047     }
00048 
00049     const LocalRoute&
00050     LocalRoute::make_key(const address_t& d, unsigned p) {
00051       const_cast<address_t&>(_dummy_for_find._d_addr) = d;
00052       const_cast<unsigned&>(_dummy_for_find._prefix) = p;
00053       return _dummy_for_find;
00054     }
00055 
00056     RemoteRoute::RemoteRoute()
00057       : _d_addr(),
00058         _prefix(0),
00059         _n_addr()
00060     {}
00061 
00062     RemoteRoute::RemoteRoute(const address_t& d, unsigned p,
00063                              const address_t& n)
00064       : _d_addr(address_t::network(d, p)),
00065         _prefix(p),
00066         _n_addr(n) {
00067       assert(_n_addr != address_t());
00068     }
00069 
00070     RemoteRoute::RemoteRoute(const This& other)
00071       : _d_addr(other._d_addr),
00072         _prefix(other._prefix),
00073         _n_addr(other._n_addr) {
00074       assert(_n_addr != address_t());
00075     }
00076 
00077     const RemoteRoute&
00078     RemoteRoute::make_key(const address_t& d, unsigned p) {
00079       const_cast<address_t&>(_dummy_for_find._d_addr) = d;
00080       const_cast<unsigned&>(_dummy_for_find._prefix) = p;
00081       return _dummy_for_find;
00082     }
00083 
00084   } // namespace net
00085 
00086 } // namespace olsr
00087 
00088 #endif // ! QOLYESTER_DAEMON_NET_ROUTE_HXX

Generated on Thu Jul 28 21:21:48 2005 for Qolyester daemon by  doxygen 1.4.1