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

(-)a/src/aodv/bindings/modulegen__gcc_ILP32.py (-4 / +25 lines)
 Lines 142-147    Link Here 
142
    module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
142
    module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
143
    ## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
143
    ## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
144
    module.add_class('TagBuffer', import_from_module='ns.network')
144
    module.add_class('TagBuffer', import_from_module='ns.network')
145
    ## nstime.h (module 'core'): ns3::TimeWithUnit [class]
146
    module.add_class('TimeWithUnit', import_from_module='ns.core')
145
    ## timer.h (module 'core'): ns3::Timer [class]
147
    ## timer.h (module 'core'): ns3::Timer [class]
146
    module.add_class('Timer', import_from_module='ns.core')
148
    module.add_class('Timer', import_from_module='ns.core')
147
    ## timer.h (module 'core'): ns3::Timer::DestroyPolicy [enumeration]
149
    ## timer.h (module 'core'): ns3::Timer::DestroyPolicy [enumeration]
 Lines 494-499    Link Here 
494
    register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
496
    register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
495
    register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
497
    register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
496
    register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
498
    register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
499
    register_Ns3TimeWithUnit_methods(root_module, root_module['ns3::TimeWithUnit'])
497
    register_Ns3Timer_methods(root_module, root_module['ns3::Timer'])
500
    register_Ns3Timer_methods(root_module, root_module['ns3::Timer'])
498
    register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl'])
501
    register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl'])
499
    register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
502
    register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
 Lines 2452-2457    Link Here 
2452
                   [param('uint8_t', 'v')])
2455
                   [param('uint8_t', 'v')])
2453
    return
2456
    return
2454
2457
2458
def register_Ns3TimeWithUnit_methods(root_module, cls):
2459
    cls.add_output_stream_operator()
2460
    ## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::TimeWithUnit const & arg0) [copy constructor]
2461
    cls.add_constructor([param('ns3::TimeWithUnit const &', 'arg0')])
2462
    ## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::Time const time, ns3::Time::Unit const unit) [constructor]
2463
    cls.add_constructor([param('ns3::Time const', 'time'), param('ns3::Time::Unit const', 'unit')])
2464
    return
2465
2455
def register_Ns3Timer_methods(root_module, cls):
2466
def register_Ns3Timer_methods(root_module, cls):
2456
    ## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer const & arg0) [copy constructor]
2467
    ## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer const & arg0) [copy constructor]
2457
    cls.add_constructor([param('ns3::Timer const &', 'arg0')])
2468
    cls.add_constructor([param('ns3::Timer const &', 'arg0')])
 Lines 2733-2739    Link Here 
2733
    return
2744
    return
2734
2745
2735
def register_Ns3Int64x64_t_methods(root_module, cls):
2746
def register_Ns3Int64x64_t_methods(root_module, cls):
2736
    cls.add_binary_comparison_operator('<=')
2737
    cls.add_binary_comparison_operator('!=')
2747
    cls.add_binary_comparison_operator('!=')
2738
    cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
2748
    cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
2739
    cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
2749
    cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
 Lines 2747-2752    Link Here 
2747
    cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
2757
    cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
2748
    cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
2758
    cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
2749
    cls.add_output_stream_operator()
2759
    cls.add_output_stream_operator()
2760
    cls.add_binary_comparison_operator('<=')
2750
    cls.add_binary_comparison_operator('==')
2761
    cls.add_binary_comparison_operator('==')
2751
    cls.add_binary_comparison_operator('>=')
2762
    cls.add_binary_comparison_operator('>=')
2752
    ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor]
2763
    ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor]
 Lines 3956-3962    Link Here 
3956
    return
3967
    return
3957
3968
3958
def register_Ns3Time_methods(root_module, cls):
3969
def register_Ns3Time_methods(root_module, cls):
3959
    cls.add_binary_comparison_operator('<=')
3960
    cls.add_binary_comparison_operator('!=')
3970
    cls.add_binary_comparison_operator('!=')
3961
    cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
3971
    cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
3962
    cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
3972
    cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
 Lines 3967-3972    Link Here 
3967
    cls.add_binary_comparison_operator('>')
