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

(-)a/src/routing/olsr/olsr-routing-protocol.cc (-4 / +32 lines)
 Lines 140-146    Link Here 
140
namespace ns3 {
140
namespace ns3 {
141
namespace olsr {
141
namespace olsr {
142
142
143
NS_LOG_COMPONENT_DEFINE ("OlsrAgent");
143
NS_LOG_COMPONENT_DEFINE ("OlsrRoutingProtocol");
144
144
145
145
146
/********** OLSR class **********/
146
/********** OLSR class **********/
 Lines 2641-2652    Link Here 
2641
      rtentry->SetOutputDevice (m_ipv4->GetNetDevice (interfaceIdx));
2641
      rtentry->SetOutputDevice (m_ipv4->GetNetDevice (interfaceIdx));
2642
      sockerr = Socket::ERROR_NOTERROR;
2642
      sockerr = Socket::ERROR_NOTERROR;
2643
      NS_LOG_DEBUG ("Olsr node " << m_mainAddress 
2643
      NS_LOG_DEBUG ("Olsr node " << m_mainAddress 
2644
                    << ": RouteRequest for dest=" << header.GetDestination ()
2644
                    << ": RouteOutput for dest=" << header.GetDestination ()
2645
                    << " --> nextHop=" << entry2.nextAddr
2645
                    << " --> nextHop=" << entry2.nextAddr
2646
                    << " interface=" << entry2.interface);      NS_LOG_DEBUG ("Found route to " << rtentry->GetDestination () << " via nh " << rtentry->GetGateway () << " with source addr " << rtentry->GetSource () << " and output dev " << rtentry->GetOutputDevice());
2646
                    << " interface=" << entry2.interface);      NS_LOG_DEBUG ("Found route to " << rtentry->GetDestination () << " via nh " << rtentry->GetGateway () << " with source addr " << rtentry->GetSource () << " and output dev " << rtentry->GetOutputDevice());
2647
    }
2647
    }
2648
  else
2648
  else
2649
    { 
2649
    { 
2650
      NS_LOG_DEBUG ("Olsr node " << m_mainAddress 
2651
                    << ": RouteOutput for dest=" << header.GetDestination ()
2652
                    << " No route to host");
2650
      sockerr = Socket::ERROR_NOROUTETOHOST;
2653
      sockerr = Socket::ERROR_NOROUTETOHOST;
2651
    }
2654
    }
2652
  return rtentry;
2655
  return rtentry;
 Lines 2706-2712    Link Here 
2706
      rtentry->SetOutputDevice (m_ipv4->GetNetDevice (interfaceIdx));
2709
      rtentry->SetOutputDevice (m_ipv4->GetNetDevice (interfaceIdx));
2707
      
2710
      
2708
      NS_LOG_DEBUG ("Olsr node " << m_mainAddress
2711
      NS_LOG_DEBUG ("Olsr node " << m_mainAddress
2709
                    << ": RouteRequest for dest=" << header.GetDestination ()
2712
                    << ": RouteInput for dest=" << header.GetDestination ()
2710
                    << " --> nextHop=" << entry2.nextAddr
2713
                    << " --> nextHop=" << entry2.nextAddr
2711
                    << " interface=" << entry2.interface);
2714
                    << " interface=" << entry2.interface);
2712
      
2715
      
 Lines 2717-2723    Link Here 
2717
    {
2720
    {
2718
#ifdef NS3_LOG_ENABLE
2721
#ifdef NS3_LOG_ENABLE
2719
      NS_LOG_DEBUG ("Olsr node " << m_mainAddress 
2722
      NS_LOG_DEBUG ("Olsr node " << m_mainAddress 
2720
                    << ": RouteRequest for dest=" << header.GetDestination ()
2723
                    << ": RouteInput for dest=" << header.GetDestination ()
2721
                    << " --> NOT FOUND; ** Dumping routing table...");      for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator iter = m_table.begin ();
2724
                    << " --> NOT FOUND; ** Dumping routing table...");      for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator iter = m_table.begin ();
2722
           iter != m_table.end (); iter++)
2725
           iter != m_table.end (); iter++)
2723
        {           NS_LOG_DEBUG ("dest=" << iter->first << " --> next=" << iter->second.nextAddr                 
2726
        {           NS_LOG_DEBUG ("dest=" << iter->first << " --> next=" << iter->second.nextAddr                 
 Lines 2956-2961    Link Here 
2956
  return false;
2959
  return false;
2957
}
2960
}
2958
2961
2962
void
2963
RoutingProtocol::Dump (void)
2964
{
2965
#ifdef NS3_LOG_ENABLE
2966
  NS_LOG_DEBUG ("Dumping for node with main address " << m_mainAddress);
2967
  NS_LOG_DEBUG (" Neighbor set");
2968
  for (NeighborSet::const_iterator iter = m_state.GetNeighbors ().begin ();
2969
         iter != m_state.GetNeighbors ().end (); iter++)
2970
    {
2971
      NS_LOG_DEBUG ("  " << iter->neighborMainAddr << " status:" << iter->status << " willingness:" << (int) iter->willingness);
2972
    }
2973
  NS_LOG_DEBUG (" Two-hop neighbor set");
2974
  for (TwoHopNeighborSet::const_iterator iter = m_state.GetTwoHopNeighbors ().begin ();
2975
         iter != m_state.GetTwoHopNeighbors ().end (); iter++)
2976
    {
2977
      NS_LOG_DEBUG ("  " << iter->neighborMainAddr << "->" << iter->twoHopNeighborAddr);
2978
    }
2979
  NS_LOG_DEBUG (" Routing table");
2980
  for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator iter = m_table.begin (); iter != m_table.end (); iter++)
2981
    {
2982
      NS_LOG_DEBUG ("  dest=" << iter->first << " --> next=" << iter->second.nextAddr << " via interface " << iter->second.interface);
2983
    }
2984
  NS_LOG_DEBUG ("");
2985
#endif  //NS3_LOG_ENABLE
2986
}
2959
2987
2960
}} // namespace olsr, ns3
2988
}} // namespace olsr, ns3
2961
2989
(-)a/src/routing/olsr/olsr-routing-protocol.h (+2 lines)
 Lines 81-86    Link Here 
81
81
82
  void SetMainInterface (uint32_t interface);
82
  void SetMainInterface (uint32_t interface);
83
83
84
  void Dump (void);
85
84
protected:
86
protected:
85
  virtual void DoStart (void);
87
  virtual void DoStart (void);
86
private:
88
private:
(-)a/src/routing/olsr/olsr.h (-2 / +2 lines)
 Lines 49-58    Link Here 
49
 * node); or ns3::OlsrHelper::InstallAll (void);
49
 * node); or ns3::OlsrHelper::InstallAll (void);
50
 *
50
 *
51
 * In addition, the behavior of OLSR can be modified by changing certain
51
 * In addition, the behavior of OLSR can be modified by changing certain
52
 * attributes.  The method ns3::OlsrHelper::SetAgent () can be used
52
 * attributes.  The method ns3::OlsrHelper::Set () can be used
53
 * to set OLSR attributes.  These include HelloInterval, TcInterval,
53
 * to set OLSR attributes.  These include HelloInterval, TcInterval,
54
 * MidInterval, Willingness.  Other parameters are defined as macros
54
 * MidInterval, Willingness.  Other parameters are defined as macros
55
 * in olsr-agent-impl.cc.
55
 * in olsr-routing-protocol.cc.
56
 */
56
 */
57
57
58
58

Return to bug 780