From 9cd4786758a3e46c32c4536ff51bb2b81811507f Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Sun, 21 Dec 2008 15:03:59 +0000 Subject: added ipv6 routing support routing still only works if all routes have the same netmask --- src/syncOnConnect.hpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/syncOnConnect.hpp') 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) -- cgit v1.2.3