3977
    cls.add_binary_comparison_operator('>')
3968
    cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
3978
    cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
3969
    cls.add_output_stream_operator()
3979
    cls.add_output_stream_operator()
3980
    cls.add_binary_comparison_operator('<=')
3970
    cls.add_binary_comparison_operator('==')
3981
    cls.add_binary_comparison_operator('==')
3971
    cls.add_binary_comparison_operator('>=')
3982
    cls.add_binary_comparison_operator('>=')
3972
    ## nstime.h (module 'core'): ns3::Time::Time() [constructor]
3983
    ## nstime.h (module 'core'): ns3::Time::Time() [constructor]
 Lines 3991-3996    Link Here 
3991
    cls.add_constructor([param('std::string const &', 's')])
4002
    cls.add_constructor([param('std::string const &', 's')])
3992
    ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor]
4003
    ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor]
3993
    cls.add_constructor([param('ns3::int64x64_t const &', 'value')])
4004
    cls.add_constructor([param('ns3::int64x64_t const &', 'value')])
4005
    ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function]
4006
    cls.add_method('As', 
4007
                   'ns3::TimeWithUnit', 
4008
                   [param('ns3::Time::Unit const', 'unit')], 
4009
                   is_const=True)
3994
    ## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function]
4010
    ## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function]
3995
    cls.add_method('Compare', 
4011
    cls.add_method('Compare', 
3996
                   'int', 
4012
                   'int', 
 Lines 5867-5872    Link Here 
5867
                   'bool', 
5883
                   'bool', 
5868
                   [param('uint32_t', 'i')], 
5884
                   [param('uint32_t', 'i')], 
5869
                   is_const=True, is_virtual=True)
5885
                   is_const=True, is_virtual=True)
5886
    ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUnicast(ns3::Ipv4Address ad) const [member function]
5887
    cls.add_method('IsUnicast', 
5888
                   'bool', 
5889
                   [param('ns3::Ipv4Address', 'ad')], 
5890
                   is_const=True)
5870
    ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function]
5891
    ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function]
5871
    cls.add_method('IsUp', 
5892
    cls.add_method('IsUp', 
5872
                   'bool', 
5893
                   'bool', 
 Lines 6854-6863    Link Here 
6854
                   'uint32_t', 
6875
                   'uint32_t', 
6855
                   [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], 
6876
                   [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], 
6856
                   is_const=True)
6877
                   is_const=True)
6857
    ## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> arg0) [member function]
6878
    ## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> nixVector) [member function]
6858
    cls.add_method('SetNixVector', 
6879
    cls.add_method('SetNixVector', 
6859
                   'void', 
6880
                   'void', 
6860
                   [param('ns3::Ptr< ns3::NixVector >', 'arg0')])
6881
                   [param('ns3::Ptr< ns3::NixVector >', 'nixVector')])
6861
    return
6882
    return
6862
6883
6863
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
6884
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
(-)a/src/aodv/bindings/modulegen__gcc_LP64.py (-4 / +25 lines)
 Lines 142-147    Link Here 
142
    module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
142
    module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
143
    ## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
143
    ## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
144
    module.add_class('TagBuffer', import_from_module='ns.network')
144
    module.add_class('TagBuffer', import_from_module='ns.network')
145
    ## nstime.h (module 'core'): ns3::TimeWithUnit [class]
146
    module.add_class('TimeWithUnit', import_from_module='ns.core')
145
    ## timer.h (module 'core'): ns3::Timer [class]
147
    ## timer.h (module 'core'): ns3::Timer [class]
146
    module.add_class('Timer', import_from_module='ns.core')
148
    module.add_class('Timer', import_from_module='ns.core')
147
    ## timer.h (module 'core'): ns3::Timer::DestroyPolicy [enumeration]
149
    ## timer.h (module 'core'): ns3::Timer::DestroyPolicy [enumeration]
 Lines 494-499    Link Here 
494
    register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
496
    register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
495
    register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
497
    register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
496
    register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
498
    register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
499
    register_Ns3TimeWithUnit_methods(root_module, root_module['ns3::TimeWithUnit'])
497
    register_Ns3Timer_methods(root_module, root_module['ns3::Timer'])
