00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 }
00085
00086 }
00087
00088 #endif // ! QOLYESTER_DAEMON_NET_ROUTE_HXX