diff options
author | Othmar Gsenger <otti@anytun.org> | 2008-02-28 15:16:46 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2008-02-28 15:16:46 +0000 |
commit | abef27c309c3e3bc607ab3fd44ef4479290911f7 (patch) | |
tree | e75fdbbb6a18b49fd116fcf8fd884bb2a060f3b9 /routingTable.cpp | |
parent | more edits on dokumentation.odt (diff) |
added joobla template
Diffstat (limited to 'routingTable.cpp')
-rw-r--r-- | routingTable.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/routingTable.cpp b/routingTable.cpp index 10a6041..a2b5f56 100644 --- a/routingTable.cpp +++ b/routingTable.cpp @@ -91,6 +91,18 @@ u_int16_t RoutingTable::getRoute(const NetworkAddress & addr) return 0; } +u_int16_t& RoutingTable::getOrNewRoutingTEUnlocked(const NetworkAddress & addr) +{ + RoutingMap::iterator it = routes_.find(addr); + if(it!=routes_.end()) + return it->second; + + routes_.insert(RoutingMap::value_type(addr, 0)); + it = routes_.find(addr); + return it->second; +} + + void RoutingTable::clear() { Lock lock(mutex_); |