500
    register_Ns3Timer_methods(root_module, root_module['ns3::Timer'])
498
    register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl'])
501
    register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl'])
499
    register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
502
    register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
 Lines 2452-2457    Link Here 
2452
                   [param('uint8_t', 'v')])
2455
                   [param('uint8_t', 'v')])
2453
    return
2456
    return
2454
2457
2458
def register_Ns3TimeWithUnit_methods(root_module, cls):
2459
    cls.add_output_stream_operator()
2460
    ## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::TimeWithUnit const & arg0) [copy constructor]
2461
    cls.add_constructor([param('ns3::TimeWithUnit const &', 'arg0')])
2462
    ## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::Time const time, ns3::Time::Unit const unit) [constructor]
2463
    cls.add_constructor([param('ns3::Time const', 'time'), param('ns3::Time::Unit const', 'unit')])
2464
    return
2465
2455
def register_Ns3Timer_methods(root_module, cls):
2466
def register_Ns3Timer_methods(root_module, cls):
2456
    ## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer const & arg0) [copy constructor]
2467
    ## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer const & arg0) [copy constructor]
2457
    cls.add_constructor([param('ns3::Timer const &', 'arg0')])
2468
    cls.add_constructor([param('ns3::Timer const &', 'arg0')])
 Lines 2733-2739    Link Here 
2733
    return
2744
    return
2734
2745
2735
def register_Ns3Int64x64_t_methods(root_module, cls):
2746
def register_Ns3Int64x64_t_methods(root_module, cls):
2736
    cls.add_binary_comparison_operator('<=')
2737
    cls.add_binary_comparison_operator('!=')
2747
    cls.add_binary_comparison_operator('!=')
2738
    cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
2748
    cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
2739
    cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
2749
    cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
 Lines 2747-2752    Link Here 
2747
    cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
2757
    cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
2748
    cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
2758
    cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
2749
    cls.add_output_stream_operator()
2759
    cls.add_output_stream_operator()
2760
    cls.add_binary_comparison_operator('<=')
2750
    cls.add_binary_comparison_operator('==')
2761
    cls.add_binary_comparison_operator('==')
2751
    cls.add_binary_comparison_operator('>=')
2762
    cls.add_binary_comparison_operator('>=')
2752
    ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor]
2763
    ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor]
 Lines 3956-3962    Link Here 
3956
    return
3967
    return
3957
3968
3958
def register_Ns3Time_methods(root_module, cls):
3969
def register_Ns3Time_methods(root_module, cls):
3959
    cls.add_binary_comparison_operator('<=')
3960
    cls.add_binary_comparison_operator('!=')
3970
    cls.add_binary_comparison_operator('!=')
3961
    cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
3971
    cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
3962
    cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
3972
    cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
 Lines 3967-3972    Link Here 
3967
    cls.add_binary_comparison_operator('>')
3977
    cls.add_binary_comparison_operator('>')
3968
    cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
3978
    cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
3969
    cls.add_output_stream_operator()
3979
    cls.add_output_stream_operator()
3980
    cls.add_binary_comparison_operator('<=')
3970
    cls.add_binary_comparison_operator('==')
3981
    cls.add_binary_comparison_operator('==')
3971
    cls.add_binary_comparison_operator('>=')
3982
    cls.add_binary_comparison_operator('>=')
3972
    ## nstime.h (module 'core'): ns3::Time::Time() [constructor]
3983
    ## nstime.h (module 'core'): ns3::Time::Time() [constructor]
 Lines 3991-3996    Link Here 
3991
    cls.add_constructor([param('std::string const &', 's')])
4002
    cls.add_constructor([param('std::string const &', 's')])
3992
    ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor]
4003
    ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor]
3993
    cls.add_constructor([param('ns3::int64x64_t const &', 'value')])
4004
    cls.add_constructor([param('ns3::int64x64_t const &', 'value')])
4005
    ## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function]
4006
    cls.add_method('As', 
4007
                   'ns3::TimeWithUnit', 
4008
                   [param('ns3::Time::Unit const', 'unit')], 
4009
                   is_const=True)
3994
    ## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function]
