View | Details | Raw Unified | Return to bug 600
Collapse All | Expand All

(-)a/bindings/python/ns3_module_global_routing.py (-20 / +91 lines)
 Lines 17-22    Link Here 
17
    module.add_enum('LinkType', ['Unknown', 'PointToPoint', 'TransitNetwork', 'StubNetwork', 'VirtualLink'], outer_class=root_module['ns3::GlobalRoutingLinkRecord'])
17
    module.add_enum('LinkType', ['Unknown', 'PointToPoint', 'TransitNetwork', 'StubNetwork', 'VirtualLink'], outer_class=root_module['ns3::GlobalRoutingLinkRecord'])
18
    ## global-router-interface.h: ns3::GlobalRouter [class]
18
    ## global-router-interface.h: ns3::GlobalRouter [class]
19
    module.add_class('GlobalRouter', is_singleton=True, parent=root_module['ns3::Object'])
19
    module.add_class('GlobalRouter', is_singleton=True, parent=root_module['ns3::Object'])
20
    ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting [class]
21
    module.add_class('Ipv4GlobalRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
20
    
22
    
21
    ## Register a nested module for the namespace Config
23
    ## Register a nested module for the namespace Config
22
    
24
    
 Lines 73-78    Link Here 
73
    register_Ns3GlobalRoutingLSA_methods(root_module, root_module['ns3::GlobalRoutingLSA'])
75
    register_Ns3GlobalRoutingLSA_methods(root_module, root_module['ns3::GlobalRoutingLSA'])
74
    register_Ns3GlobalRoutingLinkRecord_methods(root_module, root_module['ns3::GlobalRoutingLinkRecord'])
76
    register_Ns3GlobalRoutingLinkRecord_methods(root_module, root_module['ns3::GlobalRoutingLinkRecord'])
75
    register_Ns3GlobalRouter_methods(root_module, root_module['ns3::GlobalRouter'])
77
    register_Ns3GlobalRouter_methods(root_module, root_module['ns3::GlobalRouter'])
78
    register_Ns3Ipv4GlobalRouting_methods(root_module, root_module['ns3::Ipv4GlobalRouting'])
76
    return
79
    return
77
80
78
def register_Ns3GlobalRouteManager_methods(root_module, cls):
81
def register_Ns3GlobalRouteManager_methods(root_module, cls):
 Lines 81-111    Link Here 
81
                   'void', 
84
                   'void', 
82
                   [], 
85
                   [], 
83
                   is_static=True)
86
                   is_static=True)
84
    ## global-route-manager.h: static void ns3::GlobalRouteManager::PopulateRoutingTables(ns3::NodeContainer c) [member function]
85
    cls.add_method('PopulateRoutingTables', 
86
                   'void', 
87
                   [param('ns3::NodeContainer', 'c')], 
88
                   is_static=True)
89
    ## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function]
87
    ## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function]
90
    cls.add_method('RecomputeRoutingTables', 
88
    cls.add_method('RecomputeRoutingTables', 
91
                   'void', 
89
                   'void', 
92
                   [], 
90
                   [], 
93
                   is_static=True)
91
                   is_static=True)
94
    ## global-route-manager.h: static void ns3::GlobalRouteManager::DeleteGlobalRoutes() [member function]
95
    cls.add_method('DeleteGlobalRoutes', 
96
                   'void', 
97
                   [], 
98
                   is_static=True)
99
    ## global-route-manager.h: static void ns3::GlobalRouteManager::SelectRouterNodes() [member function]
100
    cls.add_method('SelectRouterNodes', 
101
                   'void', 
102
                   [], 
103
                   is_static=True)
104
    ## global-route-manager.h: static void ns3::GlobalRouteManager::SelectRouterNodes(ns3::NodeContainer c) [member function]
105
    cls.add_method('SelectRouterNodes', 
106
                   'void', 
107
                   [param('ns3::NodeContainer', 'c')], 
108
                   is_static=True)
109
    ## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function]
92
    ## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function]
110
    cls.add_method('AllocateRouterId', 
93
    cls.add_method('AllocateRouterId', 
111
                   'uint32_t', 
94
                   'uint32_t', 
 Lines 267-272    Link Here 
267
                   is_static=True)
250
                   is_static=True)
268
    ## global-router-interface.h: ns3::GlobalRouter::GlobalRouter() [constructor]
251
    ## global-router-interface.h: ns3::GlobalRouter::GlobalRouter() [constructor]
269
    cls.add_constructor([])
252
    cls.add_constructor([])
253
    ## global-router-interface.h: void ns3::GlobalRouter::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4GlobalRouting> routing) [member function]
254
    cls.add_method('SetRoutingProtocol', 
255
                   'void', 
256
                   [param('ns3::Ptr< ns3::Ipv4GlobalRouting >', 'routing')])
257
    ## global-router-interface.h: ns3::Ptr<ns3::Ipv4GlobalRouting> ns3::GlobalRouter::GetRoutingProtocol() [member function]
258
    cls.add_method('GetRoutingProtocol', 
259
                   'ns3::Ptr< ns3::Ipv4GlobalRouting >', 
260
                   [])
270
    ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRouter::GetRouterId() const [member function]
261
    ## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRouter::GetRouterId() const [member function]
271
    cls.add_method('GetRouterId', 
262
    cls.add_method('GetRouterId', 
272
                   'ns3::Ipv4Address', 
263
                   'ns3::Ipv4Address', 
 Lines 293-298    Link Here 
293
                   visibility='private', is_virtual=True)
284
                   visibility='private', is_virtual=True)
294
    return
285
    return
295
286
287
def register_Ns3Ipv4GlobalRouting_methods(root_module, cls):
288
    ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting(ns3::Ipv4GlobalRouting const & arg0) [copy constructor]
289
    cls.add_constructor([param('ns3::Ipv4GlobalRouting const &', 'arg0')])
290
    ## ipv4-global-routing.h: static ns3::TypeId ns3::Ipv4GlobalRouting::GetTypeId() [member function]
291
    cls.add_method('GetTypeId', 
292
                   'ns3::TypeId', 
293
                   [], 
294
                   is_static=True)
295
    ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting() [constructor]
296
    cls.add_constructor([])
297
    ## 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]
