Compare commits

...
Author SHA1 Message Date
Alexander Afanasyev 406e063af0 internet+python: rescanned bindings 2012-06-06 17:01:56 -07:00
Alexander Afanasyev 90164ba8a2 Revert "internet+network: Ipv4GlobalRouting is rewritten to use PATRICIA Trie lookups."
This reverts commit 14b5c3bb39.
2012-06-06 16:57:51 -07:00
Alexander Afanasyev 4dc0539d2d Revert "internet: Disable host routes in GlobalRouteManagerImpl. All of them are covered by stub LSAs"
This reverts commit 9615e4936d.
2012-06-06 16:44:29 -07:00
Alexander Afanasyev 0f7d7a254b Revert "internet: Updating global routing controller"
This reverts commit 10c2679ebf.
2012-06-06 16:44:29 -07:00
Alexander Afanasyev 51861d5fd5 Revert "internet: Adding necessary methods to implement alternative-interface global routing table"
This reverts commit 8a0c45ea89.
2012-06-06 16:44:29 -07:00
Alexander Afanasyev 1d4ce6c227 Revert "internet: Repairing GlobalRouting lookup"
This reverts commit b26d351756.
2012-06-06 16:44:29 -07:00
Alexander Afanasyev c575872330 Revert "internet: Solving very serious bug in Ipv4GlobalRoutingHelper"
This reverts commit b1ec1fde9a.
2012-06-06 16:44:29 -07:00
Alexander Afanasyev b969adc955 Revert "internet: rescanned bindings and small modification"
This reverts commit fe9a8cca8e.
2012-06-06 16:44:29 -07:00
Alexander Afanasyev 8330fc7f3e Revert "Correcting small bug in Ipv4GlobalRoutingHelper"
This reverts commit a0f327d5b0.
2012-06-06 16:44:29 -07:00
Alexander Afanasyev 013520275b core: Give ability to generate subset of documentation by utils/print-introspected-doxygen 2012-06-06 16:44:24 -07:00
Alexander Afanasyev a0f327d5b0 Correcting small bug in Ipv4GlobalRoutingHelper 2012-06-05 07:21:57 -07:00
Alexander Afanasyev b1f586a872 Add disclaimer note in README 2012-06-01 11:37:32 -07:00
Alexander Afanasyev c62a3a9999 topology-read+python: rescanned bindings 2012-05-31 16:19:23 -07:00
30 changed files with 1595 additions and 1597 deletions

No files matched your search