4010
    ## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function]
3995
    cls.add_method('Compare', 
4011
    cls.add_method('Compare', 
3996
                   'int', 
4012
                   'int', 
 Lines 5867-5872    Link Here 
5867
                   'bool', 
5883
                   'bool', 
5868
                   [param('uint32_t', 'i')], 
5884
                   [param('uint32_t', 'i')], 
5869
                   is_const=True, is_virtual=True)
5885
                   is_const=True, is_virtual=True)
5886
    ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUnicast(ns3::Ipv4Address ad) const [member function]
5887
    cls.add_method('IsUnicast', 
5888
                   'bool', 
5889
                   [param('ns3::Ipv4Address', 'ad')], 
5890
                   is_const=True)
5870
    ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function]
5891
    ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function]
5871
    cls.add_method('IsUp', 
5892
    cls.add_method('IsUp', 
5872
                   'bool', 
5893
                   'bool', 
 Lines 6854-6863    Link Here 
6854
                   'uint32_t', 
6875
                   'uint32_t', 
6855
                   [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], 
6876
                   [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], 
6856
                   is_const=True)
6877
                   is_const=True)
6857
    ## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> arg0) [member function]
6878
    ## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> nixVector) [member function]
6858
    cls.add_method('SetNixVector', 
6879
    cls.add_method('SetNixVector', 
6859
                   'void', 
6880
                   'void', 
6860
                   [param('ns3::Ptr< ns3::NixVector >', 'arg0')])
6881
                   [param('ns3::Ptr< ns3::NixVector >', 'nixVector')])
6861
    return
6882
    return
6862
6883
6863
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
6884
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
(-)a/src/aodv/model/aodv-routing-protocol.cc (-6 / +95 lines)
 Lines 283-288    Link Here 
283
      iter->first->Close ();
283
      iter->first->Close ();
284
    }
284
    }
285
  m_socketAddresses.clear ();
285
  m_socketAddresses.clear ();
286
  for (std::map<Ptr<Socket>, Ipv4InterfaceAddress>::iterator iter =
287
         m_socketSubnetBroadcastAddresses.begin (); iter != m_socketSubnetBroadcastAddresses.end (); iter++)
288
    {
289
      iter->first->Close ();
290
    }
291
  m_socketSubnetBroadcastAddresses.clear ();
286
  Ipv4RoutingProtocol::DoDispose ();
292
  Ipv4RoutingProtocol::DoDispose ();
287
}
293
}
288
294
 Lines 613-630    Link Here 
613
                                             UdpSocketFactory::GetTypeId ());
619
                                             UdpSocketFactory::GetTypeId ());
614
  NS_ASSERT (socket != 0);
620
  NS_ASSERT (socket != 0);
615
  socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
621
  socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
622
  socket->Bind (InetSocketAddress (iface.GetLocal (), AODV_PORT));
616
  socket->BindToNetDevice (l3->GetNetDevice (i));
623
  socket->BindToNetDevice (l3->GetNetDevice (i));
617
  socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT));
618
  socket->SetAllowBroadcast (true);
624
  socket->SetAllowBroadcast (true);
619
  socket->SetAttribute ("IpTtl", UintegerValue (1));
625
  socket->SetAttribute ("IpTtl", UintegerValue (1));
620
  m_socketAddresses.insert (std::make_pair (socket, iface));
626
  m_socketAddresses.insert (std::make_pair (socket, iface));
621
627
628
  // create also a subnet broadcast socket
629
  socket = Socket::CreateSocket (GetObject<Node> (),
630
                                               UdpSocketFactory::GetTypeId ());
631
  NS_ASSERT (socket != 0);
632
  socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
633
  socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT));
634
  socket->BindToNetDevice (l3->GetNetDevice (i));
635
  socket->SetAllowBroadcast (true);
636
  socket->SetAttribute ("IpTtl", UintegerValue (1));
637
  m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface));
638
622
  // Add local broadcast record to the routing table
639
  // Add local broadcast record to the routing table
623
  Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
640
  Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
