bug 600: lower the default routing priority of Ipv4GlobalRouting; move to helper
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 26 Jun 2009 15:34:16 +0200
changeset 4616 a84f60b6cd12
parent 4612 0053aa3d8c22
child 4617 8562a42accf6
bug 600: lower the default routing priority of Ipv4GlobalRouting; move to helper
bindings/python/ns3_module_global_routing.py
bindings/python/ns3_module_helper.py
bindings/python/ns3_module_list_routing.py
bindings/python/ns3_module_olsr.py
examples/csma-bridge-one-hop.cc
examples/csma-ping.cc
examples/csma-star.cc
examples/dynamic-global-routing.cc
examples/global-routing-slash32.cc
examples/mixed-global-routing.cc
examples/mixed-wireless.cc
examples/second.cc
examples/simple-alternate-routing.cc
examples/simple-error-model.cc
examples/simple-global-routing.cc
examples/simple-point-to-point-olsr.cc
examples/simple-wifi-frame-aggregation.cc
examples/star.cc
examples/tap-wifi-dumbbell.cc
examples/tcp-large-transfer.cc
examples/tcp-nsc-lfn.cc
examples/tcp-nsc-zoo.cc
examples/tcp-star-server.cc
examples/third.cc
examples/virtual-net-device.cc
examples/wifi-wired-bridging.cc
src/helper/internet-stack-helper.cc
src/helper/internet-stack-helper.h
src/helper/ipv4-global-routing-helper.cc
src/helper/ipv4-global-routing-helper.h
src/helper/ipv4-list-routing-helper.cc
src/helper/ipv4-list-routing-helper.h
src/helper/ipv4-routing-helper.cc
src/helper/ipv4-routing-helper.h
src/helper/ipv4-static-routing-helper.cc
src/helper/ipv4-static-routing-helper.h
src/helper/olsr-helper.cc
src/helper/olsr-helper.h
src/helper/wscript
src/internet-stack/ipv4-l3-protocol.cc
src/internet-stack/ipv4-l3-protocol.h
src/routing/global-routing/global-route-manager-impl.cc
src/routing/global-routing/global-route-manager-impl.h
src/routing/global-routing/global-route-manager.cc
src/routing/global-routing/global-route-manager.h
src/routing/global-routing/global-router-interface.cc
src/routing/global-routing/global-router-interface.h
src/routing/global-routing/ipv4-global-routing.cc
src/routing/global-routing/wscript
src/routing/list-routing/ipv4-list-routing.cc
src/routing/list-routing/ipv4-list-routing.h
src/routing/olsr/olsr-routing-protocol.cc
src/routing/olsr/olsr-routing-protocol.h
--- a/bindings/python/ns3_module_global_routing.py	Fri Jun 26 13:58:03 2009 +0200
+++ b/bindings/python/ns3_module_global_routing.py	Fri Jun 26 15:34:16 2009 +0200
@@ -17,6 +17,8 @@
     module.add_enum('LinkType', ['Unknown', 'PointToPoint', 'TransitNetwork', 'StubNetwork', 'VirtualLink'], outer_class=root_module['ns3::GlobalRoutingLinkRecord'])
     ## global-router-interface.h: ns3::GlobalRouter [class]
     module.add_class('GlobalRouter', is_singleton=True, parent=root_module['ns3::Object'])
+    ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting [class]
+    module.add_class('Ipv4GlobalRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
     
     ## Register a nested module for the namespace Config
     
@@ -73,6 +75,7 @@
     register_Ns3GlobalRoutingLSA_methods(root_module, root_module['ns3::GlobalRoutingLSA'])
     register_Ns3GlobalRoutingLinkRecord_methods(root_module, root_module['ns3::GlobalRoutingLinkRecord'])
     register_Ns3GlobalRouter_methods(root_module, root_module['ns3::GlobalRouter'])
+    register_Ns3Ipv4GlobalRouting_methods(root_module, root_module['ns3::Ipv4GlobalRouting'])
     return
 
 def register_Ns3GlobalRouteManager_methods(root_module, cls):
@@ -81,31 +84,11 @@
                    'void', 
                    [], 
                    is_static=True)
-    ## global-route-manager.h: static void ns3::GlobalRouteManager::PopulateRoutingTables(ns3::NodeContainer c) [member function]
-    cls.add_method('PopulateRoutingTables', 
-                   'void', 
-                   [param('ns3::NodeContainer', 'c')], 
-                   is_static=True)
     ## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function]
     cls.add_method('RecomputeRoutingTables', 
                    'void', 
                    [], 
                    is_static=True)
-    ## global-route-manager.h: static void ns3::GlobalRouteManager::DeleteGlobalRoutes() [member function]
-    cls.add_method('DeleteGlobalRoutes', 
-                   'void', 
-                   [], 
-                   is_static=True)
-    ## global-route-manager.h: static void ns3::GlobalRouteManager::SelectRouterNodes() [member function]
-    cls.add_method('SelectRouterNodes', 
-                   'void', 
-                   [], 
-                   is_static=True)
-    ## global-route-manager.h: static void ns3::GlobalRouteManager::SelectRouterNodes(ns3::NodeContainer c) [member function]
-    cls.add_method('SelectRouterNodes', 
-                   'void', 
-                   [param('ns3::NodeContainer', 'c')], 
-                   is_static=True)
     ## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function]
     cls.add_method('AllocateRouterId', 
                    'uint32_t', 
@@ -267,6 +250,14 @@
                    is_static=True)
     ## global-router-interface.h: ns3::GlobalRouter::GlobalRouter() [constructor]
     cls.add_constructor([])
