src/routing/aodv/aodv-routing-protocol.cc
changeset 5711 4bdbf97344a9
parent 5708 55abd6e61f17
child 5717 4c67658e54af
equal deleted inserted replaced
5710:802e547277d0 5711:4bdbf97344a9
   446   m_socketAddresses.insert (std::make_pair (socket, iface));
   446   m_socketAddresses.insert (std::make_pair (socket, iface));
   447 
   447 
   448   // Add local broadcast record to the routing table
   448   // Add local broadcast record to the routing table
   449   Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
   449   Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
   450   RoutingTableEntry rt (/*device=*/dev, /*dst=*/iface.GetBroadcast (), /*know seqno=*/true, /*seqno=*/0, /*iface=*/iface,
   450   RoutingTableEntry rt (/*device=*/dev, /*dst=*/iface.GetBroadcast (), /*know seqno=*/true, /*seqno=*/0, /*iface=*/iface,
   451                         /*hops=*/1, /*next hop=*/iface.GetBroadcast (), /*lifetime=*/Seconds (1e9));
   451                         /*hops=*/1, /*next hop=*/iface.GetBroadcast (), /*lifetime=*/Simulator::GetMaximumSimulationTime ());
   452   m_routingTable.AddRoute (rt);
   452   m_routingTable.AddRoute (rt);
   453   
   453   
   454   // Allow neighbor manager use this interface for layer 2 feedback if possible
   454   // Allow neighbor manager use this interface for layer 2 feedback if possible
   455   Ptr<WifiNetDevice> wifi = dev->GetObject<WifiNetDevice> ();
   455   Ptr<WifiNetDevice> wifi = dev->GetObject<WifiNetDevice> ();
   456   if (wifi == 0)
   456   if (wifi == 0)
   526           // Add local broadcast record to the routing table
   526           // Add local broadcast record to the routing table
   527           Ptr<NetDevice> dev = m_ipv4->GetNetDevice (
   527           Ptr<NetDevice> dev = m_ipv4->GetNetDevice (
   528               m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
   528               m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
   529           RoutingTableEntry rt (/*device=*/dev, /*dst=*/iface.GetBroadcast (), /*know seqno=*/true,
   529           RoutingTableEntry rt (/*device=*/dev, /*dst=*/iface.GetBroadcast (), /*know seqno=*/true,
   530                                 /*seqno=*/0, /*iface=*/iface, /*hops=*/1,
   530                                 /*seqno=*/0, /*iface=*/iface, /*hops=*/1,
   531                                 /*next hop=*/iface.GetBroadcast (), /*lifetime=*/Seconds (1e9));
   531                                 /*next hop=*/iface.GetBroadcast (), /*lifetime=*/Simulator::GetMaximumSimulationTime ());
   532           m_routingTable.AddRoute (rt);
   532           m_routingTable.AddRoute (rt);
   533         }
   533         }
   534     }
   534     }
   535   else
   535   else
   536     {
   536     {
   561           m_socketAddresses.insert (std::make_pair (socket, iface));
   561           m_socketAddresses.insert (std::make_pair (socket, iface));
   562 
   562 
   563           // Add local broadcast record to the routing table
   563           // Add local broadcast record to the routing table
   564           Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
   564           Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (iface.GetLocal ()));
   565           RoutingTableEntry rt (/*device=*/dev, /*dst=*/iface.GetBroadcast (), /*know seqno=*/true, /*seqno=*/0, /*iface=*/iface,
   565           RoutingTableEntry rt (/*device=*/dev, /*dst=*/iface.GetBroadcast (), /*know seqno=*/true, /*seqno=*/0, /*iface=*/iface,
   566                                 /*hops=*/1, /*next hop=*/iface.GetBroadcast (), /*lifetime=*/Seconds (1e9));
   566                                 /*hops=*/1, /*next hop=*/iface.GetBroadcast (), /*lifetime=*/Simulator::GetMaximumSimulationTime ());
   567           m_routingTable.AddRoute (rt);
   567           m_routingTable.AddRoute (rt);
   568         }
   568         }
   569       if (m_socketAddresses.empty ())
   569       if (m_socketAddresses.empty ())
   570         {
   570         {
   571           NS_LOG_LOGIC ("No aodv interfaces");
   571           NS_LOG_LOGIC ("No aodv interfaces");