624
  RoutingTableEntry rt (/*device=*/ dev, /*dst=*/ iface.GetBroadcast (), /*know seqno=*/ true, /*seqno=*/ 0, /*iface=*/ iface,
641
  RoutingTableEntry rt (/*device=*/ dev, /*dst=*/ iface.GetBroadcast (), /*know seqno=*/ true, /*seqno=*/ 0, /*iface=*/ iface,
625
                                    /*hops=*/ 1, /*next hop=*/ iface.GetBroadcast (), /*lifetime=*/ Simulator::GetMaximumSimulationTime ());
642
                                    /*hops=*/ 1, /*next hop=*/ iface.GetBroadcast (), /*lifetime=*/ Simulator::GetMaximumSimulationTime ());
626
  m_routingTable.AddRoute (rt);
643
  m_routingTable.AddRoute (rt);
627
644
645
  if (l3->GetInterface (i)->GetArpCache ())
646
   {
647
     m_nb.AddArpCache (l3->GetInterface (i)->GetArpCache ());
648
   }
649
628
  // Allow neighbor manager use this interface for layer 2 feedback if possible
650
  // Allow neighbor manager use this interface for layer 2 feedback if possible
629
  Ptr<WifiNetDevice> wifi = dev->GetObject<WifiNetDevice> ();
651
  Ptr<WifiNetDevice> wifi = dev->GetObject<WifiNetDevice> ();
630
  if (wifi == 0)
652
  if (wifi == 0)
 Lines 634-640    Link Here 
634
    return;
656
    return;
635
657
636
  mac->TraceConnectWithoutContext ("TxErrHeader", m_nb.GetTxErrorCallback ());
658
  mac->TraceConnectWithoutContext ("TxErrHeader", m_nb.GetTxErrorCallback ());
637
  m_nb.AddArpCache (l3->GetInterface (i)->GetArpCache ());
638
}
659
}
639
660
640
void
661
void
 Lines 662-667    Link Here 
662
  NS_ASSERT (socket);
683
  NS_ASSERT (socket);
663
  socket->Close ();
684
  socket->Close ();
664
  m_socketAddresses.erase (socket);
685
  m_socketAddresses.erase (socket);
686
687
  // Close socket
688
  socket = FindSubnetBroadcastSocketWithInterfaceAddress (m_ipv4->GetAddress (i, 0));
689
  NS_ASSERT (socket);
690
  socket->Close ();
691
  m_socketSubnetBroadcastAddresses.erase (socket);
692
665
  if (m_socketAddresses.empty ())
693
  if (m_socketAddresses.empty ())
666
    {
694
    {
667
      NS_LOG_LOGIC ("No aodv interfaces");
695
      NS_LOG_LOGIC ("No aodv interfaces");
 Lines 693-704    Link Here 
693
                                                     UdpSocketFactory::GetTypeId ());
721
                                                     UdpSocketFactory::GetTypeId ());
694
          NS_ASSERT (socket != 0);
722
          NS_ASSERT (socket != 0);
695
          socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv,this));
723
          socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv,this));
724
          socket->Bind (InetSocketAddress (iface.GetLocal (), AODV_PORT));
696
          socket->BindToNetDevice (l3->GetNetDevice (i));
725
          socket->BindToNetDevice (l3->GetNetDevice (i));
697
          // Bind to any IP address so that broadcasts can be received
698
          socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT));
699
          socket->SetAllowBroadcast (true);
726
          socket->SetAllowBroadcast (true);
700
          m_socketAddresses.insert (std::make_pair (socket, iface));
727
          m_socketAddresses.insert (std::make_pair (socket, iface));
701
728
729
          // create also a subnet directed broadcast socket
730
          socket = Socket::CreateSocket (GetObject<Node> (),
731
                                                       UdpSocketFactory::GetTypeId ());
732
          NS_ASSERT (socket != 0);
733
          socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
734
          socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT));
735
          socket->BindToNetDevice (l3->GetNetDevice (i));
736
          socket->SetAllowBroadcast (true);
737
          socket->SetAttribute ("IpTtl", UintegerValue (1));
738
          m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface));
739
702
          // Add local broadcast record to the routing table
740
          // Add local broadcast record to the routing table