298
    cls.add_method('RouteOutput', 
299
                   'ns3::Ptr< ns3::Ipv4Route >', 
300
                   [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('uint32_t', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], 
301
                   is_virtual=True)
302
    ## 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]
303
    cls.add_method('RouteInput', 
304
                   'bool', 
305
                   [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')], 
306
                   is_virtual=True)
307
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyInterfaceUp(uint32_t interface) [member function]
308
    cls.add_method('NotifyInterfaceUp', 
309
                   'void', 
310
                   [param('uint32_t', 'interface')], 
311
                   is_virtual=True)
312
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyInterfaceDown(uint32_t interface) [member function]
313
    cls.add_method('NotifyInterfaceDown', 
314
                   'void', 
315
                   [param('uint32_t', 'interface')], 
316
                   is_virtual=True)
317
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
318
    cls.add_method('NotifyAddAddress', 
319
                   'void', 
320
                   [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], 
321
                   is_virtual=True)
322
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
323
    cls.add_method('NotifyRemoveAddress', 
324
                   'void', 
325
                   [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], 
326
                   is_virtual=True)
327
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
328
    cls.add_method('SetIpv4', 
329
                   'void', 
330
                   [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], 
331
                   is_virtual=True)
332
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
333
    cls.add_method('AddHostRouteTo', 
334
                   'void', 
335
                   [param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
336
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
337
    cls.add_method('AddHostRouteTo', 
338
                   'void', 
339
                   [param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
340
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
341
    cls.add_method('AddNetworkRouteTo', 
342
                   'void', 
343
                   [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
344
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
345
    cls.add_method('AddNetworkRouteTo', 
346
                   'void', 
347
                   [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
348
    ## ipv4-global-routing.h: uint32_t ns3::Ipv4GlobalRouting::GetNRoutes() [member function]
349
    cls.add_method('GetNRoutes', 
350
                   'uint32_t', 
351
                   [])
352
    ## ipv4-global-routing.h: ns3::Ipv4RoutingTableEntry * ns3::Ipv4GlobalRouting::GetRoute(uint32_t i) [member function]
353
    cls.add_method('GetRoute', 
354
                   'ns3::Ipv4RoutingTableEntry *', 
355
                   [param('uint32_t', 'i')])
356
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::RemoveRoute(uint32_t i) [member function]
357
    cls.add_method('RemoveRoute', 
358
                   'void', 
359
                   [param('uint32_t', 'i')])
360
    ## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::DoDispose() [member function]
361
    cls.add_method('DoDispose', 
362
                   'void', 
363
                   [], 
364
                   visibility='protected', is_virtual=True)
365
    return
366
296
def register_functions(root_module):
367
def register_functions(root_module):
297
    module = root_module
368
    module = root_module
298
    register_functions_ns3_Config(module.get_submodule('Config'), root_module)
369
    register_functions_ns3_Config(module.get_submodule('Config'), root_module)
(-)a/bindings/python/ns3_module_helper.py (-21 / +83 lines)
 Lines 17-24    Link Here 
17
    module.add_class('Ipv4AddressHelper', allow_subclassing=False)
17
    module.add_class('Ipv4AddressHelper', allow_subclassing=False)
18
    ## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer [class]
18
    ## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer [class]
19
    module.add_class('Ipv4InterfaceContainer')
19
    module.add_class('Ipv4InterfaceContainer')
20
    ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper [class]
21
    module.add_class('Ipv4RoutingHelper', allow_subclassing=False)
20
    ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper [class]
22
    ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper [class]
21
    module.add_class('Ipv4StaticRoutingHelper', allow_subclassing=False)
23
    module.add_class('Ipv4StaticRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper'])
22
    ## mobility-helper.h: ns3::MobilityHelper [class]
24
    ## mobility-helper.h: ns3::MobilityHelper [class]
23
    module.add_class('MobilityHelper', allow_subclassing=False)
25
    module.add_class('MobilityHelper', allow_subclassing=False)
24
    ## net-device-container.h: ns3::NetDeviceContainer [class]
26
    ## net-device-container.h: ns3::NetDeviceContainer [class]
 Lines 28-34    Link Here 
28
    ## ns2-mobility-helper.h: ns3::Ns2MobilityHelper [class]
30
    ## ns2-mobility-helper.h: ns3::Ns2MobilityHelper [class]
29
    module.add_class('Ns2MobilityHelper', allow_subclassing=False)
31
    module.add_class('Ns2MobilityHelper', allow_subclassing=False)
30
    ## olsr-helper.h: ns3::OlsrHelper [class]
32
    ## olsr-helper.h: ns3::OlsrHelper [class]
31
    module.add_class('OlsrHelper', allow_subclassing=False)
33
    module.add_class('OlsrHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper'])
32
    ## on-off-helper.h: ns3::OnOffHelper [class]
34
    ## on-off-helper.h: ns3::OnOffHelper [class]
33
    module.add_class('OnOffHelper', allow_subclassing=False)
35
    module.add_class('OnOffHelper', allow_subclassing=False)
34
    ## packet-sink-helper.h: ns3::PacketSinkHelper [class]
36
    ## packet-sink-helper.h: ns3::PacketSinkHelper [class]
 Lines 57-62    Link Here 
57
    module.add_class('YansWifiPhyHelper', allow_subclassing=False, parent=root_module['ns3::WifiPhyHelper'])
59
    module.add_class('YansWifiPhyHelper', allow_subclassing=False, parent=root_module['ns3::WifiPhyHelper'])
58
    ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::PcapFormat [enumeration]
60
    ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::PcapFormat [enumeration]
59
    module.add_enum('PcapFormat', ['PCAP_FORMAT_80211', 'PCAP_FORMAT_80211_PRISM', 'PCAP_FORMAT_80211_RADIOTAP'], outer_class=root_module['ns3::YansWifiPhyHelper'])
61
    module.add_enum('PcapFormat', ['PCAP_FORMAT_80211', 'PCAP_FORMAT_80211_PRISM', 'PCAP_FORMAT_80211_RADIOTAP'], outer_class=root_module['ns3::YansWifiPhyHelper'])
62
    ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper [class]
63
    module.add_class('Ipv4GlobalRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper'])
64
    ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper [class]
65
    module.add_class('Ipv4ListRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper'])
60
    ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper [class]
66
    ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper [class]
61
    module.add_class('NqosWifiMacHelper', allow_subclassing=False, parent=root_module['ns3::WifiMacHelper'])
67
    module.add_class('NqosWifiMacHelper', allow_subclassing=False, parent=root_module['ns3::WifiMacHelper'])
62
    ## qos-wifi-mac-helper.h: ns3::QosWifiMacHelper [class]
68
    ## qos-wifi-mac-helper.h: ns3::QosWifiMacHelper [class]
 Lines 120-125    Link Here 
120
    register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper'])
126
    register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper'])
121
    register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper'])
127
    register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper'])
122
    register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer'])
128
    register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer'])
129
    register_Ns3Ipv4RoutingHelper_methods(root_module, root_module['ns3::Ipv4RoutingHelper'])
123
    register_Ns3Ipv4StaticRoutingHelper_methods(root_module, root_module['ns3::Ipv4StaticRoutingHelper'])
130
    register_Ns3Ipv4StaticRoutingHelper_methods(root_module, root_module['ns3::Ipv4StaticRoutingHelper'])
124
    register_Ns3MobilityHelper_methods(root_module, root_module['ns3::MobilityHelper'])
131
    register_Ns3MobilityHelper_methods(root_module, root_module['ns3::MobilityHelper'])
125
    register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
132
    register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
 Lines 139-144    Link Here 
139
    register_Ns3WifiPhyHelper_methods(root_module, root_module['ns3::WifiPhyHelper'])
146
    register_Ns3WifiPhyHelper_methods(root_module, root_module['ns3::WifiPhyHelper'])
140
    register_Ns3YansWifiChannelHelper_methods(root_module, root_module['ns3::YansWifiChannelHelper'])
147
    register_Ns3YansWifiChannelHelper_methods(root_module, root_module['ns3::YansWifiChannelHelper'])
141
    register_Ns3YansWifiPhyHelper_methods(root_module, root_module['ns3::YansWifiPhyHelper'])
148
    register_Ns3YansWifiPhyHelper_methods(root_module, root_module['ns3::YansWifiPhyHelper'])
149
    register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, root_module['ns3::Ipv4GlobalRoutingHelper'])
150
    register_Ns3Ipv4ListRoutingHelper_methods(root_module, root_module['ns3::Ipv4ListRoutingHelper'])
142
    register_Ns3NqosWifiMacHelper_methods(root_module, root_module['ns3::NqosWifiMacHelper'])
151
    register_Ns3NqosWifiMacHelper_methods(root_module, root_module['ns3::NqosWifiMacHelper'])
143
    register_Ns3QosWifiMacHelper_methods(root_module, root_module['ns3::QosWifiMacHelper'])
152
    register_Ns3QosWifiMacHelper_methods(root_module, root_module['ns3::QosWifiMacHelper'])
144
    return
153
    return
 Lines 420-425    Link Here 
420
    cls.add_constructor([param('ns3::InternetStackHelper const &', 'arg0')])
429
    cls.add_constructor([param('ns3::InternetStackHelper const &', 'arg0')])
421
    ## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper() [constructor]
430
    ## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper() [constructor]
422
    cls.add_constructor([])
431
    cls.add_constructor([])
432
    ## internet-stack-helper.h: void ns3::InternetStackHelper::SetRoutingHelper(ns3::Ipv4RoutingHelper const & routing) [member function]
433
    cls.add_method('SetRoutingHelper', 
434
                   'void', 
435
                   [param('ns3::Ipv4RoutingHelper const &', 'routing')])
423
    ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(std::string nodeName) const [member function]
436
    ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(std::string nodeName) const [member function]
424
    cls.add_method('Install', 
437
    cls.add_method('Install', 
425
                   'void', 
438
                   'void', 
 Lines 435-440    Link Here 
435
                   'void', 
448
                   'void', 
436
                   [param('ns3::NodeContainer', 'c')], 
449
                   [param('ns3::NodeContainer', 'c')], 
437
                   is_const=True)
450
                   is_const=True)
451
    ## internet-stack-helper.h: void ns3::InternetStackHelper::InstallAll() const [member function]
452
    cls.add_method('InstallAll', 
453
                   'void', 
454
                   [], 
455
                   is_const=True)
438
    ## internet-stack-helper.h: void ns3::InternetStackHelper::SetTcp(std::string tid) [member function]
456
    ## internet-stack-helper.h: void ns3::InternetStackHelper::SetTcp(std::string tid) [member function]
439
    cls.add_method('SetTcp', 
457
    cls.add_method('SetTcp', 
440
                   'void', 
458
                   'void', 
 Lines 516-526    Link Here 
516
                   [param('std::string', 'ipv4Name'), param('uint32_t', 'interface')])
534
                   [param('std::string', 'ipv4Name'), param('uint32_t', 'interface')])
517
    return
535
    return
518
536
537
def register_Ns3Ipv4RoutingHelper_methods(root_module, cls):
538
    ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper::Ipv4RoutingHelper(ns3::Ipv4RoutingHelper const & arg0) [copy constructor]
539
    cls.add_constructor([param('ns3::Ipv4RoutingHelper const &', 'arg0')])
540
    ## ipv4-routing-helper.h: ns3::Ipv4RoutingHelper::Ipv4RoutingHelper() [constructor]
541
    cls.add_constructor([])
542
    ## ipv4-routing-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4RoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
543
    cls.add_method('Create', 
544
                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
545
                   [param('ns3::Ptr< ns3::Node >', 'node')], 
546
                   is_pure_virtual=True, is_const=True, is_virtual=True)
547
    return
548
519
def register_Ns3Ipv4StaticRoutingHelper_methods(root_module, cls):
549
def register_Ns3Ipv4StaticRoutingHelper_methods(root_module, cls):
520
    ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper(ns3::Ipv4StaticRoutingHelper const & arg0) [copy constructor]
550
    ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper(ns3::Ipv4StaticRoutingHelper const & arg0) [copy constructor]
521
    cls.add_constructor([param('ns3::Ipv4StaticRoutingHelper const &', 'arg0')])
551
    cls.add_constructor([param('ns3::Ipv4StaticRoutingHelper const &', 'arg0')])
522
    ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper() [constructor]
552
    ## ipv4-static-routing-helper.h: ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper() [constructor]
523
    cls.add_constructor([])
553
    cls.add_constructor([])
554
    ## ipv4-static-routing-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4StaticRoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
555
    cls.add_method('Create', 
556
                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
557
                   [param('ns3::Ptr< ns3::Node >', 'node')], 
558
                   is_const=True, is_virtual=True)
524
    ## ipv4-static-routing-helper.h: ns3::Ptr<ns3::Ipv4StaticRouting> ns3::Ipv4StaticRoutingHelper::GetStaticRouting(ns3::Ptr<ns3::Ipv4> ipv4) const [member function]
559
    ## ipv4-static-routing-helper.h: ns3::Ptr<ns3::Ipv4StaticRouting> ns3::Ipv4StaticRoutingHelper::GetStaticRouting(ns3::Ptr<ns3::Ipv4> ipv4) const [member function]
525
    cls.add_method('GetStaticRouting', 
560
    cls.add_method('GetStaticRouting', 
526
                   'ns3::Ptr< ns3::Ipv4StaticRouting >', 
561
                   'ns3::Ptr< ns3::Ipv4StaticRouting >', 
 Lines 752-777    Link Here 
752
    cls.add_constructor([param('ns3::OlsrHelper const &', 'arg0')])
787
    cls.add_constructor([param('ns3::OlsrHelper const &', 'arg0')])
753
    ## olsr-helper.h: ns3::OlsrHelper::OlsrHelper() [constructor]
788
    ## olsr-helper.h: ns3::OlsrHelper::OlsrHelper() [constructor]
754
    cls.add_constructor([])
789
    cls.add_constructor([])
755
    ## 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]
790
    ## olsr-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::OlsrHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
756
    cls.add_method('SetAgent', 
791
    cls.add_method('Create', 
792
                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
793
                   [param('ns3::Ptr< ns3::Node >', 'node')], 
794
                   is_const=True, is_virtual=True)
795
    ## olsr-helper.h: void ns3::OlsrHelper::Set(std::string name, ns3::AttributeValue const & value) [member function]
796
    cls.add_method('Set', 
757
                   'void', 
797
                   'void', 
758
                   [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()')])
798
                   [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
759
    ## olsr-helper.h: void ns3::OlsrHelper::Install(ns3::NodeContainer container) [member function]
760
    cls.add_method('Install', 
761
                   'void', 
762
                   [param('ns3::NodeContainer', 'container')])
763
    ## olsr-helper.h: void ns3::OlsrHelper::Install(ns3::Ptr<ns3::Node> node) [member function]
764
    cls.add_method('Install', 
765
                   'void', 
766
                   [param('ns3::Ptr< ns3::Node >', 'node')])
767
    ## olsr-helper.h: void ns3::OlsrHelper::Install(std::string nodeName) [member function]
768
    cls.add_method('Install', 
769
                   'void', 
770
                   [param('std::string', 'nodeName')])
771
    ## olsr-helper.h: void ns3::OlsrHelper::InstallAll() [member function]
772
    cls.add_method('InstallAll', 
773
                   'void', 
774
                   [])
775
    return
799
    return
776
800
777
def register_Ns3OnOffHelper_methods(root_module, cls):
801
def register_Ns3OnOffHelper_methods(root_module, cls):
 Lines 1234-1239    Link Here 
1234
                   is_const=True, visibility='private', is_virtual=True)
1258
                   is_const=True, visibility='private', is_virtual=True)
1235
    return
1259
    return
1236
1260
1261
def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls):
1262
    ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper(ns3::Ipv4GlobalRoutingHelper const & arg0) [copy constructor]
1263
    cls.add_constructor([param('ns3::Ipv4GlobalRoutingHelper const &', 'arg0')])
1264
    ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper() [constructor]
1265
    cls.add_constructor([])
1266
    ## ipv4-global-routing-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4GlobalRoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
1267
    cls.add_method('Create', 
1268
                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
1269
                   [param('ns3::Ptr< ns3::Node >', 'node')], 
1270
                   is_const=True, is_virtual=True)
1271
    ## ipv4-global-routing-helper.h: static void ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables() [member function]
1272
    cls.add_method('PopulateRoutingTables', 
1273
                   'void', 
1274
                   [], 
1275
                   is_static=True)
1276
    ## ipv4-global-routing-helper.h: static void ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables() [member function]
1277
    cls.add_method('RecomputeRoutingTables', 
1278
                   'void', 
1279
                   [], 
1280
                   is_static=True)
1281
    return
1282
1283
def register_Ns3Ipv4ListRoutingHelper_methods(root_module, cls):
1284
    ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper::Ipv4ListRoutingHelper(ns3::Ipv4ListRoutingHelper const & arg0) [copy constructor]
1285
    cls.add_constructor([param('ns3::Ipv4ListRoutingHelper const &', 'arg0')])
1286
    ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper::Ipv4ListRoutingHelper() [constructor]
1287
    cls.add_constructor([])
1288
    ## ipv4-list-routing-helper.h: void ns3::Ipv4ListRoutingHelper::Add(ns3::Ipv4RoutingHelper const & routing, int16_t priority) [member function]
1289
    cls.add_method('Add', 
1290
                   'void', 
1291
                   [param('ns3::Ipv4RoutingHelper const &', 'routing'), param('int16_t', 'priority')])
1292
    ## ipv4-list-routing-helper.h: ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4ListRoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
1293
    cls.add_method('Create', 
1294
                   'ns3::Ptr< ns3::Ipv4RoutingProtocol >', 
1295
                   [param('ns3::Ptr< ns3::Node >', 'node')], 
1296
                   is_const=True, is_virtual=True)
1297
    return
1298
1237
def register_Ns3NqosWifiMacHelper_methods(root_module, cls):
1299
def register_Ns3NqosWifiMacHelper_methods(root_module, cls):
1238
    ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper::NqosWifiMacHelper(ns3::NqosWifiMacHelper const & arg0) [copy constructor]
1300
    ## nqos-wifi-mac-helper.h: ns3::NqosWifiMacHelper::NqosWifiMacHelper(ns3::NqosWifiMacHelper const & arg0) [copy constructor]
1239
    cls.add_constructor([param('ns3::NqosWifiMacHelper const &', 'arg0')])
1301
    cls.add_constructor([param('ns3::NqosWifiMacHelper const &', 'arg0')])
(-)a/bindings/python/ns3_module_list_routing.py (-5 lines)
 Lines 120-130    Link Here 
120
                   'void', 
120
                   'void', 
121
                   [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], 
121
                   [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], 
122
                   is_virtual=True)
122
                   is_virtual=True)
123
    ## ipv4-list-routing.h: ns3::Ptr<ns3::Ipv4StaticRouting> ns3::Ipv4ListRouting::GetStaticRouting() const [member function]
124
    cls.add_method('GetStaticRouting', 
125
                   'ns3::Ptr< ns3::Ipv4StaticRouting >', 
126
                   [], 
127
                   is_const=True, is_virtual=True)
128
    ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::DoDispose() [member function]
123
    ## ipv4-list-routing.h: void ns3::Ipv4ListRouting::DoDispose() [member function]
129
    cls.add_method('DoDispose', 
124
    cls.add_method('DoDispose', 
130
                   'void', 
125
                   'void', 
(-)a/bindings/python/ns3_module_olsr.py (-4 lines)
 Lines 747-756    Link Here 
747
                   is_static=True)
747
                   is_static=True)
748
    ## olsr-routing-protocol.h: ns3::olsr::RoutingProtocol::RoutingProtocol() [constructor]
748
    ## olsr-routing-protocol.h: ns3::olsr::RoutingProtocol::RoutingProtocol() [constructor]
749
    cls.add_constructor([])
749
    cls.add_constructor([])
750
    ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::Start() [member function]
751
    cls.add_method('Start', 
752
                   'void', 
753
                   [])
754
    ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::SetMainInterface(uint32_t interface) [member function]
750
    ## olsr-routing-protocol.h: void ns3::olsr::RoutingProtocol::SetMainInterface(uint32_t interface) [member function]
755
    cls.add_method('SetMainInterface', 
751
    cls.add_method('SetMainInterface', 
756
                   'void', 
752
                   'void', 
(-)a/examples/csma-bridge-one-hop.cc (-8 / +4 lines)
 Lines 74-80    Link Here 
74
#include "ns3/core-module.h"
74
#include "ns3/core-module.h"
75
#include "ns3/helper-module.h"
75
#include "ns3/helper-module.h"
76
#include "ns3/bridge-module.h"
76
#include "ns3/bridge-module.h"
77
#include "ns3/global-route-manager.h"
78
77
79
using namespace ns3;
78
using namespace ns3;
80
79
 Lines 142-150    Link Here 
142
  BridgeHelper bridge;
141
  BridgeHelper bridge;
143
  bridge.Install (bridge1, topBridgeDevices);
142
  bridge.Install (bridge1, topBridgeDevices);
144
143
145
  // Add internet stack to the topLan nodes
144
  // Add internet stack to the router nodes
145
  NodeContainer routerNodes (n0, n1, n2, n3, n4);
146
  InternetStackHelper internet;
146
  InternetStackHelper internet;
147
  internet.Install (topLan);
147
  internet.Install (routerNodes);
148
148
149
  // Repeat for bottom bridged LAN
149
  // Repeat for bottom bridged LAN
150
  NetDeviceContainer bottomLanDevices;
150
  NetDeviceContainer bottomLanDevices;
 Lines 158-166    Link Here 
158
    }
158
    }
159
  bridge.Install (bridge2, bottomBridgeDevices);
159
  bridge.Install (bridge2, bottomBridgeDevices);
160
160
161
  // Add internet stack to the bottomLan nodes
162
  internet.Install (NodeContainer (n3, n4));
163
164
  // We've got the "hardware" in place.  Now we need to add IP addresses.
161
  // We've got the "hardware" in place.  Now we need to add IP addresses.
165
  NS_LOG_INFO ("Assign IP Addresses.");
162
  NS_LOG_INFO ("Assign IP Addresses.");
166
  Ipv4AddressHelper ipv4;
163
  Ipv4AddressHelper ipv4;
 Lines 174-181    Link Here 
174
  // tables in the nodes.  We excuse the bridge nodes from having to serve as
171
  // tables in the nodes.  We excuse the bridge nodes from having to serve as
175
  // routers, since they don't even have internet stacks on them.
172
  // routers, since they don't even have internet stacks on them.
176
  //
173
  //
177
  NodeContainer routerNodes (n0, n1, n2, n3, n4);
174
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
178
  GlobalRouteManager::PopulateRoutingTables (routerNodes);
179
175
180
  //
176
  //
181
  // Create an OnOff application to send UDP datagrams from node zero to node 1.
177
  // Create an OnOff application to send UDP datagrams from node zero to node 1.
(-)a/examples/csma-ping.cc (-2 / +1 lines)
 Lines 37-43    Link Here 
37
#include "ns3/simulator-module.h"
37
#include "ns3/simulator-module.h"
38
#include "ns3/node-module.h"
38
#include "ns3/node-module.h"
39
#include "ns3/helper-module.h"
39
#include "ns3/helper-module.h"
40
#include "ns3/global-route-manager.h"
41
40
42
using namespace ns3;
41
using namespace ns3;
43
42
 Lines 85-91    Link Here 
85
  Ipv4InterfaceContainer addresses = ip.Assign (devs);
84
  Ipv4InterfaceContainer addresses = ip.Assign (devs);
86
85
87
  // setup global router
86
  // setup global router
88
  GlobalRouteManager::PopulateRoutingTables ();
87
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
89
  NS_LOG_INFO ("Create Source");
88
  NS_LOG_INFO ("Create Source");
90
  Config::SetDefault ("ns3::Ipv4RawSocketImpl::Protocol", StringValue ("2"));
89
  Config::SetDefault ("ns3::Ipv4RawSocketImpl::Protocol", StringValue ("2"));
91
  InetSocketAddress dst = InetSocketAddress (addresses.GetAddress (3));
90
  InetSocketAddress dst = InetSocketAddress (addresses.GetAddress (3));
(-)a/examples/csma-star.cc (-2 / +1 lines)
 Lines 20-26    Link Here 
20
#include "ns3/node-module.h"
20
#include "ns3/node-module.h"
21
#include "ns3/helper-module.h"
21
#include "ns3/helper-module.h"
22
#include "ns3/csma-module.h"
22
#include "ns3/csma-module.h"
23
#include "ns3/global-route-manager.h"
24
23
25
// Network topology (default)
24
// Network topology (default)
26
//
25
//
 Lines 196-202    Link Here 
196
  //
195
  //
197
  // Turn on global static routing so we can actually be routed across the star.
196
  // Turn on global static routing so we can actually be routed across the star.
198
  //
197
  //
199
  GlobalRouteManager::PopulateRoutingTables ();
198
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
200
199
201
  NS_LOG_INFO ("Enable pcap tracing.");
200
  NS_LOG_INFO ("Enable pcap tracing.");
202
  //
201
  //
(-)a/examples/dynamic-global-routing.cc (-8 / +7 lines)
 Lines 79-85    Link Here 
79
#include "ns3/simulator-module.h"
79
#include "ns3/simulator-module.h"
80
#include "ns3/node-module.h"
80
#include "ns3/node-module.h"
81
#include "ns3/helper-module.h"
81
#include "ns3/helper-module.h"
82
#include "ns3/global-route-manager.h"
83
82
84
using namespace ns3;
83
using namespace ns3;
85
84
 Lines 145-151    Link Here 
145
144
146
  // Create router nodes, initialize routing database and set up the routing
145
  // Create router nodes, initialize routing database and set up the routing
147
  // tables in the nodes.
146
  // tables in the nodes.
148
  GlobalRouteManager::PopulateRoutingTables ();
147
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
149
148
150
  // Create the OnOff application to send UDP datagrams of size
149
  // Create the OnOff application to send UDP datagrams of size
151
  // 210 bytes at a rate of 448 Kb/s
150
  // 210 bytes at a rate of 448 Kb/s
 Lines 204-212    Link Here 
204
  uint32_t ipv4ifIndex1 = 2;
203
  uint32_t ipv4ifIndex1 = 2;
205
204
206
  Simulator::Schedule (Seconds (2),&Ipv4::SetDown,ipv41, ipv4ifIndex1);
205
  Simulator::Schedule (Seconds (2),&Ipv4::SetDown,ipv41, ipv4ifIndex1);
207
  Simulator::Schedule (Seconds (3),&GlobalRouteManager::RecomputeRoutingTables);
206
  Simulator::Schedule (Seconds (3),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
208
  Simulator::Schedule (Seconds (4),&Ipv4::SetUp,ipv41, ipv4ifIndex1);
207
  Simulator::Schedule (Seconds (4),&Ipv4::SetUp,ipv41, ipv4ifIndex1);
209
  Simulator::Schedule (Seconds (5),&GlobalRouteManager::RecomputeRoutingTables);
208
  Simulator::Schedule (Seconds (5),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
210
209
211
  Ptr<Node> n6 = c.Get (6);
210
  Ptr<Node> n6 = c.Get (6);
212
  Ptr<Ipv4> ipv46 = n6->GetObject<Ipv4> ();
211
  Ptr<Ipv4> ipv46 = n6->GetObject<Ipv4> ();
 Lines 214-227    Link Here 
214
  // then the next p2p is numbered 2
213
  // then the next p2p is numbered 2
215
  uint32_t ipv4ifIndex6 = 2;
214
  uint32_t ipv4ifIndex6 = 2;
216
  Simulator::Schedule (Seconds (6),&Ipv4::SetDown,ipv46, ipv4ifIndex6);
215
  Simulator::Schedule (Seconds (6),&Ipv4::SetDown,ipv46, ipv4ifIndex6);
217
  Simulator::Schedule (Seconds (7),&GlobalRouteManager::RecomputeRoutingTables);
216
  Simulator::Schedule (Seconds (7),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
218
  Simulator::Schedule (Seconds (8),&Ipv4::SetUp,ipv46, ipv4ifIndex6);
217
  Simulator::Schedule (Seconds (8),&Ipv4::SetUp,ipv46, ipv4ifIndex6);
219
  Simulator::Schedule (Seconds (9),&GlobalRouteManager::RecomputeRoutingTables);
218
  Simulator::Schedule (Seconds (9),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
220
219
221
  Simulator::Schedule (Seconds (12),&Ipv4::SetDown,ipv41, ipv4ifIndex1);
220
  Simulator::Schedule (Seconds (12),&Ipv4::SetDown,ipv41, ipv4ifIndex1);
222
  Simulator::Schedule (Seconds (13),&GlobalRouteManager::RecomputeRoutingTables);
221
  Simulator::Schedule (Seconds (13),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
223
  Simulator::Schedule (Seconds (14),&Ipv4::SetUp,ipv41, ipv4ifIndex1);
222
  Simulator::Schedule (Seconds (14),&Ipv4::SetUp,ipv41, ipv4ifIndex1);
224
  Simulator::Schedule (Seconds (15),&GlobalRouteManager::RecomputeRoutingTables);
223
  Simulator::Schedule (Seconds (15),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
225
224
226
  NS_LOG_INFO ("Run Simulation.");
225
  NS_LOG_INFO ("Run Simulation.");
227
  Simulator::Run ();
226
  Simulator::Run ();
(-)a/examples/global-routing-slash32.cc (-2 / +1 lines)
 Lines 29-35    Link Here 
29
#include "ns3/simulator-module.h"
29
#include "ns3/simulator-module.h"
30
#include "ns3/node-module.h"
30
#include "ns3/node-module.h"
31
#include "ns3/helper-module.h"
31
#include "ns3/helper-module.h"
32
#include "ns3/global-route-manager.h"
33
32
34
using namespace ns3;
33
using namespace ns3;
35
34
 Lines 99-105    Link Here 
99
 
98
 
100
  // Create router nodes, initialize routing database and set up the routing
99
  // Create router nodes, initialize routing database and set up the routing
101
  // tables in the nodes.
100
  // tables in the nodes.
102
  GlobalRouteManager::PopulateRoutingTables ();
101
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
103
102
104
  // Create the OnOff application to send UDP datagrams of size
103
  // Create the OnOff application to send UDP datagrams of size
105
  // 210 bytes at a rate of 448 Kb/s
104
  // 210 bytes at a rate of 448 Kb/s
(-)a/examples/mixed-global-routing.cc (-2 / +1 lines)
 Lines 40-46    Link Here 
40
#include "ns3/simulator-module.h"
40
#include "ns3/simulator-module.h"
41
#include "ns3/node-module.h"
41
#include "ns3/node-module.h"
42
#include "ns3/helper-module.h"
42
#include "ns3/helper-module.h"
43
#include "ns3/global-route-manager.h"
44
43
45
using namespace ns3;
44
using namespace ns3;
46
45
 Lines 104-110    Link Here 
104
103
105
  // Create router nodes, initialize routing database and set up the routing
104
  // Create router nodes, initialize routing database and set up the routing
106
  // tables in the nodes.
105
  // tables in the nodes.
107
  GlobalRouteManager::PopulateRoutingTables ();
106
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
108
107
109
  // Create the OnOff application to send UDP datagrams of size
108
  // Create the OnOff application to send UDP datagrams of size
110
  // 210 bytes at a rate of 448 Kb/s
109
  // 210 bytes at a rate of 448 Kb/s
(-)a/examples/mixed-wireless.cc (-8 / +11 lines)
 Lines 67-73    Link Here 
67
#include "ns3/mobility-module.h"
67
#include "ns3/mobility-module.h"
68
#include "ns3/contrib-module.h"
68
#include "ns3/contrib-module.h"
69
#include "ns3/wifi-module.h"
69
#include "ns3/wifi-module.h"
70
#include "ns3/global-route-manager.h"
71
70
72
using namespace ns3;
71
using namespace ns3;
73
72
 Lines 152-162    Link Here 
152
  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
151
  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
153
  wifiPhy.SetChannel (wifiChannel.Create ());
152
  wifiPhy.SetChannel (wifiChannel.Create ());
154
  NetDeviceContainer backboneDevices = wifi.Install (wifiPhy, mac, backbone);
153
  NetDeviceContainer backboneDevices = wifi.Install (wifiPhy, mac, backbone);
154
155
  // We enable OLSR (which will be consulted at a higher priority than
156
  // the global routing) on the backbone ad hoc nodes
157
  NS_LOG_INFO ("Enabling OLSR routing on all backbone nodes");
158
  OlsrHelper olsr;
155
  //
159
  //
156
  // Add the IPv4 protocol stack to the nodes in our container
160
  // Add the IPv4 protocol stack to the nodes in our container
157
  //
161
  //
158
  InternetStackHelper internet;
162
  InternetStackHelper internet;
163
  internet.SetRoutingHelper (olsr);
159
  internet.Install (backbone);
164
  internet.Install (backbone);
165
166
  // re-initialize for non-olsr routing.
167
  internet = InternetStackHelper ();
168
160
  //
169
  //
161
  // Assign IPv4 addresses to the device drivers (actually to the associated
170
  // Assign IPv4 addresses to the device drivers (actually to the associated
162
  // IPv4 interfaces) we just created.
171
  // IPv4 interfaces) we just created.
 Lines 322-334    Link Here 
322
  // However, it is useful for setting default routes for all of the nodes
331
  // However, it is useful for setting default routes for all of the nodes
323
  // such as the LAN nodes.  
332
  // such as the LAN nodes.  
324
  NS_LOG_INFO ("Enabling global routing on all nodes");
333
  NS_LOG_INFO ("Enabling global routing on all nodes");
325
  GlobalRouteManager::PopulateRoutingTables ();
334
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
326
327
  // We enable OLSR (which will be consulted at a higher priority than
328
  // the global routing above) on the backbone ad hoc nodes
329
  NS_LOG_INFO ("Enabling OLSR routing on all backbone nodes");
330
  OlsrHelper olsr;
331
  olsr.Install (backbone);
332
335
333
  /////////////////////////////////////////////////////////////////////////// 
336
  /////////////////////////////////////////////////////////////////////////// 
334
  //                                                                       //
337
  //                                                                       //
(-)a/examples/second.cc (-2 / +1 lines)
 Lines 18-24    Link Here 
18
#include "ns3/simulator-module.h"
18
#include "ns3/simulator-module.h"
19
#include "ns3/node-module.h"
19
#include "ns3/node-module.h"
20
#include "ns3/helper-module.h"
20
#include "ns3/helper-module.h"
21
#include "ns3/global-routing-module.h"
22
21
23
// Default Network Topology
22
// Default Network Topology
24
//
23
//
 Lines 102-108    Link Here 
102
  clientApps.Start (Seconds (2.0));
101
  clientApps.Start (Seconds (2.0));
103
  clientApps.Stop (Seconds (10.0));
102
  clientApps.Stop (Seconds (10.0));
104
103
105
  GlobalRouteManager::PopulateRoutingTables ();
104
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
106
105
107
  PointToPointHelper::EnablePcapAll ("second");
106
  PointToPointHelper::EnablePcapAll ("second");
108
  CsmaHelper::EnablePcap ("second", csmaDevices.Get (1), true);
107
  CsmaHelper::EnablePcap ("second", csmaDevices.Get (1), true);
(-)a/examples/simple-alternate-routing.cc (-3 / +2 lines)
 Lines 41-47    Link Here 
41
#include "ns3/simulator-module.h"
41
#include "ns3/simulator-module.h"
42
#include "ns3/node-module.h"
42
#include "ns3/node-module.h"
43
#include "ns3/helper-module.h"
43
#include "ns3/helper-module.h"
44
#include "ns3/global-route-manager.h"
45
44
46
using namespace ns3;
45
using namespace ns3;
47
46
 Lines 53-59    Link Here 
53
  // Users may find it convenient to turn on explicit debugging
52
  // Users may find it convenient to turn on explicit debugging
54
  // for selected modules; the below lines suggest how to do this
53
  // for selected modules; the below lines suggest how to do this
55
#if 0 
54
#if 0 
56
  LogComponentEnable("GlobalRouteManager", LOG_LOGIC);
55
  LogComponentEnable("GlobalRoutingHelper", LOG_LOGIC);
57
  LogComponentEnable("GlobalRouter", LOG_LOGIC);
56
  LogComponentEnable("GlobalRouter", LOG_LOGIC);
58
#endif
57
#endif
59
58
 Lines 130-136    Link Here 
130
129
131
  // Create router nodes, initialize routing database and set up the routing
130
  // Create router nodes, initialize routing database and set up the routing
132
  // tables in the nodes.
131
  // tables in the nodes.
133
  GlobalRouteManager::PopulateRoutingTables ();
132
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
134
133
135
  // Create the OnOff application to send UDP datagrams 
134
  // Create the OnOff application to send UDP datagrams 
136
  NS_LOG_INFO ("Create Application.");
135
  NS_LOG_INFO ("Create Application.");
(-)a/examples/simple-error-model.cc (-2 / +1 lines)
 Lines 44-50    Link Here 
44
#include "ns3/simulator-module.h"
44
#include "ns3/simulator-module.h"
45
#include "ns3/node-module.h"
45
#include "ns3/node-module.h"
46
#include "ns3/helper-module.h"
46
#include "ns3/helper-module.h"
47
#include "ns3/global-route-manager.h"
48
47
49
using namespace ns3;
48
using namespace ns3;
50
49
 Lines 111-117    Link Here 
111
  Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
110
  Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
112
111
113
  NS_LOG_INFO ("Use global routing.");
112
  NS_LOG_INFO ("Use global routing.");
114
  GlobalRouteManager::PopulateRoutingTables ();
113
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
115
114
116
  // Create the OnOff application to send UDP datagrams of size
115
  // Create the OnOff application to send UDP datagrams of size
117
  // 210 bytes at a rate of 448 Kb/s
116
  // 210 bytes at a rate of 448 Kb/s
(-)a/examples/simple-global-routing.cc (-2 / +1 lines)
 Lines 46-52    Link Here 
46
#include "ns3/simulator-module.h"
46
#include "ns3/simulator-module.h"
47
#include "ns3/node-module.h"
47
#include "ns3/node-module.h"
48
#include "ns3/helper-module.h"
48
#include "ns3/helper-module.h"
49
#include "ns3/global-route-manager.h"
50
49
51
using namespace ns3;
50
using namespace ns3;
52
51
 Lines 111-117    Link Here 
111
110
112
  // Create router nodes, initialize routing database and set up the routing
111
  // Create router nodes, initialize routing database and set up the routing
113
  // tables in the nodes.
112
  // tables in the nodes.
114
  GlobalRouteManager::PopulateRoutingTables ();
113
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
115
114
116
  // Create the OnOff application to send UDP datagrams of size
115
  // Create the OnOff application to send UDP datagrams of size
117
  // 210 bytes at a rate of 448 Kb/s
116
  // 210 bytes at a rate of 448 Kb/s
(-)a/examples/simple-point-to-point-olsr.cc (-5 / +11 lines)
 Lines 82-88    Link Here 
82
  NodeContainer n32 = NodeContainer (c.Get(3), c.Get (2));
82
  NodeContainer n32 = NodeContainer (c.Get(3), c.Get (2));
83
  NodeContainer n34 = NodeContainer (c.Get (3), c.Get (4));
83
  NodeContainer n34 = NodeContainer (c.Get (3), c.Get (4));
84
84
85
  // Enable OLSR
86
  NS_LOG_INFO ("Enabling OLSR Routing.");
87
  OlsrHelper olsr;
88
89
  Ipv4StaticRoutingHelper staticRouting;
90
91
  Ipv4ListRoutingHelper list;
92
  list.Add (staticRouting, 0);
93
  list.Add (olsr, 10);
94
85
  InternetStackHelper internet;
95
  InternetStackHelper internet;
96
  internet.SetRoutingHelper (list);
86
  internet.Install (c);
97
  internet.Install (c);
87
98
88
  // We create the channels first without any IP addressing information
99
  // We create the channels first without any IP addressing information
 Lines 112-122    Link Here 
112
  ipv4.SetBase ("10.1.4.0", "255.255.255.0");
123
  ipv4.SetBase ("10.1.4.0", "255.255.255.0");
113
  Ipv4InterfaceContainer i34 = ipv4.Assign (nd34);
124
  Ipv4InterfaceContainer i34 = ipv4.Assign (nd34);
114
125
115
  // Enable OLSR
116
  NS_LOG_INFO ("Enabling OLSR Routing.");
117
  OlsrHelper olsr;
118
  olsr.InstallAll ();
119
120
  // Create the OnOff application to send UDP datagrams of size
126
  // Create the OnOff application to send UDP datagrams of size
121
  // 210 bytes at a rate of 448 Kb/s
127
  // 210 bytes at a rate of 448 Kb/s
122
  NS_LOG_INFO ("Create Applications.");
128
  NS_LOG_INFO ("Create Applications.");
(-)a/examples/simple-wifi-frame-aggregation.cc (-2 / +1 lines)
 Lines 21-27    Link Here 
21
#include "ns3/simulator-module.h"
21
#include "ns3/simulator-module.h"
22
#include "ns3/node-module.h"
22
#include "ns3/node-module.h"
23
#include "ns3/helper-module.h"
23
#include "ns3/helper-module.h"
24
#include "ns3/global-routing-module.h"
25
#include "ns3/wifi-module.h"
24
#include "ns3/wifi-module.h"
26
#include "ns3/mobility-module.h"
25
#include "ns3/mobility-module.h"
27
26
 Lines 137-143    Link Here 
137
  clientApps.Start (Seconds (2.0));
136
  clientApps.Start (Seconds (2.0));
138
  clientApps.Stop (Seconds (10.0));
137
  clientApps.Stop (Seconds (10.0));
139
138
140
  GlobalRouteManager::PopulateRoutingTables ();
139
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
141
140
142
  Simulator::Stop (Seconds (10.0));
141
  Simulator::Stop (Seconds (10.0));
143
  
142
  
(-)a/examples/star.cc (-2 / +1 lines)
 Lines 19-25    Link Here 
19
#include "ns3/simulator-module.h"
19
#include "ns3/simulator-module.h"
20
#include "ns3/node-module.h"
20
#include "ns3/node-module.h"
21
#include "ns3/helper-module.h"
21
#include "ns3/helper-module.h"
22
#include "ns3/global-route-manager.h"
23
22
24
// Network topology (default)
23
// Network topology (default)
25
//
24
//
 Lines 132-138    Link Here 
132
  //
131
  //
133
  // Turn on global static routing so we can actually be routed across the star.
132
  // Turn on global static routing so we can actually be routed across the star.
134
  //
133
  //
135
  GlobalRouteManager::PopulateRoutingTables ();
134
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
136
135
137
  NS_LOG_INFO ("Enable pcap tracing.");
136
  NS_LOG_INFO ("Enable pcap tracing.");
138
  //
137
  //
(-)a/examples/tap-wifi-dumbbell.cc (-2 / +1 lines)
 Lines 114-120    Link Here 
114
#include "ns3/core-module.h"
114
#include "ns3/core-module.h"
115
#include "ns3/wifi-module.h"
115
#include "ns3/wifi-module.h"
116
#include "ns3/helper-module.h"
116
#include "ns3/helper-module.h"
117
#include "ns3/global-routing-module.h"
118
117
119
using namespace ns3;
118
using namespace ns3;
120
119
 Lines 228-234    Link Here 
228
  apps.Start (Seconds (1.0));
227
  apps.Start (Seconds (1.0));
229
228
230
  CsmaHelper::EnablePcapAll ("tap-wifi-dumbbell", false);
229
  CsmaHelper::EnablePcapAll ("tap-wifi-dumbbell", false);
231
  GlobalRouteManager::PopulateRoutingTables ();
230
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
232
231
233
  Simulator::Stop (Seconds (60.));
232
  Simulator::Stop (Seconds (60.));
234
  Simulator::Run ();
233
  Simulator::Run ();
(-)a/examples/tcp-large-transfer.cc (-4 / +2 lines)
 Lines 39-45    Link Here 
39
#include "ns3/core-module.h"
39
#include "ns3/core-module.h"
40
#include "ns3/helper-module.h"
40
#include "ns3/helper-module.h"
41
#include "ns3/node-module.h"
41
#include "ns3/node-module.h"
42
#include "ns3/global-route-manager.h"
43
#include "ns3/simulator-module.h"
42
#include "ns3/simulator-module.h"
44
43
45
using namespace ns3;
44
using namespace ns3;
 Lines 111-119    Link Here 
111
  NetDeviceContainer dev1 = p2p.Install (n1n2);
110
  NetDeviceContainer dev1 = p2p.Install (n1n2);
112
111
113
  // Now add ip/tcp stack to all nodes.
112
  // Now add ip/tcp stack to all nodes.
114
  NodeContainer allNodes = NodeContainer (n0n1, n1n2.Get (1));
115
  InternetStackHelper internet;
113
  InternetStackHelper internet;
116
  internet.Install (allNodes);
114
  internet.InstallAll ();
117
115
118
  // Later, we add IP addresses.
116
  // Later, we add IP addresses.
119
  Ipv4AddressHelper ipv4;
117
  Ipv4AddressHelper ipv4;
 Lines 123-129    Link Here 
123
  Ipv4InterfaceContainer ipInterfs = ipv4.Assign (dev1);
121
  Ipv4InterfaceContainer ipInterfs = ipv4.Assign (dev1);
124
122
125
  // and setup ip routing tables to get total ip-level connectivity.
123
  // and setup ip routing tables to get total ip-level connectivity.
126
  GlobalRouteManager::PopulateRoutingTables ();
124
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
127
125
128
  ///////////////////////////////////////////////////////////////////////////
126
  ///////////////////////////////////////////////////////////////////////////
129
  // Simulation 1
127
  // Simulation 1
(-)a/examples/tcp-nsc-lfn.cc (-2 / +1 lines)
 Lines 36-42    Link Here 
36
#include "ns3/common-module.h"
36
#include "ns3/common-module.h"
37
#include "ns3/helper-module.h"
37
#include "ns3/helper-module.h"
38
#include "ns3/node-module.h"
38
#include "ns3/node-module.h"
39
#include "ns3/global-route-manager.h"
40
#include "ns3/simulator-module.h"
39
#include "ns3/simulator-module.h"
41
40
42
using namespace ns3;
41
using namespace ns3;
 Lines 117-123    Link Here 
117
  p2pInterfaces.Get(0)->SetAttribute("ReceiveErrorModel", PointerValue (em1));
116
  p2pInterfaces.Get(0)->SetAttribute("ReceiveErrorModel", PointerValue (em1));
118
  p2pInterfaces.Get(1)->SetAttribute("ReceiveErrorModel", PointerValue (em2));
117
  p2pInterfaces.Get(1)->SetAttribute("ReceiveErrorModel", PointerValue (em2));
119
118
120
  GlobalRouteManager::PopulateRoutingTables ();
119
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
121
120
122
  uint16_t servPort = 8080;
121
  uint16_t servPort = 8080;
123
  PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
122
  PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
(-)a/examples/tcp-nsc-zoo.cc (-3 / +1 lines)
 Lines 33-39    Link Here 
33
#include "ns3/core-module.h"
33
#include "ns3/core-module.h"
34
#include "ns3/helper-module.h"
34
#include "ns3/helper-module.h"
35
#include "ns3/node-module.h"
35
#include "ns3/node-module.h"
36
#include "ns3/global-route-manager.h"
37
#include "ns3/simulator-module.h"
36
#include "ns3/simulator-module.h"
38
37
39
using namespace ns3;
38
using namespace ns3;
 Lines 68-74    Link Here 
68
  NetDeviceContainer ethInterfaces = csma.Install (n);
67
  NetDeviceContainer ethInterfaces = csma.Install (n);
69
68
70
  InternetStackHelper internetStack;
69
  InternetStackHelper internetStack;
71
72
  internetStack.SetTcp ("ns3::NscTcpL4Protocol","Library",StringValue("liblinux2.6.26.so"));
70
  internetStack.SetTcp ("ns3::NscTcpL4Protocol","Library",StringValue("liblinux2.6.26.so"));
73
  // this switches nodes 0 and 1 to NSCs Linux 2.6.26 stack.
71
  // this switches nodes 0 and 1 to NSCs Linux 2.6.26 stack.
74
  internetStack.Install (n.Get(0));
72
  internetStack.Install (n.Get(0));
 Lines 106-112    Link Here 
106
  ipv4.SetBase ("10.0.0.0", "255.255.255.0");
104
  ipv4.SetBase ("10.0.0.0", "255.255.255.0");
107
  Ipv4InterfaceContainer ipv4Interfaces = ipv4.Assign (ethInterfaces);
105
  Ipv4InterfaceContainer ipv4Interfaces = ipv4.Assign (ethInterfaces);
108
106
109
  GlobalRouteManager::PopulateRoutingTables ();
107
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
110
108
111
  uint16_t servPort = 8080;
109
  uint16_t servPort = 8080;
112
  PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
110
  PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
(-)a/examples/tcp-star-server.cc (-2 / +1 lines)
 Lines 52-58    Link Here 
52
#include "ns3/simulator-module.h"
52
#include "ns3/simulator-module.h"
53
#include "ns3/node-module.h"
53
#include "ns3/node-module.h"
54
#include "ns3/helper-module.h"
54
#include "ns3/helper-module.h"
55
#include "ns3/global-route-manager.h"
56
55
57
using namespace ns3;
56
using namespace ns3;
58
57
 Lines 123-129    Link Here 
123
  }
122
  }
124
123
125
  //Turn on global static routing
124
  //Turn on global static routing
126
  GlobalRouteManager::PopulateRoutingTables ();
125
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
127
126
128
  // Create a packet sink on the star "hub" to receive these packets
127
  // Create a packet sink on the star "hub" to receive these packets
129
  uint16_t port = 50000;
128
  uint16_t port = 50000;
(-)a/examples/third.cc (-2 / +1 lines)
 Lines 18-24    Link Here 
18
#include "ns3/simulator-module.h"
18
#include "ns3/simulator-module.h"
19
#include "ns3/node-module.h"
19
#include "ns3/node-module.h"
20
#include "ns3/helper-module.h"
20
#include "ns3/helper-module.h"
21
#include "ns3/global-routing-module.h"
22
#include "ns3/wifi-module.h"
21
#include "ns3/wifi-module.h"
23
#include "ns3/mobility-module.h"
22
#include "ns3/mobility-module.h"
24
23
 Lines 159-165    Link Here 
159
  clientApps.Start (Seconds (2.0));
158
  clientApps.Start (Seconds (2.0));
160
  clientApps.Stop (Seconds (10.0));
159
  clientApps.Stop (Seconds (10.0));
161
160
162
  GlobalRouteManager::PopulateRoutingTables ();
161
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
163
162
164
  Simulator::Stop (Seconds (10.0));
163
  Simulator::Stop (Seconds (10.0));
165
164
(-)a/examples/virtual-net-device.cc (-2 / +1 lines)
 Lines 57-63    Link Here 
57
#include "ns3/simulator-module.h"
57
#include "ns3/simulator-module.h"
58
#include "ns3/node-module.h"
58
#include "ns3/node-module.h"
59
#include "ns3/helper-module.h"
59
#include "ns3/helper-module.h"
60
#include "ns3/global-route-manager.h"
61
#include "ns3/virtual-net-device.h"
60
#include "ns3/virtual-net-device.h"
62
61
63
using namespace ns3;
62
using namespace ns3;
 Lines 238-244    Link Here 
238
237
239
  // Create router nodes, initialize routing database and set up the routing
238
  // Create router nodes, initialize routing database and set up the routing
240
  // tables in the nodes.
239
  // tables in the nodes.
241
  GlobalRouteManager::PopulateRoutingTables ();
240
  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
242
241
243
  // Add the tunnels
242
  // Add the tunnels
244
  Tunnel tunnel (c.Get (3), c.Get (0), c.Get (1),
243
  Tunnel tunnel (c.Get (3), c.Get (0), c.Get (1),
(-)a/examples/wifi-wired-bridging.cc (-1 lines)
 Lines 49-55    Link Here 
49
#include "ns3/helper-module.h"
49
#include "ns3/helper-module.h"
50
#include "ns3/wifi-module.h"
50
#include "ns3/wifi-module.h"
51
#include "ns3/node-module.h"
51
#include "ns3/node-module.h"
52
#include "ns3/global-route-manager.h"
53
#include <vector>
52
#include <vector>
54
#include <stdint.h>
53
#include <stdint.h>
55
#include <sstream>
54
#include <sstream>
(-)a/src/helper/internet-stack-helper.cc (-9 / +25 lines)
 Lines 153-159    Link Here 
153
#include "ns3/object.h"
153
#include "ns3/object.h"
154
#include "ns3/names.h"
154
#include "ns3/names.h"
155
#include "ns3/ipv4.h"
155
#include "ns3/ipv4.h"
156
#include "internet-stack-helper.h"
157
#include "ns3/packet-socket-factory.h"
156
#include "ns3/packet-socket-factory.h"
158
#include "ns3/config.h"
157
#include "ns3/config.h"
159
#include "ns3/simulator.h"
158
#include "ns3/simulator.h"
 Lines 162-169    Link Here 
162
#include "ns3/callback.h"
161
#include "ns3/callback.h"
163
#include "ns3/node.h"
162
#include "ns3/node.h"
164
#include "ns3/core-config.h"
163
#include "ns3/core-config.h"
165
#include "ns3/ipv4-list-routing.h"
164
#include "internet-stack-helper.h"
166
#include "ns3/ipv4-static-routing.h"
165
#include "ipv4-list-routing-helper.h"
166
#include "ipv4-static-routing-helper.h"
167
#include "ipv4-global-routing-helper.h"
167
#include <limits>
168
#include <limits>
168
169
169
namespace ns3 {
170
namespace ns3 {
 Lines 174-179    Link Here 
174
InternetStackHelper::InternetStackHelper ()
175
InternetStackHelper::InternetStackHelper ()
175
{
176
{
176
  SetTcp ("ns3::TcpL4Protocol");
177
  SetTcp ("ns3::TcpL4Protocol");
178
  static Ipv4StaticRoutingHelper staticRouting;
179
  static Ipv4GlobalRoutingHelper globalRouting;
180
  static Ipv4ListRoutingHelper listRouting;
181
  listRouting.Add (staticRouting, 0);
182
  listRouting.Add (globalRouting, -10);
183
  SetRoutingHelper (listRouting);
184
}
185
186
void 
187
InternetStackHelper::SetRoutingHelper (const Ipv4RoutingHelper &routing)
188
{
189
  m_routing = &routing;
177
}
190
}
178
191
179
void
192
void
 Lines 213-220    Link Here 
213
    }
226
    }
214
}
227
}
215
228
216
static void
229
void 
217
CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId)
230
InternetStackHelper::InstallAll (void) const
231
{
232
  Install (NodeContainer::GetGlobal ());
233
}
234
235
void
236
InternetStackHelper::CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId)
218
{
237
{
219
  ObjectFactory factory;
238
  ObjectFactory factory;
220
  factory.SetTypeId(typeId);
239
  factory.SetTypeId(typeId);
 Lines 241-250    Link Here 
241
  node->AggregateObject (factory);
260
  node->AggregateObject (factory);
242
  // Set routing
261
  // Set routing
243
  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
262
  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
244
  // XXX cut this over to use of TypeIds and factories
263
  Ptr<Ipv4RoutingProtocol> ipv4Routing = m_routing->Create (node);
245
  Ptr<Ipv4ListRouting> ipv4Routing = CreateObject<Ipv4ListRouting> ();
246
  Ptr<Ipv4StaticRouting> ipv4staticRouting = CreateObject<Ipv4StaticRouting> ();
247
  ipv4Routing->AddRoutingProtocol (ipv4staticRouting, 0);
248
  ipv4->SetRoutingProtocol (ipv4Routing);
264
  ipv4->SetRoutingProtocol (ipv4Routing);
249
}
265
}
250
266
(-)a/src/helper/internet-stack-helper.h (+28 lines)
 Lines 31-36    Link Here 
31
namespace ns3 {
31
namespace ns3 {
32
32
33
class Node;
33
class Node;
34
class Ipv4RoutingHelper;
34
35
35
/**
36
/**
36
 * \brief aggregate IP/TCP/UDP functionality to existing Nodes.
37
 * \brief aggregate IP/TCP/UDP functionality to existing Nodes.
 Lines 38-46    Link Here 
38
class InternetStackHelper
39
class InternetStackHelper
39
{
40
{
40
public:
41
public:
42
  /**
43
   * Create a new InternetStackHelper which uses a mix of static routing
44
   * and global routing by default. The static routing protocol 
45
   * (ns3::Ipv4StaticRouting) and the global routing protocol are
46
   * stored in an ns3::Ipv4ListRouting protocol with priorities 0, and -10
47
   * by default. If you wish to use different priorites and different
48
   * routing protocols, you need to use an adhoc ns3::Ipv4RoutingHelper, 
49
   * such as ns3::OlsrHelper
50
   */
41
  InternetStackHelper(void);
51
  InternetStackHelper(void);
42
52
43
  /**
53
  /**
54
   * \param routing a new routing helper
55
   *
56
   * Set the routing helper to use during Install. The routing
57
   * helper is really an object factory which is used to create 
58
   * an object of type ns3::Ipv4RoutingProtocol per node. This routing
59
   * object is then associated to a single ns3::Ipv4 object through its 
60
   * ns3::Ipv4::SetRoutingProtocol.
61
   */
62
  void SetRoutingHelper (const Ipv4RoutingHelper &routing);
63
64
  /**
44
   * Aggregate implementations of the ns3::Ipv4, ns3::Udp, and ns3::Tcp classes
65
   * Aggregate implementations of the ns3::Ipv4, ns3::Udp, and ns3::Tcp classes
45
   * onto the provided node.  This method will assert if called on a node that 
66
   * onto the provided node.  This method will assert if called on a node that 
46
   * already has an Ipv4 object aggregated to it.
67
   * already has an Ipv4 object aggregated to it.
 Lines 69-74    Link Here 
69
   */
90
   */
70
  void Install (NodeContainer c) const;
91
  void Install (NodeContainer c) const;
71
92
93
  /**
94
   * Aggregate ip, udp, and tcp stacks to all nodes in the simulation
95
   */
96
  void InstallAll (void) const;
97
72
 /**
98
 /**
73
   * \brief set the Tcp stack which will not need any other parameter.  
99
   * \brief set the Tcp stack which will not need any other parameter.  
74
   *
100
   *
 Lines 132-137    Link Here 
132
158
133
private:
159
private:
134
  ObjectFactory m_tcpFactory;
160
  ObjectFactory m_tcpFactory;
161
  const Ipv4RoutingHelper *m_routing;
162
  static void CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId);
135
  static void Cleanup (void);
163
  static void Cleanup (void);
136
  static void LogRxIp (std::string context, Ptr<const Packet> packet, uint32_t deviceId);
164
  static void LogRxIp (std::string context, Ptr<const Packet> packet, uint32_t deviceId);
137
  static void LogTxIp (std::string context, Ptr<const Packet> packet, uint32_t deviceId);
165
  static void LogTxIp (std::string context, Ptr<const Packet> packet, uint32_t deviceId);
(-)0053aa3d8c22 (+63 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2008 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
#include "ipv4-global-routing-helper.h"
21
#include "ns3/global-router-interface.h"
22
#include "ns3/ipv4-global-routing.h"
23
#include "ns3/ipv4-list-routing.h"
24
#include "ns3/log.h"
25
26
NS_LOG_COMPONENT_DEFINE("GlobalRoutingHelper");
27
28
namespace ns3 {
29
30
Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper ()
31
{}
32
Ptr<Ipv4RoutingProtocol> 
33
Ipv4GlobalRoutingHelper::Create (Ptr<Node> node) const
34
{
35
  NS_LOG_LOGIC ("Adding GlobalRouter interface to node " << 
36
		node->GetId ());
37
38
  Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
39
  node->AggregateObject (globalRouter);
40
41
  NS_LOG_LOGIC ("Adding GlobalRouting Protocol to node " << node->GetId ());
42
  Ptr<Ipv4GlobalRouting> globalRouting = CreateObject<Ipv4GlobalRouting> ();
43
  globalRouter->SetRoutingProtocol (globalRouting);
44
45
  return globalRouting;
46
}
47
48
void 
49
Ipv4GlobalRoutingHelper::PopulateRoutingTables (void)
50
{
51
  GlobalRouteManager::BuildGlobalRoutingDatabase ();
52
  GlobalRouteManager::InitializeRoutes ();
53
}
54
void 
55
Ipv4GlobalRoutingHelper::RecomputeRoutingTables (void)
56
{
57
  GlobalRouteManager::DeleteGlobalRoutes ();
58
  GlobalRouteManager::BuildGlobalRoutingDatabase ();
59
  GlobalRouteManager::InitializeRoutes ();
60
}
61
62
63
} // namespace ns3
(-)0053aa3d8c22 (+70 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2008 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
#ifndef IPV4_GLOBAL_ROUTING_HELPER_H
21
#define IPV4_GLOBAL_ROUTING_HELPER_H
22
23
#include "node-container.h"
24
#include "ipv4-routing-helper.h"
25
26
namespace ns3 {
27
28
/**
29
 * \brief Helper class that adds ns3::Ipv4GlobalRouting objects
30
 */
31
class Ipv4GlobalRoutingHelper  : public Ipv4RoutingHelper
32
{
33
public:
34
  Ipv4GlobalRoutingHelper ();
35
  /**
36
   * \param node the node on which the routing protocol will run
37
   * \returns a newly-created routing protocol
38
   *
39
   * This method will be called by ns3::InternetStackHelper::Install
40
   */
41
  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const;
42
43
  /**
44
   * @brief Build a routing database and initialize the routing tables of
45
   * the nodes in the simulation.  Makes all nodes in the simulation into
46
   * routers.
47
   *
48
   * All this function does is call the functions
49
   * BuildGlobalRoutingDatabase () and  InitializeRoutes ().
50
   *
51
   */
52
  static void PopulateRoutingTables (void);
53
  /**
54
   *@brief Remove all routes that were previously installed in a prior call
55
   * to either PopulateRoutingTables() or RecomputeRoutingTables(), and 
56
   * add a new set of routes.  
57
   * 
58
   * This method does not change the set of nodes
59
   * over which GlobalRouting is being used, but it will dynamically update
60
   * its representation of the global topology before recomputing routes.
61
   * Users must first call PopulateRoutingTables() and then may subsequently
62
   * call RecomputeRoutingTables() at any later time in the simulation.
63
   *
64
   */
65
  static void RecomputeRoutingTables (void);
66
};
67
68
} // namespace ns3
69
70
#endif /* IPV4_GLOBAL_ROUTING_HELPER_H */
(-)0053aa3d8c22 (+46 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2008 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
#include "ipv4-list-routing-helper.h"
21
#include "ns3/ipv4-list-routing.h"
22
#include "ns3/node.h"
23
24
namespace ns3 {
25
26
Ipv4ListRoutingHelper::Ipv4ListRoutingHelper()
27
{}
28
void 
29
Ipv4ListRoutingHelper::Add (const Ipv4RoutingHelper &routing, int16_t priority)
30
{
31
  m_list.push_back (std::make_pair(&routing,priority));
32
}
33
Ptr<Ipv4RoutingProtocol> 
34
Ipv4ListRoutingHelper::Create (Ptr<Node> node) const
35
{
36
  Ptr<Ipv4ListRouting> list = CreateObject<Ipv4ListRouting> ();
37
  for (std::list<std::pair<const Ipv4RoutingHelper *,int16_t> >::const_iterator i = m_list.begin ();
38
       i != m_list.end (); ++i)
39
    {
40
      Ptr<Ipv4RoutingProtocol> prot = i->first->Create (node);
41
      list->AddRoutingProtocol (prot,i->second);
42
    }
43
  return list;
44
}
45
46
} // namespace ns3
(-)0053aa3d8c22 (+60 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2008 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
#ifndef IPV4_LIST_ROUTING_HELPER_H
21
#define IPV4_LIST_ROUTING_HELPER_H
22
23
#include "ipv4-routing-helper.h"
24
#include <stdint.h>
25
#include <list>
26
27
namespace ns3 {
28
29
/**
30
 * \brief Helper class that adds ns3::Ipv4ListRouting objects
31
 */
32
class Ipv4ListRoutingHelper : public Ipv4RoutingHelper
33
{
34
public:
35
  Ipv4ListRoutingHelper();
36
  /**
37
   * \param routing a routing helper
38
   * \param priority the priority of the associated helper
39
   *
40
   * Store in the internal list a reference to the input routing helper
41
   * and associated priority. These helpers will be used later by
42
   * the ns3::Ipv4ListRoutingHelper::Create method to create
43
   * an ns3::Ipv4ListRouting object and add in it routing protocols
44
   * created with the helpers.
45
   */
46
  void Add (const Ipv4RoutingHelper &routing, int16_t priority);
47
  /**
48
   * \param node the node on which the routing protocol will run
49
   * \returns a newly-created routing protocol
50
   *
51
   * This method will be called by ns3::InternetStackHelper::Install
52
   */
53
  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const;
54
private:
55
  std::list<std::pair<const Ipv4RoutingHelper *,int16_t> > m_list;
56
};
57
58
} // namespace ns3
59
60
#endif /* IPV4_LIST_ROUTING_HELPER_H */
(-)0053aa3d8c22 (+27 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2008 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
#include "ipv4-routing-helper.h"
21
22
namespace ns3 {
23
24
Ipv4RoutingHelper::~Ipv4RoutingHelper ()
25
{}
26
27
} // namespace ns3
(-)0053aa3d8c22 (+53 lines)
Added Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2008 INRIA
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License version 2 as
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 */
20
#ifndef IPV4_ROUTING_HELPER_H
21
#define IPV4_ROUTING_HELPER_H
22
23
#include "ns3/ptr.h"
24
25
namespace ns3 {
26
27
class Ipv4RoutingProtocol;
28
class Node;
29
30
/**
31
 * \brief a factory to create ns3::Ipv4RoutingProtocol objects
32
 *
33
 * For each new routing protocol created as a subclass of 
34
 * ns3::Ipv4RoutingProtocol, you need to create a subclass of 
35
 * ns3::Ipv4RoutingHelper which can be used by 
36
 * ns3::InternetStackHelper::SetRoutingProtocol and 
37
 * ns3::InternetStackHelper::Install.
38
 */
39
class Ipv4RoutingHelper
40
{
41
public:
42
  virtual ~Ipv4RoutingHelper ();
43
  /**
44
   * \param node the node within which the new routing protocol will run
45
   * \returns a newly-created routing protocol
46
   */
47
  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const = 0;
48
};
49
50
} // namespace ns3
51
52
53
#endif /* IPV4_ROUTING_HELPER_H */
(-)a/src/helper/ipv4-static-routing-helper.cc (+9 lines)
 Lines 33-38    Link Here 
33
33
34
namespace ns3 {
34
namespace ns3 {
35
35
36
Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper()
37
{}
38
Ptr<Ipv4RoutingProtocol> 
39
Ipv4StaticRoutingHelper::Create (Ptr<Node> node) const
40
{
41
  return CreateObject<Ipv4StaticRouting> ();
42
}
43
44
36
Ptr<Ipv4StaticRouting>
45
Ptr<Ipv4StaticRouting>
37
Ipv4StaticRoutingHelper::GetStaticRouting (Ptr<Ipv4> ipv4) const
46
Ipv4StaticRoutingHelper::GetStaticRouting (Ptr<Ipv4> ipv4) const
38
{
47
{
(-)a/src/helper/ipv4-static-routing-helper.h (-1 / +15 lines)
 Lines 25-38    Link Here 
25
#include "ns3/ipv4-address.h"
25
#include "ns3/ipv4-address.h"
26
#include "ns3/node.h"
26
#include "ns3/node.h"
27
#include "ns3/net-device.h"
27
#include "ns3/net-device.h"
28
#include "ipv4-routing-helper.h"
28
#include "node-container.h"
29
#include "node-container.h"
29
#include "net-device-container.h"
30
#include "net-device-container.h"
30
31
31
namespace ns3 {
32
namespace ns3 {
32
33
33
class Ipv4StaticRoutingHelper
34
/**
35
 * \brief Helper class that adds ns3::Ipv4StaticRouting objects
36
 */
37
class Ipv4StaticRoutingHelper : public Ipv4RoutingHelper
34
{
38
{
35
public:
39
public:
40
  Ipv4StaticRoutingHelper();
41
42
  /**
43
   * \param node the node on which the routing protocol will run
44
   * \returns a newly-created routing protocol
45
   *
46
   * This method will be called by ns3::InternetStackHelper::Install
47
   */
48
  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const;
49
36
  Ptr<Ipv4StaticRouting> GetStaticRouting (Ptr<Ipv4> ipv4) const;
50
  Ptr<Ipv4StaticRouting> GetStaticRouting (Ptr<Ipv4> ipv4) const;
37
51
38
  void AddMulticastRoute (Ptr<Node> n, Ipv4Address source, Ipv4Address group,  
52
  void AddMulticastRoute (Ptr<Node> n, Ipv4Address source, Ipv4Address group,  
(-)a/src/helper/olsr-helper.cc (-53 / +7 lines)
 Lines 30-93    Link Here 
30
  m_agentFactory.SetTypeId ("ns3::olsr::RoutingProtocol");
30
  m_agentFactory.SetTypeId ("ns3::olsr::RoutingProtocol");
31
}
31
}
32
32
33
void 
33
Ptr<Ipv4RoutingProtocol> 
34
OlsrHelper::SetAgent (std::string tid,
34
OlsrHelper::Create (Ptr<Node> node) const
35
                      std::string n0, const AttributeValue &v0,
36
                      std::string n1, const AttributeValue &v1,
37
                      std::string n2, const AttributeValue &v2,
38
                      std::string n3, const AttributeValue &v3,
39
                      std::string n4, const AttributeValue &v4,
40
                      std::string n5, const AttributeValue &v5,
41
                      std::string n6, const AttributeValue &v6,
42
                      std::string n7, const AttributeValue &v7)
43
{
35
{
44
  m_agentFactory.SetTypeId (tid);
36
  Ptr<olsr::RoutingProtocol> agent = m_agentFactory.Create<olsr::RoutingProtocol> ();
45
  m_agentFactory.Set (n0, v0);
37
  node->AggregateObject (agent);
46
  m_agentFactory.Set (n1, v1);
38
  return agent;
47
  m_agentFactory.Set (n2, v2);
48
  m_agentFactory.Set (n3, v3);
49
  m_agentFactory.Set (n4, v4);
50
  m_agentFactory.Set (n5, v5);
51
  m_agentFactory.Set (n6, v6);
52
  m_agentFactory.Set (n7, v7);
53
}
39
}
54
40
55
void 
41
void 
56
OlsrHelper::Install (NodeContainer container)
42
OlsrHelper::Set (std::string name, const AttributeValue &value)
57
{
43
{
58
  for (NodeContainer::Iterator i = container.Begin (); i != container.End (); ++i)
44
  m_agentFactory.Set (name, value);
59
    {
60
      Ptr<Node> node = *i;
61
      Install (node);
62
    }
63
}
64
void 
65
OlsrHelper::Install (Ptr<Node> node)
66
{
67
  if (node->GetObject<olsr::RoutingProtocol> () != 0)
68
    {
69
      NS_FATAL_ERROR ("OlsrHelper::Install(): Aggregating "
70
         "an Olsr Agent to a node with an existing Olsr RoutingProtocol");
71
      return;
72
    }
73
  Ptr<olsr::RoutingProtocol> agent = m_agentFactory.Create<olsr::RoutingProtocol> ();
74
  node->AggregateObject (agent);
75
  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
76
  Ptr<Ipv4ListRouting> ipv4Routing = DynamicCast<Ipv4ListRouting> (ipv4->GetRoutingProtocol ());
77
  NS_ASSERT (ipv4Routing);
78
  ipv4Routing->AddRoutingProtocol (agent, 10);
79
  agent->Start ();
80
}
81
void 
82
OlsrHelper::Install (std::string nodeName)
83
{
84
  Ptr<Node> node = Names::Find<Node> (nodeName);
85
  Install (node);
86
}
87
void 
88
OlsrHelper::InstallAll (void)
89
{
90
  Install (NodeContainer::GetGlobal ());
91
}
45
}
92
46
93
} // namespace ns3
47
} // namespace ns3
(-)a/src/helper/olsr-helper.h (-26 / +13 lines)
 Lines 21-68    Link Here 
21
#define OLSR_HELPER_H
21
#define OLSR_HELPER_H
22
22
23
#include "ns3/object-factory.h"
23
#include "ns3/object-factory.h"
24
#include "ns3/node-container.h"
25
#include "ns3/node.h"
24
#include "ns3/node.h"
25
#include "node-container.h"
26
#include "ipv4-routing-helper.h"
26
27
27
namespace ns3 {
28
namespace ns3 {
28
29
29
/**
30
/**
30
 * \brief Helper class that adds OLSR routing to nodes.
31
 * \brief Helper class that adds OLSR routing to nodes.
31
 */
32
 */
32
class OlsrHelper
33
class OlsrHelper : public Ipv4RoutingHelper
33
{
34
{
34
public:
35
public:
35
  OlsrHelper ();
36
  OlsrHelper ();
36
37
37
  /**
38
  /**
38
   * \brief Set default OLSR routing agent attributes
39
   * \param node the node on which the routing protocol will run
40
   * \returns a newly-created routing protocol
41
   *
42
   * This method will be called by ns3::InternetStackHelper::Install
39
   */
43
   */
40
  void SetAgent (std::string tid,
44
  virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const;
41
                 std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
42
                 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
43
                 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
44
                 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
45
                 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
46
                 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
47
                 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
48
                 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
49
45
50
  /**
46
  /**
51
   * \brief Enable OLSR routing for a set of nodes
47
   * \param name the name of the attribute to set
48
   * \param value the value of the attribute to set.
49
   *
50
   * This method controls the attributes of ns3::olsr::RoutingProtocol
52
   */
51
   */
53
  void Install (NodeContainer container);
52
  void Set (std::string name, const AttributeValue &value);
54
  /**
55
   * \brief Enable OLSR routing for a single node
56
   */
57
  void Install (Ptr<Node> node);
58
  /**
59
   * \brief Enable OLSR routing for a single node
60
   */
61
  void Install (std::string nodeName);
62
  /**
63
   * \brief Enable OLSR routing for all nodes
64
   */
65
  void InstallAll (void);
66
private:
53
private:
67
  ObjectFactory m_agentFactory;
54
  ObjectFactory m_agentFactory;
68
};
55
};
(-)a/src/helper/wscript (+6 lines)
 Lines 25-30    Link Here 
25
        'v4ping-helper.cc',
25
        'v4ping-helper.cc',
26
        'nqos-wifi-mac-helper.cc',
26
        'nqos-wifi-mac-helper.cc',
27
        'qos-wifi-mac-helper.cc',
27
        'qos-wifi-mac-helper.cc',
28
        'ipv4-global-routing-helper.cc',
29
        'ipv4-list-routing-helper.cc',
30
        'ipv4-routing-helper.cc',
28
        ]
31
        ]
29
32
30
    headers = bld.new_task_gen('ns3header')
33
    headers = bld.new_task_gen('ns3header')
 Lines 52-57    Link Here 
52
        'v4ping-helper.h',
55
        'v4ping-helper.h',
53
        'nqos-wifi-mac-helper.h',
56
        'nqos-wifi-mac-helper.h',
54
        'qos-wifi-mac-helper.h',
57
        'qos-wifi-mac-helper.h',
58
        'ipv4-global-routing-helper.h',
59
        'ipv4-list-routing-helper.h',
60
        'ipv4-routing-helper.h',
55
        ]
61
        ]
56
62
57
    env = bld.env_of_name('default')
63
    env = bld.env_of_name('default')
(-)a/src/internet-stack/ipv4-l3-protocol.cc (-5 / +1 lines)
 Lines 187-197    Link Here 
187
    }
187
    }
188
  m_interfaces.clear ();
188
  m_interfaces.clear ();
189
  m_node = 0;
189
  m_node = 0;
190
  if (m_routingProtocol)
190
  m_routingProtocol = 0;
191
    {
192
      m_routingProtocol->Dispose ();
193
      m_routingProtocol = 0;
194
    }
195
  Object::DoDispose ();
191
  Object::DoDispose ();
196
}
192
}
197
193
(-)a/src/internet-stack/ipv4-l3-protocol.h (-3 lines)
 Lines 157-165    Link Here 
157
157
158
  Ptr<NetDevice> GetNetDevice (uint32_t i);
158
  Ptr<NetDevice> GetNetDevice (uint32_t i);
159
159
160
  void AddRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol,
161
                           int16_t priority);
162
163
protected:
160
protected:
164
161
165
  virtual void DoDispose (void);
162
  virtual void DoDispose (void);
(-)a/src/routing/global-routing/global-route-manager-impl.cc (-100 / +25 lines)
 Lines 374-380    Link Here 
374
  for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
374
  for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
375
    {
375
    {
376
      Ptr<Node> node = *i;
376
      Ptr<Node> node = *i;
377
      Ptr<Ipv4GlobalRouting> gr = GetGlobalRoutingProtocol (node->GetId ());
377
      Ptr<GlobalRouter> router = node->GetObject<GlobalRouter> ();
378
      if (router == 0)
379
        {
380
          continue;
381
        }
382
      Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
378
      uint32_t j = 0;
383
      uint32_t j = 0;
379
      uint32_t nRoutes = gr->GetNRoutes ();
384
      uint32_t nRoutes = gr->GetNRoutes ();
380
      NS_LOG_LOGIC ("Deleting " << gr->GetNRoutes ()<< " routes from node " << node->GetId ());
385
      NS_LOG_LOGIC ("Deleting " << gr->GetNRoutes ()<< " routes from node " << node->GetId ());
 Lines 397-475    Link Here 
397
}
402
}
398
403
399
//
404
//
400
// In order to build the routing database, we need at least one of the nodes
401
// to participate as a router.  This is a convenience function that makes
402
// all nodes routers.  We do this by walking the list of nodes in the system
403
// and aggregating a Global Router Interface to each of the nodes.
404
//
405
  void
406
GlobalRouteManagerImpl::SelectRouterNodes () 
407
{
408
  NS_LOG_FUNCTION_NOARGS ();
409
  for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
410
    {
411
      Ptr<Node> node = *i;
412
      NS_LOG_LOGIC ("Adding GlobalRouter interface to node " << node->GetId ());
413
414
      Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
415
      node->AggregateObject (globalRouter);
416
417
      NS_LOG_LOGIC ("Adding GlobalRouting Protocol to node " << node->GetId ());
418
      Ptr<Ipv4GlobalRouting> globalRouting = CreateObject<Ipv4GlobalRouting> ();
419
      // Here, we check whether there is an existing Ipv4RoutingProtocol object
420
      // to add this protocol to.
421
      Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
422
      NS_ASSERT_MSG (ipv4, "GlobalRouteManagerImpl::SelectRouterNodes (): GetObject for <Ipv4> interface failed");
423
      // Now, we add this to an Ipv4ListRouting object.  
424
      // XXX in the future, we may want to allow this to be added to Ipv4
425
      // directly
426
      Ptr<Ipv4ListRouting> ipv4ListRouting = DynamicCast<Ipv4ListRouting> (ipv4->GetRoutingProtocol ());
427
      NS_ASSERT_MSG (ipv4ListRouting, "GlobalRouteManagerImpl::SelectRouterNodes (): Ipv4ListRouting not found"); 
428
      // This is the object that will keep the global routes.  We insert it
429
      // at slightly higher priority than static routing (which is at zero).
430
      // This means that global routes (e.g. host routes) will be consulted
431
      // before static routes
432
      // XXX make the below  priority value an attribute
433
      ipv4ListRouting->AddRoutingProtocol (globalRouting, 3);  
434
      // Locally cache the globalRouting pointer; we'll need it later
435
      // when we add routes
436
      AddGlobalRoutingProtocol (node->GetId (), globalRouting);
437
    }
438
}
439
440
  void
441
GlobalRouteManagerImpl::SelectRouterNodes (NodeContainer c) 
442
{
443
  NS_LOG_FUNCTION (&c);
444
  for (NodeContainer::Iterator i = c.Begin (); i != c.End (); i++)
445
    {
446
      Ptr<Node> node = *i;
447
      NS_LOG_LOGIC ("Adding GlobalRouter interface to node " << 
448
        node->GetId ());
449
450
      Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
451
      node->AggregateObject (globalRouter);
452
453
      NS_LOG_LOGIC ("Adding GlobalRouting Protocol to node " << node->GetId ());
454
      Ptr<Ipv4GlobalRouting> globalRouting = CreateObject<Ipv4GlobalRouting> ();
455
      // This is the object that will keep the global routes.  We insert it
456
      // at slightly higher priority than static routing (which is at zero).
457
      // This means that global routes (e.g. host routes) will be consulted
458
      // before static routes
459
      Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
460
      NS_ASSERT_MSG (ipv4, "GlobalRouteManagerImpl::SelectRouterNodes (): "
461
        "GetObject for <Ipv4> interface failed");
462
      Ptr<Ipv4ListRouting> ipv4ListRouting = DynamicCast<Ipv4ListRouting> (ipv4->GetRoutingProtocol ());
463
      NS_ASSERT_MSG (ipv4ListRouting, "GlobalRouteManagerImpl::SelectRouterNodes (): Ipv4ListRouting not found"); 
464
      // XXX make the below  priority value an attribute
465
      ipv4ListRouting->AddRoutingProtocol (globalRouting, 3);  
466
      // Locally cache the globalRouting pointer; we'll need it later
467
      // when we add routes
468
      AddGlobalRoutingProtocol (node->GetId (), globalRouting);
469
    }
470
}
471
472
//
473
// In order to build the routing database, we need to walk the list of nodes
405
// In order to build the routing database, we need to walk the list of nodes
474
// in the system and look for those that support the GlobalRouter interface.
406
// in the system and look for those that support the GlobalRouter interface.
475
// These routers will export a number of Link State Advertisements (LSAs)
407
// These routers will export a number of Link State Advertisements (LSAs)
 Lines 1352-1358    Link Here 
1352
// Similarly, the vertex <v> has an m_rootOif (outbound interface index) to
1284
// Similarly, the vertex <v> has an m_rootOif (outbound interface index) to
1353
// which the packets should be send for forwarding.
1285
// which the packets should be send for forwarding.
1354
//
1286
//
1355
          Ptr<Ipv4GlobalRouting> gr = GetGlobalRoutingProtocol (node->GetId ());
1287
          
1288
          Ptr<GlobalRouter> router = node->GetObject<GlobalRouter> ();
1289
          if (router == 0)
1290
            {
1291
              continue;
1292
            }
1293
          Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
1356
          NS_ASSERT (gr);
1294
          NS_ASSERT (gr);
1357
          if (v->GetOutgoingInterfaceId () >= 0)
1295
          if (v->GetOutgoingInterfaceId () >= 0)
1358
            {
1296
            {
 Lines 1576-1582    Link Here 
1576
// Similarly, the vertex <v> has an m_rootOif (outbound interface index) to
1514
// Similarly, the vertex <v> has an m_rootOif (outbound interface index) to
1577
// which the packets should be send for forwarding.
1515
// which the packets should be send for forwarding.
1578
//
1516
//
1579
              Ptr<Ipv4GlobalRouting> gr = GetGlobalRoutingProtocol (node->GetId ());
1517
              Ptr<GlobalRouter> router = node->GetObject<GlobalRouter> ();
1518
              if (router == 0)
1519
                {
1520
                  continue;
1521
                }
1522
              Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
1580
              NS_ASSERT (gr);
1523
              NS_ASSERT (gr);
1581
              if (v->GetOutgoingInterfaceId () >= 0)
1524
              if (v->GetOutgoingInterfaceId () >= 0)
1582
                {
1525
                {
 Lines 1674-1680    Link Here 
1674
          Ipv4Mask tempmask = lsa->GetNetworkLSANetworkMask ();
1617
          Ipv4Mask tempmask = lsa->GetNetworkLSANetworkMask ();
1675
          Ipv4Address tempip = lsa->GetLinkStateId ();
1618
          Ipv4Address tempip = lsa->GetLinkStateId ();
1676
          tempip = tempip.CombineMask (tempmask);
1619
          tempip = tempip.CombineMask (tempmask);
1677
          Ptr<Ipv4GlobalRouting> gr = GetGlobalRoutingProtocol (node->GetId ());
1620
          Ptr<GlobalRouter> router = node->GetObject<GlobalRouter> ();
1621
          if (router == 0)
1622
            {
1623
              continue;
1624
            }
1625
          Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
1678
          NS_ASSERT (gr);
1626
          NS_ASSERT (gr);
1679
          if (v->GetOutgoingInterfaceId () >= 0)
1627
          if (v->GetOutgoingInterfaceId () >= 0)
1680
            {
1628
            {
 Lines 1714-1742    Link Here 
1714
  v->GetParent ()->AddChild (v);
1662
  v->GetParent ()->AddChild (v);
1715
}
1663
}
1716
1664
1717
  void 
1718
GlobalRouteManagerImpl::AddGlobalRoutingProtocol (uint32_t nodeId, Ptr<Ipv4GlobalRouting> proto)
1719
{
1720
  NS_LOG_FUNCTION (nodeId);
1721
  m_routingProtocols.push_back
1722
    (std::pair<uint32_t, Ptr<Ipv4GlobalRouting> > (nodeId, proto));
1723
  m_routingProtocols.sort ();
1724
}
1725
1726
  Ptr<Ipv4GlobalRouting>
1727
GlobalRouteManagerImpl::GetGlobalRoutingProtocol (uint32_t nodeId)
1728
{
1729
  for (Ipv4GlobalRoutingList::const_iterator rprotoIter = m_routingProtocols.begin (); rprotoIter != m_routingProtocols.end (); rprotoIter++)
1730
    {
1731
      if ((*rprotoIter).first == nodeId)
1732
        {
1733
          return (*rprotoIter).second;
1734
        }
1735
    }
1736
  return 0;
1737
}
1738
1739
1740
} // namespace ns3
1665
} // namespace ns3
1741
1666
1742
#ifdef RUN_SELF_TESTS
1667
#ifdef RUN_SELF_TESTS
(-)a/src/routing/global-routing/global-route-manager-impl.h (-22 lines)
 Lines 29-35    Link Here 
29
#include "ns3/object.h"
29
#include "ns3/object.h"
30
#include "ns3/ptr.h"
30
#include "ns3/ptr.h"
31
#include "ns3/ipv4-address.h"
31
#include "ns3/ipv4-address.h"
32
#include "ns3/node-container.h"
33
#include "global-router-interface.h"
32
#include "global-router-interface.h"
34
33
35
namespace ns3 {
34
namespace ns3 {
 Lines 729-749    Link Here 
729
 *
728
 *
730
 */
729
 */
731
  virtual void DeleteGlobalRoutes ();
730
  virtual void DeleteGlobalRoutes ();
732
/**
733
 * @brief Select which nodes in the system are to be router nodes and 
734
 * aggregate the appropriate interfaces onto those nodes.
735
 * @internal
736
 *
737
 */
738
  virtual void SelectRouterNodes ();
739
740
/**
741
 * @brief Select which nodes in the system are to be router nodes and 
742
 * aggregate the appropriate interfaces onto those nodes.
743
 * @internal
744
 *
745
 */
746
  virtual void SelectRouterNodes (NodeContainer c);
747
731
748
/**
732
/**
749
 * @brief Build the routing database by gathering Link State Advertisements
733
 * @brief Build the routing database by gathering Link State Advertisements
 Lines 801-812    Link Here 
801
  void SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v);
785
  void SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v);
802
  int32_t FindOutgoingInterfaceId (Ipv4Address a, 
786
  int32_t FindOutgoingInterfaceId (Ipv4Address a, 
803
    Ipv4Mask amask = Ipv4Mask("255.255.255.255"));
787
    Ipv4Mask amask = Ipv4Mask("255.255.255.255"));
804
805
  // Local cache of the Ipv4GlobalRouting objects, indexed by nodeId
806
  typedef std::list< std::pair< uint32_t, Ptr<Ipv4GlobalRouting> > > Ipv4GlobalRoutingList;
807
  void AddGlobalRoutingProtocol (uint32_t nodeId, Ptr<Ipv4GlobalRouting> proto);
808
  Ptr<Ipv4GlobalRouting> GetGlobalRoutingProtocol (uint32_t nodeId);
809
  Ipv4GlobalRoutingList m_routingProtocols;
810
};
788
};
811
789
812
} // namespace ns3
790
} // namespace ns3
(-)a/src/routing/global-routing/global-route-manager.cc (-24 lines)
 Lines 21-27    Link Here 
21
#include "ns3/assert.h"
21
#include "ns3/assert.h"
22
#include "ns3/log.h"
22
#include "ns3/log.h"
23
#include "ns3/simulation-singleton.h"
23
#include "ns3/simulation-singleton.h"
24
#include "ns3/node-container.h"
25
#include "global-route-manager.h"
24
#include "global-route-manager.h"
26
#include "global-route-manager-impl.h"
25
#include "global-route-manager-impl.h"
27
26
 Lines 36-50    Link Here 
36
  void
35
  void
37
GlobalRouteManager::PopulateRoutingTables (void) 
36
GlobalRouteManager::PopulateRoutingTables (void) 
38
{
37
{
39
  SelectRouterNodes ();
40
  BuildGlobalRoutingDatabase ();
41
  InitializeRoutes ();
42
}
43
44
  void
45
GlobalRouteManager::PopulateRoutingTables (NodeContainer c) 
46
{
47
  SelectRouterNodes (c);
48
  BuildGlobalRoutingDatabase ();
38
  BuildGlobalRoutingDatabase ();
49
  InitializeRoutes ();
39
  InitializeRoutes ();
50
}
40
}
 Lines 65-84    Link Here 
65
}
55
}
66
56
67
  void
57
  void
68
GlobalRouteManager::SelectRouterNodes (void) 
69
{
70
  SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
71
    SelectRouterNodes ();
72
}
73
74
  void
75
GlobalRouteManager::SelectRouterNodes (NodeContainer c) 
76
{
77
  SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
78
    SelectRouterNodes (c);
79
}
80
81
  void
82
GlobalRouteManager::BuildGlobalRoutingDatabase (void) 
58
GlobalRouteManager::BuildGlobalRoutingDatabase (void) 
83
{
59
{
84
  SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
60
  SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
(-)a/src/routing/global-routing/global-route-manager.h (-45 / +12 lines)
 Lines 22-28    Link Here 
22
#ifndef GLOBAL_ROUTE_MANAGER_H
22
#ifndef GLOBAL_ROUTE_MANAGER_H
23
#define GLOBAL_ROUTE_MANAGER_H
23
#define GLOBAL_ROUTE_MANAGER_H
24
24
25
#include "ns3/node-container.h"
25
#include "ns3/deprecated.h"
26
26
27
namespace ns3 {
27
namespace ns3 {
28
28
 Lines 45-74    Link Here 
45
 * the nodes in the simulation.  Makes all nodes in the simulation into
45
 * the nodes in the simulation.  Makes all nodes in the simulation into
46
 * routers.
46
 * routers.
47
 *
47
 *
48
 * All this function does is call the three functions
48
 * All this function does is call the functions
49
 * SelectRouterNodes (), BuildGlobalRoutingDatabase (), and
49
 * BuildGlobalRoutingDatabase () and  InitializeRoutes ().
50
 * InitializeRoutes ().
51
 *
50
 *
52
 * @see SelectRouterNodes ();
53
 * @see BuildGlobalRoutingDatabase ();
51
 * @see BuildGlobalRoutingDatabase ();
54
 * @see InitializeRoutes ();
52
 * @see InitializeRoutes ();
55
 */
53
 */
56
  static void PopulateRoutingTables ();
54
  static void PopulateRoutingTables () NS_DEPRECATED;
57
58
/**
59
 * @brief Build a routing database and initialize the routing tables of
60
 * the nodes in the simulation.  Makes the nodes in the provided container
61
 * into routers.
62
 *
63
 * All this function does is call the three functions
64
 * SelectRouterNodes (), BuildGlobalRoutingDatabase (), and
65
 * InitializeRoutes ().
66
 *
67
 * @see SelectRouterNodes (Node Container c);
68
 * @see BuildGlobalRoutingDatabase ();
69
 * @see InitializeRoutes ();
70
 */
71
  static void PopulateRoutingTables (NodeContainer c);
72
55
73
 /**
56
 /**
74
  *@brief Remove all routes that were previously installed in a prior call
57
  *@brief Remove all routes that were previously installed in a prior call
 Lines 85-91    Link Here 
85
 * @see BuildGlobalRoutingDatabase ();
68
 * @see BuildGlobalRoutingDatabase ();
86
 * @see InitializeRoutes ();
69
 * @see InitializeRoutes ();
87
 */
70
 */
88
 static void RecomputeRoutingTables ();
71
 static void RecomputeRoutingTables () NS_DEPRECATED;
72
73
public:
74
/**
75
 * @brief Allocate a 32-bit router ID from monotonically increasing counter.
76
 */
77
  static uint32_t AllocateRouterId ();
89
78
90
/**
79
/**
91
 * @brief Delete all static routes on all nodes that have a 
80
 * @brief Delete all static routes on all nodes that have a 
 Lines 95-123    Link Here 
95
  static void DeleteGlobalRoutes ();
84
  static void DeleteGlobalRoutes ();
96
85
97
/**
86
/**
98
 * @brief Select which nodes in the system are to be router nodes and 
99
 * aggregate the appropriate interfaces onto those nodes.
100
 * @internal
101
 *
102
 */
103
  static void SelectRouterNodes ();
104
105
/**
106
 * @brief Select which nodes in the system are to be router nodes and 
107
 * aggregate the appropriate interfaces onto those nodes.
108
 * @internal
109
 *
110
 */
111
  static void SelectRouterNodes (NodeContainer c);
112
113
/**
114
 * @brief Allocate a 32-bit router ID from monotonically increasing counter.
115
 */
116
  static uint32_t AllocateRouterId ();
117
118
private:
119
120
/**
121
 * @brief Build the routing database by gathering Link State Advertisements
87
 * @brief Build the routing database by gathering Link State Advertisements
122
 * from each node exporting a GlobalRouter interface.
88
 * from each node exporting a GlobalRouter interface.
123
 * @internal
89
 * @internal
 Lines 132-137    Link Here 
132
 */
98
 */
133
  static void InitializeRoutes ();
99
  static void InitializeRoutes ();
134
100
101
private:
135
/**
102
/**
136
 * @brief Global Route Manager copy construction is disallowed.  There's no 
103
 * @brief Global Route Manager copy construction is disallowed.  There's no 
137
 * need for it and a compiler provided shallow copy would be wrong.
104
 * need for it and a compiler provided shallow copy would be wrong.
(-)a/src/routing/global-routing/global-router-interface.cc (-1 / +13 lines)
 Lines 26-32    Link Here 
26
#include "ns3/node.h"
26
#include "ns3/node.h"
27
#include "ns3/ipv4.h"
27
#include "ns3/ipv4.h"
28
#include "ns3/bridge-net-device.h"
28
#include "ns3/bridge-net-device.h"
29
#include "ns3/net-device-container.h"
29
#include "ipv4-global-routing.h"
30
#include "global-router-interface.h"
30
#include "global-router-interface.h"
31
#include <vector>
31
#include <vector>
32
32
 Lines 497-506    Link Here 
497
  ClearLSAs();
497
  ClearLSAs();
498
}
498
}
499
499
500
void 
501
GlobalRouter::SetRoutingProtocol (Ptr<Ipv4GlobalRouting> routing)
502
{
503
  m_routingProtocol = routing;
504
}
505
Ptr<Ipv4GlobalRouting> 
506
GlobalRouter::GetRoutingProtocol (void)
507
{
508
  return m_routingProtocol;
509
}
510
500
void
511
void
501
GlobalRouter::DoDispose ()
512
GlobalRouter::DoDispose ()
502
{
513
{
503
  NS_LOG_FUNCTION_NOARGS ();
514
  NS_LOG_FUNCTION_NOARGS ();
515
  m_routingProtocol = 0;
504
  Object::DoDispose ();
516
  Object::DoDispose ();
505
}
517
}
506
518
(-)a/src/routing/global-routing/global-router-interface.h (+6 lines)
 Lines 36-41    Link Here 
36
namespace ns3 {
36
namespace ns3 {
37
37
38
class GlobalRouter;
38
class GlobalRouter;
39
class Ipv4GlobalRouting;
39
40
40
/**
41
/**
41
 * @brief A single link record for a link state advertisement.
42
 * @brief A single link record for a link state advertisement.
 Lines 572-577    Link Here 
572
 */
573
 */
573
  GlobalRouter ();
574
  GlobalRouter ();
574
575
576
577
  void SetRoutingProtocol (Ptr<Ipv4GlobalRouting> routing);
578
  Ptr<Ipv4GlobalRouting> GetRoutingProtocol (void);
579
575
/**
580
/**
576
 * @brief Get the Router ID associated with this Global Router.
581
 * @brief Get the Router ID associated with this Global Router.
577
 *
582
 *
 Lines 660-665    Link Here 
660
  ListOfLSAs_t m_LSAs;
665
  ListOfLSAs_t m_LSAs;
661
666
662
  Ipv4Address m_routerId;
667
  Ipv4Address m_routerId;
668
  Ptr<Ipv4GlobalRouting> m_routingProtocol;
663
669
664
  // inherited from Object
670
  // inherited from Object
665
  virtual void DoDispose (void);
671
  virtual void DoDispose (void);
(-)a/src/routing/global-routing/ipv4-global-routing.cc (-1 / +1 lines)
 Lines 19-25    Link Here 
19
#include "ns3/log.h"
19
#include "ns3/log.h"
20
#include "ns3/object.h"
20
#include "ns3/object.h"
21
#include "ns3/packet.h"
21
#include "ns3/packet.h"
22
#include "ns3/node.h"
22
#include "ns3/net-device.h"
23
#include "ns3/ipv4-route.h"
23
#include "ns3/ipv4-route.h"
24
#include "ns3/ipv4-routing-table-entry.h"
24
#include "ns3/ipv4-routing-table-entry.h"
25
#include "ipv4-global-routing.h"
25
#include "ipv4-global-routing.h"
(-)a/src/routing/global-routing/wscript (+1 lines)
 Lines 14-18    Link Here 
14
    headers.source = [
14
    headers.source = [
15
        'global-router-interface.h',
15
        'global-router-interface.h',
16
        'global-route-manager.h',
16
        'global-route-manager.h',
17
        'ipv4-global-routing.h',
17
        ]
18
        ]
18
19
(-)a/src/routing/list-routing/ipv4-list-routing.cc (-21 lines)
 Lines 304-330    Link Here 
304
  return 0;
304
  return 0;
305
}
305
}
306
306
307
Ptr<Ipv4StaticRouting>
308
Ipv4ListRouting::GetStaticRouting (void) const
309
{
310
  NS_LOG_FUNCTION (this);
311
  Ipv4StaticRouting* srp;
312
  for (Ipv4RoutingProtocolList::const_iterator rprotoIter = m_routingProtocols.begin ();
313
       rprotoIter != m_routingProtocols.end (); rprotoIter++)
314
    {
315
      NS_LOG_LOGIC ("Searching for static routing");
316
      srp = dynamic_cast<Ipv4StaticRouting*> (PeekPointer((*rprotoIter).second));
317
      if (srp)
318
        {
319
          NS_LOG_LOGIC ("Found static routing");
320
          return Ptr<Ipv4StaticRouting> (srp);
321
        }
322
    }
323
  NS_LOG_LOGIC ("Static routing not found");
324
  return 0;
325
326
}
327
328
bool 
307
bool 
329
Ipv4ListRouting::Compare (const Ipv4RoutingProtocolEntry& a, const Ipv4RoutingProtocolEntry& b)
308
Ipv4ListRouting::Compare (const Ipv4RoutingProtocolEntry& a, const Ipv4RoutingProtocolEntry& b)
330
{
309
{
(-)a/src/routing/list-routing/ipv4-list-routing.h (-4 lines)
 Lines 24-31    Link Here 
24
24
25
namespace ns3 {
25
namespace ns3 {
26
26
27
class Ipv4StaticRouting;
28
29
/**
27
/**
30
 * \ingroup ipv4Routing 
28
 * \ingroup ipv4Routing 
31
 *
29
 *
 Lines 84-91    Link Here 
84
  virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address);
82
  virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address);
85
  virtual void SetIpv4 (Ptr<Ipv4> ipv4);
83
  virtual void SetIpv4 (Ptr<Ipv4> ipv4);
86
84
87
  virtual Ptr<Ipv4StaticRouting> GetStaticRouting (void) const;
88
89
protected:
85
protected:
90
  void DoDispose (void);
86
  void DoDispose (void);
91
private:
87
private:
(-)a/src/routing/olsr/olsr-routing-protocol.cc (+2 lines)
 Lines 213-218    Link Here 
213
  m_linkTupleTimerFirstTime = true;
213
  m_linkTupleTimerFirstTime = true;
214
214
215
  m_ipv4 = ipv4;
215
  m_ipv4 = ipv4;
216
217
  Simulator::ScheduleNow (&RoutingProtocol::Start, this);
216
}
218
}
217
219
218
void RoutingProtocol::DoDispose ()
220
void RoutingProtocol::DoDispose ()
(-)a/src/routing/olsr/olsr-routing-protocol.h (-2 / +1 lines)
 Lines 68-74    Link Here 
68
  RoutingProtocol ();
68
  RoutingProtocol ();
69
  virtual ~RoutingProtocol ();
69
  virtual ~RoutingProtocol ();
70
70
71
  void Start ();
72
  void SetMainInterface (uint32_t interface);
71
  void SetMainInterface (uint32_t interface);
73
72
74
private:
73
private:
 Lines 101-107    Link Here 
101
  Ptr<Ipv4> m_ipv4;
100
  Ptr<Ipv4> m_ipv4;
102
	
101
	
103
private:
102
private:
104
103
  void Start ();
105
  void Clear ();
104
  void Clear ();
106
  uint32_t GetSize () const { return m_table.size (); }
105
  uint32_t GetSize () const { return m_table.size (); }
107
  std::vector<RoutingTableEntry> GetEntries () const;
106
  std::vector<RoutingTableEntry> GetEntries () const;

Return to bug 600