52 #ifdef WITH_BUNDLE_SECURITY
60 const std::string BaseRouter::TAG =
"BaseRouter";
66 : _extension_state(false), _next_expiration(0)
69 RoutingExtension::_router =
this;
85 _extensions.insert(extension);
91 _extensions.erase(extension);
96 return _extensions_mutex;
109 for (extension_list::iterator iter = _extensions.begin(); iter != _extensions.end(); ++iter)
124 for (extension_list::iterator iter = _extensions.begin(); iter != _extensions.end(); ++iter)
130 _extension_state =
true;
137 _extension_state =
false;
140 for (extension_list::iterator iter = _extensions.begin(); iter != _extensions.end(); ++iter)
163 for (BaseRouter::extension_list::const_iterator iter = extensions.begin(); iter != extensions.end(); ++iter)
183 for (BaseRouter::extension_list::const_iterator iter = extensions.begin(); iter != extensions.end(); ++iter)
203 for (BaseRouter::extension_list::const_iterator iter = extensions.begin(); iter != extensions.end(); ++iter)
259 _neighbor_database.create( event.getNode().getEID() );
264 _neighbor_database.create( event.getNode().getEID() ).reset();
269 __forward_event(evt);
271 }
catch (
const std::bad_cast&) { };
284 entry.
add(event.getBundle());
289 __forward_event(evt);
291 }
catch (
const std::bad_cast&) { };
314 __forward_event(evt);
316 }
catch (
const std::bad_cast&) { };
326 getStorage().store(received.
bundle);
329 setKnown(received.
bundle);
335 else if (!filterKnown(received.
bundle))
340 #ifdef WITH_BUNDLE_SECURITY
362 _neighbor_database.get(received.
peer).add(received.
bundle);
366 getStorage().store(bundle);
378 #ifdef WITH_BUNDLE_SECURITY
402 }
catch (
const std::bad_cast&) { };
408 setKnown(generated.
bundle);
413 getStorage().store(generated.
bundle);
425 }
catch (
const std::bad_cast&) { };
435 }
catch (
const std::bad_cast&) { }
442 if (expire_time > _next_expiration) {
444 _next_expiration = expire_time + 60;
447 if (expire_time <= 60) expire_time = 0;
448 else expire_time -= 60;
452 _known_bundles.expire(expire_time);
457 _purged_bundles.expire(expire_time);
467 for (std::set<dtn::core::Node>::const_iterator it = neighbors.begin(); it != neighbors.end(); ++it) {
468 _neighbor_database.create( (*it).getEID() );
478 __forward_event(evt);
480 }
catch (
const std::bad_cast&) { };
484 __forward_event(evt);
490 if (!_extension_state)
return;
492 _nh_extension.notify(evt);
493 _retransmission_extension.notify(evt);
496 for (extension_list::const_iterator iter = _extensions.begin(); iter != _extensions.end(); ++iter)
498 (*iter)->notify(evt);
520 return _known_bundles.
add(meta);
527 return _known_bundles.
has(
id);
536 bool ret = _known_bundles.
has(meta);
537 if (!ret) _known_bundles.
add(meta);
545 return _known_bundles;
552 return _purged_bundles.
has(
id);
558 return _purged_bundles.
add(meta);
564 return _purged_bundles;
574 return _neighbor_database;