703
          Ptr<NetDevice> dev = m_ipv4->GetNetDevice (
741
          Ptr<NetDevice> dev = m_ipv4->GetNetDevice (
704
              m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
742
              m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
 Lines 722-728    Link Here 
722
  if (socket)
760
  if (socket)
723
    {
761
    {
724
      m_routingTable.DeleteAllRoutesFromInterface (address);
762
      m_routingTable.DeleteAllRoutesFromInterface (address);
763
      socket->Close ();
725
      m_socketAddresses.erase (socket);
764
      m_socketAddresses.erase (socket);
765
766
      Ptr<Socket> unicastSocket = FindSubnetBroadcastSocketWithInterfaceAddress (address);
767
      if (unicastSocket)
768
        {
769
          unicastSocket->Close ();
770
          m_socketAddresses.erase (unicastSocket);
771
        }
772
726
      Ptr<Ipv4L3Protocol> l3 = m_ipv4->GetObject<Ipv4L3Protocol> ();
773
      Ptr<Ipv4L3Protocol> l3 = m_ipv4->GetObject<Ipv4L3Protocol> ();
727
      if (l3->GetNAddresses (i))
774
      if (l3->GetNAddresses (i))
728
        {
775
        {
 Lines 733-742    Link Here 
733
          NS_ASSERT (socket != 0);
780
          NS_ASSERT (socket != 0);
734
          socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
781
          socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
735
          // Bind to any IP address so that broadcasts can be received
782
          // Bind to any IP address so that broadcasts can be received
736
          socket->Bind (InetSocketAddress (Ipv4Address::GetAny (), AODV_PORT));
783
          socket->Bind (InetSocketAddress (iface.GetLocal (), AODV_PORT));
784
          socket->BindToNetDevice (l3->GetNetDevice (i));
737
          socket->SetAllowBroadcast (true);
785
          socket->SetAllowBroadcast (true);
786
          socket->SetAttribute ("IpTtl", UintegerValue (1));
738
          m_socketAddresses.insert (std::make_pair (socket, iface));
787
          m_socketAddresses.insert (std::make_pair (socket, iface));
739
788
789
          // create also a unicast socket
790
          socket = Socket::CreateSocket (GetObject<Node> (),
791
                                                       UdpSocketFactory::GetTypeId ());
792
          NS_ASSERT (socket != 0);
793
          socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvAodv, this));
794
          socket->Bind (InetSocketAddress (iface.GetBroadcast (), AODV_PORT));
795
          socket->BindToNetDevice (l3->GetNetDevice (i));
796
          socket->SetAllowBroadcast (true);
797
          socket->SetAttribute ("IpTtl", UintegerValue (1));
798
          m_socketSubnetBroadcastAddresses.insert (std::make_pair (socket, iface));
799
740
          // Add local broadcast record to the routing table
800
          // Add local broadcast record to the routing table
741
          Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
801
          Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
742
          RoutingTableEntry rt (/*device=*/ dev, /*dst=*/ iface.GetBroadcast (), /*know seqno=*/ true, /*seqno=*/ 0, /*iface=*/ iface,
802
          RoutingTableEntry rt (/*device=*/ dev, /*dst=*/ iface.GetBroadcast (), /*know seqno=*/ true, /*seqno=*/ 0, /*iface=*/ iface,
 Lines 937-943    Link Here 
937
  Ptr<Packet> packet = socket->RecvFrom (sourceAddress);
997
  Ptr<Packet> packet = socket->RecvFrom (sourceAddress);
938
  InetSocketAddress inetSourceAddr = InetSocketAddress::ConvertFrom (sourceAddress);
998
  InetSocketAddress inetSourceAddr = InetSocketAddress::ConvertFrom (sourceAddress);
939
  Ipv4Address sender = inetSourceAddr.GetIpv4 ();
999
  Ipv4Address sender = inetSourceAddr.GetIpv4 ();
940
  Ipv4Address receiver = m_socketAddresses[socket].GetLocal ();
1000
  Ipv4Address receiver;
1001
1002
  if (m_socketAddresses.find (socket) != m_socketAddresses.end ())
1003
    {
1004
      receiver = m_socketAddresses[socket].GetLocal ();
1005
    }
1006
  else if(m_socketSubnetBroadcastAddresses.find (socket) != m_socketSubnetBroadcastAddresses.end ())
1007
    {
1008
      receiver = m_socketSubnetBroadcastAddresses[socket].GetLocal ();
1009
    }
1010
  else
1011
    {
1012
      NS_ASSERT_MSG (false, "Received a packet from an unknown socket");
1013
    }
941
  NS_LOG_DEBUG ("AODV node " << this << " received a AODV packet from " << sender << " to " << receiver);
1014
  NS_LOG_DEBUG ("AODV node " << this << " received a AODV packet from " << sender << " to " << receiver);
942
1015
943
  UpdateRouteToNeighbor (sender, receiver);
1016
  UpdateRouteToNeighbor (sender, receiver);
 Lines 1832-1836    Link Here 
1832
  return socket;
1905
  return socket;
1833
}
1906
}
1834
1907
1908
Ptr<Socket>
1909
RoutingProtocol::FindSubnetBroadcastSocketWithInterfaceAddress (Ipv4InterfaceAddress addr ) const
1910
{
1911
  NS_LOG_FUNCTION (this << addr);
1912
  for (std::map<Ptr<Socket>, Ipv4InterfaceAddress>::const_iterator j =
1913
         m_socketSubnetBroadcastAddresses.begin (); j != m_socketSubnetBroadcastAddresses.end (); ++j)
1914
    {
1915
      Ptr<Socket> socket = j->first;
1916
      Ipv4InterfaceAddress iface = j->second;
1917
      if (iface == addr)
1918
        return socket;
1919
    }
1920
  Ptr<Socket> socket;
1921
  return socket;
1835
}
1922
}
1923
1836
}
1924
}
1925
}
(-)a/src/aodv/model/aodv-routing-protocol.h (-2 / +6 lines)
 Lines 140-147    Link Here 