+    ## global-router-interface.h: void ns3::GlobalRouter::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4GlobalRouting> routing) [member function]
+    cls.add_method('SetRoutingProtocol', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Ipv4GlobalRouting >', 'routing')])
+    ## global-router-interface.h: ns3::Ptr<ns3::Ipv4GlobalRouting> ns3::GlobalRouter::GetRoutingProtocol() [member function]
+    cls.add_method('GetRoutingProtocol', 
+                   'ns3::Ptr< ns3::Ipv4GlobalRouting >', 
+                   [])
     ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRouter::GetRouterId() const [member function]
     cls.add_method('GetRouterId', 
                    'ns3::Ipv4Address', 
@@ -293,6 +284,86 @@
                    visibility='private', is_virtual=True)
     return
 
+def register_Ns3Ipv4GlobalRouting_methods(root_module, cls):
+    ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting(ns3::Ipv4GlobalRouting const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Ipv4GlobalRouting const &', 'arg0')])
+    ## ipv4-global-routing.h: static ns3::TypeId ns3::Ipv4GlobalRouting::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting() [constructor]
+    cls.add_constructor([])
+    ## ipv4-global-routing.h: ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4GlobalRouting::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, uint32_t oif, ns3::Socket::SocketErrno & sockerr) [member function]
+    cls.add_method('RouteOutput', 
+                   'ns3::Ptr< ns3::Ipv4Route >', 
+                   [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], 
+                   is_virtual=True)
+    ## ipv4-global-routing.h: bool ns3::Ipv4GlobalRouting::RouteInput(ns3::Ptr<ns3::Packet const> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Callback<void,ns3::Ptr<ns3::Ipv4Route>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback<void,ns3::Ptr<ns3::Ipv4MulticastRoute>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function]
+    cls.add_method('RouteInput', 
+                   'bool', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], 
+                   is_virtual=True)
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyInterfaceUp(uint32_t interface) [member function]
+    cls.add_method('NotifyInterfaceUp', 
+                   'void', 
+                   [param('uint32_t', 'interface')], 
+                   is_virtual=True)
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyInterfaceDown(uint32_t interface) [member function]
+    cls.add_method('NotifyInterfaceDown', 
+                   'void', 
+                   [param('uint32_t', 'interface')], 
+                   is_virtual=True)
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
+    cls.add_method('NotifyAddAddress', 
+                   'void', 
+                   [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], 
+                   is_virtual=True)
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
+    cls.add_method('NotifyRemoveAddress', 
+                   'void', 
+                   [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], 
+                   is_virtual=True)
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
+    cls.add_method('SetIpv4', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], 
+                   is_virtual=True)
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
+    cls.add_method('AddHostRouteTo', 
+                   'void', 
+                   [param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
+    cls.add_method('AddHostRouteTo', 
+                   'void', 
+                   [param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
+    cls.add_method('AddNetworkRouteTo', 
+                   'void', 
+                   [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
+    cls.add_method('AddNetworkRouteTo', 
+                   'void', 
+                   [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
+    ## ipv4-global-routing.h: uint32_t ns3::Ipv4GlobalRouting::GetNRoutes() [member function]
+    cls.add_method('GetNRoutes', 
+                   'uint32_t', 
+                   [])
+    ## ipv4-global-routing.h: ns3::Ipv4RoutingTableEntry * ns3::Ipv4GlobalRouting::GetRoute(uint32_t i) [member function]
+    cls.add_method('GetRoute', 
+                   'ns3::Ipv4RoutingTableEntry *', 
+                   [param('uint32_t', 'i')])
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::RemoveRoute(uint32_t i) [member function]
+    cls.add_method('RemoveRoute', 
+                   'void', 
+                   [param('uint32_t', 'i')])
+    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_functions(root_module):
     module = root_module
     register_functions_ns3_Config(module.get_submodule('Config'), root_module)
--- a/bindings/python/ns3_module_helper.py	Fri Jun 26 13:58:03 2009 +0200
+++ b/bindings/python/ns3_module_helper.py	Fri Jun 26 15:34:16 2009 +0200
@@ -17,8 +17,10 @@
     module.add_class('Ipv4AddressHelper', allow_subclassing=False)
     ## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer [class]
     module.add_class('Ipv4InterfaceContainer')
+    ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper [class]
+    module.add_class('Ipv4RoutingHelper', allow_subclassing=False)
     ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper [class]
-    module.add_class('Ipv4StaticRoutingHelper', allow_subclassing=False)
+    module.add_class('Ipv4StaticRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper'])
     ## mobility-helper.h: ns3::MobilityHelper [class]
     module.add_class('MobilityHelper', allow_subclassing=False)
     ## net-device-container.h: ns3::NetDeviceContainer [class]
@@ -28,7 +30,7 @@
     ## ns2-mobility-helper.h: ns3::Ns2MobilityHelper [class]
     module.add_class('Ns2MobilityHelper', allow_subclassing=False)
     ## olsr-helper.h: ns3::OlsrHelper [class]
-    module.add_class('OlsrHelper', allow_subclassing=False)
+    module.add_class('OlsrHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper'])
     ## on-off-helper.h: ns3::OnOffHelper [class]
     module.add_class('OnOffHelper', allow_subclassing=False)
     ## packet-sink-helper.h: ns3::PacketSinkHelper [class]
@@ -57,6 +59,10 @@
     module.add_class('YansWifiPhyHelper', allow_subclassing=False, parent=root_module['ns3::WifiPhyHelper'])
     ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::PcapFormat [enumeration]
     module.add_enum('PcapFormat', ['PCAP_FORMAT_80211', 'PCAP_FORMAT_80211_PRISM', 'PCAP_FORMAT_80211_RADIOTAP'], outer_class=root_module['ns3::YansWifiPhyHelper'])
+    ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper [class]
+    module.add_class('Ipv4GlobalRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper'])
+    ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper [class]
+    module.add_class('Ipv4ListRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper'])
     ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper [class]
     module.add_class('NqosWifiMacHelper', allow_subclassing=False, parent=root_module['ns3::WifiMacHelper'])
     ## qos-wifi-mac-helper.h: ns3::QosWifiMacHelper [class]
@@ -120,6 +126,7 @@
     register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper'])
     register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper'])
     register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer'])
+    register_Ns3Ipv4RoutingHelper_methods(root_module, root_module['ns3::Ipv4RoutingHelper'])
     register_Ns3Ipv4StaticRoutingHelper_methods(root_module, root_module['ns3::Ipv4StaticRoutingHelper'])
     register_Ns3MobilityHelper_methods(root_module, root_module['ns3::MobilityHelper'])
     register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
@@ -139,6 +146,8 @@
     register_Ns3WifiPhyHelper_methods(root_module, root_module['ns3::WifiPhyHelper'])
     register_Ns3YansWifiChannelHelper_methods(root_module, root_module['ns3::YansWifiChannelHelper'])
     register_Ns3YansWifiPhyHelper_methods(root_module, root_module['ns3::YansWifiPhyHelper'])
+    register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, root_module['ns3::Ipv4GlobalRoutingHelper'])
+    register_Ns3Ipv4ListRoutingHelper_methods(root_module, root_module['ns3::Ipv4ListRoutingHelper'])
     register_Ns3NqosWifiMacHelper_methods(root_module, root_module['ns3::NqosWifiMacHelper'])
     register_Ns3QosWifiMacHelper_methods(root_module, root_module['ns3::QosWifiMacHelper'])
     return
@@ -420,6 +429,10 @@
     cls.add_constructor([param('ns3::InternetStackHelper const &', 'arg0')])
     ## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper() [constructor]
     cls.add_constructor([])
+    ## internet-stack-helper.h: void ns3::InternetStackHelper::SetRoutingHelper(ns3::Ipv4RoutingHelper const & routing) [member function]
+    cls.add_method('SetRoutingHelper', 
+                   'void', 
+                   [param('ns3::Ipv4RoutingHelper const &', 'routing')])
     ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(std::string nodeName) const [member function]
     cls.add_method('Install', 
                    'void', 
@@ -435,6 +448,11 @@
                    'void', 
                    [param('ns3::NodeContainer', 'c')], 
                    is_const=True)
+    ## internet-stack-helper.h: void ns3::InternetStackHelper::InstallAll() const [member function]
+    cls.add_method('InstallAll', 
+                   'void', 
+                   [], 
+                   is_const=True)
     ## internet-stack-helper.h: void ns3::InternetStackHelper::SetTcp(std::string tid) [member function]
     cls.add_method('SetTcp', 
                    'void', 
@@ -516,11 +534,28 @@
                    [param('std::string', 'ipv4Name'), param('uint32_t', 'interface')])
     return
 
+def register_Ns3Ipv4RoutingHelper_methods(root_module, cls):
+    ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper::Ipv4RoutingHelper(ns3::Ipv4RoutingHelper const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Ipv4RoutingHelper const &', 'arg0')])
+    ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper::Ipv4RoutingHelper() [constructor]
+    cls.add_constructor([])
+    ## ipv4-routing-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4RoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
+    cls.add_method('Create', 
+                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
+                   [param('ns3::Ptr< ns3::Node >', 'node')], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    return
+
 def register_Ns3Ipv4StaticRoutingHelper_methods(root_module, cls):
     ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper(ns3::Ipv4StaticRoutingHelper const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::Ipv4StaticRoutingHelper const &', 'arg0')])
     ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper() [constructor]
     cls.add_constructor([])
+    ## ipv4-static-routing-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4StaticRoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
+    cls.add_method('Create', 
+                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
+                   [param('ns3::Ptr< ns3::Node >', 'node')], 
+                   is_const=True, is_virtual=True)
     ## ipv4-static-routing-helper.h: ns3::Ptr<ns3::Ipv4StaticRouting> ns3::Ipv4StaticRoutingHelper::GetStaticRouting(ns3::Ptr<ns3::Ipv4> ipv4) const [member function]
     cls.add_method('GetStaticRouting', 
                    'ns3::Ptr< ns3::Ipv4StaticRouting >', 
@@ -752,26 +787,15 @@
     cls.add_constructor([param('ns3::OlsrHelper const &', 'arg0')])
     ## olsr-helper.h: ns3::OlsrHelper::OlsrHelper() [constructor]
     cls.add_constructor([])
-    ## olsr-helper.h: void ns3::OlsrHelper::SetAgent(std::string tid, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function]
-    cls.add_method('SetAgent', 
-                   'void', 
-                   [param('std::string', 'tid'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')])
-    ## olsr-helper.h: void ns3::OlsrHelper::Install(ns3::NodeContainer container) [member function]
-    cls.add_method('Install', 
+    ## olsr-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::OlsrHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
+    cls.add_method('Create', 
+                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
+                   [param('ns3::Ptr< ns3::Node >', 'node')], 
+                   is_const=True, is_virtual=True)
+    ## olsr-helper.h: void ns3::OlsrHelper::Set(std::string name, ns3::AttributeValue const & value) [member function]
+    cls.add_method('Set', 
                    'void', 
-                   [param('ns3::NodeContainer', 'container')])
-    ## olsr-helper.h: void ns3::OlsrHelper::Install(ns3::Ptr<ns3::Node> node) [member function]
-    cls.add_method('Install', 
-                   'void', 
-                   [param('ns3::Ptr< ns3::Node >', 'node')])
-    ## olsr-helper.h: void ns3::OlsrHelper::Install(std::string nodeName) [member function]
-    cls.add_method('Install', 
-                   'void', 
-                   [param('std::string', 'nodeName')])
-    ## olsr-helper.h: void ns3::OlsrHelper::InstallAll() [member function]
-    cls.add_method('InstallAll', 
-                   'void', 
-                   [])
+                   [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
     return
 
 def register_Ns3OnOffHelper_methods(root_module, cls):
@@ -1234,6 +1258,44 @@
                    is_const=True, visibility='private', is_virtual=True)
     return
 
+def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls):
+    ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper(ns3::Ipv4GlobalRoutingHelper const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Ipv4GlobalRoutingHelper const &', 'arg0')])
+    ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper() [constructor]
+    cls.add_constructor([])
+    ## ipv4-global-routing-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4GlobalRoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
+    cls.add_method('Create', 
+                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
+                   [param('ns3::Ptr< ns3::Node >', 'node')], 
+                   is_const=True, is_virtual=True)
+    ## ipv4-global-routing-helper.h: static void ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables() [member function]
+    cls.add_method('PopulateRoutingTables', 
+                   'void', 
+                   [], 
+                   is_static=True)
+    ## ipv4-global-routing-helper.h: static void ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables() [member function]
+    cls.add_method('RecomputeRoutingTables', 
+                   'void', 
+                   [], 
+                   is_static=True)
+    return
+
+def register_Ns3Ipv4ListRoutingHelper_methods(root_module, cls):
+    ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper::Ipv4ListRoutingHelper(ns3::Ipv4ListRoutingHelper const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Ipv4ListRoutingHelper const &', 'arg0')])
+    ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper::Ipv4ListRoutingHelper() [constructor]
+    cls.add_constructor([])
+    ## ipv4-list-routing-helper.h: void ns3::Ipv4ListRoutingHelper::Add(ns3::Ipv4RoutingHelper const & routing, int16_t priority) [member function]
+    cls.add_method('Add', 
+                   'void', 
+                   [param('ns3::Ipv4RoutingHelper const &', 'routing'), param('int16_t', 'priority')])
+    ## ipv4-list-routing-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4ListRoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
+    cls.add_method('Create', 
+                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
+                   [param('ns3::Ptr< ns3::Node >', 'node')], 
+                   is_const=True, is_virtual=True)
+    return
+
 def register_Ns3NqosWifiMacHelper_methods(root_module, cls):
     ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper::NqosWifiMacHelper(ns3::NqosWifiMacHelper const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::NqosWifiMacHelper const &', 'arg0')])
--- a/bindings/python/ns3_module_list_routing.py	Fri Jun 26 13:58:03 2009 +0200
+++ b/bindings/python/ns3_module_list_routing.py	Fri Jun 26 15:34:16 2009 +0200
@@ -120,11 +120,6 @@
                    'void', 
                    [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], 
                    is_virtual=True)
-    ## ipv4-list-routing.h: ns3::Ptr<ns3::Ipv4StaticRouting> ns3::Ipv4ListRouting::GetStaticRouting() const [member function]
-    cls.add_method('GetStaticRouting', 
-                   'ns3::Ptr< ns3::Ipv4StaticRouting >', 
-                   [], 
-                   is_const=True, is_virtual=True)
     ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::DoDispose() [member function]
     cls.add_method('DoDispose', 
                    'void', 
--- a/bindings/python/ns3_module_olsr.py	Fri Jun 26 13:58:03 2009 +0200
+++ b/bindings/python/ns3_module_olsr.py	Fri Jun 26 15:34:16 2009 +0200
@@ -747,10 +747,6 @@
                    is_static=True)
     ## olsr-routing-protocol.h: ns3::olsr::RoutingProtocol::RoutingProtocol() [constructor]
     cls.add_constructor([])
-    ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::Start() [member function]
-    cls.add_method('Start', 
-                   'void', 
-                   [])
     ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::SetMainInterface(uint32_t interface) [member function]
     cls.add_method('SetMainInterface', 
                    'void', 
--- a/examples/csma-bridge-one-hop.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/csma-bridge-one-hop.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -74,7 +74,6 @@
 #include "ns3/core-module.h"
 #include "ns3/helper-module.h"
 #include "ns3/bridge-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -142,9 +141,10 @@
   BridgeHelper bridge;
   bridge.Install (bridge1, topBridgeDevices);
 
-  // Add internet stack to the topLan nodes
+  // Add internet stack to the router nodes
+  NodeContainer routerNodes (n0, n1, n2, n3, n4);
   InternetStackHelper internet;
-  internet.Install (topLan);
+  internet.Install (routerNodes);
 
   // Repeat for bottom bridged LAN
   NetDeviceContainer bottomLanDevices;
@@ -158,9 +158,6 @@
     }
   bridge.Install (bridge2, bottomBridgeDevices);
 
-  // Add internet stack to the bottomLan nodes
-  internet.Install (NodeContainer (n3, n4));
-
   // We've got the "hardware" in place.  Now we need to add IP addresses.
   NS_LOG_INFO ("Assign IP Addresses.");
   Ipv4AddressHelper ipv4;
@@ -174,8 +171,7 @@
   // tables in the nodes.  We excuse the bridge nodes from having to serve as
   // routers, since they don't even have internet stacks on them.
   //
-  NodeContainer routerNodes (n0, n1, n2, n3, n4);
-  GlobalRouteManager::PopulateRoutingTables (routerNodes);
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   //
   // Create an OnOff application to send UDP datagrams from node zero to node 1.
--- a/examples/csma-ping.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/csma-ping.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -37,7 +37,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -85,7 +84,7 @@
   Ipv4InterfaceContainer addresses = ip.Assign (devs);
 
   // setup global router
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
   NS_LOG_INFO ("Create Source");
   Config::SetDefault ("ns3::Ipv4RawSocketImpl::Protocol", StringValue ("2"));
   InetSocketAddress dst = InetSocketAddress (addresses.GetAddress (3));
--- a/examples/csma-star.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/csma-star.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -20,7 +20,6 @@
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
 #include "ns3/csma-module.h"
-#include "ns3/global-route-manager.h"
 
 // Network topology (default)
 //
@@ -196,7 +195,7 @@
   //
   // Turn on global static routing so we can actually be routed across the star.
   //
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   NS_LOG_INFO ("Enable pcap tracing.");
   //
--- a/examples/dynamic-global-routing.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/dynamic-global-routing.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -79,7 +79,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -145,7 +144,7 @@
 
   // Create router nodes, initialize routing database and set up the routing
   // tables in the nodes.
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s
@@ -204,9 +203,9 @@
   uint32_t ipv4ifIndex1 = 2;
 
   Simulator::Schedule (Seconds (2),&Ipv4::SetDown,ipv41, ipv4ifIndex1);
-  Simulator::Schedule (Seconds (3),&GlobalRouteManager::RecomputeRoutingTables);
+  Simulator::Schedule (Seconds (3),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
   Simulator::Schedule (Seconds (4),&Ipv4::SetUp,ipv41, ipv4ifIndex1);
-  Simulator::Schedule (Seconds (5),&GlobalRouteManager::RecomputeRoutingTables);
+  Simulator::Schedule (Seconds (5),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
 
   Ptr<Node> n6 = c.Get (6);
   Ptr<Ipv4> ipv46 = n6->GetObject<Ipv4> ();
@@ -214,14 +213,14 @@
   // then the next p2p is numbered 2
   uint32_t ipv4ifIndex6 = 2;
   Simulator::Schedule (Seconds (6),&Ipv4::SetDown,ipv46, ipv4ifIndex6);
-  Simulator::Schedule (Seconds (7),&GlobalRouteManager::RecomputeRoutingTables);
+  Simulator::Schedule (Seconds (7),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
   Simulator::Schedule (Seconds (8),&Ipv4::SetUp,ipv46, ipv4ifIndex6);
-  Simulator::Schedule (Seconds (9),&GlobalRouteManager::RecomputeRoutingTables);
+  Simulator::Schedule (Seconds (9),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
 
   Simulator::Schedule (Seconds (12),&Ipv4::SetDown,ipv41, ipv4ifIndex1);
-  Simulator::Schedule (Seconds (13),&GlobalRouteManager::RecomputeRoutingTables);
+  Simulator::Schedule (Seconds (13),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
   Simulator::Schedule (Seconds (14),&Ipv4::SetUp,ipv41, ipv4ifIndex1);
-  Simulator::Schedule (Seconds (15),&GlobalRouteManager::RecomputeRoutingTables);
+  Simulator::Schedule (Seconds (15),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
 
   NS_LOG_INFO ("Run Simulation.");
   Simulator::Run ();
--- a/examples/global-routing-slash32.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/global-routing-slash32.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -29,7 +29,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -99,7 +98,7 @@
  
   // Create router nodes, initialize routing database and set up the routing
   // tables in the nodes.
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s
--- a/examples/mixed-global-routing.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/mixed-global-routing.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -40,7 +40,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -104,7 +103,7 @@
 
   // Create router nodes, initialize routing database and set up the routing
   // tables in the nodes.
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s
--- a/examples/mixed-wireless.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/mixed-wireless.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -67,7 +67,6 @@
 #include "ns3/mobility-module.h"
 #include "ns3/contrib-module.h"
 #include "ns3/wifi-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -152,11 +151,21 @@
   YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
   wifiPhy.SetChannel (wifiChannel.Create ());
   NetDeviceContainer backboneDevices = wifi.Install (wifiPhy, mac, backbone);
+
+  // We enable OLSR (which will be consulted at a higher priority than
+  // the global routing) on the backbone ad hoc nodes
+  NS_LOG_INFO ("Enabling OLSR routing on all backbone nodes");
+  OlsrHelper olsr;
   //
   // Add the IPv4 protocol stack to the nodes in our container
   //
   InternetStackHelper internet;
+  internet.SetRoutingHelper (olsr);
   internet.Install (backbone);
+
+  // re-initialize for non-olsr routing.
+  internet = InternetStackHelper ();
+
   //
   // Assign IPv4 addresses to the device drivers (actually to the associated
   // IPv4 interfaces) we just created.
@@ -322,13 +331,7 @@
   // However, it is useful for setting default routes for all of the nodes
   // such as the LAN nodes.  
   NS_LOG_INFO ("Enabling global routing on all nodes");
-  GlobalRouteManager::PopulateRoutingTables ();
-
-  // We enable OLSR (which will be consulted at a higher priority than
-  // the global routing above) on the backbone ad hoc nodes
-  NS_LOG_INFO ("Enabling OLSR routing on all backbone nodes");
-  OlsrHelper olsr;
-  olsr.Install (backbone);
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   /////////////////////////////////////////////////////////////////////////// 
   //                                                                       //
--- a/examples/second.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/second.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -18,7 +18,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-routing-module.h"
 
 // Default Network Topology
 //
@@ -102,7 +101,7 @@
   clientApps.Start (Seconds (2.0));
   clientApps.Stop (Seconds (10.0));
 
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   PointToPointHelper::EnablePcapAll ("second");
   CsmaHelper::EnablePcap ("second", csmaDevices.Get (1), true);
--- a/examples/simple-alternate-routing.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/simple-alternate-routing.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -41,7 +41,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -53,7 +52,7 @@
   // Users may find it convenient to turn on explicit debugging
   // for selected modules; the below lines suggest how to do this
 #if 0 
-  LogComponentEnable("GlobalRouteManager", LOG_LOGIC);
+  LogComponentEnable("GlobalRoutingHelper", LOG_LOGIC);
   LogComponentEnable("GlobalRouter", LOG_LOGIC);
 #endif
 
@@ -130,7 +129,7 @@
 
   // Create router nodes, initialize routing database and set up the routing
   // tables in the nodes.
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   // Create the OnOff application to send UDP datagrams 
   NS_LOG_INFO ("Create Application.");
--- a/examples/simple-error-model.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/simple-error-model.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -44,7 +44,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -111,7 +110,7 @@
   Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
 
   NS_LOG_INFO ("Use global routing.");
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s
--- a/examples/simple-global-routing.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/simple-global-routing.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -46,7 +46,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -111,7 +110,7 @@
 
   // Create router nodes, initialize routing database and set up the routing
   // tables in the nodes.
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s
--- a/examples/simple-point-to-point-olsr.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/simple-point-to-point-olsr.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -82,7 +82,18 @@
   NodeContainer n32 = NodeContainer (c.Get(3), c.Get (2));
   NodeContainer n34 = NodeContainer (c.Get (3), c.Get (4));
 
+  // Enable OLSR
+  NS_LOG_INFO ("Enabling OLSR Routing.");
+  OlsrHelper olsr;
+
+  Ipv4StaticRoutingHelper staticRouting;
+
+  Ipv4ListRoutingHelper list;
+  list.Add (staticRouting, 0);
+  list.Add (olsr, 10);
+
   InternetStackHelper internet;
+  internet.SetRoutingHelper (list);
   internet.Install (c);
 
   // We create the channels first without any IP addressing information
@@ -112,11 +123,6 @@
   ipv4.SetBase ("10.1.4.0", "255.255.255.0");
   Ipv4InterfaceContainer i34 = ipv4.Assign (nd34);
 
-  // Enable OLSR
-  NS_LOG_INFO ("Enabling OLSR Routing.");
-  OlsrHelper olsr;
-  olsr.InstallAll ();
-
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s
   NS_LOG_INFO ("Create Applications.");
--- a/examples/simple-wifi-frame-aggregation.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/simple-wifi-frame-aggregation.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -21,7 +21,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-routing-module.h"
 #include "ns3/wifi-module.h"
 #include "ns3/mobility-module.h"
 
@@ -137,7 +136,7 @@
   clientApps.Start (Seconds (2.0));
   clientApps.Stop (Seconds (10.0));
 
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   Simulator::Stop (Seconds (10.0));
   
--- a/examples/star.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/star.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -19,7 +19,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 // Network topology (default)
 //
@@ -132,7 +131,7 @@
   //
   // Turn on global static routing so we can actually be routed across the star.
   //
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   NS_LOG_INFO ("Enable pcap tracing.");
   //
--- a/examples/tap-wifi-dumbbell.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/tap-wifi-dumbbell.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -114,7 +114,6 @@
 #include "ns3/core-module.h"
 #include "ns3/wifi-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-routing-module.h"
 
 using namespace ns3;
 
@@ -228,7 +227,7 @@
   apps.Start (Seconds (1.0));
 
   CsmaHelper::EnablePcapAll ("tap-wifi-dumbbell", false);
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   Simulator::Stop (Seconds (60.));
   Simulator::Run ();
--- a/examples/tcp-large-transfer.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/tcp-large-transfer.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -39,7 +39,6 @@
 #include "ns3/core-module.h"
 #include "ns3/helper-module.h"
 #include "ns3/node-module.h"
-#include "ns3/global-route-manager.h"
 #include "ns3/simulator-module.h"
 
 using namespace ns3;
@@ -111,9 +110,8 @@
   NetDeviceContainer dev1 = p2p.Install (n1n2);
 
   // Now add ip/tcp stack to all nodes.
-  NodeContainer allNodes = NodeContainer (n0n1, n1n2.Get (1));
   InternetStackHelper internet;
-  internet.Install (allNodes);
+  internet.InstallAll ();
 
   // Later, we add IP addresses.
   Ipv4AddressHelper ipv4;
@@ -123,7 +121,7 @@
   Ipv4InterfaceContainer ipInterfs = ipv4.Assign (dev1);
 
   // and setup ip routing tables to get total ip-level connectivity.
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   ///////////////////////////////////////////////////////////////////////////
   // Simulation 1
--- a/examples/tcp-nsc-lfn.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/tcp-nsc-lfn.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -36,7 +36,6 @@
 #include "ns3/common-module.h"
 #include "ns3/helper-module.h"
 #include "ns3/node-module.h"
-#include "ns3/global-route-manager.h"
 #include "ns3/simulator-module.h"
 
 using namespace ns3;
@@ -117,7 +116,7 @@
   p2pInterfaces.Get(0)->SetAttribute("ReceiveErrorModel", PointerValue (em1));
   p2pInterfaces.Get(1)->SetAttribute("ReceiveErrorModel", PointerValue (em2));
 
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   uint16_t servPort = 8080;
   PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
--- a/examples/tcp-nsc-zoo.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/tcp-nsc-zoo.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -33,7 +33,6 @@
 #include "ns3/core-module.h"
 #include "ns3/helper-module.h"
 #include "ns3/node-module.h"
-#include "ns3/global-route-manager.h"
 #include "ns3/simulator-module.h"
 
 using namespace ns3;
@@ -68,7 +67,6 @@
   NetDeviceContainer ethInterfaces = csma.Install (n);
 
   InternetStackHelper internetStack;
-
   internetStack.SetTcp ("ns3::NscTcpL4Protocol","Library",StringValue("liblinux2.6.26.so"));
   // this switches nodes 0 and 1 to NSCs Linux 2.6.26 stack.
   internetStack.Install (n.Get(0));
@@ -106,7 +104,7 @@
   ipv4.SetBase ("10.0.0.0", "255.255.255.0");
   Ipv4InterfaceContainer ipv4Interfaces = ipv4.Assign (ethInterfaces);
 
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   uint16_t servPort = 8080;
   PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
--- a/examples/tcp-star-server.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/tcp-star-server.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -52,7 +52,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 
 using namespace ns3;
 
@@ -123,7 +122,7 @@
   }
 
   //Turn on global static routing
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   // Create a packet sink on the star "hub" to receive these packets
   uint16_t port = 50000;
--- a/examples/third.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/third.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -18,7 +18,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-routing-module.h"
 #include "ns3/wifi-module.h"
 #include "ns3/mobility-module.h"
 
@@ -159,7 +158,7 @@
   clientApps.Start (Seconds (2.0));
   clientApps.Stop (Seconds (10.0));
 
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   Simulator::Stop (Seconds (10.0));
 
--- a/examples/virtual-net-device.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/virtual-net-device.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -57,7 +57,6 @@
 #include "ns3/simulator-module.h"
 #include "ns3/node-module.h"
 #include "ns3/helper-module.h"
-#include "ns3/global-route-manager.h"
 #include "ns3/virtual-net-device.h"
 
 using namespace ns3;
@@ -238,7 +237,7 @@
 
   // Create router nodes, initialize routing database and set up the routing
   // tables in the nodes.
-  GlobalRouteManager::PopulateRoutingTables ();
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
 
   // Add the tunnels
   Tunnel tunnel (c.Get (3), c.Get (0), c.Get (1),
--- a/examples/wifi-wired-bridging.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/examples/wifi-wired-bridging.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -49,7 +49,6 @@
 #include "ns3/helper-module.h"
 #include "ns3/wifi-module.h"
 #include "ns3/node-module.h"
-#include "ns3/global-route-manager.h"
 #include <vector>
 #include <stdint.h>
 #include <sstream>
--- a/src/helper/internet-stack-helper.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/helper/internet-stack-helper.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -153,7 +153,6 @@
 #include "ns3/object.h"
 #include "ns3/names.h"
 #include "ns3/ipv4.h"
-#include "internet-stack-helper.h"
 #include "ns3/packet-socket-factory.h"
 #include "ns3/config.h"
 #include "ns3/simulator.h"
@@ -162,8 +161,10 @@
 #include "ns3/callback.h"
 #include "ns3/node.h"
 #include "ns3/core-config.h"
-#include "ns3/ipv4-list-routing.h"
-#include "ns3/ipv4-static-routing.h"
+#include "internet-stack-helper.h"
+#include "ipv4-list-routing-helper.h"
+#include "ipv4-static-routing-helper.h"
+#include "ipv4-global-routing-helper.h"
 #include <limits>
 
 namespace ns3 {
@@ -174,6 +175,18 @@
 InternetStackHelper::InternetStackHelper ()
 {
   SetTcp ("ns3::TcpL4Protocol");
+  static Ipv4StaticRoutingHelper staticRouting;
+  static Ipv4GlobalRoutingHelper globalRouting;
+  static Ipv4ListRoutingHelper listRouting;
+  listRouting.Add (staticRouting, 0);
+  listRouting.Add (globalRouting, -10);
+  SetRoutingHelper (listRouting);
+}
+
+void 
+InternetStackHelper::SetRoutingHelper (const Ipv4RoutingHelper &routing)
+{
+  m_routing = &routing;
 }
 
 void
@@ -213,8 +226,14 @@
     }
 }
 
-static void
-CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId)
+void 
+InternetStackHelper::InstallAll (void) const
+{
+  Install (NodeContainer::GetGlobal ());
+}
+
+void
+InternetStackHelper::CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId)
 {
   ObjectFactory factory;
   factory.SetTypeId(typeId);
@@ -241,10 +260,7 @@
   node->AggregateObject (factory);
   // Set routing
   Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
-  // XXX cut this over to use of TypeIds and factories
-  Ptr<Ipv4ListRouting> ipv4Routing = CreateObject<Ipv4ListRouting> ();
-  Ptr<Ipv4StaticRouting> ipv4staticRouting = CreateObject<Ipv4StaticRouting> ();
-  ipv4Routing->AddRoutingProtocol (ipv4staticRouting, 0);
+  Ptr<Ipv4RoutingProtocol> ipv4Routing = m_routing->Create (node);
   ipv4->SetRoutingProtocol (ipv4Routing);
 }
 
--- a/src/helper/internet-stack-helper.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/helper/internet-stack-helper.h	Fri Jun 26 15:34:16 2009 +0200
@@ -31,6 +31,7 @@
 namespace ns3 {
 
 class Node;
+class Ipv4RoutingHelper;
 
 /**
  * \brief aggregate IP/TCP/UDP functionality to existing Nodes.
@@ -38,9 +39,29 @@
 class InternetStackHelper
 {
 public:
+  /**
+   * Create a new InternetStackHelper which uses a mix of static routing
+   * and global routing by default. The static routing protocol 
+   * (ns3::Ipv4StaticRouting) and the global routing protocol are
+   * stored in an ns3::Ipv4ListRouting protocol with priorities 0, and -10
+   * by default. If you wish to use different priorites and different
+   * routing protocols, you need to use an adhoc ns3::Ipv4RoutingHelper, 
+   * such as ns3::OlsrHelper
+   */
   InternetStackHelper(void);
 
   /**
+   * \param routing a new routing helper
+   *
+   * Set the routing helper to use during Install. The routing
+   * helper is really an object factory which is used to create 
+   * an object of type ns3::Ipv4RoutingProtocol per node. This routing
+   * object is then associated to a single ns3::Ipv4 object through its 
+   * ns3::Ipv4::SetRoutingProtocol.
+   */
+  void SetRoutingHelper (const Ipv4RoutingHelper &routing);
+
+  /**
    * Aggregate implementations of the ns3::Ipv4, ns3::Udp, and ns3::Tcp classes
    * onto the provided node.  This method will assert if called on a node that 
    * already has an Ipv4 object aggregated to it.
@@ -69,6 +90,11 @@
    */
   void Install (NodeContainer c) const;
 
+  /**
+   * Aggregate ip, udp, and tcp stacks to all nodes in the simulation
+   */
+  void InstallAll (void) const;
+
  /**
    * \brief set the Tcp stack which will not need any other parameter.  
    *
@@ -132,6 +158,8 @@
 
 private:
   ObjectFactory m_tcpFactory;
+  const Ipv4RoutingHelper *m_routing;
+  static void CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId);
   static void Cleanup (void);
   static void LogRxIp (std::string context, Ptr<const Packet> packet, uint32_t deviceId);
   static void LogTxIp (std::string context, Ptr<const Packet> packet, uint32_t deviceId);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/helper/ipv4-global-routing-helper.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -0,0 +1,63 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#include "ipv4-global-routing-helper.h"
+#include "ns3/global-router-interface.h"
+#include "ns3/ipv4-global-routing.h"
+#include "ns3/ipv4-list-routing.h"
+#include "ns3/log.h"
+
+NS_LOG_COMPONENT_DEFINE("GlobalRoutingHelper");
+
+namespace ns3 {
+
+Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper ()
+{}
+Ptr<Ipv4RoutingProtocol> 
+Ipv4GlobalRoutingHelper::Create (Ptr<Node> node) const
+{
+  NS_LOG_LOGIC ("Adding GlobalRouter interface to node " << 
+		node->GetId ());
+
+  Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
+  node->AggregateObject (globalRouter);
+
+  NS_LOG_LOGIC ("Adding GlobalRouting Protocol to node " << node->GetId ());
+  Ptr<Ipv4GlobalRouting> globalRouting = CreateObject<Ipv4GlobalRouting> ();
+  globalRouter->SetRoutingProtocol (globalRouting);
+
+  return globalRouting;
+}
+
+void 
+Ipv4GlobalRoutingHelper::PopulateRoutingTables (void)
+{
+  GlobalRouteManager::BuildGlobalRoutingDatabase ();
+  GlobalRouteManager::InitializeRoutes ();
+}
+void 
+Ipv4GlobalRoutingHelper::RecomputeRoutingTables (void)
+{
+  GlobalRouteManager::DeleteGlobalRoutes ();
+  GlobalRouteManager::BuildGlobalRoutingDatabase ();
+  GlobalRouteManager::InitializeRoutes ();
+}
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/helper/ipv4-global-routing-helper.h	Fri Jun 26 15:34:16 2009 +0200
@@ -0,0 +1,70 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#ifndef IPV4_GLOBAL_ROUTING_HELPER_H
+#define IPV4_GLOBAL_ROUTING_HELPER_H
+
+#include "node-container.h"
+#include "ipv4-routing-helper.h"
+
+namespace ns3 {
+
+/**
+ * \brief Helper class that adds ns3::Ipv4GlobalRouting objects
+ */
+class Ipv4GlobalRoutingHelper  : public Ipv4RoutingHelper
+{
+public:
+  Ipv4GlobalRoutingHelper ();
+  /**
+   * \param node the node on which the routing protocol will run
+   * \returns a newly-created routing protocol
+   *
+   * This method will be called by ns3::InternetStackHelper::Install
+   */
+  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const;
+
+  /**
+   * @brief Build a routing database and initialize the routing tables of
+   * the nodes in the simulation.  Makes all nodes in the simulation into
+   * routers.
+   *
+   * All this function does is call the functions
+   * BuildGlobalRoutingDatabase () and  InitializeRoutes ().
+   *
+   */
+  static void PopulateRoutingTables (void);
+  /**
+   *@brief Remove all routes that were previously installed in a prior call
+   * to either PopulateRoutingTables() or RecomputeRoutingTables(), and 
+   * add a new set of routes.  
+   * 
+   * This method does not change the set of nodes
+   * over which GlobalRouting is being used, but it will dynamically update
+   * its representation of the global topology before recomputing routes.
+   * Users must first call PopulateRoutingTables() and then may subsequently
+   * call RecomputeRoutingTables() at any later time in the simulation.
+   *
+   */
+  static void RecomputeRoutingTables (void);
+};
+
+} // namespace ns3
+
+#endif /* IPV4_GLOBAL_ROUTING_HELPER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/helper/ipv4-list-routing-helper.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -0,0 +1,46 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#include "ipv4-list-routing-helper.h"
+#include "ns3/ipv4-list-routing.h"
+#include "ns3/node.h"
+
+namespace ns3 {
+
+Ipv4ListRoutingHelper::Ipv4ListRoutingHelper()
+{}
+void 
+Ipv4ListRoutingHelper::Add (const Ipv4RoutingHelper &routing, int16_t priority)
+{
+  m_list.push_back (std::make_pair(&routing,priority));
+}
+Ptr<Ipv4RoutingProtocol> 
+Ipv4ListRoutingHelper::Create (Ptr<Node> node) const
+{
+  Ptr<Ipv4ListRouting> list = CreateObject<Ipv4ListRouting> ();
+  for (std::list<std::pair<const Ipv4RoutingHelper *,int16_t> >::const_iterator i = m_list.begin ();
+       i != m_list.end (); ++i)
+    {
+      Ptr<Ipv4RoutingProtocol> prot = i->first->Create (node);
+      list->AddRoutingProtocol (prot,i->second);
+    }
+  return list;
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/helper/ipv4-list-routing-helper.h	Fri Jun 26 15:34:16 2009 +0200
@@ -0,0 +1,60 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#ifndef IPV4_LIST_ROUTING_HELPER_H
+#define IPV4_LIST_ROUTING_HELPER_H
+
+#include "ipv4-routing-helper.h"
+#include <stdint.h>
+#include <list>
+
+namespace ns3 {
+
+/**
+ * \brief Helper class that adds ns3::Ipv4ListRouting objects
+ */
+class Ipv4ListRoutingHelper : public Ipv4RoutingHelper
+{
+public:
+  Ipv4ListRoutingHelper();
+  /**
+   * \param routing a routing helper
+   * \param priority the priority of the associated helper
+   *
+   * Store in the internal list a reference to the input routing helper
+   * and associated priority. These helpers will be used later by
+   * the ns3::Ipv4ListRoutingHelper::Create method to create
+   * an ns3::Ipv4ListRouting object and add in it routing protocols
+   * created with the helpers.
+   */
+  void Add (const Ipv4RoutingHelper &routing, int16_t priority);
+  /**
+   * \param node the node on which the routing protocol will run
+   * \returns a newly-created routing protocol
+   *
+   * This method will be called by ns3::InternetStackHelper::Install
+   */
+  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const;
+private:
+  std::list<std::pair<const Ipv4RoutingHelper *,int16_t> > m_list;
+};
+
+} // namespace ns3
+
+#endif /* IPV4_LIST_ROUTING_HELPER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/helper/ipv4-routing-helper.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -0,0 +1,27 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#include "ipv4-routing-helper.h"
+
+namespace ns3 {
+
+Ipv4RoutingHelper::~Ipv4RoutingHelper ()
+{}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/helper/ipv4-routing-helper.h	Fri Jun 26 15:34:16 2009 +0200
@@ -0,0 +1,53 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#ifndef IPV4_ROUTING_HELPER_H
+#define IPV4_ROUTING_HELPER_H
+
+#include "ns3/ptr.h"
+
+namespace ns3 {
+
+class Ipv4RoutingProtocol;
+class Node;
+
+/**
+ * \brief a factory to create ns3::Ipv4RoutingProtocol objects
+ *
+ * For each new routing protocol created as a subclass of 
+ * ns3::Ipv4RoutingProtocol, you need to create a subclass of 
+ * ns3::Ipv4RoutingHelper which can be used by 
+ * ns3::InternetStackHelper::SetRoutingProtocol and 
+ * ns3::InternetStackHelper::Install.
+ */
+class Ipv4RoutingHelper
+{
+public:
+  virtual ~Ipv4RoutingHelper ();
+  /**
+   * \param node the node within which the new routing protocol will run
+   * \returns a newly-created routing protocol
+   */
+  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const = 0;
+};
+
+} // namespace ns3
+
+
+#endif /* IPV4_ROUTING_HELPER_H */
--- a/src/helper/ipv4-static-routing-helper.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/helper/ipv4-static-routing-helper.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -33,6 +33,15 @@
 
 namespace ns3 {
 
+Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper()
+{}
+Ptr<Ipv4RoutingProtocol> 
+Ipv4StaticRoutingHelper::Create (Ptr<Node> node) const
+{
+  return CreateObject<Ipv4StaticRouting> ();
+}
+
+
 Ptr<Ipv4StaticRouting>
 Ipv4StaticRoutingHelper::GetStaticRouting (Ptr<Ipv4> ipv4) const
 {
--- a/src/helper/ipv4-static-routing-helper.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/helper/ipv4-static-routing-helper.h	Fri Jun 26 15:34:16 2009 +0200
@@ -25,14 +25,28 @@
 #include "ns3/ipv4-address.h"
 #include "ns3/node.h"
 #include "ns3/net-device.h"
+#include "ipv4-routing-helper.h"
 #include "node-container.h"
 #include "net-device-container.h"
 
 namespace ns3 {
 
-class Ipv4StaticRoutingHelper
+/**
+ * \brief Helper class that adds ns3::Ipv4StaticRouting objects
+ */
+class Ipv4StaticRoutingHelper : public Ipv4RoutingHelper
 {
 public:
+  Ipv4StaticRoutingHelper();
+
+  /**
+   * \param node the node on which the routing protocol will run
+   * \returns a newly-created routing protocol
+   *
+   * This method will be called by ns3::InternetStackHelper::Install
+   */
+  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const;
+
   Ptr<Ipv4StaticRouting> GetStaticRouting (Ptr<Ipv4> ipv4) const;
 
   void AddMulticastRoute (Ptr<Node> n, Ipv4Address source, Ipv4Address group,  
--- a/src/helper/olsr-helper.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/helper/olsr-helper.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -30,64 +30,18 @@
   m_agentFactory.SetTypeId ("ns3::olsr::RoutingProtocol");
 }
 
-void 
-OlsrHelper::SetAgent (std::string tid,
-                      std::string n0, const AttributeValue &v0,
-                      std::string n1, const AttributeValue &v1,
-                      std::string n2, const AttributeValue &v2,
-                      std::string n3, const AttributeValue &v3,
-                      std::string n4, const AttributeValue &v4,
-                      std::string n5, const AttributeValue &v5,
-                      std::string n6, const AttributeValue &v6,
-                      std::string n7, const AttributeValue &v7)
+Ptr<Ipv4RoutingProtocol> 
+OlsrHelper::Create (Ptr<Node> node) const
 {
-  m_agentFactory.SetTypeId (tid);
-  m_agentFactory.Set (n0, v0);
-  m_agentFactory.Set (n1, v1);
-  m_agentFactory.Set (n2, v2);
-  m_agentFactory.Set (n3, v3);
-  m_agentFactory.Set (n4, v4);
-  m_agentFactory.Set (n5, v5);
-  m_agentFactory.Set (n6, v6);
-  m_agentFactory.Set (n7, v7);
+  Ptr<olsr::RoutingProtocol> agent = m_agentFactory.Create<olsr::RoutingProtocol> ();
+  node->AggregateObject (agent);
+  return agent;
 }
 
 void 
-OlsrHelper::Install (NodeContainer container)
-{
-  for (NodeContainer::Iterator i = container.Begin (); i != container.End (); ++i)
-    {
-      Ptr<Node> node = *i;
-      Install (node);
-    }
-}
-void 
-OlsrHelper::Install (Ptr<Node> node)
+OlsrHelper::Set (std::string name, const AttributeValue &value)
 {
-  if (node->GetObject<olsr::RoutingProtocol> () != 0)
-    {
-      NS_FATAL_ERROR ("OlsrHelper::Install(): Aggregating "
-         "an Olsr Agent to a node with an existing Olsr RoutingProtocol");
-      return;
-    }
-  Ptr<olsr::RoutingProtocol> agent = m_agentFactory.Create<olsr::RoutingProtocol> ();
-  node->AggregateObject (agent);
-  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
-  Ptr<Ipv4ListRouting> ipv4Routing = DynamicCast<Ipv4ListRouting> (ipv4->GetRoutingProtocol ());
-  NS_ASSERT (ipv4Routing);
-  ipv4Routing->AddRoutingProtocol (agent, 10);
-  agent->Start ();
-}
-void 
-OlsrHelper::Install (std::string nodeName)
-{
-  Ptr<Node> node = Names::Find<Node> (nodeName);
-  Install (node);
-}
-void 
-OlsrHelper::InstallAll (void)
-{
-  Install (NodeContainer::GetGlobal ());
+  m_agentFactory.Set (name, value);
 }
 
 } // namespace ns3
--- a/src/helper/olsr-helper.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/helper/olsr-helper.h	Fri Jun 26 15:34:16 2009 +0200
@@ -21,48 +21,35 @@
 #define OLSR_HELPER_H
 
 #include "ns3/object-factory.h"
-#include "ns3/node-container.h"
 #include "ns3/node.h"
+#include "node-container.h"
+#include "ipv4-routing-helper.h"
 
 namespace ns3 {
 
 /**
  * \brief Helper class that adds OLSR routing to nodes.
  */
-class OlsrHelper
+class OlsrHelper : public Ipv4RoutingHelper
 {
 public:
   OlsrHelper ();
 
   /**
-   * \brief Set default OLSR routing agent attributes
+   * \param node the node on which the routing protocol will run
+   * \returns a newly-created routing protocol
+   *
+   * This method will be called by ns3::InternetStackHelper::Install
    */
-  void SetAgent (std::string tid,
-                 std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
-                 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
-                 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
-                 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
-                 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
-                 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
-                 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
-                 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
+  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const;
 
   /**
-   * \brief Enable OLSR routing for a set of nodes
-   */
-  void Install (NodeContainer container);
-  /**
-   * \brief Enable OLSR routing for a single node
+   * \param name the name of the attribute to set
+   * \param value the value of the attribute to set.
+   *
+   * This method controls the attributes of ns3::olsr::RoutingProtocol
    */
-  void Install (Ptr<Node> node);
-  /**
-   * \brief Enable OLSR routing for a single node
-   */
-  void Install (std::string nodeName);
-  /**
-   * \brief Enable OLSR routing for all nodes
-   */
-  void InstallAll (void);
+  void Set (std::string name, const AttributeValue &value);
 private:
   ObjectFactory m_agentFactory;
 };
--- a/src/helper/wscript	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/helper/wscript	Fri Jun 26 15:34:16 2009 +0200
@@ -25,6 +25,9 @@
         'v4ping-helper.cc',
         'nqos-wifi-mac-helper.cc',
         'qos-wifi-mac-helper.cc',
+        'ipv4-global-routing-helper.cc',
+        'ipv4-list-routing-helper.cc',
+        'ipv4-routing-helper.cc',
         ]
 
     headers = bld.new_task_gen('ns3header')
@@ -52,6 +55,9 @@
         'v4ping-helper.h',
         'nqos-wifi-mac-helper.h',
         'qos-wifi-mac-helper.h',
+        'ipv4-global-routing-helper.h',
+        'ipv4-list-routing-helper.h',
+        'ipv4-routing-helper.h',
         ]
 
     env = bld.env_of_name('default')
--- a/src/internet-stack/ipv4-l3-protocol.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/internet-stack/ipv4-l3-protocol.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -187,11 +187,7 @@
     }
   m_interfaces.clear ();
   m_node = 0;
-  if (m_routingProtocol)
-    {
-      m_routingProtocol->Dispose ();
-      m_routingProtocol = 0;
-    }
+  m_routingProtocol = 0;
   Object::DoDispose ();
 }
 
--- a/src/internet-stack/ipv4-l3-protocol.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/internet-stack/ipv4-l3-protocol.h	Fri Jun 26 15:34:16 2009 +0200
@@ -157,9 +157,6 @@
 
   Ptr<NetDevice> GetNetDevice (uint32_t i);
 
-  void AddRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol,
-                           int16_t priority);
-
 protected:
 
   virtual void DoDispose (void);
--- a/src/routing/global-routing/global-route-manager-impl.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/global-routing/global-route-manager-impl.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -374,7 +374,12 @@
   for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
-      Ptr<Ipv4GlobalRouting> gr = GetGlobalRoutingProtocol (node->GetId ());
+      Ptr<GlobalRouter> router = node->GetObject<GlobalRouter> ();
+      if (router == 0)
+        {
+          continue;
+        }
+      Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
       uint32_t j = 0;
       uint32_t nRoutes = gr->GetNRoutes ();
       NS_LOG_LOGIC ("Deleting " << gr->GetNRoutes ()<< " routes from node " << node->GetId ());
@@ -397,79 +402,6 @@
 }
 
 //
-// In order to build the routing database, we need at least one of the nodes
-// to participate as a router.  This is a convenience function that makes
-// all nodes routers.  We do this by walking the list of nodes in the system
-// and aggregating a Global Router Interface to each of the nodes.
-//
-  void
-GlobalRouteManagerImpl::SelectRouterNodes () 
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
-    {
-      Ptr<Node> node = *i;
-      NS_LOG_LOGIC ("Adding GlobalRouter interface to node " << node->GetId ());
-
-      Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
-      node->AggregateObject (globalRouter);
-
-      NS_LOG_LOGIC ("Adding GlobalRouting Protocol to node " << node->GetId ());
-      Ptr<Ipv4GlobalRouting> globalRouting = CreateObject<Ipv4GlobalRouting> ();
-      // Here, we check whether there is an existing Ipv4RoutingProtocol object
-      // to add this protocol to.
-      Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
-      NS_ASSERT_MSG (ipv4, "GlobalRouteManagerImpl::SelectRouterNodes (): GetObject for <Ipv4> interface failed");
-      // Now, we add this to an Ipv4ListRouting object.  
-      // XXX in the future, we may want to allow this to be added to Ipv4
-      // directly
-      Ptr<Ipv4ListRouting> ipv4ListRouting = DynamicCast<Ipv4ListRouting> (ipv4->GetRoutingProtocol ());
-      NS_ASSERT_MSG (ipv4ListRouting, "GlobalRouteManagerImpl::SelectRouterNodes (): Ipv4ListRouting not found"); 
-      // This is the object that will keep the global routes.  We insert it
-      // at slightly higher priority than static routing (which is at zero).
-      // This means that global routes (e.g. host routes) will be consulted
-      // before static routes
-      // XXX make the below  priority value an attribute
-      ipv4ListRouting->AddRoutingProtocol (globalRouting, 3);  
-      // Locally cache the globalRouting pointer; we'll need it later
-      // when we add routes
-      AddGlobalRoutingProtocol (node->GetId (), globalRouting);
-    }
-}
-
-  void
-GlobalRouteManagerImpl::SelectRouterNodes (NodeContainer c) 
-{
-  NS_LOG_FUNCTION (&c);
-  for (NodeContainer::Iterator i = c.Begin (); i != c.End (); i++)
-    {
-      Ptr<Node> node = *i;
-      NS_LOG_LOGIC ("Adding GlobalRouter interface to node " << 
-        node->GetId ());
-
-      Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
-      node->AggregateObject (globalRouter);
-
-      NS_LOG_LOGIC ("Adding GlobalRouting Protocol to node " << node->GetId ());
-      Ptr<Ipv4GlobalRouting> globalRouting = CreateObject<Ipv4GlobalRouting> ();
-      // This is the object that will keep the global routes.  We insert it
-      // at slightly higher priority than static routing (which is at zero).
-      // This means that global routes (e.g. host routes) will be consulted
-      // before static routes
-      Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
-      NS_ASSERT_MSG (ipv4, "GlobalRouteManagerImpl::SelectRouterNodes (): "
-        "GetObject for <Ipv4> interface failed");
-      Ptr<Ipv4ListRouting> ipv4ListRouting = DynamicCast<Ipv4ListRouting> (ipv4->GetRoutingProtocol ());
-      NS_ASSERT_MSG (ipv4ListRouting, "GlobalRouteManagerImpl::SelectRouterNodes (): Ipv4ListRouting not found"); 
-      // XXX make the below  priority value an attribute
-      ipv4ListRouting->AddRoutingProtocol (globalRouting, 3);  
-      // Locally cache the globalRouting pointer; we'll need it later
-      // when we add routes
-      AddGlobalRoutingProtocol (node->GetId (), globalRouting);
-    }
-}
-
-//
 // In order to build the routing database, we need to walk the list of nodes
 // in the system and look for those that support the GlobalRouter interface.
 // These routers will export a number of Link State Advertisements (LSAs)
@@ -1352,7 +1284,13 @@
 // Similarly, the vertex <v> has an m_rootOif (outbound interface index) to
 // which the packets should be send for forwarding.
 //
-          Ptr<Ipv4GlobalRouting> gr = GetGlobalRoutingProtocol (node->GetId ());
+          
+          Ptr<GlobalRouter> router = node->GetObject<GlobalRouter> ();
+          if (router == 0)
+            {
+              continue;
+            }
+          Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
           NS_ASSERT (gr);
           if (v->GetOutgoingInterfaceId () >= 0)
             {
@@ -1576,7 +1514,12 @@
 // Similarly, the vertex <v> has an m_rootOif (outbound interface index) to
 // which the packets should be send for forwarding.
 //
-              Ptr<Ipv4GlobalRouting> gr = GetGlobalRoutingProtocol (node->GetId ());
+              Ptr<GlobalRouter> router = node->GetObject<GlobalRouter> ();
+              if (router == 0)
+                {
+                  continue;
+                }
+              Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
               NS_ASSERT (gr);
               if (v->GetOutgoingInterfaceId () >= 0)
                 {
@@ -1674,7 +1617,12 @@
           Ipv4Mask tempmask = lsa->GetNetworkLSANetworkMask ();
           Ipv4Address tempip = lsa->GetLinkStateId ();
           tempip = tempip.CombineMask (tempmask);
-          Ptr<Ipv4GlobalRouting> gr = GetGlobalRoutingProtocol (node->GetId ());
+          Ptr<GlobalRouter> router = node->GetObject<GlobalRouter> ();
+          if (router == 0)
+            {
+              continue;
+            }
+          Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
           NS_ASSERT (gr);
           if (v->GetOutgoingInterfaceId () >= 0)
             {
@@ -1714,29 +1662,6 @@
   v->GetParent ()->AddChild (v);
 }
 
-  void 
-GlobalRouteManagerImpl::AddGlobalRoutingProtocol (uint32_t nodeId, Ptr<Ipv4GlobalRouting> proto)
-{
-  NS_LOG_FUNCTION (nodeId);
-  m_routingProtocols.push_back
-    (std::pair<uint32_t, Ptr<Ipv4GlobalRouting> > (nodeId, proto));
-  m_routingProtocols.sort ();
-}
-
-  Ptr<Ipv4GlobalRouting>
-GlobalRouteManagerImpl::GetGlobalRoutingProtocol (uint32_t nodeId)
-{
-  for (Ipv4GlobalRoutingList::const_iterator rprotoIter = m_routingProtocols.begin (); rprotoIter != m_routingProtocols.end (); rprotoIter++)
-    {
-      if ((*rprotoIter).first == nodeId)
-        {
-          return (*rprotoIter).second;
-        }
-    }
-  return 0;
-}
-
-
 } // namespace ns3
 
 #ifdef RUN_SELF_TESTS
--- a/src/routing/global-routing/global-route-manager-impl.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/global-routing/global-route-manager-impl.h	Fri Jun 26 15:34:16 2009 +0200
@@ -29,7 +29,6 @@
 #include "ns3/object.h"
 #include "ns3/ptr.h"
 #include "ns3/ipv4-address.h"
-#include "ns3/node-container.h"
 #include "global-router-interface.h"
 
 namespace ns3 {
@@ -729,21 +728,6 @@
  *
  */
   virtual void DeleteGlobalRoutes ();
-/**
- * @brief Select which nodes in the system are to be router nodes and 
- * aggregate the appropriate interfaces onto those nodes.
- * @internal
- *
- */
-  virtual void SelectRouterNodes ();
-
-/**
- * @brief Select which nodes in the system are to be router nodes and 
- * aggregate the appropriate interfaces onto those nodes.
- * @internal
- *
- */
-  virtual void SelectRouterNodes (NodeContainer c);
 
 /**
  * @brief Build the routing database by gathering Link State Advertisements
@@ -801,12 +785,6 @@
   void SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v);
   int32_t FindOutgoingInterfaceId (Ipv4Address a, 
     Ipv4Mask amask = Ipv4Mask("255.255.255.255"));
-
-  // Local cache of the Ipv4GlobalRouting objects, indexed by nodeId
-  typedef std::list< std::pair< uint32_t, Ptr<Ipv4GlobalRouting> > > Ipv4GlobalRoutingList;
-  void AddGlobalRoutingProtocol (uint32_t nodeId, Ptr<Ipv4GlobalRouting> proto);
-  Ptr<Ipv4GlobalRouting> GetGlobalRoutingProtocol (uint32_t nodeId);
-  Ipv4GlobalRoutingList m_routingProtocols;
 };
 
 } // namespace ns3
--- a/src/routing/global-routing/global-route-manager.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/global-routing/global-route-manager.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -21,7 +21,6 @@
 #include "ns3/assert.h"
 #include "ns3/log.h"
 #include "ns3/simulation-singleton.h"
-#include "ns3/node-container.h"
 #include "global-route-manager.h"
 #include "global-route-manager-impl.h"
 
@@ -36,15 +35,6 @@
   void
 GlobalRouteManager::PopulateRoutingTables (void) 
 {
-  SelectRouterNodes ();
-  BuildGlobalRoutingDatabase ();
-  InitializeRoutes ();
-}
-
-  void
-GlobalRouteManager::PopulateRoutingTables (NodeContainer c) 
-{
-  SelectRouterNodes (c);
   BuildGlobalRoutingDatabase ();
   InitializeRoutes ();
 }
@@ -65,20 +55,6 @@
 }
 
   void
-GlobalRouteManager::SelectRouterNodes (void) 
-{
-  SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
-    SelectRouterNodes ();
-}
-
-  void
-GlobalRouteManager::SelectRouterNodes (NodeContainer c) 
-{
-  SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
-    SelectRouterNodes (c);
-}
-
-  void
 GlobalRouteManager::BuildGlobalRoutingDatabase (void) 
 {
   SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
--- a/src/routing/global-routing/global-route-manager.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/global-routing/global-route-manager.h	Fri Jun 26 15:34:16 2009 +0200
@@ -22,7 +22,7 @@
 #ifndef GLOBAL_ROUTE_MANAGER_H
 #define GLOBAL_ROUTE_MANAGER_H
 
-#include "ns3/node-container.h"
+#include "ns3/deprecated.h"
 
 namespace ns3 {
 
@@ -45,30 +45,13 @@
  * the nodes in the simulation.  Makes all nodes in the simulation into
  * routers.
  *
- * All this function does is call the three functions
- * SelectRouterNodes (), BuildGlobalRoutingDatabase (), and
- * InitializeRoutes ().
+ * All this function does is call the functions
+ * BuildGlobalRoutingDatabase () and  InitializeRoutes ().
  *
- * @see SelectRouterNodes ();
  * @see BuildGlobalRoutingDatabase ();
  * @see InitializeRoutes ();
  */
-  static void PopulateRoutingTables ();
-
-/**
- * @brief Build a routing database and initialize the routing tables of
- * the nodes in the simulation.  Makes the nodes in the provided container
- * into routers.
- *
- * All this function does is call the three functions
- * SelectRouterNodes (), BuildGlobalRoutingDatabase (), and
- * InitializeRoutes ().
- *
- * @see SelectRouterNodes (Node Container c);
- * @see BuildGlobalRoutingDatabase ();
- * @see InitializeRoutes ();
- */
-  static void PopulateRoutingTables (NodeContainer c);
+  static void PopulateRoutingTables () NS_DEPRECATED;
 
  /**
   *@brief Remove all routes that were previously installed in a prior call
@@ -85,7 +68,13 @@
  * @see BuildGlobalRoutingDatabase ();
  * @see InitializeRoutes ();
  */
- static void RecomputeRoutingTables ();
+ static void RecomputeRoutingTables () NS_DEPRECATED;
+
+public:
+/**
+ * @brief Allocate a 32-bit router ID from monotonically increasing counter.
+ */
+  static uint32_t AllocateRouterId ();
 
 /**
  * @brief Delete all static routes on all nodes that have a 
@@ -95,29 +84,6 @@
   static void DeleteGlobalRoutes ();
 
 /**
- * @brief Select which nodes in the system are to be router nodes and 
- * aggregate the appropriate interfaces onto those nodes.
- * @internal
- *
- */
-  static void SelectRouterNodes ();
-
-/**
- * @brief Select which nodes in the system are to be router nodes and 
- * aggregate the appropriate interfaces onto those nodes.
- * @internal
- *
- */
-  static void SelectRouterNodes (NodeContainer c);
-
-/**
- * @brief Allocate a 32-bit router ID from monotonically increasing counter.
- */
-  static uint32_t AllocateRouterId ();
-
-private:
-
-/**
  * @brief Build the routing database by gathering Link State Advertisements
  * from each node exporting a GlobalRouter interface.
  * @internal
@@ -132,6 +98,7 @@
  */
   static void InitializeRoutes ();
 
+private:
 /**
  * @brief Global Route Manager copy construction is disallowed.  There's no 
  * need for it and a compiler provided shallow copy would be wrong.
--- a/src/routing/global-routing/global-router-interface.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/global-routing/global-router-interface.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -26,7 +26,7 @@
 #include "ns3/node.h"
 #include "ns3/ipv4.h"
 #include "ns3/bridge-net-device.h"
-#include "ns3/net-device-container.h"
+#include "ipv4-global-routing.h"
 #include "global-router-interface.h"
 #include <vector>
 
@@ -497,10 +497,22 @@
   ClearLSAs();
 }
 
+void 
+GlobalRouter::SetRoutingProtocol (Ptr<Ipv4GlobalRouting> routing)
+{
+  m_routingProtocol = routing;
+}
+Ptr<Ipv4GlobalRouting> 
+GlobalRouter::GetRoutingProtocol (void)
+{
+  return m_routingProtocol;
+}
+
 void
 GlobalRouter::DoDispose ()
 {
   NS_LOG_FUNCTION_NOARGS ();
+  m_routingProtocol = 0;
   Object::DoDispose ();
 }
 
--- a/src/routing/global-routing/global-router-interface.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/global-routing/global-router-interface.h	Fri Jun 26 15:34:16 2009 +0200
@@ -36,6 +36,7 @@
 namespace ns3 {
 
 class GlobalRouter;
+class Ipv4GlobalRouting;
 
 /**
  * @brief A single link record for a link state advertisement.
@@ -572,6 +573,10 @@
  */
   GlobalRouter ();
 
+
+  void SetRoutingProtocol (Ptr<Ipv4GlobalRouting> routing);
+  Ptr<Ipv4GlobalRouting> GetRoutingProtocol (void);
+
 /**
  * @brief Get the Router ID associated with this Global Router.
  *
@@ -660,6 +665,7 @@
   ListOfLSAs_t m_LSAs;
 
   Ipv4Address m_routerId;
+  Ptr<Ipv4GlobalRouting> m_routingProtocol;
 
   // inherited from Object
   virtual void DoDispose (void);
--- a/src/routing/global-routing/ipv4-global-routing.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/global-routing/ipv4-global-routing.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -19,7 +19,7 @@
 #include "ns3/log.h"
 #include "ns3/object.h"
 #include "ns3/packet.h"
-#include "ns3/node.h"
+#include "ns3/net-device.h"
 #include "ns3/ipv4-route.h"
 #include "ns3/ipv4-routing-table-entry.h"
 #include "ipv4-global-routing.h"
--- a/src/routing/global-routing/wscript	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/global-routing/wscript	Fri Jun 26 15:34:16 2009 +0200
@@ -14,5 +14,6 @@
     headers.source = [
         'global-router-interface.h',
         'global-route-manager.h',
+        'ipv4-global-routing.h',
         ]
 
--- a/src/routing/list-routing/ipv4-list-routing.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/list-routing/ipv4-list-routing.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -304,27 +304,6 @@
   return 0;
 }
 
-Ptr<Ipv4StaticRouting>
-Ipv4ListRouting::GetStaticRouting (void) const
-{
-  NS_LOG_FUNCTION (this);
-  Ipv4StaticRouting* srp;
-  for (Ipv4RoutingProtocolList::const_iterator rprotoIter = m_routingProtocols.begin ();
-       rprotoIter != m_routingProtocols.end (); rprotoIter++)
-    {
-      NS_LOG_LOGIC ("Searching for static routing");
-      srp = dynamic_cast<Ipv4StaticRouting*> (PeekPointer((*rprotoIter).second));
-      if (srp)
-        {
-          NS_LOG_LOGIC ("Found static routing");
-          return Ptr<Ipv4StaticRouting> (srp);
-        }
-    }
-  NS_LOG_LOGIC ("Static routing not found");
-  return 0;
-
-}
-
 bool 
 Ipv4ListRouting::Compare (const Ipv4RoutingProtocolEntry& a, const Ipv4RoutingProtocolEntry& b)
 {
--- a/src/routing/list-routing/ipv4-list-routing.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/list-routing/ipv4-list-routing.h	Fri Jun 26 15:34:16 2009 +0200
@@ -24,8 +24,6 @@
 
 namespace ns3 {
 
-class Ipv4StaticRouting;
-
 /**
  * \ingroup ipv4Routing 
  *
@@ -84,8 +82,6 @@
   virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address);
   virtual void SetIpv4 (Ptr<Ipv4> ipv4);
 
-  virtual Ptr<Ipv4StaticRouting> GetStaticRouting (void) const;
-
 protected:
   void DoDispose (void);
 private:
--- a/src/routing/olsr/olsr-routing-protocol.cc	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/olsr/olsr-routing-protocol.cc	Fri Jun 26 15:34:16 2009 +0200
@@ -213,6 +213,8 @@
   m_linkTupleTimerFirstTime = true;
 
   m_ipv4 = ipv4;
+
+  Simulator::ScheduleNow (&RoutingProtocol::Start, this);
 }
 
 void RoutingProtocol::DoDispose ()
--- a/src/routing/olsr/olsr-routing-protocol.h	Fri Jun 26 13:58:03 2009 +0200
+++ b/src/routing/olsr/olsr-routing-protocol.h	Fri Jun 26 15:34:16 2009 +0200
@@ -68,7 +68,6 @@
   RoutingProtocol ();
   virtual ~RoutingProtocol ();
 
-  void Start ();
   void SetMainInterface (uint32_t interface);
 
 private:
@@ -101,7 +100,7 @@
   Ptr<Ipv4> m_ipv4;
 	
 private:
-
+  void Start ();
   void Clear ();
   uint32_t GetSize () const { return m_table.size (); }
   std::vector<RoutingTableEntry> GetEntries () const;