summaryrefslogtreecommitdiff
path: root/src/anytun-showtables.cpp
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/anytun-showtables.cpp
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/anytun-showtables.cpp')
-rw-r--r--src/anytun-showtables.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/anytun-showtables.cpp b/src/anytun-showtables.cpp
index 6e197b1..d3e8569 100644
--- a/src/anytun-showtables.cpp
+++ b/src/anytun-showtables.cpp
@@ -65,15 +65,21 @@ void output(ConnectionList &cl)
std::cout << std::endl;
//std::cout << "Connection: Keyderivation-Type: " << conn.kd_.printType() << std::endl;
cl.clear();
- }
- else if( !gRoutingTable.empty() )
- {
- RoutingMap::iterator it = gRoutingTable.getBeginUnlocked();
- NetworkPrefix pref( it->first );
- std::cout << "Route: " << pref.toString() << "/" << pref.getNetworkPrefixLength() << " -> ";
- mux_t mux = it->second;
- std::cout << mux << std::endl;
- gRoutingTable.clear();
+ } else {
+ 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];
+ if( !gRoutingTable.empty(type) )
+ {
+ RoutingMap::iterator it = gRoutingTable.getBeginUnlocked(type);
+ NetworkPrefix pref( it->first );
+ std::cout << "Route: " << pref.toString() << "/" << pref.getNetworkPrefixLength() << " -> ";
+ mux_t mux = it->second;
+ std::cout << mux << std::endl;
+ gRoutingTable.clear(type);
+ }
+ }
}
}