140
140
141
  /// IP protocol
141
  /// IP protocol
142
  Ptr<Ipv4> m_ipv4;
142
  Ptr<Ipv4> m_ipv4;
143
  /// Raw socket per each IP interface, map socket -> iface address (IP + mask)
143
  /// Raw unicast socket per each IP interface, map socket -> iface address (IP + mask)
144
  std::map< Ptr<Socket>, Ipv4InterfaceAddress > m_socketAddresses;
144
  std::map< Ptr<Socket>, Ipv4InterfaceAddress > m_socketAddresses;
145
  /// Raw subnet directed broadcast socket per each IP interface, map socket -> iface address (IP + mask)
146
  std::map< Ptr<Socket>, Ipv4InterfaceAddress > m_socketSubnetBroadcastAddresses;
145
  /// Loopback device used to defer RREQ until packet will be fully formed
147
  /// Loopback device used to defer RREQ until packet will be fully formed
146
  Ptr<NetDevice> m_lo; 
148
  Ptr<NetDevice> m_lo; 
147
149
 Lines 191-198    Link Here 
191
  void UpdateRouteToNeighbor (Ipv4Address sender, Ipv4Address receiver);
193
  void UpdateRouteToNeighbor (Ipv4Address sender, Ipv4Address receiver);
192
  /// Check that packet is send from own interface
194
  /// Check that packet is send from own interface
193
  bool IsMyOwnAddress (Ipv4Address src);
195
  bool IsMyOwnAddress (Ipv4Address src);
194
  /// Find socket with local interface address iface
196
  /// Find unicast socket with local interface address iface
195
  Ptr<Socket> FindSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const;
197
  Ptr<Socket> FindSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const;
198
  /// Find subnet directed broadcast socket with local interface address iface
199
  Ptr<Socket> FindSubnetBroadcastSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const;
196
  /// Process hello message
200
  /// Process hello message
197
  void ProcessHello (RrepHeader const & rrepHeader, Ipv4Address receiverIfaceAddr);
201
  void ProcessHello (RrepHeader const & rrepHeader, Ipv4Address receiverIfaceAddr);
198
  /// Create loopback route for given header
202
  /// Create loopback route for given header

Return to bug 1911