+1 -2
View File
@@ -45,5 +45,4 @@ massif.*
\#[^\#/]+\#$
.lock-wscript
.lock-wafbuild
*~
\#*\#
+6
View File
@@ -1,3 +1,9 @@
Note:
This is a custom and unsupported fork of NS-3 simulator (http://www.nsnam.org/).
**The code in this repository is frequently rebased on top of the latest ns-3-dev branch**
The Network Simulator, Version 3
--------------------------------
+241 -130
View File
@@ -110,10 +110,6 @@ def register_types(module):
module.add_class('Ipv4AddressGenerator')
## ipv4-address-helper.h (module 'internet'): ns3::Ipv4AddressHelper [class]
module.add_class('Ipv4AddressHelper')
## trie.h (module 'network'): ns3::Ipv4AddressTrieEAccessTraits [class]
module.add_class('Ipv4AddressTrieEAccessTraits', import_from_module='ns.network')
## trie.h (module 'network'): ns3::Ipv4AddressTrieEAccessTraits [enumeration]
module.add_enum('', ['min_e_val', 'max_e_val', 'max_size'], outer_class=root_module['ns3::Ipv4AddressTrieEAccessTraits'], import_from_module='ns.network')
## ipv4-end-point.h (module 'internet'): ns3::Ipv4EndPoint [class]
module.add_class('Ipv4EndPoint')
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress [class]
@@ -204,6 +200,8 @@ def register_types(module):
module.add_class('PcapHelperForIpv6', allow_subclassing=True)
## random-variable.h (module 'core'): ns3::RandomVariable [class]
module.add_class('RandomVariable', import_from_module='ns.core')
## rtt-estimator.h (module 'internet'): ns3::RttHistory [class]
module.add_class('RttHistory')
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex [class]
module.add_class('SPFVertex')
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex::VertexType [enumeration]
@@ -326,8 +324,6 @@ def register_types(module):
module.add_class('InternetStackHelper', parent=[root_module['ns3::PcapHelperForIpv4'], root_module['ns3::PcapHelperForIpv6'], root_module['ns3::AsciiTraceHelperForIpv4'], root_module['ns3::AsciiTraceHelperForIpv6']])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper [class]
module.add_class('Ipv4GlobalRoutingHelper', parent=root_module['ns3::Ipv4RoutingHelper'])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper::GlobalRoutingType [enumeration]
module.add_enum('GlobalRoutingType', ['ONE_NEXT_HOP', 'ORDERED_NEXT_HOPS', 'UNORDERED_NEXT_HOPS'], outer_class=root_module['ns3::Ipv4GlobalRoutingHelper'])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header [class]
module.add_class('Ipv4Header', parent=root_module['ns3::Header'])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::DscpType [enumeration]
@@ -376,6 +372,10 @@ def register_types(module):
module.add_class('ParetoVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable'])
## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class]
module.add_class('PcapFileWrapper', import_from_module='ns.network', parent=root_module['ns3::Object'])
## rtt-estimator.h (module 'internet'): ns3::RttEstimator [class]
module.add_class('RttEstimator', parent=root_module['ns3::Object'])
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation [class]
module.add_class('RttMeanDeviation', parent=root_module['ns3::RttEstimator'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
@@ -596,8 +596,6 @@ def register_types(module):
module.add_class('Icmpv6L4Protocol', parent=root_module['ns3::IpL4Protocol'])
## ipv4-global-routing.h (module 'internet'): ns3::Ipv4GlobalRouting [class]
module.add_class('Ipv4GlobalRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ipv4GlobalRoutingOneNexthop [class]
module.add_class('Ipv4GlobalRoutingOneNexthop', parent=root_module['ns3::Ipv4GlobalRouting'])
## ipv4-list-routing.h (module 'internet'): ns3::Ipv4ListRouting [class]
module.add_class('Ipv4ListRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
## ipv6-list-routing.h (module 'internet'): ns3::Ipv6ListRouting [class]
@@ -615,6 +613,9 @@ def register_types(module):
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >', 'ns3::SequenceNumber32')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >*', 'ns3::SequenceNumber32*')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >&', 'ns3::SequenceNumber32&')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >', 'ns3::RttHistory_t')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >*', 'ns3::RttHistory_t*')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >&', 'ns3::RttHistory_t&')
## Register a nested module for the namespace FatalImpl
@@ -659,7 +660,6 @@ def register_methods(root_module):
register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address'])
register_Ns3Ipv4AddressGenerator_methods(root_module, root_module['ns3::Ipv4AddressGenerator'])
register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper'])
register_Ns3Ipv4AddressTrieEAccessTraits_methods(root_module, root_module['ns3::Ipv4AddressTrieEAccessTraits'])
register_Ns3Ipv4EndPoint_methods(root_module, root_module['ns3::Ipv4EndPoint'])
register_Ns3Ipv4InterfaceAddress_methods(root_module, root_module['ns3::Ipv4InterfaceAddress'])
register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer'])
@@ -698,6 +698,7 @@ def register_methods(root_module):
register_Ns3PcapHelperForIpv4_methods(root_module, root_module['ns3::PcapHelperForIpv4'])
register_Ns3PcapHelperForIpv6_methods(root_module, root_module['ns3::PcapHelperForIpv6'])
register_Ns3RandomVariable_methods(root_module, root_module['ns3::RandomVariable'])
register_Ns3RttHistory_methods(root_module, root_module['ns3::RttHistory'])
register_Ns3SPFVertex_methods(root_module, root_module['ns3::SPFVertex'])
register_Ns3SeedManager_methods(root_module, root_module['ns3::SeedManager'])
register_Ns3SequenceNumber32_methods(root_module, root_module['ns3::SequenceNumber32'])
@@ -768,6 +769,8 @@ def register_methods(root_module):
register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
register_Ns3ParetoVariable_methods(root_module, root_module['ns3::ParetoVariable'])
register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper'])
register_Ns3RttEstimator_methods(root_module, root_module['ns3::RttEstimator'])
register_Ns3RttMeanDeviation_methods(root_module, root_module['ns3::RttMeanDeviation'])
register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
@@ -868,7 +871,6 @@ def register_methods(root_module):
register_Ns3Icmpv4L4Protocol_methods(root_module, root_module['ns3::Icmpv4L4Protocol'])
register_Ns3Icmpv6L4Protocol_methods(root_module, root_module['ns3::Icmpv6L4Protocol'])
register_Ns3Ipv4GlobalRouting_methods(root_module, root_module['ns3::Ipv4GlobalRouting'])
register_Ns3Ipv4GlobalRoutingOneNexthop_methods(root_module, root_module['ns3::Ipv4GlobalRoutingOneNexthop'])
register_Ns3Ipv4ListRouting_methods(root_module, root_module['ns3::Ipv4ListRouting'])
register_Ns3Ipv6ListRouting_methods(root_module, root_module['ns3::Ipv6ListRouting'])
register_Ns3LoopbackNetDevice_methods(root_module, root_module['ns3::LoopbackNetDevice'])
@@ -1358,6 +1360,10 @@ def register_Ns3BufferIterator_methods(root_module, cls):
cls.add_method('Next',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::PeekU8() [member function]
cls.add_method('PeekU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function]
cls.add_method('Prev',
'void',
@@ -1370,6 +1376,10 @@ def register_Ns3BufferIterator_methods(root_module, cls):
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(ns3::Buffer::Iterator start, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function]
cls.add_method('ReadLsbtohU16',
'uint16_t',
@@ -1689,11 +1699,6 @@ def register_Ns3GlobalRouteManager_methods(root_module, cls):
'void',
[],
is_static=True)
## global-route-manager.h (module 'internet'): static void ns3::GlobalRouteManager::ClearLSDB() [member function]
cls.add_method('ClearLSDB',
'void',
[],
is_static=True)
## global-route-manager.h (module 'internet'): static void ns3::GlobalRouteManager::BuildGlobalRoutingDatabase() [member function]
cls.add_method('BuildGlobalRoutingDatabase',
'void',
@@ -1714,11 +1719,6 @@ def register_Ns3GlobalRouteManagerImpl_methods(root_module, cls):
'void',
[],
is_virtual=True)
## global-route-manager-impl.h (module 'internet'): void ns3::GlobalRouteManagerImpl::ClearLSDB() [member function]
cls.add_method('ClearLSDB',
'void',
[],
is_virtual=True)
## global-route-manager-impl.h (module 'internet'): void ns3::GlobalRouteManagerImpl::BuildGlobalRoutingDatabase() [member function]
cls.add_method('BuildGlobalRoutingDatabase',
'void',
@@ -2004,9 +2004,9 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t const & ns3::Ipv4Address::Get() const [member function]
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t const &',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
@@ -2161,28 +2161,6 @@ def register_Ns3Ipv4AddressHelper_methods(root_module, cls):
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'mask'), param('ns3::Ipv4Address', 'base', default_value='"0.0.0.1"')])
return
def register_Ns3Ipv4AddressTrieEAccessTraits_methods(root_module, cls):
## trie.h (module 'network'): ns3::Ipv4AddressTrieEAccessTraits::Ipv4AddressTrieEAccessTraits() [constructor]
cls.add_constructor([])
## trie.h (module 'network'): ns3::Ipv4AddressTrieEAccessTraits::Ipv4AddressTrieEAccessTraits(ns3::Ipv4AddressTrieEAccessTraits const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4AddressTrieEAccessTraits const &', 'arg0')])
## trie.h (module 'network'): static uint8_t const * ns3::Ipv4AddressTrieEAccessTraits::begin(ns3::Ipv4Address const & r_key) [member function]
cls.add_method('begin',
'uint8_t const *',
[param('ns3::Ipv4Address const &', 'r_key')],
is_static=True)
## trie.h (module 'network'): static size_t ns3::Ipv4AddressTrieEAccessTraits::e_pos(uint8_t e) [member function]
cls.add_method('e_pos',
'size_t',
[param('uint8_t', 'e')],
is_static=True)
## trie.h (module 'network'): static uint8_t const * ns3::Ipv4AddressTrieEAccessTraits::end(ns3::Ipv4Address const & r_key) [member function]
cls.add_method('end',
'uint8_t const *',
[param('ns3::Ipv4Address const &', 'r_key')],
is_static=True)
return
def register_Ns3Ipv4EndPoint_methods(root_module, cls):
## ipv4-end-point.h (module 'internet'): ns3::Ipv4EndPoint::Ipv4EndPoint(ns3::Ipv4EndPoint const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4EndPoint const &', 'arg0')])
@@ -2508,30 +2486,30 @@ def register_Ns3Ipv4RoutingTableEntry_methods(root_module, cls):
cls.add_constructor([param('ns3::Ipv4RoutingTableEntry const &', 'route')])
## ipv4-routing-table-entry.h (module 'internet'): ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry(ns3::Ipv4RoutingTableEntry const * route) [constructor]
cls.add_constructor([param('ns3::Ipv4RoutingTableEntry const *', 'route')])
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('CreateDefaultRoute',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('CreateHostRouteTo',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('CreateHostRouteTo',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('CreateNetworkRouteTo',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
cls.add_method('CreateNetworkRouteTo',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4RoutingTableEntry::GetDest() const [member function]
cls.add_method('GetDest',
@@ -2558,11 +2536,6 @@ def register_Ns3Ipv4RoutingTableEntry_methods(root_module, cls):
'uint32_t',
[],
is_const=True)
## ipv4-routing-table-entry.h (module 'internet'): uint32_t ns3::Ipv4RoutingTableEntry::GetMetric() const [member function]
cls.add_method('GetMetric',
'uint32_t',
[],
is_const=True)
## ipv4-routing-table-entry.h (module 'internet'): bool ns3::Ipv4RoutingTableEntry::IsDefault() const [member function]
cls.add_method('IsDefault',
'bool',
@@ -2583,10 +2556,6 @@ def register_Ns3Ipv4RoutingTableEntry_methods(root_module, cls):
'bool',
[],
is_const=True)
## ipv4-routing-table-entry.h (module 'internet'): void ns3::Ipv4RoutingTableEntry::SetMetric(uint32_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint32_t', 'metric')])
return
def register_Ns3Ipv4StaticRoutingHelper_methods(root_module, cls):
@@ -4032,6 +4001,21 @@ def register_Ns3RandomVariable_methods(root_module, cls):
is_const=True)
return
def register_Ns3RttHistory_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttHistory::RttHistory(ns3::SequenceNumber32 s, uint32_t c, ns3::Time t) [constructor]
cls.add_constructor([param('ns3::SequenceNumber32', 's'), param('uint32_t', 'c'), param('ns3::Time', 't')])
## rtt-estimator.h (module 'internet'): ns3::RttHistory::RttHistory(ns3::RttHistory const & h) [copy constructor]
cls.add_constructor([param('ns3::RttHistory const &', 'h')])
## rtt-estimator.h (module 'internet'): ns3::RttHistory::count [variable]
cls.add_instance_attribute('count', 'uint32_t', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::retx [variable]
cls.add_instance_attribute('retx', 'bool', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::seq [variable]
cls.add_instance_attribute('seq', 'ns3::SequenceNumber32', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::time [variable]
cls.add_instance_attribute('time', 'ns3::Time', is_const=False)
return
def register_Ns3SPFVertex_methods(root_module, cls):
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex::SPFVertex() [constructor]
cls.add_constructor([])
@@ -4728,7 +4712,6 @@ def register_Ns3Empty_methods(root_module, cls):
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right'))
@@ -4781,6 +4764,7 @@ def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_output_stream_operator()
@@ -6181,8 +6165,8 @@ def register_Ns3InternetStackHelper_methods(root_module, cls):
return
def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls):
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper(std::string const & type="ns3::Ipv4GlobalRoutingOneNexthop") [constructor]
cls.add_constructor([param('std::string const &', 'type', default_value='"ns3::Ipv4GlobalRoutingOneNexthop"')])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper() [constructor]
cls.add_constructor([])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper(ns3::Ipv4GlobalRoutingHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4GlobalRoutingHelper const &', 'arg0')])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper * ns3::Ipv4GlobalRoutingHelper::Copy() const [member function]
@@ -6200,11 +6184,6 @@ def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls):
'void',
[],
is_static=True)
## ipv4-global-routing-helper.h (module 'internet'): static void ns3::Ipv4GlobalRoutingHelper::PopulateAllPossibleRoutingTables() [member function]
cls.add_method('PopulateAllPossibleRoutingTables',
'void',
[],
is_static=True)
## ipv4-global-routing-helper.h (module 'internet'): static void ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables() [member function]
cls.add_method('RecomputeRoutingTables',
'void',
@@ -7243,6 +7222,126 @@ def register_Ns3PcapFileWrapper_methods(root_module, cls):
[])
return
def register_Ns3RttEstimator_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator() [constructor]
cls.add_constructor([])
## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator(ns3::RttEstimator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RttEstimator const &', 'arg0')])
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::AckSeq(ns3::SequenceNumber32 ackSeq) [member function]
cls.add_method('AckSeq',
'ns3::Time',
[param('ns3::SequenceNumber32', 'ackSeq')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ClearSent() [member function]
cls.add_method('ClearSent',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Ptr<ns3::RttEstimator> ns3::RttEstimator::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::RttEstimator >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetCurrentEstimate() const [member function]
cls.add_method('GetCurrentEstimate',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetMaxRto() const [member function]
cls.add_method('GetMaxRto',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetMinRto() const [member function]
cls.add_method('GetMinRto',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): static ns3::TypeId ns3::RttEstimator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::IncreaseMultiplier() [member function]
cls.add_method('IncreaseMultiplier',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::Measurement(ns3::Time t) [member function]
cls.add_method('Measurement',
'void',
[param('ns3::Time', 't')],
is_pure_virtual=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ResetMultiplier() [member function]
cls.add_method('ResetMultiplier',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::RetransmitTimeout() [member function]
cls.add_method('RetransmitTimeout',
'ns3::Time',
[],
is_pure_virtual=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SentSeq(ns3::SequenceNumber32 seq, uint32_t size) [member function]
cls.add_method('SentSeq',
'void',
[param('ns3::SequenceNumber32', 'seq'), param('uint32_t', 'size')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetCurrentEstimate(ns3::Time estimate) [member function]
cls.add_method('SetCurrentEstimate',
'void',
[param('ns3::Time', 'estimate')])
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetMaxRto(ns3::Time maxRto) [member function]
cls.add_method('SetMaxRto',
'void',
[param('ns3::Time', 'maxRto')])
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetMinRto(ns3::Time minRto) [member function]
cls.add_method('SetMinRto',
'void',
[param('ns3::Time', 'minRto')])
return
def register_Ns3RttMeanDeviation_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation::RttMeanDeviation() [constructor]
cls.add_constructor([])
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation::RttMeanDeviation(ns3::RttMeanDeviation const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RttMeanDeviation const &', 'arg0')])
## rtt-estimator.h (module 'internet'): ns3::Ptr<ns3::RttEstimator> ns3::RttMeanDeviation::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::RttEstimator >',
[],
is_const=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Gain(double g) [member function]
cls.add_method('Gain',
'void',
[param('double', 'g')])
## rtt-estimator.h (module 'internet'): static ns3::TypeId ns3::RttMeanDeviation::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Measurement(ns3::Time measure) [member function]
cls.add_method('Measurement',
'void',
[param('ns3::Time', 'measure')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttMeanDeviation::RetransmitTimeout() [member function]
cls.add_method('RetransmitTimeout',
'ns3::Time',
[],
is_virtual=True)
return
def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -8063,11 +8162,11 @@ def register_Ns3TcpSocketFactory_methods(root_module, cls):
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
@@ -8932,6 +9031,14 @@ def register_Ns3GlobalRouter_methods(root_module, cls):
is_static=True)
## global-router-interface.h (module 'internet'): ns3::GlobalRouter::GlobalRouter() [constructor]
cls.add_constructor([])
## global-router-interface.h (module 'internet'): void ns3::GlobalRouter::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4GlobalRouting> routing) [member function]
cls.add_method('SetRoutingProtocol',
'void',
[param('ns3::Ptr< ns3::Ipv4GlobalRouting >', 'routing')])
## global-router-interface.h (module 'internet'): ns3::Ptr<ns3::Ipv4GlobalRouting> ns3::GlobalRouter::GetRoutingProtocol() [member function]
cls.add_method('GetRoutingProtocol',
'ns3::Ptr< ns3::Ipv4GlobalRouting >',
[])
## global-router-interface.h (module 'internet'): ns3::Ipv4Address ns3::GlobalRouter::GetRouterId() const [member function]
cls.add_method('GetRouterId',
'ns3::Ipv4Address',
@@ -8951,10 +9058,22 @@ def register_Ns3GlobalRouter_methods(root_module, cls):
'bool',
[param('uint32_t', 'n'), param('ns3::GlobalRoutingLSA &', 'lsa')],
is_const=True)
## global-router-interface.h (module 'internet'): void ns3::GlobalRouter::InjectRoute(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t metric=1) [member function]
## global-router-interface.h (module 'internet'): void ns3::GlobalRouter::InjectRoute(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask) [member function]
cls.add_method('InjectRoute',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'metric', default_value='1')])
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask')])
## global-router-interface.h (module 'internet'): uint32_t ns3::GlobalRouter::GetNInjectedRoutes() [member function]
cls.add_method('GetNInjectedRoutes',
'uint32_t',
[])
## global-router-interface.h (module 'internet'): ns3::Ipv4RoutingTableEntry * ns3::GlobalRouter::GetInjectedRoute(uint32_t i) [member function]
cls.add_method('GetInjectedRoute',
retval('ns3::Ipv4RoutingTableEntry *', caller_owns_return=False),
[param('uint32_t', 'i')])
## global-router-interface.h (module 'internet'): void ns3::GlobalRouter::RemoveInjectedRoute(uint32_t i) [member function]
cls.add_method('RemoveInjectedRoute',
'void',
[param('uint32_t', 'i')])
## global-router-interface.h (module 'internet'): bool ns3::GlobalRouter::WithdrawRoute(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask) [member function]
cls.add_method('WithdrawRoute',
'bool',
@@ -12835,16 +12954,36 @@ def register_Ns3Ipv4GlobalRouting_methods(root_module, cls):
cls.add_constructor([param('ns3::Ipv4GlobalRouting const &', 'arg0')])
## ipv4-global-routing.h (module 'internet'): ns3::Ipv4GlobalRouting::Ipv4GlobalRouting() [constructor]
cls.add_constructor([])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Mask destMask, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('AddRouteTo',
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddASExternalRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddASExternalRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Mask', 'destMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
is_pure_virtual=True, is_virtual=True)
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::DeleteRoutes() [member function]
cls.add_method('DeleteRoutes',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): uint32_t ns3::Ipv4GlobalRouting::GetNRoutes() const [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[],
is_pure_virtual=True, is_virtual=True)
is_const=True)
## ipv4-global-routing.h (module 'internet'): ns3::Ipv4RoutingTableEntry * ns3::Ipv4GlobalRouting::GetRoute(uint32_t i) const [member function]
cls.add_method('GetRoute',
retval('ns3::Ipv4RoutingTableEntry *', caller_owns_return=False),
[param('uint32_t', 'i')],
is_const=True)
## ipv4-global-routing.h (module 'internet'): static ns3::TypeId ns3::Ipv4GlobalRouting::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
@@ -12870,62 +13009,34 @@ def register_Ns3Ipv4GlobalRouting_methods(root_module, cls):
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_virtual=True)
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
is_const=True, is_virtual=True)
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::RemoveRoute(uint32_t i) [member function]
cls.add_method('RemoveRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-global-routing.h (module 'internet'): bool ns3::Ipv4GlobalRouting::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Callback<void,ns3::Ptr<ns3::Ipv4Route>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback<void,ns3::Ptr<ns3::Ipv4MulticastRoute>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
is_virtual=True)
## ipv4-global-routing.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4GlobalRouting::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
is_virtual=True)
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')],
is_virtual=True)
return
def register_Ns3Ipv4GlobalRoutingOneNexthop_methods(root_module, cls):
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ipv4GlobalRoutingOneNexthop::Ipv4GlobalRoutingOneNexthop() [constructor]
cls.add_constructor([])
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ipv4GlobalRoutingOneNexthop::Ipv4GlobalRoutingOneNexthop(ns3::Ipv4GlobalRoutingOneNexthop const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4GlobalRoutingOneNexthop const &', 'arg0')])
## ipv4-global-routing-one-nexthop.h (module 'internet'): void ns3::Ipv4GlobalRoutingOneNexthop::AddRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Mask destMask, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('AddRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Mask', 'destMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): void ns3::Ipv4GlobalRoutingOneNexthop::DeleteRoutes() [member function]
cls.add_method('DeleteRoutes',
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): uint32_t ns3::Ipv4GlobalRoutingOneNexthop::GetNRoutes() const [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[],
is_const=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ipv4RoutingTableEntry ns3::Ipv4GlobalRoutingOneNexthop::GetRoute(uint32_t i) const [member function]
cls.add_method('GetRoute',
'ns3::Ipv4RoutingTableEntry',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): static ns3::TypeId ns3::Ipv4GlobalRoutingOneNexthop::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): void ns3::Ipv4GlobalRoutingOneNexthop::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
is_const=True, is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): bool ns3::Ipv4GlobalRoutingOneNexthop::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Callback<void,ns3::Ptr<ns3::Ipv4Route>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback<void,ns3::Ptr<ns3::Ipv4MulticastRoute>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4GlobalRoutingOneNexthop::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4GlobalRoutingOneNexthop::LookupGlobal(ns3::Ipv4Address dest, ns3::Ptr<ns3::NetDevice> oif=0) [member function]
cls.add_method('LookupGlobal',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ptr< ns3::NetDevice >', 'oif', default_value='0')],
visibility='protected', is_virtual=True)
return
+241 -130
View File
@@ -110,10 +110,6 @@ def register_types(module):
module.add_class('Ipv4AddressGenerator')
## ipv4-address-helper.h (module 'internet'): ns3::Ipv4AddressHelper [class]
module.add_class('Ipv4AddressHelper')
## trie.h (module 'network'): ns3::Ipv4AddressTrieEAccessTraits [class]
module.add_class('Ipv4AddressTrieEAccessTraits', import_from_module='ns.network')
## trie.h (module 'network'): ns3::Ipv4AddressTrieEAccessTraits [enumeration]
module.add_enum('', ['min_e_val', 'max_e_val', 'max_size'], outer_class=root_module['ns3::Ipv4AddressTrieEAccessTraits'], import_from_module='ns.network')
## ipv4-end-point.h (module 'internet'): ns3::Ipv4EndPoint [class]
module.add_class('Ipv4EndPoint')
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress [class]
@@ -204,6 +200,8 @@ def register_types(module):
module.add_class('PcapHelperForIpv6', allow_subclassing=True)
## random-variable.h (module 'core'): ns3::RandomVariable [class]
module.add_class('RandomVariable', import_from_module='ns.core')
## rtt-estimator.h (module 'internet'): ns3::RttHistory [class]
module.add_class('RttHistory')
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex [class]
module.add_class('SPFVertex')
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex::VertexType [enumeration]
@@ -326,8 +324,6 @@ def register_types(module):
module.add_class('InternetStackHelper', parent=[root_module['ns3::PcapHelperForIpv4'], root_module['ns3::PcapHelperForIpv6'], root_module['ns3::AsciiTraceHelperForIpv4'], root_module['ns3::AsciiTraceHelperForIpv6']])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper [class]
module.add_class('Ipv4GlobalRoutingHelper', parent=root_module['ns3::Ipv4RoutingHelper'])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper::GlobalRoutingType [enumeration]
module.add_enum('GlobalRoutingType', ['ONE_NEXT_HOP', 'ORDERED_NEXT_HOPS', 'UNORDERED_NEXT_HOPS'], outer_class=root_module['ns3::Ipv4GlobalRoutingHelper'])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header [class]
module.add_class('Ipv4Header', parent=root_module['ns3::Header'])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::DscpType [enumeration]
@@ -376,6 +372,10 @@ def register_types(module):
module.add_class('ParetoVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable'])
## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class]
module.add_class('PcapFileWrapper', import_from_module='ns.network', parent=root_module['ns3::Object'])
## rtt-estimator.h (module 'internet'): ns3::RttEstimator [class]
module.add_class('RttEstimator', parent=root_module['ns3::Object'])
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation [class]
module.add_class('RttMeanDeviation', parent=root_module['ns3::RttEstimator'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
@@ -596,8 +596,6 @@ def register_types(module):
module.add_class('Icmpv6L4Protocol', parent=root_module['ns3::IpL4Protocol'])
## ipv4-global-routing.h (module 'internet'): ns3::Ipv4GlobalRouting [class]
module.add_class('Ipv4GlobalRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ipv4GlobalRoutingOneNexthop [class]
module.add_class('Ipv4GlobalRoutingOneNexthop', parent=root_module['ns3::Ipv4GlobalRouting'])
## ipv4-list-routing.h (module 'internet'): ns3::Ipv4ListRouting [class]
module.add_class('Ipv4ListRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
## ipv6-list-routing.h (module 'internet'): ns3::Ipv6ListRouting [class]
@@ -615,6 +613,9 @@ def register_types(module):
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >', 'ns3::SequenceNumber32')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >*', 'ns3::SequenceNumber32*')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >&', 'ns3::SequenceNumber32&')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >', 'ns3::RttHistory_t')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >*', 'ns3::RttHistory_t*')
typehandlers.add_type_alias('std::deque< ns3::RttHistory, std::allocator< ns3::RttHistory > >&', 'ns3::RttHistory_t&')
## Register a nested module for the namespace FatalImpl
@@ -659,7 +660,6 @@ def register_methods(root_module):
register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address'])
register_Ns3Ipv4AddressGenerator_methods(root_module, root_module['ns3::Ipv4AddressGenerator'])
register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper'])
register_Ns3Ipv4AddressTrieEAccessTraits_methods(root_module, root_module['ns3::Ipv4AddressTrieEAccessTraits'])
register_Ns3Ipv4EndPoint_methods(root_module, root_module['ns3::Ipv4EndPoint'])
register_Ns3Ipv4InterfaceAddress_methods(root_module, root_module['ns3::Ipv4InterfaceAddress'])
register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer'])
@@ -698,6 +698,7 @@ def register_methods(root_module):
register_Ns3PcapHelperForIpv4_methods(root_module, root_module['ns3::PcapHelperForIpv4'])
register_Ns3PcapHelperForIpv6_methods(root_module, root_module['ns3::PcapHelperForIpv6'])
register_Ns3RandomVariable_methods(root_module, root_module['ns3::RandomVariable'])
register_Ns3RttHistory_methods(root_module, root_module['ns3::RttHistory'])
register_Ns3SPFVertex_methods(root_module, root_module['ns3::SPFVertex'])
register_Ns3SeedManager_methods(root_module, root_module['ns3::SeedManager'])
register_Ns3SequenceNumber32_methods(root_module, root_module['ns3::SequenceNumber32'])
@@ -768,6 +769,8 @@ def register_methods(root_module):
register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
register_Ns3ParetoVariable_methods(root_module, root_module['ns3::ParetoVariable'])
register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper'])
register_Ns3RttEstimator_methods(root_module, root_module['ns3::RttEstimator'])
register_Ns3RttMeanDeviation_methods(root_module, root_module['ns3::RttMeanDeviation'])
register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
@@ -868,7 +871,6 @@ def register_methods(root_module):
register_Ns3Icmpv4L4Protocol_methods(root_module, root_module['ns3::Icmpv4L4Protocol'])
register_Ns3Icmpv6L4Protocol_methods(root_module, root_module['ns3::Icmpv6L4Protocol'])
register_Ns3Ipv4GlobalRouting_methods(root_module, root_module['ns3::Ipv4GlobalRouting'])
register_Ns3Ipv4GlobalRoutingOneNexthop_methods(root_module, root_module['ns3::Ipv4GlobalRoutingOneNexthop'])
register_Ns3Ipv4ListRouting_methods(root_module, root_module['ns3::Ipv4ListRouting'])
register_Ns3Ipv6ListRouting_methods(root_module, root_module['ns3::Ipv6ListRouting'])
register_Ns3LoopbackNetDevice_methods(root_module, root_module['ns3::LoopbackNetDevice'])
@@ -1358,6 +1360,10 @@ def register_Ns3BufferIterator_methods(root_module, cls):
cls.add_method('Next',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::PeekU8() [member function]
cls.add_method('PeekU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function]
cls.add_method('Prev',
'void',
@@ -1370,6 +1376,10 @@ def register_Ns3BufferIterator_methods(root_module, cls):
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(ns3::Buffer::Iterator start, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function]
cls.add_method('ReadLsbtohU16',
'uint16_t',
@@ -1689,11 +1699,6 @@ def register_Ns3GlobalRouteManager_methods(root_module, cls):
'void',
[],
is_static=True)
## global-route-manager.h (module 'internet'): static void ns3::GlobalRouteManager::ClearLSDB() [member function]
cls.add_method('ClearLSDB',
'void',
[],
is_static=True)
## global-route-manager.h (module 'internet'): static void ns3::GlobalRouteManager::BuildGlobalRoutingDatabase() [member function]
cls.add_method('BuildGlobalRoutingDatabase',
'void',
@@ -1714,11 +1719,6 @@ def register_Ns3GlobalRouteManagerImpl_methods(root_module, cls):
'void',
[],
is_virtual=True)
## global-route-manager-impl.h (module 'internet'): void ns3::GlobalRouteManagerImpl::ClearLSDB() [member function]
cls.add_method('ClearLSDB',
'void',
[],
is_virtual=True)
## global-route-manager-impl.h (module 'internet'): void ns3::GlobalRouteManagerImpl::BuildGlobalRoutingDatabase() [member function]
cls.add_method('BuildGlobalRoutingDatabase',
'void',
@@ -2004,9 +2004,9 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t const & ns3::Ipv4Address::Get() const [member function]
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t const &',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
@@ -2161,28 +2161,6 @@ def register_Ns3Ipv4AddressHelper_methods(root_module, cls):
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'mask'), param('ns3::Ipv4Address', 'base', default_value='"0.0.0.1"')])
return
def register_Ns3Ipv4AddressTrieEAccessTraits_methods(root_module, cls):
## trie.h (module 'network'): ns3::Ipv4AddressTrieEAccessTraits::Ipv4AddressTrieEAccessTraits() [constructor]
cls.add_constructor([])
## trie.h (module 'network'): ns3::Ipv4AddressTrieEAccessTraits::Ipv4AddressTrieEAccessTraits(ns3::Ipv4AddressTrieEAccessTraits const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4AddressTrieEAccessTraits const &', 'arg0')])
## trie.h (module 'network'): static uint8_t const * ns3::Ipv4AddressTrieEAccessTraits::begin(ns3::Ipv4Address const & r_key) [member function]
cls.add_method('begin',
'uint8_t const *',
[param('ns3::Ipv4Address const &', 'r_key')],
is_static=True)
## trie.h (module 'network'): static size_t ns3::Ipv4AddressTrieEAccessTraits::e_pos(uint8_t e) [member function]
cls.add_method('e_pos',
'size_t',
[param('uint8_t', 'e')],
is_static=True)
## trie.h (module 'network'): static uint8_t const * ns3::Ipv4AddressTrieEAccessTraits::end(ns3::Ipv4Address const & r_key) [member function]
cls.add_method('end',
'uint8_t const *',
[param('ns3::Ipv4Address const &', 'r_key')],
is_static=True)
return
def register_Ns3Ipv4EndPoint_methods(root_module, cls):
## ipv4-end-point.h (module 'internet'): ns3::Ipv4EndPoint::Ipv4EndPoint(ns3::Ipv4EndPoint const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4EndPoint const &', 'arg0')])
@@ -2508,30 +2486,30 @@ def register_Ns3Ipv4RoutingTableEntry_methods(root_module, cls):
cls.add_constructor([param('ns3::Ipv4RoutingTableEntry const &', 'route')])
## ipv4-routing-table-entry.h (module 'internet'): ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry(ns3::Ipv4RoutingTableEntry const * route) [constructor]
cls.add_constructor([param('ns3::Ipv4RoutingTableEntry const *', 'route')])
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('CreateDefaultRoute',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('CreateHostRouteTo',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('CreateHostRouteTo',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('CreateNetworkRouteTo',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface, uint32_t metric=0) [member function]
## ipv4-routing-table-entry.h (module 'internet'): static ns3::Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
cls.add_method('CreateNetworkRouteTo',
'ns3::Ipv4RoutingTableEntry',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')],
is_static=True)
## ipv4-routing-table-entry.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4RoutingTableEntry::GetDest() const [member function]
cls.add_method('GetDest',
@@ -2558,11 +2536,6 @@ def register_Ns3Ipv4RoutingTableEntry_methods(root_module, cls):
'uint32_t',
[],
is_const=True)
## ipv4-routing-table-entry.h (module 'internet'): uint32_t ns3::Ipv4RoutingTableEntry::GetMetric() const [member function]
cls.add_method('GetMetric',
'uint32_t',
[],
is_const=True)
## ipv4-routing-table-entry.h (module 'internet'): bool ns3::Ipv4RoutingTableEntry::IsDefault() const [member function]
cls.add_method('IsDefault',
'bool',
@@ -2583,10 +2556,6 @@ def register_Ns3Ipv4RoutingTableEntry_methods(root_module, cls):
'bool',
[],
is_const=True)
## ipv4-routing-table-entry.h (module 'internet'): void ns3::Ipv4RoutingTableEntry::SetMetric(uint32_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint32_t', 'metric')])
return
def register_Ns3Ipv4StaticRoutingHelper_methods(root_module, cls):
@@ -4032,6 +4001,21 @@ def register_Ns3RandomVariable_methods(root_module, cls):
is_const=True)
return
def register_Ns3RttHistory_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttHistory::RttHistory(ns3::SequenceNumber32 s, uint32_t c, ns3::Time t) [constructor]
cls.add_constructor([param('ns3::SequenceNumber32', 's'), param('uint32_t', 'c'), param('ns3::Time', 't')])
## rtt-estimator.h (module 'internet'): ns3::RttHistory::RttHistory(ns3::RttHistory const & h) [copy constructor]
cls.add_constructor([param('ns3::RttHistory const &', 'h')])
## rtt-estimator.h (module 'internet'): ns3::RttHistory::count [variable]
cls.add_instance_attribute('count', 'uint32_t', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::retx [variable]
cls.add_instance_attribute('retx', 'bool', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::seq [variable]
cls.add_instance_attribute('seq', 'ns3::SequenceNumber32', is_const=False)
## rtt-estimator.h (module 'internet'): ns3::RttHistory::time [variable]
cls.add_instance_attribute('time', 'ns3::Time', is_const=False)
return
def register_Ns3SPFVertex_methods(root_module, cls):
## global-route-manager-impl.h (module 'internet'): ns3::SPFVertex::SPFVertex() [constructor]
cls.add_constructor([])
@@ -4728,7 +4712,6 @@ def register_Ns3Empty_methods(root_module, cls):
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right'))
@@ -4781,6 +4764,7 @@ def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_output_stream_operator()
@@ -6181,8 +6165,8 @@ def register_Ns3InternetStackHelper_methods(root_module, cls):
return
def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls):
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper(std::string const & type="ns3::Ipv4GlobalRoutingOneNexthop") [constructor]
cls.add_constructor([param('std::string const &', 'type', default_value='"ns3::Ipv4GlobalRoutingOneNexthop"')])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper() [constructor]
cls.add_constructor([])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper(ns3::Ipv4GlobalRoutingHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4GlobalRoutingHelper const &', 'arg0')])
## ipv4-global-routing-helper.h (module 'internet'): ns3::Ipv4GlobalRoutingHelper * ns3::Ipv4GlobalRoutingHelper::Copy() const [member function]
@@ -6200,11 +6184,6 @@ def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls):
'void',
[],
is_static=True)
## ipv4-global-routing-helper.h (module 'internet'): static void ns3::Ipv4GlobalRoutingHelper::PopulateAllPossibleRoutingTables() [member function]
cls.add_method('PopulateAllPossibleRoutingTables',
'void',
[],
is_static=True)
## ipv4-global-routing-helper.h (module 'internet'): static void ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables() [member function]
cls.add_method('RecomputeRoutingTables',
'void',
@@ -7243,6 +7222,126 @@ def register_Ns3PcapFileWrapper_methods(root_module, cls):
[])
return
def register_Ns3RttEstimator_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator() [constructor]
cls.add_constructor([])
## rtt-estimator.h (module 'internet'): ns3::RttEstimator::RttEstimator(ns3::RttEstimator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RttEstimator const &', 'arg0')])
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::AckSeq(ns3::SequenceNumber32 ackSeq) [member function]
cls.add_method('AckSeq',
'ns3::Time',
[param('ns3::SequenceNumber32', 'ackSeq')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ClearSent() [member function]
cls.add_method('ClearSent',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Ptr<ns3::RttEstimator> ns3::RttEstimator::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::RttEstimator >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetCurrentEstimate() const [member function]
cls.add_method('GetCurrentEstimate',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetMaxRto() const [member function]
cls.add_method('GetMaxRto',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::GetMinRto() const [member function]
cls.add_method('GetMinRto',
'ns3::Time',
[],
is_const=True)
## rtt-estimator.h (module 'internet'): static ns3::TypeId ns3::RttEstimator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::IncreaseMultiplier() [member function]
cls.add_method('IncreaseMultiplier',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::Measurement(ns3::Time t) [member function]
cls.add_method('Measurement',
'void',
[param('ns3::Time', 't')],
is_pure_virtual=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::ResetMultiplier() [member function]
cls.add_method('ResetMultiplier',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttEstimator::RetransmitTimeout() [member function]
cls.add_method('RetransmitTimeout',
'ns3::Time',
[],
is_pure_virtual=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SentSeq(ns3::SequenceNumber32 seq, uint32_t size) [member function]
cls.add_method('SentSeq',
'void',
[param('ns3::SequenceNumber32', 'seq'), param('uint32_t', 'size')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetCurrentEstimate(ns3::Time estimate) [member function]
cls.add_method('SetCurrentEstimate',
'void',
[param('ns3::Time', 'estimate')])
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetMaxRto(ns3::Time maxRto) [member function]
cls.add_method('SetMaxRto',
'void',
[param('ns3::Time', 'maxRto')])
## rtt-estimator.h (module 'internet'): void ns3::RttEstimator::SetMinRto(ns3::Time minRto) [member function]
cls.add_method('SetMinRto',
'void',
[param('ns3::Time', 'minRto')])
return
def register_Ns3RttMeanDeviation_methods(root_module, cls):
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation::RttMeanDeviation() [constructor]
cls.add_constructor([])
## rtt-estimator.h (module 'internet'): ns3::RttMeanDeviation::RttMeanDeviation(ns3::RttMeanDeviation const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RttMeanDeviation const &', 'arg0')])
## rtt-estimator.h (module 'internet'): ns3::Ptr<ns3::RttEstimator> ns3::RttMeanDeviation::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::RttEstimator >',
[],
is_const=True, is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Gain(double g) [member function]
cls.add_method('Gain',
'void',
[param('double', 'g')])
## rtt-estimator.h (module 'internet'): static ns3::TypeId ns3::RttMeanDeviation::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Measurement(ns3::Time measure) [member function]
cls.add_method('Measurement',
'void',
[param('ns3::Time', 'measure')],
is_virtual=True)
## rtt-estimator.h (module 'internet'): void ns3::RttMeanDeviation::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
## rtt-estimator.h (module 'internet'): ns3::Time ns3::RttMeanDeviation::RetransmitTimeout() [member function]
cls.add_method('RetransmitTimeout',
'ns3::Time',
[],
is_virtual=True)
return
def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -8063,11 +8162,11 @@ def register_Ns3TcpSocketFactory_methods(root_module, cls):
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
@@ -8932,6 +9031,14 @@ def register_Ns3GlobalRouter_methods(root_module, cls):
is_static=True)
## global-router-interface.h (module 'internet'): ns3::GlobalRouter::GlobalRouter() [constructor]
cls.add_constructor([])
## global-router-interface.h (module 'internet'): void ns3::GlobalRouter::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4GlobalRouting> routing) [member function]
cls.add_method('SetRoutingProtocol',
'void',
[param('ns3::Ptr< ns3::Ipv4GlobalRouting >', 'routing')])
## global-router-interface.h (module 'internet'): ns3::Ptr<ns3::Ipv4GlobalRouting> ns3::GlobalRouter::GetRoutingProtocol() [member function]
cls.add_method('GetRoutingProtocol',
'ns3::Ptr< ns3::Ipv4GlobalRouting >',
[])
## global-router-interface.h (module 'internet'): ns3::Ipv4Address ns3::GlobalRouter::GetRouterId() const [member function]
cls.add_method('GetRouterId',
'ns3::Ipv4Address',
@@ -8951,10 +9058,22 @@ def register_Ns3GlobalRouter_methods(root_module, cls):
'bool',
[param('uint32_t', 'n'), param('ns3::GlobalRoutingLSA &', 'lsa')],
is_const=True)
## global-router-interface.h (module 'internet'): void ns3::GlobalRouter::InjectRoute(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t metric=1) [member function]
## global-router-interface.h (module 'internet'): void ns3::GlobalRouter::InjectRoute(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask) [member function]
cls.add_method('InjectRoute',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'metric', default_value='1')])
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask')])
## global-router-interface.h (module 'internet'): uint32_t ns3::GlobalRouter::GetNInjectedRoutes() [member function]
cls.add_method('GetNInjectedRoutes',
'uint32_t',
[])
## global-router-interface.h (module 'internet'): ns3::Ipv4RoutingTableEntry * ns3::GlobalRouter::GetInjectedRoute(uint32_t i) [member function]
cls.add_method('GetInjectedRoute',
retval('ns3::Ipv4RoutingTableEntry *', caller_owns_return=False),
[param('uint32_t', 'i')])
## global-router-interface.h (module 'internet'): void ns3::GlobalRouter::RemoveInjectedRoute(uint32_t i) [member function]
cls.add_method('RemoveInjectedRoute',
'void',
[param('uint32_t', 'i')])
## global-router-interface.h (module 'internet'): bool ns3::GlobalRouter::WithdrawRoute(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask) [member function]
cls.add_method('WithdrawRoute',
'bool',
@@ -12835,16 +12954,36 @@ def register_Ns3Ipv4GlobalRouting_methods(root_module, cls):
cls.add_constructor([param('ns3::Ipv4GlobalRouting const &', 'arg0')])
## ipv4-global-routing.h (module 'internet'): ns3::Ipv4GlobalRouting::Ipv4GlobalRouting() [constructor]
cls.add_constructor([])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Mask destMask, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('AddRouteTo',
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddASExternalRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddASExternalRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Mask', 'destMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
is_pure_virtual=True, is_virtual=True)
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::DeleteRoutes() [member function]
cls.add_method('DeleteRoutes',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
## ipv4-global-routing.h (module 'internet'): uint32_t ns3::Ipv4GlobalRouting::GetNRoutes() const [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[],
is_pure_virtual=True, is_virtual=True)
is_const=True)
## ipv4-global-routing.h (module 'internet'): ns3::Ipv4RoutingTableEntry * ns3::Ipv4GlobalRouting::GetRoute(uint32_t i) const [member function]
cls.add_method('GetRoute',
retval('ns3::Ipv4RoutingTableEntry *', caller_owns_return=False),
[param('uint32_t', 'i')],
is_const=True)
## ipv4-global-routing.h (module 'internet'): static ns3::TypeId ns3::Ipv4GlobalRouting::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
@@ -12870,62 +13009,34 @@ def register_Ns3Ipv4GlobalRouting_methods(root_module, cls):
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_virtual=True)
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
is_const=True, is_virtual=True)
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::RemoveRoute(uint32_t i) [member function]
cls.add_method('RemoveRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-global-routing.h (module 'internet'): bool ns3::Ipv4GlobalRouting::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Callback<void,ns3::Ptr<ns3::Ipv4Route>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback<void,ns3::Ptr<ns3::Ipv4MulticastRoute>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
is_virtual=True)
## ipv4-global-routing.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4GlobalRouting::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
is_virtual=True)
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')],
is_virtual=True)
return
def register_Ns3Ipv4GlobalRoutingOneNexthop_methods(root_module, cls):
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ipv4GlobalRoutingOneNexthop::Ipv4GlobalRoutingOneNexthop() [constructor]
cls.add_constructor([])
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ipv4GlobalRoutingOneNexthop::Ipv4GlobalRoutingOneNexthop(ns3::Ipv4GlobalRoutingOneNexthop const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4GlobalRoutingOneNexthop const &', 'arg0')])
## ipv4-global-routing-one-nexthop.h (module 'internet'): void ns3::Ipv4GlobalRoutingOneNexthop::AddRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Mask destMask, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('AddRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Mask', 'destMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')],
is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): void ns3::Ipv4GlobalRoutingOneNexthop::DeleteRoutes() [member function]
cls.add_method('DeleteRoutes',
## ipv4-global-routing.h (module 'internet'): void ns3::Ipv4GlobalRouting::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): uint32_t ns3::Ipv4GlobalRoutingOneNexthop::GetNRoutes() const [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[],
is_const=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ipv4RoutingTableEntry ns3::Ipv4GlobalRoutingOneNexthop::GetRoute(uint32_t i) const [member function]
cls.add_method('GetRoute',
'ns3::Ipv4RoutingTableEntry',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): static ns3::TypeId ns3::Ipv4GlobalRoutingOneNexthop::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): void ns3::Ipv4GlobalRoutingOneNexthop::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
is_const=True, is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): bool ns3::Ipv4GlobalRoutingOneNexthop::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Callback<void,ns3::Ptr<ns3::Ipv4Route>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback<void,ns3::Ptr<ns3::Ipv4MulticastRoute>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4GlobalRoutingOneNexthop::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
is_virtual=True)
## ipv4-global-routing-one-nexthop.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4GlobalRoutingOneNexthop::LookupGlobal(ns3::Ipv4Address dest, ns3::Ptr<ns3::NetDevice> oif=0) [member function]
cls.add_method('LookupGlobal',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ptr< ns3::NetDevice >', 'oif', default_value='0')],
visibility='protected', is_virtual=True)
return
@@ -20,24 +20,18 @@
#include "ipv4-global-routing-helper.h"
#include "ns3/global-router-interface.h"
#include "ns3/ipv4-global-routing.h"
#include "ns3/ipv4-global-routing-one-nexthop.h"
#include "ns3/ipv4-list-routing.h"
#include "ns3/log.h"
#include "ns3/node-list.h"
NS_LOG_COMPONENT_DEFINE ("GlobalRoutingHelper");
namespace ns3 {
UniformVariable Ipv4GlobalRoutingHelper::m_rand;
Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper (const std::string &type/* = "ns3::Ipv4GlobalRoutingOneNexthop"*/)
: m_type (type)
Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper ()
{
}
Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper (const Ipv4GlobalRoutingHelper &o)
: m_type (o.m_type)
{
}
@@ -57,10 +51,8 @@ Ipv4GlobalRoutingHelper::Create (Ptr<Node> node) const
node->AggregateObject (globalRouter);
NS_LOG_LOGIC ("Adding GlobalRouting Protocol to node " << node->GetId ());
ObjectFactory factory;
factory.SetTypeId (m_type);
Ptr<Ipv4GlobalRouting> globalRouting = DynamicCast<Ipv4GlobalRouting> (factory.Create<Object> ());
Ptr<Ipv4GlobalRouting> globalRouting = CreateObject<Ipv4GlobalRouting> ();
globalRouter->SetRoutingProtocol (globalRouting);
return globalRouting;
}
@@ -71,101 +63,6 @@ Ipv4GlobalRoutingHelper::PopulateRoutingTables (void)
GlobalRouteManager::BuildGlobalRoutingDatabase ();
GlobalRouteManager::InitializeRoutes ();
}
void
Ipv4GlobalRoutingHelper::PopulateAllPossibleRoutingTables (void)
{
NodeList::Iterator listEnd = NodeList::End ();
for (NodeList::Iterator node = NodeList::Begin (); node != listEnd; node++)
{
// if ((*node)->GetId ()!=3) continue;
Ptr<Ipv4> ipv4 = (*node)->GetObject<Ipv4> ();
NS_ASSERT (ipv4 != 0);
// remember interface statuses
std::vector<uint16_t> originalMetric (ipv4->GetNInterfaces ());
for (uint32_t iface = 1; iface < ipv4->GetNInterfaces (); iface++)
{
originalMetric[iface] = ipv4->GetMetric (iface);
}
// enable interfaces one by one and calculate routes
for (uint32_t enabledInterface = 1; enabledInterface < ipv4->GetNInterfaces (); enabledInterface++)
{
NS_LOG_ERROR ("Enabled interface: " << enabledInterface);
for (uint32_t iface = 1; iface < ipv4->GetNInterfaces (); iface++)
{
ipv4->SetMetric (iface, UINT16_MAX);
}
ipv4->SetMetric (enabledInterface, originalMetric[enabledInterface]);
GlobalRouteManager::ClearLSDB ();
GlobalRouteManager::BuildGlobalRoutingDatabase ();
GlobalRouteManager::InitializeRoutes ();
}
// restore original interface statuses
for (uint32_t iface = 1; iface < ipv4->GetNInterfaces (); iface++)
{
ipv4->SetMetric (iface, originalMetric[iface]);
}
}
}
// void
// Ipv4GlobalRoutingHelper::PopulateAllPossibleRoutingTables (void)
// {
// for (int xx = 0; xx < 100; xx++)
// {
// for (NodeList::Iterator node = NodeList::Begin (); node != NodeList::End (); node++)
// {
// Ptr<Ipv4> ipv4 = (*node)->GetObject<Ipv4> ();
// NS_ASSERT (ipv4 != 0);
// // // remember interface statuses
// // std::vector<uint16_t> originalMetric (ipv4->GetNInterfaces ());
// // for (uint32_t iface = 1; iface < ipv4->GetNInterfaces (); iface++)
// // {
// // originalMetric[iface] = ipv4->GetMetric (iface);
// // }
// // enable interfaces one by one and calculate routes
// // for (uint32_t enabledInterface = 1; enabledInterface < ipv4->GetNInterfaces (); enabledInterface++)
// // {
// // NS_LOG_ERROR ("Enabled interface: " << enabledInterface);
// for (uint32_t iface = 1; iface < ipv4->GetNInterfaces (); iface++)
// {
// ipv4->SetMetric (iface, m_rand.GetInteger (1, 500));
// }
// // ipv4->SetMetric (enabledInterface, originalMetric[enabledInterface]);
// // }
// // // restore original interface statuses
// // for (uint32_t iface = 1; iface < ipv4->GetNInterfaces (); iface++)
// // {
// // ipv4->SetMetric (iface, originalMetric[iface]);
// // }
// }
// GlobalRouteManager::ClearLSDB ();
// GlobalRouteManager::BuildGlobalRoutingDatabase ();
// GlobalRouteManager::InitializeRoutes ();
// // Ptr<GlobalRouter> rtr =
// // (*node)->GetObject<GlobalRouter> ();
// // if (rtr && rtr->GetNumLSAs () )
// // {
// // SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
// // SPFCalculate (rtr->GetRouterId ());
// // }
// }
// }
void
Ipv4GlobalRoutingHelper::RecomputeRoutingTables (void)
{
@@ -22,7 +22,6 @@
#include "ns3/node-container.h"
#include "ns3/ipv4-routing-helper.h"
#include "ns3/random-variable.h"
namespace ns3 {
@@ -32,18 +31,11 @@ namespace ns3 {
class Ipv4GlobalRoutingHelper : public Ipv4RoutingHelper
{
public:
enum GlobalRoutingType
{ ONE_NEXT_HOP = 0,
ORDERED_NEXT_HOPS = 1,
UNORDERED_NEXT_HOPS = 2};
/**
* \brief Construct a GlobalRoutingHelper to make life easier for managing
* global routing tasks.
*
* param type Type of the global routing
*/
Ipv4GlobalRoutingHelper (const std::string &type = "ns3::Ipv4GlobalRoutingOneNexthop");
Ipv4GlobalRoutingHelper ();
/**
* \brief Construct a GlobalRoutingHelper from another previously initialized
@@ -78,8 +70,6 @@ public:
*
*/
static void PopulateRoutingTables (void);
static void PopulateAllPossibleRoutingTables ();
/**
* \brief Remove all routes that were previously installed in a prior call
* to either PopulateRoutingTables() or RecomputeRoutingTables(), and
@@ -100,10 +90,6 @@ private:
* assignment and prevent the compiler from happily inserting its own.
*/
Ipv4GlobalRoutingHelper &operator = (const Ipv4GlobalRoutingHelper &o);
std::string m_type;
static UniformVariable m_rand;
};
} // namespace ns3
+5 -5
View File
@@ -61,7 +61,7 @@ public:
* \returns a newly-created routing protocol
*/
virtual Ptr<Ipv4RoutingProtocol> Create (Ptr<Node> node) const = 0;
/**
* \brief prints the routing tables of all nodes at a particular time.
* \param printTime the time at which the routing table is supposed to be printed.
@@ -135,12 +135,12 @@ Ptr<T> Ipv4RoutingHelper::GetRouting (Ptr<Ipv4RoutingProtocol> protocol)
// trying to check if protocol is a list routing
Ptr<Ipv4ListRouting> lrp = DynamicCast<Ipv4ListRouting> (protocol);
if (lrp != 0)
{
for (uint32_t i = 0; i < lrp->GetNRoutingProtocols (); i++)
{
int16_t priority;
for (uint32_t i = 0; i < lrp->GetNRoutingProtocols (); i++)
{
int16_t priority;
ret = GetRouting<T> (lrp->GetRoutingProtocol (i, priority)); // potential recursion, if inside ListRouting is ListRouting
if (ret != 0)
if (ret != 0)
break;
}
}
+153 -186
View File
@@ -35,7 +35,6 @@
#include "ns3/ipv4-routing-protocol.h"
#include "ns3/ipv4-list-routing.h"
#include "ns3/mpi-interface.h"
#include "ns3/ipv4-routing-helper.h"
#include "global-router-interface.h"
#include "global-route-manager-impl.h"
#include "candidate-queue.h"
@@ -567,15 +566,19 @@ GlobalRouteManagerImpl::DeleteGlobalRoutes ()
{
continue;
}
Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
NS_ASSERT_MSG (ipv4 != 0, "GlobalRouteManagerImpl requires IPv4 stack to be installed on the node");
Ptr<Ipv4GlobalRouting> gr = Ipv4RoutingHelper::
GetRouting<Ipv4GlobalRouting> (ipv4->GetRoutingProtocol ());
NS_ASSERT_MSG (gr != 0, "GlobalRouteManagerImpl needs an instance of Ipv4GlobalRouting to be installed on the node");
gr->DeleteRoutes ();
Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
uint32_t j = 0;
uint32_t nRoutes = gr->GetNRoutes ();
NS_LOG_LOGIC ("Deleting " << gr->GetNRoutes ()<< " routes from node " << node->GetId ());
// Each time we delete route 0, the route index shifts downward
// We can delete all routes if we delete the route numbered 0
// nRoutes times
for (j = 0; j < nRoutes; j++)
{
NS_LOG_LOGIC ("Deleting global route " << j << " from node " << node->GetId ());
gr->RemoveRoute (0);
}
NS_LOG_LOGIC ("Deleted " << j << " global routes from node "<< node->GetId ());
}
if (m_lsdb)
{
@@ -585,14 +588,6 @@ GlobalRouteManagerImpl::DeleteGlobalRoutes ()
}
}
void
GlobalRouteManagerImpl::ClearLSDB ()
{
NS_LOG_LOGIC ("Deleting LSDB, creating new one");
delete m_lsdb;
m_lsdb = new GlobalRouteManagerLSDB ();
}
//
// In order to build the routing database, we need to walk the list of nodes
// in the system and look for those that support the GlobalRouter interface.
@@ -631,14 +626,7 @@ GlobalRouteManagerImpl::BuildGlobalRoutingDatabase ()
// DiscoverLSAs () will get zero as the number since no routes have been
// found.
//
Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
NS_ASSERT_MSG (ipv4 != 0, "GlobalRouteManagerImpl requires IPv4 stack to be installed on the node");
Ptr<Ipv4GlobalRouting> grouting = Ipv4RoutingHelper::
GetRouting<Ipv4GlobalRouting> (ipv4->GetRoutingProtocol ());
NS_ASSERT_MSG (grouting != 0, "GlobalRouteManagerImpl needs an instance of Ipv4GlobalRouting to be installed on the node");
Ptr<Ipv4GlobalRouting> grouting = rtr->GetRoutingProtocol ();
uint32_t numLSAs = rtr->DiscoverLSAs ();
NS_LOG_LOGIC ("Found " << numLSAs << " LSAs");
@@ -704,7 +692,6 @@ GlobalRouteManagerImpl::InitializeRoutes ()
for (NodeList::Iterator i = NodeList::Begin (); i != listEnd; i++)
{
Ptr<Node> node = *i;
//
// Look for the GlobalRouter interface that indicates that the node is
// participating in routing.
@@ -889,7 +876,7 @@ GlobalRouteManagerImpl::SPFNext (SPFVertex* v, CandidateQueue& candidate)
else if (w_lsa->GetStatus () == GlobalRoutingLSA::LSA_SPF_CANDIDATE)
{
//
// We have already considered the link represented by <w>. What we have to
// We have already considered the link represented by <w>. What wse have to
// do now is to decide if this new router represents a route with a shorter
// distance metric.
//
@@ -1318,15 +1305,12 @@ GlobalRouteManagerImpl::CheckForStubNode (Ipv4Address root)
if (lr->GetLinkId () == myRouterId)
{
// Next hop is stored in the LinkID field of lr
Ptr<Ipv4> ipv4 = rlsa->GetNode ()->GetObject<Ipv4> ();
NS_ASSERT_MSG (ipv4 != 0, "GlobalRouteManagerImpl requires IPv4 stack to be installed on the node");
Ptr<Ipv4GlobalRouting> gr = Ipv4RoutingHelper::
GetRouting<Ipv4GlobalRouting> (ipv4->GetRoutingProtocol ());
NS_ASSERT_MSG (gr != 0, "GlobalRouteManagerImpl needs an instance of Ipv4GlobalRouting to be installed on the node");
gr->AddRouteTo (Ipv4Address ("0.0.0.0"), Ipv4Mask ("0.0.0.0"), lr->GetLinkData (),
FindOutgoingInterfaceId (transitLink->GetLinkData ()));
Ptr<GlobalRouter> router = rlsa->GetNode ()->GetObject<GlobalRouter> ();
NS_ASSERT (router);
Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
NS_ASSERT (gr);
gr->AddNetworkRouteTo (Ipv4Address ("0.0.0.0"), Ipv4Mask ("0.0.0.0"), lr->GetLinkData (),
FindOutgoingInterfaceId (transitLink->GetLinkData ()));
NS_LOG_LOGIC ("Inserting default route for node " << myRouterId << " to next hop " <<
lr->GetLinkData () << " via interface " <<
FindOutgoingInterfaceId (transitLink->GetLinkData ()));
@@ -1345,8 +1329,11 @@ GlobalRouteManagerImpl::SPFCalculate (Ipv4Address root)
NS_LOG_FUNCTION (this << root);
SPFVertex *v;
//
//
// Initialize the Link State Database.
//
m_lsdb->Initialize ();
//
// The candidate queue is a priority queue of SPFVertex objects, with the top
// of the queue being the closest vertex in terms of distance from the root
// of the tree. Initially, this queue is empty.
@@ -1364,115 +1351,105 @@ GlobalRouteManagerImpl::SPFCalculate (Ipv4Address root)
// We also mark this vertex as being in the SPF tree.
//
m_spfroot= v;
NS_ASSERT_MSG (m_spfroot->GetVertexType () == SPFVertex::VertexRouter,
"Root node has to be router");
//
// Initialize the Link State Database.
//
m_lsdb->Initialize ();
v->SetDistanceFromRoot (0);
v->GetLSA ()->SetStatus (GlobalRoutingLSA::LSA_SPF_IN_SPFTREE);
NS_LOG_LOGIC ("Starting SPFCalculate for node " << root);
//
// Optimize SPF calculation, for ns-3.
// We do not need to calculate SPF for every node in the network if this
// node has only one interface through which another router can be
// reached. Instead, short-circuit this computation and just install
// a default route in the CheckForStubNode() method.
//
// if (NodeList::GetNNodes () > 0 && CheckForStubNode (root))
// {
// NS_LOG_LOGIC ("SPFCalculate truncated for stub node " << root);
// delete m_spfroot;
// return;
// }
//
// Optimize SPF calculation, for ns-3.
// We do not need to calculate SPF for every node in the network if this
// node has only one interface through which another router can be
// reached. Instead, short-circuit this computation and just install
// a default route in the CheckForStubNode() method.
//
if (NodeList::GetNNodes () > 0 && CheckForStubNode (root))
{
NS_LOG_LOGIC ("SPFCalculate truncated for stub node " << root);
delete m_spfroot;
return;
}
for (;;)
{
//
// The operations we need to do are given in the OSPF RFC which we reference
// as we go along.
//
// RFC2328 16.1. (2).
//
// We examine the Global Router Link Records in the Link State
// Advertisements of the current vertex. If there are any point-to-point
// links to unexplored adjacent vertices we add them to the tree and update
// the distance and next hop information on how to get there. We also add
// the new vertices to the candidate queue (the priority queue ordered by
// shortest path). If the new vertices represent shorter paths, we use them
// and update the path cost.
//
//
// The operations we need to do are given in the OSPF RFC which we reference
// as we go along.
//
// RFC2328 16.1. (2).
//
// We examine the Global Router Link Records in the Link State
// Advertisements of the current vertex. If there are any point-to-point
// links to unexplored adjacent vertices we add them to the tree and update
// the distance and next hop information on how to get there. We also add
// the new vertices to the candidate queue (the priority queue ordered by
// shortest path). If the new vertices represent shorter paths, we use them
// and update the path cost.
//
SPFNext (v, candidate);
//
// RFC2328 16.1. (3).
//
// If at this step the candidate list is empty, the shortest-path tree (of
// transit vertices) has been completely built and this stage of the
// procedure terminates.
//
//
// RFC2328 16.1. (3).
//
// If at this step the candidate list is empty, the shortest-path tree (of
// transit vertices) has been completely built and this stage of the
// procedure terminates.
//
if (candidate.Size () == 0)
{
break;
}
//
// Choose the vertex belonging to the candidate list that is closest to the
// root, and add it to the shortest-path tree (removing it from the candidate
// list in the process).
//
// Recall that in the previous step, we created SPFVertex structures for each
// of the routers found in the Global Router Link Records and added tehm to
// the candidate list.
//
//
// Choose the vertex belonging to the candidate list that is closest to the
// root, and add it to the shortest-path tree (removing it from the candidate
// list in the process).
//
// Recall that in the previous step, we created SPFVertex structures for each
// of the routers found in the Global Router Link Records and added tehm to
// the candidate list.
//
NS_LOG_LOGIC (candidate);
v = candidate.Pop ();
NS_LOG_LOGIC ("Popped vertex " << v->GetVertexId ());
//
// Update the status field of the vertex to indicate that it is in the SPF
// tree.
//
//
// Update the status field of the vertex to indicate that it is in the SPF
// tree.
//
v->GetLSA ()->SetStatus (GlobalRoutingLSA::LSA_SPF_IN_SPFTREE);
//
// The current vertex has a parent pointer. By calling this rather oddly
// named method (blame quagga) we add the current vertex to the list of
// children of that parent vertex. In the next hop calculation called during
// SPFNext, the parent pointer was set but the vertex has been orphaned up
// to now.
//
//
// The current vertex has a parent pointer. By calling this rather oddly
// named method (blame quagga) we add the current vertex to the list of
// children of that parent vertex. In the next hop calculation called during
// SPFNext, the parent pointer was set but the vertex has been orphaned up
// to now.
//
SPFVertexAddParent (v);
//
// Note that when there is a choice of vertices closest to the root, network
// vertices must be chosen before router vertices in order to necessarily
// find all equal-cost paths.
//
// RFC2328 16.1. (4).
//
// This is the method that actually adds the routes. It'll walk the list
// of nodes in the system, looking for the node corresponding to the router
// ID of the root of the tree -- that is the router we're building the routes
// for. It looks for the Ipv4 interface of that node and remembers it. So
// we are only actually adding routes to that one node at the root of the SPF
// tree.
//
// We're going to pop of a pointer to every vertex in the tree except the
// root in order of distance from the root. For each of the vertices, we call
// SPFIntraAddRouter (). Down in SPFIntraAddRouter, we look at all of the
// point-to-point Global Router Link Records (the links to nodes adjacent to
// the node represented by the vertex). We add a route to the IP address
// specified by the m_linkData field of each of those link records. This will
// be the *local* IP address associated with the interface attached to the
// link. We use the outbound interface and next hop information present in
// the vertex <v> which have possibly been inherited from the root.
//
// To summarize, we're going to look at the node represented by <v> and loop
// through its point-to-point links, adding a *host* route to the local IP
// address (at the <v> side) for each of those links.
//
//
// Note that when there is a choice of vertices closest to the root, network
// vertices must be chosen before router vertices in order to necessarily
// find all equal-cost paths.
//
// RFC2328 16.1. (4).
//
// This is the method that actually adds the routes. It'll walk the list
// of nodes in the system, looking for the node corresponding to the router
// ID of the root of the tree -- that is the router we're building the routes
// for. It looks for the Ipv4 interface of that node and remembers it. So
// we are only actually adding routes to that one node at the root of the SPF
// tree.
//
// We're going to pop of a pointer to every vertex in the tree except the
// root in order of distance from the root. For each of the vertices, we call
// SPFIntraAddRouter (). Down in SPFIntraAddRouter, we look at all of the
// point-to-point Global Router Link Records (the links to nodes adjacent to
// the node represented by the vertex). We add a route to the IP address
// specified by the m_linkData field of each of those link records. This will
// be the *local* IP address associated with the interface attached to the
// link. We use the outbound interface and next hop information present in
// the vertex <v> which have possibly been inherited from the root.
//
// To summarize, we're going to look at the node represented by <v> and loop
// through its point-to-point links, adding a *host* route to the local IP
// address (at the <v> side) for each of those links.
//
if (v->GetVertexType () == SPFVertex::VertexRouter)
{
SPFIntraAddRouter (v);
@@ -1485,15 +1462,15 @@ GlobalRouteManagerImpl::SPFCalculate (Ipv4Address root)
{
NS_ASSERT_MSG (0, "illegal SPFVertex type");
}
//
// RFC2328 16.1. (5).
//
// Iterate the algorithm by returning to Step 2 until there are no more
// candidate vertices.
//
// RFC2328 16.1. (5).
//
// Iterate the algorithm by returning to Step 2 until there are no more
// candidate vertices.
} // end for loop
// Second stage of SPF calculation procedure
// Second stage of SPF calculation procedure
SPFProcessStubs (m_spfroot);
for (uint32_t i = 0; i < m_lsdb->GetNumExtLSAs (); i++)
{
@@ -1502,6 +1479,7 @@ GlobalRouteManagerImpl::SPFCalculate (Ipv4Address root)
NS_LOG_LOGIC ("Processing External LSA with id " << extlsa->GetLinkStateId ());
ProcessASExternals (m_spfroot, extlsa);
}
//
// We're all done setting the routing information for the node at the root of
// the SPF tree. Delete all of the vertices and corresponding resources. Go
@@ -1638,10 +1616,8 @@ GlobalRouteManagerImpl::SPFAddASExternal (GlobalRoutingLSA *extlsa, SPFVertex *v
{
continue;
}
Ptr<Ipv4GlobalRouting> gr = Ipv4RoutingHelper::
GetRouting<Ipv4GlobalRouting> (ipv4->GetRoutingProtocol ());
NS_ASSERT_MSG (gr != 0, "GlobalRouteManagerImpl needs an instance of Ipv4GlobalRouting to be installed on the node");
Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
NS_ASSERT (gr);
// walk through all next-hop-IPs and out-going-interfaces for reaching
// the stub network gateway 'v' from the root node
for (uint32_t i = 0; i < v->GetNRootExitDirections (); i++)
@@ -1651,7 +1627,7 @@ GlobalRouteManagerImpl::SPFAddASExternal (GlobalRoutingLSA *extlsa, SPFVertex *v
int32_t outIf = exit.second;
if (outIf >= 0)
{
gr->AddRouteTo (tempip, tempmask, nextHop, outIf, v->GetDistanceFromRoot ());
gr->AddASExternalRouteTo (tempip, tempmask, nextHop, outIf);
NS_LOG_LOGIC ("(Route " << i << ") Node " << node->GetId () <<
" add external network route to " << tempip <<
" using next hop " << nextHop <<
@@ -1726,7 +1702,7 @@ GlobalRouteManagerImpl::SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex*
NS_LOG_LOGIC ("Stub is on local host: " << v->GetVertexId () << "; returning");
return;
}
NS_LOG_LOGIC ("Stub is on remote host: " << v->GetVertexId () << "; installing (" << v->GetDistanceFromRoot () << ")");
NS_LOG_LOGIC ("Stub is on remote host: " << v->GetVertexId () << "; installing");
//
// The root of the Shortest Path First tree is the router to which we are
// going to write the actual routing table entries. The vertex corresponding
@@ -1811,10 +1787,8 @@ GlobalRouteManagerImpl::SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex*
{
continue;
}
Ptr<Ipv4GlobalRouting> gr = Ipv4RoutingHelper::
GetRouting<Ipv4GlobalRouting> (ipv4->GetRoutingProtocol ());
NS_ASSERT_MSG (gr != 0, "GlobalRouteManagerImpl needs an instance of Ipv4GlobalRouting to be installed on the node");
Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
NS_ASSERT (gr);
// walk through all next-hop-IPs and out-going-interfaces for reaching
// the stub network gateway 'v' from the root node
for (uint32_t i = 0; i < v->GetNRootExitDirections (); i++)
@@ -1824,12 +1798,11 @@ GlobalRouteManagerImpl::SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex*
int32_t outIf = exit.second;
if (outIf >= 0)
{
gr->AddRouteTo (tempip, tempmask, nextHop, outIf, v->GetDistanceFromRoot ());
gr->AddNetworkRouteTo (tempip, tempmask, nextHop, outIf);
NS_LOG_LOGIC ("(Route " << i << ") Node " << node->GetId () <<
" add network route to " << tempip <<
" using next hop " << nextHop <<
" via interface " << outIf <<
" metric " << v->GetDistanceFromRoot () );
" via interface " << outIf);
}
else
{
@@ -2048,36 +2021,33 @@ GlobalRouteManagerImpl::SPFIntraAddRouter (SPFVertex* v)
{
continue;
}
// Ptr<Ipv4GlobalRouting> gr = Ipv4RoutingHelper::
// GetRouting<Ipv4GlobalRouting> (ipv4->GetRoutingProtocol ());
// NS_ASSERT_MSG (gr != 0, "GlobalRouteManagerImpl needs an instance of Ipv4GlobalRouting to be installed on the node");
// // walk through all available exit directions due to ECMP,
// // and add host route for each of the exit direction toward
// // the vertex 'v'
// for (uint32_t i = 0; i < v->GetNRootExitDirections (); i++)
// {
// SPFVertex::NodeExit_t exit = v->GetRootExitDirection (i);
// Ipv4Address nextHop = exit.first;
// int32_t outIf = exit.second;
// if (outIf >= 0)
// {
// gr->AddRouteTo (lr->GetLinkData (), Ipv4Mask::GetOnes (), nextHop,
// outIf, v->GetDistanceFromRoot ());
// NS_LOG_LOGIC ("(Route " << i << ") Node " << node->GetId () <<
// " adding host route to " << lr->GetLinkData () <<
// " using next hop " << nextHop <<
// " and outgoing interface " << outIf);
// }
// else
// {
// NS_LOG_LOGIC ("(Route " << i << ") Node " << node->GetId () <<
// " NOT able to add host route to " << lr->GetLinkData () <<
// " using next hop " << nextHop <<
// " since outgoing interface id is negative " << outIf);
// }
// } // for all routes from the root the vertex 'v'
Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
NS_ASSERT (gr);
// walk through all available exit directions due to ECMP,
// and add host route for each of the exit direction toward
// the vertex 'v'
for (uint32_t i = 0; i < v->GetNRootExitDirections (); i++)
{
SPFVertex::NodeExit_t exit = v->GetRootExitDirection (i);
Ipv4Address nextHop = exit.first;
int32_t outIf = exit.second;
if (outIf >= 0)
{
gr->AddHostRouteTo (lr->GetLinkData (), nextHop,
outIf);
NS_LOG_LOGIC ("(Route " << i << ") Node " << node->GetId () <<
" adding host route to " << lr->GetLinkData () <<
" using next hop " << nextHop <<
" and outgoing interface " << outIf);
}
else
{
NS_LOG_LOGIC ("(Route " << i << ") Node " << node->GetId () <<
" NOT able to add host route to " << lr->GetLinkData () <<
" using next hop " << nextHop <<
" since outgoing interface id is negative " << outIf);
}
} // for all routes from the root the vertex 'v'
}
//
// Done adding the routes for the selected node.
@@ -2164,11 +2134,8 @@ GlobalRouteManagerImpl::SPFIntraAddTransit (SPFVertex* v)
{
continue;
}
Ptr<Ipv4GlobalRouting> gr = Ipv4RoutingHelper::
GetRouting<Ipv4GlobalRouting> (ipv4->GetRoutingProtocol ());
NS_ASSERT_MSG (gr != 0, "GlobalRouteManagerImpl needs an instance of Ipv4GlobalRouting to be installed on the node");
Ptr<Ipv4GlobalRouting> gr = router->GetRoutingProtocol ();
NS_ASSERT (gr);
// walk through all available exit directions due to ECMP,
// and add host route for each of the exit direction toward
// the vertex 'v'
@@ -2180,7 +2147,7 @@ GlobalRouteManagerImpl::SPFIntraAddTransit (SPFVertex* v)
if (outIf >= 0)
{
gr->AddRouteTo (tempip, tempmask, nextHop, outIf, v->GetDistanceFromRoot ());
gr->AddNetworkRouteTo (tempip, tempmask, nextHop, outIf);
NS_LOG_LOGIC ("(Route " << i << ") Node " << node->GetId () <<
" add network route to " << tempip <<
" using next hop " << nextHop <<
@@ -715,11 +715,6 @@ public:
*/
virtual void DeleteGlobalRoutes ();
/**
* @brief Reset LSDB without clearing routing entries
*/
virtual void ClearLSDB ();
/**
* @brief Build the routing database by gathering Link State Advertisements
* from each node exporting a GlobalRouter interface.
+1 -18
View File
@@ -24,8 +24,6 @@
#include "global-route-manager.h"
#include "global-route-manager-impl.h"
NS_LOG_COMPONENT_DEFINE ("GlobalRouteManager1");
namespace ns3 {
// ---------------------------------------------------------------------------
@@ -37,24 +35,13 @@ namespace ns3 {
void
GlobalRouteManager::DeleteGlobalRoutes ()
{
NS_LOG_FUNCTION (0);
SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
DeleteGlobalRoutes ();
}
void
GlobalRouteManager::ClearLSDB ()
{
NS_LOG_FUNCTION (0);
SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
ClearLSDB ();
DeleteGlobalRoutes ();
}
void
GlobalRouteManager::BuildGlobalRoutingDatabase (void)
{
NS_LOG_FUNCTION (0);
SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
BuildGlobalRoutingDatabase ();
}
@@ -62,8 +49,6 @@ GlobalRouteManager::BuildGlobalRoutingDatabase (void)
void
GlobalRouteManager::InitializeRoutes (void)
{
NS_LOG_FUNCTION (0);
SimulationSingleton<GlobalRouteManagerImpl>::Get ()->
InitializeRoutes ();
}
@@ -71,8 +56,6 @@ GlobalRouteManager::InitializeRoutes (void)
uint32_t
GlobalRouteManager::AllocateRouterId (void)
{
NS_LOG_FUNCTION (0);
static uint32_t routerId = 0;
return routerId++;
}
@@ -52,11 +52,6 @@ public:
*/
static void DeleteGlobalRoutes ();
/**
* @breif Clear LSA database without removing any entry in global routing table
*/
static void ClearLSDB ();
/**
* @brief Build the routing database by gathering Link State Advertisements
* from each node exporting a GlobalRouter interface.
+79 -80
View File
@@ -28,11 +28,9 @@
#include "ns3/ipv4.h"
#include "ns3/bridge-net-device.h"
#include "ipv4-global-routing.h"
#include "ns3/loopback-net-device.h"
#include "global-router-interface.h"
#include <vector>
NS_LOG_COMPONENT_DEFINE ("GlobalRouter");
namespace ns3 {
@@ -528,28 +526,28 @@ GlobalRouter::~GlobalRouter ()
ClearLSAs ();
}
// void
// GlobalRouter::SetRoutingProtocol (Ptr<Ipv4GlobalRouting> routing)
// {
// m_routingProtocol = routing;
// }
// Ptr<Ipv4GlobalRouting>
// GlobalRouter::GetRoutingProtocol (void)
// {
// return m_routingProtocol;
// }
void
GlobalRouter::SetRoutingProtocol (Ptr<Ipv4GlobalRouting> routing)
{
m_routingProtocol = routing;
}
Ptr<Ipv4GlobalRouting>
GlobalRouter::GetRoutingProtocol (void)
{
return m_routingProtocol;
}
void
GlobalRouter::DoDispose ()
{
NS_LOG_FUNCTION_NOARGS ();
// m_routingProtocol = 0;
// for (InjectedRoutesI k = m_injectedRoutes.begin ();
// k != m_injectedRoutes.end ();
// k = m_injectedRoutes.erase (k))
// {
// delete (*k);
// }
m_routingProtocol = 0;
for (InjectedRoutesI k = m_injectedRoutes.begin ();
k != m_injectedRoutes.end ();
k = m_injectedRoutes.erase (k))
{
delete (*k);
}
Object::DoDispose ();
}
@@ -719,17 +717,17 @@ GlobalRouter::DiscoverLSAs ()
// Build injected route LSAs as external routes
// RFC 2328, section 12.4.4
//
for (RouteList::const_iterator i = m_injectedRoutes.begin ();
for (InjectedRoutesCI i = m_injectedRoutes.begin ();
i != m_injectedRoutes.end ();
i++)
{
GlobalRoutingLSA *pLSA = new GlobalRoutingLSA;
pLSA->SetLSType (GlobalRoutingLSA::ASExternalLSAs);
pLSA->SetLinkStateId (i->GetDestNetwork ());
pLSA->SetLinkStateId ((*i)->GetDestNetwork ());
pLSA->SetAdvertisingRouter (m_routerId);
pLSA->SetNetworkLSANetworkMask (i->GetDestNetworkMask ());
pLSA->SetNetworkLSANetworkMask ((*i)->GetDestNetworkMask ());
pLSA->SetStatus (GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED);
m_LSAs.push_back (pLSA);
m_LSAs.push_back (pLSA);
}
return m_LSAs.size ();
}
@@ -754,8 +752,6 @@ GlobalRouter::ProcessSingleBroadcastLink (Ptr<NetDevice> nd, GlobalRoutingLSA *p
{
NS_LOG_FUNCTION (nd << pLSA << &c);
if (DynamicCast<LoopbackNetDevice> (nd)) return; //don't announce loopback addresses
GlobalRoutingLinkRecord *plr = new GlobalRoutingLinkRecord;
NS_ABORT_MSG_IF (plr == 0, "GlobalRouter::ProcessSingleBroadcastLink(): Can't alloc link record");
@@ -1507,74 +1503,77 @@ GlobalRouter::GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const
}
void
GlobalRouter::InjectRoute (Ipv4Address network, Ipv4Mask networkMask, uint32_t metric/*=1*/)
GlobalRouter::InjectRoute (Ipv4Address network, Ipv4Mask networkMask)
{
NS_LOG_FUNCTION (network << networkMask << metric);
WithdrawRoute (network, networkMask); //slight inefficiency to prevent duplicate routes
m_injectedRoutes.push_back (Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
metric));
NS_LOG_FUNCTION (network << networkMask);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
//
// Interface number does not matter here, using 1.
//
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
1);
m_injectedRoutes.push_back (route);
}
// Ipv4RoutingTableEntry *
// GlobalRouter::GetInjectedRoute (uint32_t index)
// {
// NS_LOG_FUNCTION (index);
// if (index < m_injectedRoutes.size ())
// {
// uint32_t tmp = 0;
// for (InjectedRoutesCI i = m_injectedRoutes.begin ();
// i != m_injectedRoutes.end ();
// i++)
// {
// if (tmp == index)
// {
// return *i;
// }
// tmp++;
// }
// }
// NS_ASSERT (false);
// // quiet compiler.
// return 0;
// }
Ipv4RoutingTableEntry *
GlobalRouter::GetInjectedRoute (uint32_t index)
{
NS_LOG_FUNCTION (index);
if (index < m_injectedRoutes.size ())
{
uint32_t tmp = 0;
for (InjectedRoutesCI i = m_injectedRoutes.begin ();
i != m_injectedRoutes.end ();
i++)
{
if (tmp == index)
{
return *i;
}
tmp++;
}
}
NS_ASSERT (false);
// quiet compiler.
return 0;
}
// uint32_t
// GlobalRouter::GetNInjectedRoutes ()
// {
// return m_injectedRoutes.size ();
// }
uint32_t
GlobalRouter::GetNInjectedRoutes ()
{
return m_injectedRoutes.size ();
}
// void
// GlobalRouter::RemoveInjectedRoute (uint32_t index)
// {
// NS_LOG_FUNCTION (index);
// NS_ASSERT (index < m_injectedRoutes.size ());
// uint32_t tmp = 0;
// for (InjectedRoutesI i = m_injectedRoutes.begin (); i != m_injectedRoutes.end (); i++)
// {
// if (tmp == index)
// {
// NS_LOG_LOGIC ("Removing route " << index << "; size = " << m_injectedRoutes.size ());
// delete *i;
// m_injectedRoutes.erase (i);
// return;
// }
// tmp++;
// }
// }
void
GlobalRouter::RemoveInjectedRoute (uint32_t index)
{
NS_LOG_FUNCTION (index);
NS_ASSERT (index < m_injectedRoutes.size ());
uint32_t tmp = 0;
for (InjectedRoutesI i = m_injectedRoutes.begin (); i != m_injectedRoutes.end (); i++)
{
if (tmp == index)
{
NS_LOG_LOGIC ("Removing route " << index << "; size = " << m_injectedRoutes.size ());
delete *i;
m_injectedRoutes.erase (i);
return;
}
tmp++;
}
}
bool
GlobalRouter::WithdrawRoute (Ipv4Address network, Ipv4Mask networkMask)
{
NS_LOG_FUNCTION (network << networkMask);
for (RouteList::iterator i = m_injectedRoutes.begin (); i != m_injectedRoutes.end (); i++)
for (InjectedRoutesI i = m_injectedRoutes.begin (); i != m_injectedRoutes.end (); i++)
{
if (i->GetDestNetwork () == network && i->GetDestNetworkMask () == networkMask)
if ((*i)->GetDestNetwork () == network && (*i)->GetDestNetworkMask () == networkMask)
{
NS_LOG_LOGIC ("Withdrawing route to network/mask " << network << "/" << networkMask);
delete *i;
m_injectedRoutes.erase (i);
return true;
}
+36 -29
View File
@@ -37,6 +37,7 @@
namespace ns3 {
class GlobalRouter;
class Ipv4GlobalRouting;
/**
* @brief A single link record for a link state advertisement.
@@ -587,6 +588,10 @@ public:
*/
GlobalRouter ();
void SetRoutingProtocol (Ptr<Ipv4GlobalRouting> routing);
Ptr<Ipv4GlobalRouting> GetRoutingProtocol (void);
/**
* @brief Get the Router ID associated with this Global Router.
*
@@ -661,35 +666,35 @@ public:
* @param network The Network to inject
* @param networkMask The Network Mask to inject
*/
void InjectRoute (Ipv4Address network, Ipv4Mask networkMask, uint32_t metric=1);
void InjectRoute (Ipv4Address network, Ipv4Mask networkMask);
// /**
// * @brief Get the number of injected routes that have been added
// * to the routing table.
// * @return number of injected routes
// */
// uint32_t GetNInjectedRoutes (void) const;
/**
* @brief Get the number of injected routes that have been added
* to the routing table.
* @return number of injected routes
*/
uint32_t GetNInjectedRoutes (void);
// /**
// * @brief Return the injected route indexed by i
// * @param i the index of the route
// * @return a pointer to that Ipv4RoutingTableEntry is returned
// *
// */
// const Ipv4RoutingTableEntry& GetInjectedRoute (uint32_t i) const;
/**
* @brief Return the injected route indexed by i
* @param i the index of the route
* @return a pointer to that Ipv4RoutingTableEntry is returned
*
*/
Ipv4RoutingTableEntry *GetInjectedRoute (uint32_t i);
// /**
// * @brief Withdraw a route from the global unicast routing table.
// *
// * Calling this function will cause all indexed routes numbered above
// * index i to have their index decremented. For instance, it is possible to
// * remove N injected routes by calling RemoveInjectedRoute (0) N times.
// *
// * @param i The index (into the injected routing list) of the route to remove.
// *
// * @see GlobalRouter::WithdrawRoute ()
// */
// void RemoveInjectedRoute (uint32_t i);
/**
* @brief Withdraw a route from the global unicast routing table.
*
* Calling this function will cause all indexed routes numbered above
* index i to have their index decremented. For instance, it is possible to
* remove N injected routes by calling RemoveInjectedRoute (0) N times.
*
* @param i The index (into the injected routing list) of the route to remove.
*
* @see GlobalRouter::WithdrawRoute ()
*/
void RemoveInjectedRoute (uint32_t i);
/**
* @brief Withdraw a route from the global unicast routing table.
@@ -723,10 +728,12 @@ private:
ListOfLSAs_t m_LSAs;
Ipv4Address m_routerId;
// Ptr<Ipv4GlobalRouting> m_routingProtocol;
Ptr<Ipv4GlobalRouting> m_routingProtocol;
typedef std::list<Ipv4RoutingTableEntry> RouteList;
RouteList m_injectedRoutes; // Routes we are exporting
typedef std::list<Ipv4RoutingTableEntry *> InjectedRoutes;
typedef std::list<Ipv4RoutingTableEntry *>::const_iterator InjectedRoutesCI;
typedef std::list<Ipv4RoutingTableEntry *>::iterator InjectedRoutesI;
InjectedRoutes m_injectedRoutes; // Routes we are exporting
// inherited from Object
virtual void DoDispose (void);
@@ -1,317 +0,0 @@
// -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*-
//
// Copyright (c) 2008 University of Washington
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation;
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#include "ns3/names.h"
#include "ns3/log.h"
#include "ns3/simulator.h"
#include "ns3/object.h"
#include "ns3/packet.h"
#include "ns3/net-device.h"
#include "ns3/ipv4-route.h"
#include "ipv4-global-routing-one-nexthop.h"
#include <iomanip>
NS_LOG_COMPONENT_DEFINE ("Ipv4GlobalRoutingOneNexthop");
namespace ns3 {
NS_OBJECT_ENSURE_REGISTERED (Ipv4GlobalRoutingOneNexthop);
TypeId
Ipv4GlobalRoutingOneNexthop::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Ipv4GlobalRoutingOneNexthop")
.SetParent<Ipv4GlobalRouting> ()
.AddConstructor<Ipv4GlobalRoutingOneNexthop> ()
;
return tid;
}
Ipv4GlobalRoutingOneNexthop::Ipv4GlobalRoutingOneNexthop ()
{
}
void
Ipv4GlobalRoutingOneNexthop::AddRouteTo (Ipv4Address dest,
Ipv4Mask destMask,
Ipv4Address nextHop,
uint32_t interface,
uint32_t metric/*=0*/)
{
NS_LOG_FUNCTION (dest << nextHop << interface);
// First, make sure we don't try to add route to ourselves
int32_t iface = m_ipv4->GetInterfaceForPrefix (dest, destMask);
NS_LOG_LOGIC ("Iface " << iface << " for " << dest);
if (iface >= 0)
{
NS_LOG_LOGIC ("Do not add route to ourselves");
return;
}
// Second, there is no reason to add p2p route that equals to the next hop
if (destMask == Ipv4Mask::GetOnes () && dest == nextHop)
{
NS_LOG_LOGIC ("Ignore route to nexthop via nexhop");
return;
}
Ipv4AddressTrie<Ipv4RoutingTableEntry>::iterator route =
m_routes.find (dest.CombineMask (destMask));
if (route == m_routes.end ())
{
NS_LOG_LOGIC ("Adding new route");
m_routes[dest.CombineMask (destMask)] =
Ipv4RoutingTableEntry::CreateNetworkRouteTo (dest, destMask, nextHop, interface, metric);
}
else
if (route->second.GetMetric () > metric)
{
NS_LOG_LOGIC ("Replacing larger-metric route");
m_routes[dest.CombineMask (destMask)] =
Ipv4RoutingTableEntry::CreateNetworkRouteTo (dest, destMask, nextHop, interface, metric);
}
else
{
NS_LOG_LOGIC ("Don't update lower-metric route");
}
}
Ptr<Ipv4Route>
Ipv4GlobalRoutingOneNexthop::LookupGlobal (Ipv4Address dest, Ptr<NetDevice> oif)
{
NS_LOG_FUNCTION_NOARGS ();
NS_LOG_LOGIC ("Looking for route for destination " << dest);
// Cheating with lookups. Need to redesign Trie
Ipv4AddressTrieMap::const_iterator longest_prefix_map;
Ipv4Mask mask ("255.255.255.255");
do {
NS_LOG_DEBUG ("Try mask " << mask);
longest_prefix_map = m_routes.longest_prefix_match (dest.CombineMask (mask));
mask = Ipv4Mask (mask.Get () << 8);
} while (longest_prefix_map == m_routes.end () && !mask.IsEqual (Ipv4Mask::GetZero ()));
if (longest_prefix_map == m_routes.end ())
{
NS_LOG_LOGIC ("Route not found...");
return 0;
}
if (oif != 0 && oif == m_ipv4->GetNetDevice (longest_prefix_map->second.GetInterface ()))
{
NS_LOG_LOGIC ("Route points to the incoming interface. Return empty route");
return 0;
}
// create a Ipv4Route object from the selected routing table entry
Ptr<Ipv4Route> rtentry = Create<Ipv4Route> ();
rtentry->SetDestination (longest_prefix_map->second.GetDest ());
rtentry->SetSource (m_ipv4->GetAddress (longest_prefix_map->second.GetInterface (), 0).GetLocal ());
rtentry->SetGateway (longest_prefix_map->second.GetGateway ());
rtentry->SetOutputDevice (m_ipv4->GetNetDevice (longest_prefix_map->second.GetInterface ()));
return rtentry;
}
void
Ipv4GlobalRoutingOneNexthop::DeleteRoutes ()
{
m_routes.clear ();
}
// Formatted like output of "route -n" command
void
Ipv4GlobalRoutingOneNexthop::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const
{
std::ostream* os = stream->GetStream ();
if (m_routes.size () > 0)
{
*os << "Destination Gateway Genmask Flags Metric Ref Use Iface" << std::endl;
for (Ipv4AddressTrieMap::const_iterator i=m_routes.begin (); i != m_routes.end (); i++)
{
std::ostringstream dest, gw, mask, flags;
const Ipv4RoutingTableEntry &route = i->second;
dest << route.GetDest ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << dest.str ();
gw << route.GetGateway ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << gw.str ();
mask << route.GetDestNetworkMask ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << mask.str ();
flags << "U";
if (route.IsHost ())
{
flags << "H";
}
else if (route.IsGateway ())
{
flags << "G";
}
*os << std::setiosflags (std::ios::left) << std::setw (6) << flags.str ();
*os << std::setiosflags (std::ios::left) << std::setw (6) << route.GetMetric ();
// Ref ct not implemented
*os << "-" << " ";
// Use not implemented
*os << "-" << " ";
if (Names::FindName (m_ipv4->GetNetDevice (route.GetInterface ())) != "")
{
*os << Names::FindName (m_ipv4->GetNetDevice (route.GetInterface ()));
}
else
{
*os << route.GetInterface ();
}
*os << std::endl;
}
}
}
Ptr<Ipv4Route>
Ipv4GlobalRoutingOneNexthop::RouteOutput (Ptr<Packet> p, const Ipv4Header &header,
Ptr<NetDevice> oif, Socket::SocketErrno &sockerr)
{
//
// First, see if this is a multicast packet we have a route for. If we
// have a route, then send the packet down each of the specified interfaces.
//
if (header.GetDestination ().IsMulticast ())
{
NS_LOG_LOGIC ("Multicast destination-- returning false");
return 0; // Let other routing protocols try to handle this
}
//
// See if this is a unicast packet we have a route for.
//
NS_LOG_LOGIC ("Unicast destination- looking up");
Ptr<Ipv4Route> rtentry = LookupGlobal (header.GetDestination (), oif);
if (rtentry)
{
sockerr = Socket::ERROR_NOTERROR;
}
else
{
sockerr = Socket::ERROR_NOROUTETOHOST;
}
return rtentry;
}
bool
Ipv4GlobalRoutingOneNexthop::RouteInput (Ptr<const Packet> p, const Ipv4Header &header,
Ptr<const NetDevice> idev,
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb)
{
NS_LOG_FUNCTION (this << p << header << header.GetSource () << header.GetDestination () << idev);
// Check if input device supports IP
NS_ASSERT (m_ipv4->GetInterfaceForDevice (idev) >= 0);
uint32_t iif = m_ipv4->GetInterfaceForDevice (idev);
if (header.GetDestination ().IsMulticast ())
{
NS_LOG_LOGIC ("Multicast destination-- returning false");
return false; // Let other routing protocols try to handle this
}
if (header.GetDestination ().IsBroadcast ())
{
NS_LOG_LOGIC ("For me (Ipv4Addr broadcast address)");
// TODO: Local Deliver for broadcast
// TODO: Forward broadcast
}
// TODO: Configurable option to enable RFC 1222 Strong End System Model
// Right now, we will be permissive and allow a source to send us
// a packet to one of our other interface addresses; that is, the
// destination unicast address does not match one of the iif addresses,
// but we check our other interfaces. This could be an option
// (to remove the outer loop immediately below and just check iif).
for (uint32_t j = 0; j < m_ipv4->GetNInterfaces (); j++)
{
for (uint32_t i = 0; i < m_ipv4->GetNAddresses (j); i++)
{
Ipv4InterfaceAddress iaddr = m_ipv4->GetAddress (j, i);
Ipv4Address addr = iaddr.GetLocal ();
if (addr.IsEqual (header.GetDestination ()))
{
if (j == iif)
{
NS_LOG_LOGIC ("For me (destination " << addr << " match)");
}
else
{
NS_LOG_LOGIC ("For me (destination " << addr << " match) on another interface " << header.GetDestination ());
}
lcb (p, header, iif);
return true;
}
if (header.GetDestination ().IsEqual (iaddr.GetBroadcast ()))
{
NS_LOG_LOGIC ("For me (interface broadcast address)");
lcb (p, header, iif);
return true;
}
NS_LOG_LOGIC ("Address "<< addr << " not a match");
}
}
// Check if input device supports IP forwarding
if (m_ipv4->IsForwarding (iif) == false)
{
NS_LOG_LOGIC ("Forwarding disabled for this interface");
ecb (p, header, Socket::ERROR_NOROUTETOHOST);
return false;
}
// Next, try to find a route
NS_LOG_LOGIC ("Unicast destination- looking up global route");
Ptr<Ipv4Route> rtentry = LookupGlobal (header.GetDestination ());
if (rtentry != 0)
{
NS_LOG_LOGIC ("Found unicast destination- calling unicast callback");
ucb (rtentry, p, header);
return true;
}
else
{
NS_LOG_LOGIC ("Did not find unicast destination- returning false");
return false; // Let other routing protocols try to handle this
// route request.
}
}
uint32_t
Ipv4GlobalRoutingOneNexthop::GetNRoutes () const
{
return m_routes.size ();
}
Ipv4RoutingTableEntry
Ipv4GlobalRoutingOneNexthop::GetRoute (uint32_t i) const
{
uint32_t index = 0;
for (Ipv4AddressTrieMap::const_iterator it = m_routes.begin ();
index <= i && it != m_routes.end ();
it++, index++)
{
if (index == i) return it->second;
}
NS_ASSERT (false);
return Ipv4RoutingTableEntry ();
}
} // namespace ns3
@@ -1,83 +0,0 @@
// -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*-
//
// Copyright (c) 2008 University of Washington
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation;
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//
#ifndef IPV4_GLOBAL_ROUTING_ONE_NEXTHOP_H
#define IPV4_GLOBAL_ROUTING_ONE_NEXTHOP_H
#include "ns3/ipv4-global-routing.h"
#include "ns3/trie.h"
#include "ns3/ipv4-routing-table-entry.h"
namespace ns3 {
/**
* \brief Global routing protocol for IP version 4 stacks.
*
* Each prefix entry stores a list of ordered by metric next-hops
*
* This class deals with Ipv4 unicast routes only.
*
* \see Ipv4GlobalRouting
* \see Ipv4RoutingProtocol
* \see GlobalRouteManager
*/
class Ipv4GlobalRoutingOneNexthop : public Ipv4GlobalRouting
{
public:
static TypeId GetTypeId (void);
Ipv4GlobalRoutingOneNexthop ();
// These methods inherited from base class
// from Ipv4RoutingProtocol
virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header,
Ptr<NetDevice> oif, Socket::SocketErrno &sockerr);
virtual bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev,
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb);
virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const;
// from Ipv4GlobalRouting
virtual void AddRouteTo (Ipv4Address dest,
Ipv4Mask destMask,
Ipv4Address nextHop,
uint32_t interface,
uint32_t metric=0);
virtual void DeleteRoutes ();
uint32_t
GetNRoutes () const;
Ipv4RoutingTableEntry
GetRoute (uint32_t i) const;
protected:
virtual Ptr<Ipv4Route> LookupGlobal (Ipv4Address dest, Ptr<NetDevice> oif = 0);
private:
typedef Ipv4AddressTrie<Ipv4RoutingTableEntry> Ipv4AddressTrieMap;
Ipv4AddressTrieMap m_routes;
};
} // Namespace ns3
#endif /* IPV4_GLOBAL_ROUTING_ONE_NEXTHOP_H */
+496 -6
View File
@@ -16,13 +16,19 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#include <vector>
#include <iomanip>
#include "ns3/names.h"
#include "ns3/log.h"
#include "ns3/simulator.h"
#include "ns3/object.h"
#include "ns3/global-route-manager.h"
#include "ns3/packet.h"
#include "ns3/net-device.h"
#include "ns3/ipv4-route.h"
#include "ns3/ipv4-routing-table-entry.h"
#include "ns3/boolean.h"
#include "ipv4-global-routing.h"
#include "global-route-manager.h"
NS_LOG_COMPONENT_DEFINE ("Ipv4GlobalRouting");
@@ -34,10 +40,14 @@ TypeId
Ipv4GlobalRouting::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Ipv4GlobalRouting")
.SetParent<Ipv4RoutingProtocol> ()
.SetParent<Object> ()
.AddAttribute ("RandomEcmpRouting",
"Set to true if packets are randomly routed among ECMP; set to false for using only one route consistently",
BooleanValue (false),
MakeBooleanAccessor (&Ipv4GlobalRouting::m_randomEcmpRouting),
MakeBooleanChecker ())
.AddAttribute ("RespondToInterfaceEvents",
"Set to true if you want to dynamically recompute the global routes "
"upon Interface notification events (up/down, or add/remove address)",
"Set to true if you want to dynamically recompute the global routes upon Interface notification events (up/down, or add/remove address)",
BooleanValue (false),
MakeBooleanAccessor (&Ipv4GlobalRouting::m_respondToInterfaceEvents),
MakeBooleanChecker ())
@@ -45,11 +55,491 @@ Ipv4GlobalRouting::GetTypeId (void)
return tid;
}
Ipv4GlobalRouting::Ipv4GlobalRouting ()
: m_respondToInterfaceEvents (false)
Ipv4GlobalRouting::Ipv4GlobalRouting ()
: m_randomEcmpRouting (false),
m_respondToInterfaceEvents (false)
{
NS_LOG_FUNCTION_NOARGS ();
}
Ipv4GlobalRouting::~Ipv4GlobalRouting ()
{
NS_LOG_FUNCTION_NOARGS ();
}
void
Ipv4GlobalRouting::AddHostRouteTo (Ipv4Address dest,
Ipv4Address nextHop,
uint32_t interface)
{
NS_LOG_FUNCTION (dest << nextHop << interface);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateHostRouteTo (dest, nextHop, interface);
m_hostRoutes.push_back (route);
}
void
Ipv4GlobalRouting::AddHostRouteTo (Ipv4Address dest,
uint32_t interface)
{
NS_LOG_FUNCTION (dest << interface);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateHostRouteTo (dest, interface);
m_hostRoutes.push_back (route);
}
void
Ipv4GlobalRouting::AddNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
Ipv4Address nextHop,
uint32_t interface)
{
NS_LOG_FUNCTION (network << networkMask << nextHop << interface);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
nextHop,
interface);
m_networkRoutes.push_back (route);
}
void
Ipv4GlobalRouting::AddNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
uint32_t interface)
{
NS_LOG_FUNCTION (network << networkMask << interface);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
interface);
m_networkRoutes.push_back (route);
}
void
Ipv4GlobalRouting::AddASExternalRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
Ipv4Address nextHop,
uint32_t interface)
{
NS_LOG_FUNCTION (network << networkMask << nextHop);
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
nextHop,
interface);
m_ASexternalRoutes.push_back (route);
}
Ptr<Ipv4Route>
Ipv4GlobalRouting::LookupGlobal (Ipv4Address dest, Ptr<NetDevice> oif)
{
NS_LOG_FUNCTION_NOARGS ();
NS_LOG_LOGIC ("Looking for route for destination " << dest);
Ptr<Ipv4Route> rtentry = 0;
// store all available routes that bring packets to their destination
typedef std::vector<Ipv4RoutingTableEntry*> RouteVec_t;
RouteVec_t allRoutes;
NS_LOG_LOGIC ("Number of m_hostRoutes = " << m_hostRoutes.size ());
for (HostRoutesCI i = m_hostRoutes.begin ();
i != m_hostRoutes.end ();
i++)
{
NS_ASSERT ((*i)->IsHost ());
if ((*i)->GetDest ().IsEqual (dest))
{
if (oif != 0)
{
if (oif != m_ipv4->GetNetDevice ((*i)->GetInterface ()))
{
NS_LOG_LOGIC ("Not on requested interface, skipping");
continue;
}
}
allRoutes.push_back (*i);
NS_LOG_LOGIC (allRoutes.size () << "Found global host route" << *i);
}
}
if (allRoutes.size () == 0) // if no host route is found
{
NS_LOG_LOGIC ("Number of m_networkRoutes" << m_networkRoutes.size ());
for (NetworkRoutesI j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j++)
{
Ipv4Mask mask = (*j)->GetDestNetworkMask ();
Ipv4Address entry = (*j)->GetDestNetwork ();
if (mask.IsMatch (dest, entry))
{
if (oif != 0)
{
if (oif != m_ipv4->GetNetDevice ((*j)->GetInterface ()))
{
NS_LOG_LOGIC ("Not on requested interface, skipping");
continue;
}
}
allRoutes.push_back (*j);
NS_LOG_LOGIC (allRoutes.size () << "Found global network route" << *j);
}
}
}
if (allRoutes.size () == 0) // consider external if no host/network found
{
for (ASExternalRoutesI k = m_ASexternalRoutes.begin ();
k != m_ASexternalRoutes.end ();
k++)
{
Ipv4Mask mask = (*k)->GetDestNetworkMask ();
Ipv4Address entry = (*k)->GetDestNetwork ();
if (mask.IsMatch (dest, entry))
{
NS_LOG_LOGIC ("Found external route" << *k);
if (oif != 0)
{
if (oif != m_ipv4->GetNetDevice ((*k)->GetInterface ()))
{
NS_LOG_LOGIC ("Not on requested interface, skipping");
continue;
}
}
allRoutes.push_back (*k);
break;
}
}
}
if (allRoutes.size () > 0 ) // if route(s) is found
{
// pick up one of the routes uniformly at random if random
// ECMP routing is enabled, or always select the first route
// consistently if random ECMP routing is disabled
uint32_t selectIndex;
if (m_randomEcmpRouting)
{
selectIndex = m_rand.GetInteger (0, allRoutes.size ()-1);
}
else
{
selectIndex = 0;
}
Ipv4RoutingTableEntry* route = allRoutes.at (selectIndex);
// create a Ipv4Route object from the selected routing table entry
rtentry = Create<Ipv4Route> ();
rtentry->SetDestination (route->GetDest ());
// XXX handle multi-address case
rtentry->SetSource (m_ipv4->GetAddress (route->GetInterface (), 0).GetLocal ());
rtentry->SetGateway (route->GetGateway ());
uint32_t interfaceIdx = route->GetInterface ();
rtentry->SetOutputDevice (m_ipv4->GetNetDevice (interfaceIdx));
return rtentry;
}
else
{
return 0;
}
}
uint32_t
Ipv4GlobalRouting::GetNRoutes (void) const
{
NS_LOG_FUNCTION_NOARGS ();
uint32_t n = 0;
n += m_hostRoutes.size ();
n += m_networkRoutes.size ();
n += m_ASexternalRoutes.size ();
return n;
}
Ipv4RoutingTableEntry *
Ipv4GlobalRouting::GetRoute (uint32_t index) const
{
NS_LOG_FUNCTION (index);
if (index < m_hostRoutes.size ())
{
uint32_t tmp = 0;
for (HostRoutesCI i = m_hostRoutes.begin ();
i != m_hostRoutes.end ();
i++)
{
if (tmp == index)
{
return *i;
}
tmp++;
}
}
index -= m_hostRoutes.size ();
uint32_t tmp = 0;
if (index < m_networkRoutes.size ())
{
for (NetworkRoutesCI j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j++)
{
if (tmp == index)
{
return *j;
}
tmp++;
}
}
index -= m_networkRoutes.size ();
tmp = 0;
for (ASExternalRoutesCI k = m_ASexternalRoutes.begin ();
k != m_ASexternalRoutes.end ();
k++)
{
if (tmp == index)
{
return *k;
}
tmp++;
}
NS_ASSERT (false);
// quiet compiler.
return 0;
}
void
Ipv4GlobalRouting::RemoveRoute (uint32_t index)
{
NS_LOG_FUNCTION (index);
if (index < m_hostRoutes.size ())
{
uint32_t tmp = 0;
for (HostRoutesI i = m_hostRoutes.begin ();
i != m_hostRoutes.end ();
i++)
{
if (tmp == index)
{
NS_LOG_LOGIC ("Removing route " << index << "; size = " << m_hostRoutes.size ());
delete *i;
m_hostRoutes.erase (i);
NS_LOG_LOGIC ("Done removing host route " << index << "; host route remaining size = " << m_hostRoutes.size ());
return;
}
tmp++;
}
}
index -= m_hostRoutes.size ();
uint32_t tmp = 0;
for (NetworkRoutesI j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j++)
{
if (tmp == index)
{
NS_LOG_LOGIC ("Removing route " << index << "; size = " << m_networkRoutes.size ());
delete *j;
m_networkRoutes.erase (j);
NS_LOG_LOGIC ("Done removing network route " << index << "; network route remaining size = " << m_networkRoutes.size ());
return;
}
tmp++;
}
index -= m_networkRoutes.size ();
tmp = 0;
for (ASExternalRoutesI k = m_ASexternalRoutes.begin ();
k != m_ASexternalRoutes.end ();
k++)
{
if (tmp == index)
{
NS_LOG_LOGIC ("Removing route " << index << "; size = " << m_ASexternalRoutes.size ());
delete *k;
m_ASexternalRoutes.erase (k);
NS_LOG_LOGIC ("Done removing network route " << index << "; network route remaining size = " << m_networkRoutes.size ());
return;
}
tmp++;
}
NS_ASSERT (false);
}
void
Ipv4GlobalRouting::DoDispose (void)
{
NS_LOG_FUNCTION_NOARGS ();
for (HostRoutesI i = m_hostRoutes.begin ();
i != m_hostRoutes.end ();
i = m_hostRoutes.erase (i))
{
delete (*i);
}
for (NetworkRoutesI j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j = m_networkRoutes.erase (j))
{
delete (*j);
}
for (ASExternalRoutesI l = m_ASexternalRoutes.begin ();
l != m_ASexternalRoutes.end ();
l = m_ASexternalRoutes.erase (l))
{
delete (*l);
}
Ipv4RoutingProtocol::DoDispose ();
}
// Formatted like output of "route -n" command
void
Ipv4GlobalRouting::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const
{
std::ostream* os = stream->GetStream ();
if (GetNRoutes () > 0)
{
*os << "Destination Gateway Genmask Flags Metric Ref Use Iface" << std::endl;
for (uint32_t j = 0; j < GetNRoutes (); j++)
{
std::ostringstream dest, gw, mask, flags;
Ipv4RoutingTableEntry route = GetRoute (j);
dest << route.GetDest ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << dest.str ();
gw << route.GetGateway ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << gw.str ();
mask << route.GetDestNetworkMask ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << mask.str ();
flags << "U";
if (route.IsHost ())
{
flags << "H";
}
else if (route.IsGateway ())
{
flags << "G";
}
*os << std::setiosflags (std::ios::left) << std::setw (6) << flags.str ();
// Metric not implemented
*os << "-" << " ";
// Ref ct not implemented
*os << "-" << " ";
// Use not implemented
*os << "-" << " ";
if (Names::FindName (m_ipv4->GetNetDevice (route.GetInterface ())) != "")
{
*os << Names::FindName (m_ipv4->GetNetDevice (route.GetInterface ()));
}
else
{
*os << route.GetInterface ();
}
*os << std::endl;
}
}
}
Ptr<Ipv4Route>
Ipv4GlobalRouting::RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr)
{
//
// First, see if this is a multicast packet we have a route for. If we
// have a route, then send the packet down each of the specified interfaces.
//
if (header.GetDestination ().IsMulticast ())
{
NS_LOG_LOGIC ("Multicast destination-- returning false");
return 0; // Let other routing protocols try to handle this
}
//
// See if this is a unicast packet we have a route for.
//
NS_LOG_LOGIC ("Unicast destination- looking up");
Ptr<Ipv4Route> rtentry = LookupGlobal (header.GetDestination (), oif);
if (rtentry)
{
sockerr = Socket::ERROR_NOTERROR;
}
else
{
sockerr = Socket::ERROR_NOROUTETOHOST;
}
return rtentry;
}
bool
Ipv4GlobalRouting::RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb)
{
NS_LOG_FUNCTION (this << p << header << header.GetSource () << header.GetDestination () << idev);
// Check if input device supports IP
NS_ASSERT (m_ipv4->GetInterfaceForDevice (idev) >= 0);
uint32_t iif = m_ipv4->GetInterfaceForDevice (idev);
if (header.GetDestination ().IsMulticast ())
{
NS_LOG_LOGIC ("Multicast destination-- returning false");
return false; // Let other routing protocols try to handle this
}
if (header.GetDestination ().IsBroadcast ())
{
NS_LOG_LOGIC ("For me (Ipv4Addr broadcast address)");
// TODO: Local Deliver for broadcast
// TODO: Forward broadcast
}
// TODO: Configurable option to enable RFC 1222 Strong End System Model
// Right now, we will be permissive and allow a source to send us
// a packet to one of our other interface addresses; that is, the
// destination unicast address does not match one of the iif addresses,
// but we check our other interfaces. This could be an option
// (to remove the outer loop immediately below and just check iif).
for (uint32_t j = 0; j < m_ipv4->GetNInterfaces (); j++)
{
for (uint32_t i = 0; i < m_ipv4->GetNAddresses (j); i++)
{
Ipv4InterfaceAddress iaddr = m_ipv4->GetAddress (j, i);
Ipv4Address addr = iaddr.GetLocal ();
if (addr.IsEqual (header.GetDestination ()))
{
if (j == iif)
{
NS_LOG_LOGIC ("For me (destination " << addr << " match)");
}
else
{
NS_LOG_LOGIC ("For me (destination " << addr << " match) on another interface " << header.GetDestination ());
}
lcb (p, header, iif);
return true;
}
if (header.GetDestination ().IsEqual (iaddr.GetBroadcast ()))
{
NS_LOG_LOGIC ("For me (interface broadcast address)");
lcb (p, header, iif);
return true;
}
NS_LOG_LOGIC ("Address "<< addr << " not a match");
}
}
// Check if input device supports IP forwarding
if (m_ipv4->IsForwarding (iif) == false)
{
NS_LOG_LOGIC ("Forwarding disabled for this interface");
ecb (p, header, Socket::ERROR_NOROUTETOHOST);
return false;
}
// Next, try to find a route
NS_LOG_LOGIC ("Unicast destination- looking up global route");
Ptr<Ipv4Route> rtentry = LookupGlobal (header.GetDestination ());
if (rtentry != 0)
{
NS_LOG_LOGIC ("Found unicast destination- calling unicast callback");
ucb (rtentry, p, header);
return true;
}
else
{
NS_LOG_LOGIC ("Did not find unicast destination- returning false");
return false; // Let other routing protocols try to handle this
// route request.
}
}
void
Ipv4GlobalRouting::NotifyInterfaceUp (uint32_t i)
{
+155 -15
View File
@@ -20,16 +20,26 @@
#ifndef IPV4_GLOBAL_ROUTING_H
#define IPV4_GLOBAL_ROUTING_H
#include <list>
#include <stdint.h>
#include "ns3/ipv4-address.h"
#include "ns3/ipv4-header.h"
#include "ns3/ptr.h"
#include "ns3/ipv4.h"
#include "ns3/ipv4-routing-protocol.h"
#include "ns3/random-variable.h"
namespace ns3 {
class Packet;
class NetDevice;
class Ipv4Interface;
class Ipv4Address;
class Ipv4Header;
class Ipv4RoutingTableEntry;
class Ipv4MulticastRoutingTableEntry;
class Node;
/**
* \brief Global routing protocol for IP version 4 stacks.
@@ -60,45 +70,175 @@ class Ipv4GlobalRouting : public Ipv4RoutingProtocol
{
public:
static TypeId GetTypeId (void);
/**
* \brief Construct an empty Ipv4GlobalRouting routing protocol,
*
* The Ipv4GlobalRouting class supports host and network unicast routes.
* This method initializes the lists containing these routes to empty.
*
* \see Ipv4GlobalRouting
*/
Ipv4GlobalRouting ();
virtual ~Ipv4GlobalRouting ();
// These methods inherited from base class
virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr);
virtual bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev,
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb);
virtual void NotifyInterfaceUp (uint32_t interface);
virtual void NotifyInterfaceDown (uint32_t interface);
virtual void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address);
virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address);
virtual void SetIpv4 (Ptr<Ipv4> ipv4);
virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const;
/**
* \brief Add a route to the global routing table.
* \brief Add a host route to the global routing table.
*
* \param dest The Ipv4Address destination for this route.
* \param destMask The Ipv4Mask to extract the network.
* \param nextHop The Ipv4Address of the next hop in the route.
* \param interface The network interface index used to send packets to the
* destination.
*
* \see Ipv4Address
*/
virtual void AddRouteTo (Ipv4Address dest,
Ipv4Mask destMask,
Ipv4Address nextHop,
uint32_t interface,
uint32_t metric=0) = 0;
void AddHostRouteTo (Ipv4Address dest,
Ipv4Address nextHop,
uint32_t interface);
/**
* \brief Add a host route to the global routing table.
*
* \param dest The Ipv4Address destination for this route.
* \param interface The network interface index used to send packets to the
* destination.
*
* \see Ipv4Address
*/
void AddHostRouteTo (Ipv4Address dest,
uint32_t interface);
/**
* \brief Function to remove all routes
*/
virtual void DeleteRoutes () = 0;
/**
* \brief Add a network route to the global routing table.
*
* \param network The Ipv4Address network for this route.
* \param networkMask The Ipv4Mask to extract the network.
* \param nextHop The next hop in the route to the destination network.
* \param interface The network interface index used to send packets to the
* destination.
*
* \see Ipv4Address
*/
void AddNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
Ipv4Address nextHop,
uint32_t interface);
/**
* \brief Add a network route to the global routing table.
*
* \param network The Ipv4Address network for this route.
* \param networkMask The Ipv4Mask to extract the network.
* \param interface The network interface index used to send packets to the
* destination.
*
* \see Ipv4Address
*/
void AddNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
uint32_t interface);
/**
* \brief Add an external route to the global routing table.
*
* \param network The Ipv4Address network for this route.
* \param networkMask The Ipv4Mask to extract the network.
* \param nextHop The next hop Ipv4Address
* \param interface The network interface index used to send packets to the
* destination.
*/
void AddASExternalRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
Ipv4Address nextHop,
uint32_t interface);
/**
* \brief Get the number of individual unicast routes that have been added
* to the routing table.
*
* \warning The default route counts as one of the routes.
*/
uint32_t GetNRoutes (void) const;
/**
* \brief Get a route from the global unicast routing table.
*
* Externally, the unicast global routing table appears simply as a table with
* n entries. The one subtlety of note is that if a default route has been set
* it will appear as the zeroth entry in the table. This means that if you
* add only a default route, the table will have one entry that can be accessed
* either by explicitly calling GetDefaultRoute () or by calling GetRoute (0).
*
* Similarly, if the default route has been set, calling RemoveRoute (0) will
* remove the default route.
*
* \param i The index (into the routing table) of the route to retrieve. If
* the default route has been set, it will occupy index zero.
* \return If route is set, a pointer to that Ipv4RoutingTableEntry is returned, otherwise
* a zero pointer is returned.
*
* \see Ipv4RoutingTableEntry
* \see Ipv4GlobalRouting::RemoveRoute
*/
Ipv4RoutingTableEntry *GetRoute (uint32_t i) const;
/**
* \brief Remove a route from the global unicast routing table.
*
* Externally, the unicast global routing table appears simply as a table with
* n entries. The one subtlety of note is that if a default route has been set
* it will appear as the zeroth entry in the table. This means that if the
* default route has been set, calling RemoveRoute (0) will remove the
* default route.
*
* \param i The index (into the routing table) of the route to remove. If
* the default route has been set, it will occupy index zero.
*
* \see Ipv4RoutingTableEntry
* \see Ipv4GlobalRouting::GetRoute
* \see Ipv4GlobalRouting::AddRoute
*/
void RemoveRoute (uint32_t i);
protected:
// virtual Ptr<Ipv4Route> LookupGlobal (Ipv4Address dest, Ptr<NetDevice> oif = 0) = 0;
Ptr<Ipv4> m_ipv4;
void DoDispose (void);
private:
/// Set to true if packets are randomly routed among ECMP; set to false for using only one route consistently
bool m_randomEcmpRouting;
/// Set to true if this interface should respond to interface events by globallly recomputing routes
bool m_respondToInterfaceEvents;
/// A uniform random number generator for randomly routing packets among ECMP
UniformVariable m_rand;
typedef std::list<Ipv4RoutingTableEntry *> HostRoutes;
typedef std::list<Ipv4RoutingTableEntry *>::const_iterator HostRoutesCI;
typedef std::list<Ipv4RoutingTableEntry *>::iterator HostRoutesI;
typedef std::list<Ipv4RoutingTableEntry *> NetworkRoutes;
typedef std::list<Ipv4RoutingTableEntry *>::const_iterator NetworkRoutesCI;
typedef std::list<Ipv4RoutingTableEntry *>::iterator NetworkRoutesI;
typedef std::list<Ipv4RoutingTableEntry *> ASExternalRoutes;
typedef std::list<Ipv4RoutingTableEntry *>::const_iterator ASExternalRoutesCI;
typedef std::list<Ipv4RoutingTableEntry *>::iterator ASExternalRoutesI;
Ptr<Ipv4Route> LookupGlobal (Ipv4Address dest, Ptr<NetDevice> oif = 0);
HostRoutes m_hostRoutes;
NetworkRoutes m_networkRoutes;
ASExternalRoutes m_ASexternalRoutes; // External routes imported
Ptr<Ipv4> m_ipv4;
};
} // Namespace ns3
+22 -50
View File
@@ -35,8 +35,7 @@ Ipv4RoutingTableEntry::Ipv4RoutingTableEntry (Ipv4RoutingTableEntry const &route
: m_dest (route.m_dest),
m_destNetworkMask (route.m_destNetworkMask),
m_gateway (route.m_gateway),
m_interface (route.m_interface),
m_metric (route.m_metric)
m_interface (route.m_interface)
{
}
@@ -44,53 +43,44 @@ Ipv4RoutingTableEntry::Ipv4RoutingTableEntry (Ipv4RoutingTableEntry const *route
: m_dest (route->m_dest),
m_destNetworkMask (route->m_destNetworkMask),
m_gateway (route->m_gateway),
m_interface (route->m_interface),
m_metric (route->m_metric)
m_interface (route->m_interface)
{
}
Ipv4RoutingTableEntry::Ipv4RoutingTableEntry (Ipv4Address dest,
Ipv4Address gateway,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
: m_dest (dest),
m_destNetworkMask (Ipv4Mask::GetOnes ()),
m_gateway (gateway),
m_interface (interface),
m_metric (metric)
m_interface (interface)
{
}
Ipv4RoutingTableEntry::Ipv4RoutingTableEntry (Ipv4Address dest,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
: m_dest (dest),
m_destNetworkMask (Ipv4Mask::GetOnes ()),
m_gateway (Ipv4Address::GetZero ()),
m_interface (interface),
m_metric (metric)
m_interface (interface)
{
}
Ipv4RoutingTableEntry::Ipv4RoutingTableEntry (Ipv4Address network,
Ipv4Mask networkMask,
Ipv4Address gateway,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
: m_dest (network),
m_destNetworkMask (networkMask),
m_gateway (gateway),
m_interface (interface),
m_metric (metric)
m_interface (interface)
{
}
Ipv4RoutingTableEntry::Ipv4RoutingTableEntry (Ipv4Address network,
Ipv4Mask networkMask,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
: m_dest (network),
m_destNetworkMask (networkMask),
m_gateway (Ipv4Address::GetZero ()),
m_interface (interface),
m_metric (metric)
m_interface (interface)
{
}
@@ -161,58 +151,41 @@ Ipv4RoutingTableEntry::GetInterface (void) const
return m_interface;
}
uint32_t
Ipv4RoutingTableEntry::GetMetric () const
{
return m_metric;
}
void
Ipv4RoutingTableEntry::SetMetric (uint32_t metric)
{
m_metric = metric;
}
Ipv4RoutingTableEntry
Ipv4RoutingTableEntry::CreateHostRouteTo (Ipv4Address dest,
Ipv4Address nextHop,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
{
return Ipv4RoutingTableEntry (dest, nextHop, interface, metric);
return Ipv4RoutingTableEntry (dest, nextHop, interface);
}
Ipv4RoutingTableEntry
Ipv4RoutingTableEntry::CreateHostRouteTo (Ipv4Address dest,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
{
return Ipv4RoutingTableEntry (dest, interface, metric);
return Ipv4RoutingTableEntry (dest, interface);
}
Ipv4RoutingTableEntry
Ipv4RoutingTableEntry::CreateNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
Ipv4Address nextHop,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
{
return Ipv4RoutingTableEntry (network, networkMask,
nextHop, interface, metric);
nextHop, interface);
}
Ipv4RoutingTableEntry
Ipv4RoutingTableEntry::CreateNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
{
return Ipv4RoutingTableEntry (network, networkMask,
interface, metric);
interface);
}
Ipv4RoutingTableEntry
Ipv4RoutingTableEntry::CreateDefaultRoute (Ipv4Address nextHop,
uint32_t interface,
uint32_t metric/*=0*/)
uint32_t interface)
{
return Ipv4RoutingTableEntry (Ipv4Address::GetZero (), nextHop, interface, metric);
return Ipv4RoutingTableEntry (Ipv4Address::GetZero (), nextHop, interface);
}
@@ -243,21 +216,20 @@ std::ostream& operator<< (std::ostream& os, Ipv4RoutingTableEntry const& route)
{
os << "network=" << route.GetDestNetwork () <<
", mask=" << route.GetDestNetworkMask () <<
", out=" << route.GetInterface () <<
",out=" << route.GetInterface () <<
", next hop=" << route.GetGateway ();
}
else
{
os << "network=" << route.GetDestNetwork () <<
", mask=" << route.GetDestNetworkMask () <<
", out=" << route.GetInterface ();
",out=" << route.GetInterface ();
}
}
else
{
NS_ASSERT (false);
}
os << ", metric=" << route.GetMetric ();
return os;
}
+9 -28
View File
@@ -88,15 +88,6 @@ public:
* \return The Ipv4 interface number used for sending outgoing packets
*/
uint32_t GetInterface (void) const;
/**
* \return Routing metric
*/
uint32_t GetMetric () const;
/**
* Set/Updates metric of the routing table entry
*/
void SetMetric (uint32_t metric);
/**
* \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
* \param dest Ipv4Address of the destination
@@ -105,16 +96,14 @@ public:
*/
static Ipv4RoutingTableEntry CreateHostRouteTo (Ipv4Address dest,
Ipv4Address nextHop,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
/**
* \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
* \param dest Ipv4Address of the destination
* \param interface Outgoing interface
*/
static Ipv4RoutingTableEntry CreateHostRouteTo (Ipv4Address dest,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
/**
* \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
* \param network Ipv4Address of the destination network
@@ -125,8 +114,7 @@ public:
static Ipv4RoutingTableEntry CreateNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
Ipv4Address nextHop,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
/**
* \return An Ipv4RoutingTableEntry object corresponding to the input parameters.
* \param network Ipv4Address of the destination network
@@ -135,8 +123,7 @@ public:
*/
static Ipv4RoutingTableEntry CreateNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
/**
* \return An Ipv4RoutingTableEntry object corresponding to the input
* parameters. This route is distinguished; it will match any
@@ -145,32 +132,26 @@ public:
* \param interface Outgoing interface
*/
static Ipv4RoutingTableEntry CreateDefaultRoute (Ipv4Address nextHop,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
private:
Ipv4RoutingTableEntry (Ipv4Address network,
Ipv4Mask mask,
Ipv4Address gateway,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
Ipv4RoutingTableEntry (Ipv4Address dest,
Ipv4Mask mask,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
Ipv4RoutingTableEntry (Ipv4Address dest,
Ipv4Address gateway,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
Ipv4RoutingTableEntry (Ipv4Address dest,
uint32_t interface,
uint32_t metric=0);
uint32_t interface);
Ipv4Address m_dest;
Ipv4Mask m_destNetworkMask;
Ipv4Address m_gateway;
uint32_t m_interface;
uint32_t m_metric;
};
std::ostream& operator<< (std::ostream& os, Ipv4RoutingTableEntry const& route);
+33 -36
View File
@@ -36,6 +36,8 @@
NS_LOG_COMPONENT_DEFINE ("Ipv4StaticRouting");
using std::make_pair;
namespace ns3 {
NS_OBJECT_ENSURE_REGISTERED (Ipv4StaticRouting);
@@ -68,9 +70,8 @@ Ipv4StaticRouting::AddNetworkRouteTo (Ipv4Address network,
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
nextHop,
interface,
metric);
m_networkRoutes.push_back (route);
interface);
m_networkRoutes.push_back (make_pair (route,metric));
}
void
@@ -83,9 +84,8 @@ Ipv4StaticRouting::AddNetworkRouteTo (Ipv4Address network,
Ipv4RoutingTableEntry *route = new Ipv4RoutingTableEntry ();
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
interface,
metric);
m_networkRoutes.push_back (route);
interface);
m_networkRoutes.push_back (make_pair (route,metric));
}
void
@@ -142,7 +142,7 @@ Ipv4StaticRouting::SetDefaultMulticastRoute (uint32_t outputInterface)
*route = Ipv4RoutingTableEntry::CreateNetworkRouteTo (network,
networkMask,
outputInterface);
m_networkRoutes.push_back (route);
m_networkRoutes.push_back (make_pair (route,0));
}
uint32_t
@@ -162,7 +162,7 @@ Ipv4StaticRouting::GetMulticastRoute (uint32_t index) const
if (index < m_multicastRoutes.size ())
{
uint32_t tmp = 0;
for (MulticastRoutes::const_iterator i = m_multicastRoutes.begin ();
for (MulticastRoutesCI i = m_multicastRoutes.begin ();
i != m_multicastRoutes.end ();
i++)
{
@@ -182,7 +182,7 @@ Ipv4StaticRouting::RemoveMulticastRoute (Ipv4Address origin,
uint32_t inputInterface)
{
NS_LOG_FUNCTION (this << origin << " " << group << " " << inputInterface);
for (MulticastRoutes::iterator i = m_multicastRoutes.begin ();
for (MulticastRoutesI i = m_multicastRoutes.begin ();
i != m_multicastRoutes.end ();
i++)
{
@@ -204,7 +204,7 @@ Ipv4StaticRouting::RemoveMulticastRoute (uint32_t index)
{
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (MulticastRoutes::iterator i = m_multicastRoutes.begin ();
for (MulticastRoutesI i = m_multicastRoutes.begin ();
i != m_multicastRoutes.end ();
i++)
{
@@ -239,12 +239,12 @@ Ipv4StaticRouting::LookupStatic (Ipv4Address dest, Ptr<NetDevice> oif)
}
for (NetworkRoutes::iterator i = m_networkRoutes.begin ();
for (NetworkRoutesI i = m_networkRoutes.begin ();
i != m_networkRoutes.end ();
i++)
{
Ipv4RoutingTableEntry *j=*i;
uint32_t metric =j->GetMetric ();
Ipv4RoutingTableEntry *j=i->first;
uint32_t metric =i->second;
Ipv4Mask mask = (j)->GetDestNetworkMask ();
uint16_t masklen = mask.GetPrefixLength ();
Ipv4Address entry = (j)->GetDestNetwork ();
@@ -305,7 +305,7 @@ Ipv4StaticRouting::LookupStatic (
NS_LOG_FUNCTION (this << origin << " " << group << " " << interface);
Ptr<Ipv4MulticastRoute> mrtentry = 0;
for (MulticastRoutes::iterator i = m_multicastRoutes.begin ();
for (MulticastRoutesI i = m_multicastRoutes.begin ();
i != m_multicastRoutes.end ();
i++)
{
@@ -363,13 +363,13 @@ Ipv4StaticRouting::GetDefaultRoute ()
Ipv4Address dest ("0.0.0.0");
uint32_t shortest_metric = 0xffffffff;
Ipv4RoutingTableEntry *result = 0;
for (NetworkRoutes::iterator i = m_networkRoutes.begin ();
for (NetworkRoutesI i = m_networkRoutes.begin ();
i != m_networkRoutes.end ();
i++)
{
Ipv4RoutingTableEntry *j = *i;
uint32_t metric = j->GetMetric ();
Ipv4Mask mask = j->GetDestNetworkMask ();
Ipv4RoutingTableEntry *j = i->first;
uint32_t metric = i->second;
Ipv4Mask mask = (j)->GetDestNetworkMask ();
uint16_t masklen = mask.GetPrefixLength ();
if (masklen != 0)
{
@@ -397,13 +397,13 @@ Ipv4StaticRouting::GetRoute (uint32_t index) const
{
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (NetworkRoutes::const_iterator j = m_networkRoutes.begin ();
for (NetworkRoutesCI j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j++)
{
if (tmp == index)
{
return *j;
return j->first;
}
tmp++;
}
@@ -417,13 +417,13 @@ Ipv4StaticRouting::GetMetric (uint32_t index) const
{
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (NetworkRoutes::const_iterator j = m_networkRoutes.begin ();
for (NetworkRoutesCI j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j++)
{
if (tmp == index)
{
return (*j)->GetMetric ();
return j->second;
}
tmp++;
}
@@ -436,13 +436,13 @@ Ipv4StaticRouting::RemoveRoute (uint32_t index)
{
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (NetworkRoutes::iterator j = m_networkRoutes.begin ();
for (NetworkRoutesI j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j++)
{
if (tmp == index)
{
delete *j;
delete j->first;
m_networkRoutes.erase (j);
return;
}
@@ -584,13 +584,13 @@ Ipv4StaticRouting::~Ipv4StaticRouting ()
void
Ipv4StaticRouting::DoDispose (void)
{
for (NetworkRoutes::iterator j = m_networkRoutes.begin ();
for (NetworkRoutesI j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j = m_networkRoutes.erase (j))
{
delete *j;
delete (j->first);
}
for (MulticastRoutes::iterator i = m_multicastRoutes.begin ();
for (MulticastRoutesI i = m_multicastRoutes.begin ();
i != m_multicastRoutes.end ();
i = m_multicastRoutes.erase (i))
{
@@ -708,18 +708,15 @@ Ipv4StaticRouting::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const
if (GetNRoutes () > 0)
{
*os << "Destination Gateway Genmask Flags Metric Ref Use Iface" << std::endl;
for (NetworkRoutes::const_iterator j = m_networkRoutes.begin ();
j != m_networkRoutes.end ();
j++)
for (uint32_t j = 0; j < GetNRoutes (); j++)
{
std::ostringstream dest, gw, mask, flags;
Ipv4RoutingTableEntry &route = *(*j);
dest << route.GetDest ();
Ipv4RoutingTableEntry route = GetRoute (j);
dest << route.GetDest ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << dest.str ();
gw << route.GetGateway ();
gw << route.GetGateway ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << gw.str ();
mask << route.GetDestNetworkMask ();
mask << route.GetDestNetworkMask ();
*os << std::setiosflags (std::ios::left) << std::setw (16) << mask.str ();
flags << "U";
if (route.IsHost ())
@@ -731,7 +728,7 @@ Ipv4StaticRouting::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const
flags << "GS";
}
*os << std::setiosflags (std::ios::left) << std::setw (6) << flags.str ();
*os << std::setiosflags (std::ios::left) << std::setw (6) << route.GetMetric ();
*os << std::setiosflags (std::ios::left) << std::setw (7) << GetMetric (j);
// Ref ct not implemented
*os << "-" << " ";
// Use not implemented
+5 -5
View File
@@ -375,13 +375,13 @@ protected:
virtual void DoDispose (void);
private:
typedef std::list<Ipv4RoutingTableEntry *> NetworkRoutes;
// typedef std::list<Ipv4RoutingTableEntry *>::const_iterator NetworkRoutesCI;
// typedef std::list<Ipv4RoutingTableEntry *>::iterator NetworkRoutesI;
typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> > NetworkRoutes;
typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> >::const_iterator NetworkRoutesCI;
typedef std::list<std::pair <Ipv4RoutingTableEntry *, uint32_t> >::iterator NetworkRoutesI;
typedef std::list<Ipv4MulticastRoutingTableEntry *> MulticastRoutes;
// typedef std::list<Ipv4MulticastRoutingTableEntry *>::const_iterator MulticastRoutesCI;
// typedef std::list<Ipv4MulticastRoutingTableEntry *>::iterator MulticastRoutesI;
typedef std::list<Ipv4MulticastRoutingTableEntry *>::const_iterator MulticastRoutesCI;
typedef std::list<Ipv4MulticastRoutingTableEntry *>::iterator MulticastRoutesI;
Ptr<Ipv4Route> LookupStatic (Ipv4Address dest, Ptr<NetDevice> oif = 0);
Ptr<Ipv4MulticastRoute> LookupStatic (Ipv4Address origin, Ipv4Address group,
-3
View File
@@ -93,7 +93,6 @@ def configure(conf):
def build(bld):
# bridge and mpi dependencies are due to global routing
obj = bld.create_ns3_module('internet', ['bridge', 'mpi', 'network', 'core'])
obj.source = [
'model/ip-l4-protocol.cc',
'model/udp-header.cc',
@@ -174,7 +173,6 @@ def build(bld):
'model/global-route-manager-impl.cc',
'model/candidate-queue.cc',
'model/ipv4-global-routing.cc',
'model/ipv4-global-routing-one-nexthop.cc',
'helper/ipv4-global-routing-helper.cc',
'helper/internet-stack-helper.cc',
'helper/internet-trace-helper.cc',
@@ -272,7 +270,6 @@ def build(bld):
'model/global-route-manager-impl.h',
'model/candidate-queue.h',
'model/ipv4-global-routing.h',
'model/ipv4-global-routing-one-nexthop.h',
'helper/ipv4-global-routing-helper.h',
'helper/internet-stack-helper.h',
'helper/internet-trace-helper.h',
+5 -5
View File
@@ -130,10 +130,10 @@ Ipv4Mask::GetInverse (void) const
void
Ipv4Mask::Print (std::ostream &os) const
{
os << (int)((m_mask >> 24) & 0xff) << "."
<< (int)((m_mask >> 16) & 0xff) << "."
<< (int)((m_mask >> 8) & 0xff) << "."
<< (int)((m_mask >> 0) & 0xff);
os << ((m_mask >> 24) & 0xff) << "."
<< ((m_mask >> 16) & 0xff) << "."
<< ((m_mask >> 8) & 0xff) << "."
<< ((m_mask >> 0) & 0xff);
}
@@ -183,7 +183,7 @@ Ipv4Address::Ipv4Address (char const *address)
m_address = AsciiToIpv4Host (address);
}
const uint32_t &
uint32_t
Ipv4Address::Get (void) const
{
return m_address;
+1 -2
View File
@@ -57,8 +57,7 @@ public:
* Get the host-order 32-bit IP address
* \return the host-order 32-bit IP address
*/
const uint32_t &
Get (void) const;
uint32_t Get (void) const;
/**
* input address is in host order.
* \param address The host order 32-bit address
-20
View File
@@ -1,20 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
-267
View File
@@ -1,267 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef _TRIE_H_
#define _TRIE_H_
#ifndef __GNUC__
#error "gcc is required to compile this code"
#else
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/pb_ds/tag_and_trait.hpp>
#if __GNUC__ < 4 || (__GNUC__==4 && __GNUC_MINOR__<=1)
#error "gcc version at least 4.1 is required to compile this code"
#elif (__GNUC__==4 && __GNUC_MINOR__<3)
#define PB_DS pb_ds
#else
#define PB_DS __gnu_pbds
#endif
#endif // __GNUC__
/**
* At least for now, trie implementation is based on gcc policy-based data containers
*
* Important!!! This trie simplifies/optimizes work with IPv4 prefixes.
* There is an assumption that nobody will use IP netmasks other than 255.255.255.0, 255.255.0.0, 255.0.0.0, or 0.0.0.0.
* As a result, branching happens on a byte level, not on bit a level.
*/
namespace ns3 {
/**
* \brief IPv4 version of element-access traits for patricia trie
*
* Refer to http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/trie_based_containers.html
*/
class Ipv4AddressTrieEAccessTraits
{
public:
// Size type.
typedef size_t size_type;
// Key type.
typedef Ipv4Address key_type;
// Const key reference type.
typedef const Ipv4Address & const_key_reference;
// Element const iterator type.
typedef const uint8_t * const_iterator;
// Element type.
typedef uint8_t e_type;
enum
{
min_e_val = 0,
max_e_val = 255,
max_size = max_e_val - min_e_val + 1
};
public:
// Returns a const_iterator to the first element of r_key.
inline static const_iterator
begin (const_key_reference r_key);
// Returns a const_iterator to the after-last element of r_key.
inline static const_iterator
end (const_key_reference r_key);
// Maps an element to a position.
inline static size_type
e_pos (e_type e);
};
Ipv4AddressTrieEAccessTraits::const_iterator
Ipv4AddressTrieEAccessTraits::begin (Ipv4AddressTrieEAccessTraits::const_key_reference r_key)
{
return reinterpret_cast<Ipv4AddressTrieEAccessTraits::const_iterator> (&r_key.Get ());
}
Ipv4AddressTrieEAccessTraits::const_iterator
Ipv4AddressTrieEAccessTraits::end (Ipv4AddressTrieEAccessTraits::const_key_reference r_key)
{
return sizeof (r_key.Get ()) + reinterpret_cast<Ipv4AddressTrieEAccessTraits::const_iterator> (&r_key.Get ());
}
Ipv4AddressTrieEAccessTraits::size_type
Ipv4AddressTrieEAccessTraits::e_pos (Ipv4AddressTrieEAccessTraits::e_type e)
{
return e;
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
#include <ext/pb_ds/detail/trie_policy/trie_policy_base.hpp>
#define PB_DS_BASE_C_DEC \
PB_DS::detail::trie_policy_base<Const_Node_Iterator,Node_Iterator,E_Access_Traits,Allocator>
template<typename Const_Node_Iterator,
class Node_Iterator,
class E_Access_Traits,
class Allocator>
class TrieLongestPrefixMatch : private PB_DS_BASE_C_DEC
{
private:
typedef PB_DS_BASE_C_DEC base_type;
public:
typedef typename base_type::key_type key_type;
typedef typename base_type::const_key_reference const_key_reference;
// Element access traits.
typedef E_Access_Traits e_access_traits;
// Const element iterator.
typedef typename e_access_traits::const_iterator const_e_iterator;
// Allocator type.
typedef Allocator allocator;
// Size type.
typedef typename allocator::size_type size_type;
typedef PB_DS::detail::null_node_metadata metadata_type;
typedef Const_Node_Iterator const_node_iterator;
typedef Node_Iterator node_iterator;
typedef typename const_node_iterator::value_type const_iterator;
typedef typename node_iterator::value_type iterator;
inline const_iterator
longest_prefix_match (const_key_reference r_key)
{
return longest_prefix_match (
get_e_access_traits().begin (r_key),
get_e_access_traits().end (r_key));
}
inline const_iterator
longest_prefix_match (typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e)
{
if (empty())
return (end());
node_iterator nd_it = node_begin ();
node_iterator end_nd_it = node_end ();
const e_access_traits& r_traits = get_e_access_traits ();
const size_type given_range_length = std::distance (b, e);
while (true)
{
if (nd_it == end_nd_it) return end ();
const size_type common_range_length =
base_type::common_prefix_len (nd_it, b, e, r_traits);
if (common_range_length >= given_range_length) // not sure what this condition is for...
{
return rightmost_it (nd_it);
}
nd_it = next_child (nd_it, b, e, end_nd_it, r_traits);
}
}
protected:
inline void
operator()(node_iterator node_it, const_node_iterator end_nd_it) const
{
}
private:
// Returns true if the container is empty.
virtual bool
empty() const = 0;
// Returns the const iterator associated with the just-after last element.
virtual const_iterator
end() const = 0;
// Returns the iterator associated with the just-after last element.
virtual iterator
end() = 0;
// Returns the const_node_iterator associated with the trie's root node.
virtual const_node_iterator
node_begin() const = 0;
// Returns the node_iterator associated with the trie's root node.
virtual node_iterator
node_begin() = 0;
// Returns the const_node_iterator associated with a just-after leaf node.
virtual const_node_iterator
node_end() const = 0;
// Returns the node_iterator associated with a just-after leaf node.
virtual node_iterator
node_end() = 0;
// Access to the cmp_fn object.
virtual const e_access_traits&
get_e_access_traits() const = 0;
node_iterator
next_child(node_iterator nd_it, const_e_iterator b, const_e_iterator e,
node_iterator end_nd_it, const e_access_traits &r_traits)
{
const size_type num_children = nd_it.num_children();
node_iterator ret = end_nd_it;
size_type max_length = 0;
for (size_type i = 0; i < num_children; ++i)
{
node_iterator pot = nd_it.get_child (i);
const size_type common_range_length =
PB_DS_BASE_C_DEC::common_prefix_len (pot, b, e, r_traits);
if (common_range_length > max_length)
{
ret = pot;
max_length = common_range_length;
}
}
return (ret);
}
};
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
template<class MappedValue>
class Ipv4AddressTrie : public PB_DS::trie<Ipv4Address,MappedValue,Ipv4AddressTrieEAccessTraits,
PB_DS::pat_trie_tag,TrieLongestPrefixMatch>
{
};
} // namespace ns3
#endif // _TRIE_H_
-1
View File
@@ -124,7 +124,6 @@ def build(bld):
'utils/simple-channel.h',
'utils/simple-net-device.h',
'utils/pcap-test.h',
'utils/trie.h',
'helper/application-container.h',
'helper/net-device-container.h',
'helper/node-container.h',
@@ -78,6 +78,8 @@ def register_types(module):
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::TopologyReader', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TopologyReader>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## nstime.h (module 'core'): ns3::Time [class]
@@ -87,7 +89,7 @@ def register_types(module):
## nstime.h (module 'core'): ns3::Time [class]
root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader [class]
module.add_class('TopologyReader', parent=root_module['ns3::Object'])
module.add_class('TopologyReader', parent=root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link [class]
module.add_class('Link', outer_class=root_module['ns3::TopologyReader'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
@@ -184,6 +186,7 @@ def register_methods(root_module):
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TopologyReader_methods(root_module, root_module['ns3::TopologyReader'])
@@ -374,9 +377,9 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
## ipv4-address.h (module 'network'): uint32_t const & ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t',
'uint32_t const &',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
@@ -1381,6 +1384,18 @@ def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > const & o) [copy constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter< ns3::TopologyReader > > const &', 'o')])
## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::Cleanup() [member function]
cls.add_method('Cleanup',
'void',
[],
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -1561,11 +1576,6 @@ def register_Ns3TopologyReader_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::TopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## topology-reader.h (module 'topology-read'): std::_List_const_iterator<ns3::TopologyReader::Link> ns3::TopologyReader::LinksBegin() const [member function]
cls.add_method('LinksBegin',
'std::_List_const_iterator< ns3::TopologyReader::Link >',
@@ -1600,6 +1610,8 @@ def register_Ns3TopologyReader_methods(root_module, cls):
def register_Ns3TopologyReaderLink_methods(root_module, cls):
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::TopologyReader::Link const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TopologyReader::Link const &', 'arg0')])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link() [constructor]
cls.add_constructor([])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::Ptr<ns3::Node> fromPtr, std::string const & fromName, ns3::Ptr<ns3::Node> toPtr, std::string const & toName) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'fromPtr'), param('std::string const &', 'fromName'), param('ns3::Ptr< ns3::Node >', 'toPtr'), param('std::string const &', 'toName')])
## topology-reader.h (module 'topology-read'): std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::TopologyReader::Link::AttributesBegin() [member function]
@@ -1620,6 +1632,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'bool',
[param('std::string const &', 'name'), param('std::string &', 'value')],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetFromNetDevice() const [member function]
cls.add_method('GetFromNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetFromNode() const [member function]
cls.add_method('GetFromNode',
'ns3::Ptr< ns3::Node >',
@@ -1630,6 +1647,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetToNetDevice() const [member function]
cls.add_method('GetToNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetToNode() const [member function]
cls.add_method('GetToNode',
'ns3::Ptr< ns3::Node >',
@@ -1644,6 +1666,10 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string const &', 'name'), param('std::string const &', 'value')])
## topology-reader.h (module 'topology-read'): void ns3::TopologyReader::Link::SetNetDevices(ns3::Ptr<ns3::NetDevice> from, ns3::Ptr<ns3::NetDevice> to) [member function]
cls.add_method('SetNetDevices',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'from'), param('ns3::Ptr< ns3::NetDevice >', 'to')])
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
@@ -1834,11 +1860,6 @@ def register_Ns3EmptyAttributeValue_methods(root_module, cls):
return
def register_Ns3InetTopologyReader_methods(root_module, cls):
## inet-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::InetTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## inet-topology-reader.h (module 'topology-read'): ns3::InetTopologyReader::InetTopologyReader() [constructor]
cls.add_constructor([])
## inet-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::InetTopologyReader::Read() [member function]
@@ -2224,11 +2245,6 @@ def register_Ns3Node_methods(root_module, cls):
return
def register_Ns3OrbisTopologyReader_methods(root_module, cls):
## orbis-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::OrbisTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## orbis-topology-reader.h (module 'topology-read'): ns3::OrbisTopologyReader::OrbisTopologyReader() [constructor]
cls.add_constructor([])
## orbis-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::OrbisTopologyReader::Read() [member function]
@@ -2239,11 +2255,6 @@ def register_Ns3OrbisTopologyReader_methods(root_module, cls):
return
def register_Ns3RocketfuelTopologyReader_methods(root_module, cls):
## rocketfuel-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::RocketfuelTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::RocketfuelTopologyReader::RocketfuelTopologyReader() [constructor]
cls.add_constructor([])
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::RocketfuelTopologyReader::Read() [member function]
@@ -78,6 +78,8 @@ def register_types(module):
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::TopologyReader', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TopologyReader>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## nstime.h (module 'core'): ns3::Time [class]
@@ -87,7 +89,7 @@ def register_types(module):
## nstime.h (module 'core'): ns3::Time [class]
root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader [class]
module.add_class('TopologyReader', parent=root_module['ns3::Object'])
module.add_class('TopologyReader', parent=root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link [class]
module.add_class('Link', outer_class=root_module['ns3::TopologyReader'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
@@ -184,6 +186,7 @@ def register_methods(root_module):
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TopologyReader_methods(root_module, root_module['ns3::TopologyReader'])
@@ -374,9 +377,9 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
## ipv4-address.h (module 'network'): uint32_t const & ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t',
'uint32_t const &',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
@@ -1381,6 +1384,18 @@ def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > const & o) [copy constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter< ns3::TopologyReader > > const &', 'o')])
## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::Cleanup() [member function]
cls.add_method('Cleanup',
'void',
[],
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -1561,11 +1576,6 @@ def register_Ns3TopologyReader_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::TopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## topology-reader.h (module 'topology-read'): std::_List_const_iterator<ns3::TopologyReader::Link> ns3::TopologyReader::LinksBegin() const [member function]
cls.add_method('LinksBegin',
'std::_List_const_iterator< ns3::TopologyReader::Link >',
@@ -1600,6 +1610,8 @@ def register_Ns3TopologyReader_methods(root_module, cls):
def register_Ns3TopologyReaderLink_methods(root_module, cls):
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::TopologyReader::Link const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TopologyReader::Link const &', 'arg0')])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link() [constructor]
cls.add_constructor([])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::Ptr<ns3::Node> fromPtr, std::string const & fromName, ns3::Ptr<ns3::Node> toPtr, std::string const & toName) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'fromPtr'), param('std::string const &', 'fromName'), param('ns3::Ptr< ns3::Node >', 'toPtr'), param('std::string const &', 'toName')])
## topology-reader.h (module 'topology-read'): std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::TopologyReader::Link::AttributesBegin() [member function]
@@ -1620,6 +1632,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'bool',
[param('std::string const &', 'name'), param('std::string &', 'value')],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetFromNetDevice() const [member function]
cls.add_method('GetFromNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetFromNode() const [member function]
cls.add_method('GetFromNode',
'ns3::Ptr< ns3::Node >',
@@ -1630,6 +1647,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetToNetDevice() const [member function]
cls.add_method('GetToNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetToNode() const [member function]
cls.add_method('GetToNode',
'ns3::Ptr< ns3::Node >',
@@ -1644,6 +1666,10 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string const &', 'name'), param('std::string const &', 'value')])
## topology-reader.h (module 'topology-read'): void ns3::TopologyReader::Link::SetNetDevices(ns3::Ptr<ns3::NetDevice> from, ns3::Ptr<ns3::NetDevice> to) [member function]
cls.add_method('SetNetDevices',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'from'), param('ns3::Ptr< ns3::NetDevice >', 'to')])
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
@@ -1834,11 +1860,6 @@ def register_Ns3EmptyAttributeValue_methods(root_module, cls):
return
def register_Ns3InetTopologyReader_methods(root_module, cls):
## inet-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::InetTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## inet-topology-reader.h (module 'topology-read'): ns3::InetTopologyReader::InetTopologyReader() [constructor]
cls.add_constructor([])
## inet-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::InetTopologyReader::Read() [member function]
@@ -2224,11 +2245,6 @@ def register_Ns3Node_methods(root_module, cls):
return
def register_Ns3OrbisTopologyReader_methods(root_module, cls):
## orbis-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::OrbisTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## orbis-topology-reader.h (module 'topology-read'): ns3::OrbisTopologyReader::OrbisTopologyReader() [constructor]
cls.add_constructor([])
## orbis-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::OrbisTopologyReader::Read() [member function]
@@ -2239,11 +2255,6 @@ def register_Ns3OrbisTopologyReader_methods(root_module, cls):
return
def register_Ns3RocketfuelTopologyReader_methods(root_module, cls):
## rocketfuel-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::RocketfuelTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::RocketfuelTopologyReader::RocketfuelTopologyReader() [constructor]
cls.add_constructor([])
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::RocketfuelTopologyReader::Read() [member function]
+34 -2
View File
@@ -313,17 +313,20 @@ PrintHelp (const char *program_name)
<< std::endl
<< "Options:" << std::endl
<< " --help : print these options" << std::endl
<< " --output-text : format output as plain text" << std::endl;
<< " --output-text : format output as plain text" << std::endl
<< " --group <group> : print information only for this group" << std::endl;
}
int main (int argc, char *argv[])
{
bool outputText = false;
char *programName = argv[0];
std::string group = "";
argv++;
argc--;
while (*argv != 0)
while (argc > 0 && *argv != 0)
{
char *arg = *argv;
@@ -336,6 +339,17 @@ int main (int argc, char *argv[])
{
outputText = true;
}
else if (strcmp(arg, "--group") == 0)
{
argv ++;
argc --;
if (argc == 0 || argv == 0)
{
PrintHelp (programName);
return 0;
}
group = *argv;
}
else
{
// un-recognized command-line argument
@@ -343,6 +357,7 @@ int main (int argc, char *argv[])
return 0;
}
argv++;
argc--;
}
if (outputText)
@@ -432,6 +447,11 @@ int main (int argc, char *argv[])
continue;
}
if (group != "" && tid.GetGroupName () != group)
{
continue;
}
// Capitalize all of letters in the name so that it sorts
// correctly in the map.
std::string name = tid.GetName ();
@@ -530,6 +550,12 @@ int main (int argc, char *argv[])
{
continue;
}
if (group != "" && tid.GetGroupName () != group)
{
continue;
}
std::cout << boldStart << tid.GetName () << boldStop << breakHtmlOnly << std::endl
<< listStart << std::endl;
for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
@@ -552,6 +578,12 @@ int main (int argc, char *argv[])
{
continue;
}
if (group != "" && tid.GetGroupName () != group)
{
continue;
}
std::cout << boldStart << tid.GetName () << boldStop << breakHtmlOnly << std::endl
<< listStart << std::endl;
for (uint32_t j = 0; j < tid.GetAttributeN (); ++j)