summaryrefslogtreecommitdiff
path: root/src/syncOnConnect.hpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-12-21 15:03:59 +0000
committerOthmar Gsenger <otti@anytun.org>2008-12-21 15:03:59 +0000
commit9cd4786758a3e46c32c4536ff51bb2b81811507f (patch)
tree6ad8743850abd2e110558eecc7d46bcf6d25a619 /src/syncOnConnect.hpp
parentinclude path fixed for windows TunDevice (diff)
added ipv6 routing support
routing still only works if all routes have the same netmask
Diffstat (limited to 'src/syncOnConnect.hpp')
-rw-r--r--src/syncOnConnect.hpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/syncOnConnect.hpp b/src/syncOnConnect.hpp
index caeae84..b0b8963 100644
--- a/src/syncOnConnect.hpp
+++ b/src/syncOnConnect.hpp
@@ -44,20 +44,25 @@ void syncOnConnect(SyncTcpConnection * connptr)
connptr->Send(lengthout.str());
connptr->Send(sout.str());
}
- //TODO Locking here
- RoutingMap::iterator it = gRoutingTable.getBeginUnlocked();
- for (;it!=gRoutingTable.getEndUnlocked();++it)
- {
- NetworkPrefix tmp(it->first);
- std::ostringstream sout;
- boost::archive::text_oarchive oa(sout);
- const SyncCommand scom(tmp);
- oa << scom;
- std::stringstream lengthout;
- lengthout << std::setw(5) << std::setfill('0') << sout.str().size()<< ' ';
- connptr->Send(lengthout.str());
- connptr->Send(sout.str());
- }
+ //TODO Locking here
+ network_address_type_t types[] = {ipv4,ipv6,ethernet};
+ for (int types_idx=0; types_idx<3; types_idx++)
+ {
+ network_address_type_t type = types[types_idx];
+ RoutingMap::iterator it = gRoutingTable.getBeginUnlocked(type);
+ for (;it!=gRoutingTable.getEndUnlocked(type);++it)
+ {
+ NetworkPrefix tmp(it->first);
+ std::ostringstream sout;
+ boost::archive::text_oarchive oa(sout);
+ const SyncCommand scom(tmp);
+ oa << scom;
+ std::stringstream lengthout;
+ lengthout << std::setw(5) << std::setfill('0') << sout.str().size()<< ' ';
+ connptr->Send(lengthout.str());
+ connptr->Send(sout.str());
+ }
+ }
//TODO Locking here
RtpSessionMap::iterator rit = gRtpSessionTable.getBeginUnlocked();
for (;rit!=gRtpSessionTable.getEndUnlocked();++rit)