disable tracing; fix ifIndex assignment
authorTom Henderson <tomh@tomh.org>
Fri, 27 Jul 2007 14:43:56 -0700
changeset 99044a604ad18cc
parent 989 baeb6102ea71
child 991 e05514a93564
disable tracing; fix ifIndex assignment
examples/csma-cd-one-subnet.cc
     1.1 --- a/examples/csma-cd-one-subnet.cc	Fri Jul 27 14:40:50 2007 -0700
     1.2 +++ b/examples/csma-cd-one-subnet.cc	Fri Jul 27 14:43:56 2007 -0700
     1.3 @@ -71,11 +71,12 @@
     1.4  
     1.5    // Users may find it convenient to turn on explicit debugging
     1.6    // for selected modules; the below lines suggest how to do this
     1.7 +  DebugComponentEnable("CsmaCdNetDevice");
     1.8 +  DebugComponentEnable("Ipv4L3Protocol");
     1.9 +  DebugComponentEnable("NetDevice");
    1.10  #if 0 
    1.11    DebugComponentEnable("Channel");
    1.12    DebugComponentEnable("CsmaCdChannel");
    1.13 -  DebugComponentEnable("CsmaCdNetDevice");
    1.14 -  DebugComponentEnable("NetDevice");
    1.15    DebugComponentEnable("PacketSocket");
    1.16  #endif
    1.17  
    1.18 @@ -103,27 +104,27 @@
    1.19      CsmaCdTopology::CreateCsmaCdChannel(
    1.20        DataRate(5000000), MilliSeconds(2));
    1.21  
    1.22 -  CsmaCdIpv4Topology::AddIpv4CsmaCdNode (n0, channel0, 
    1.23 +  uint32_t n0ifIndex = CsmaCdIpv4Topology::AddIpv4CsmaCdNode (n0, channel0, 
    1.24                                           MacAddress("10:54:23:54:23:50"));
    1.25 -  CsmaCdIpv4Topology::AddIpv4CsmaCdNode (n1, channel0,
    1.26 +  uint32_t n1ifIndex = CsmaCdIpv4Topology::AddIpv4CsmaCdNode (n1, channel0,
    1.27                                           MacAddress("10:54:23:54:23:51"));
    1.28 -  CsmaCdIpv4Topology::AddIpv4CsmaCdNode (n2, channel0,
    1.29 +  uint32_t n2ifIndex = CsmaCdIpv4Topology::AddIpv4CsmaCdNode (n2, channel0,
    1.30                                           MacAddress("10:54:23:54:23:52"));
    1.31 -  CsmaCdIpv4Topology::AddIpv4CsmaCdNode (n3, channel0,
    1.32 +  uint32_t n3ifIndex = CsmaCdIpv4Topology::AddIpv4CsmaCdNode (n3, channel0,
    1.33                                           MacAddress("10:54:23:54:23:53"));
    1.34  
    1.35    // Later, we add IP addresses.  
    1.36    CsmaCdIpv4Topology::AddIpv4Address (
    1.37 -      n0, 1, Ipv4Address("10.1.1.1"), Ipv4Mask("255.255.255.0"));
    1.38 +      n0, n0ifIndex, Ipv4Address("10.1.1.1"), Ipv4Mask("255.255.255.0"));
    1.39  
    1.40    CsmaCdIpv4Topology::AddIpv4Address (
    1.41 -      n1, 1, Ipv4Address("10.1.1.2"), Ipv4Mask("255.255.255.0"));
    1.42 +      n1, n1ifIndex, Ipv4Address("10.1.1.2"), Ipv4Mask("255.255.255.0"));
    1.43  
    1.44    CsmaCdIpv4Topology::AddIpv4Address (
    1.45 -      n2, 1, Ipv4Address("10.1.1.3"), Ipv4Mask("255.255.255.0"));
    1.46 +      n2, n2ifIndex, Ipv4Address("10.1.1.3"), Ipv4Mask("255.255.255.0"));
    1.47    
    1.48    CsmaCdIpv4Topology::AddIpv4Address (
    1.49 -      n3, 1, Ipv4Address("10.1.1.4"), Ipv4Mask("255.255.255.0"));
    1.50 +      n3, n3ifIndex, Ipv4Address("10.1.1.4"), Ipv4Mask("255.255.255.0"));
    1.51  
    1.52  
    1.53    // Create the OnOff application to send UDP datagrams of size
    1.54 @@ -154,8 +155,8 @@
    1.55   
    1.56    // Configure tracing of all enqueue, dequeue, and NetDevice receive events
    1.57    // Trace output will be sent to the csma-cd-one-subnet.tr file
    1.58 -  AsciiTrace asciitrace ("csma-cd-one-subnet.tr");
    1.59 -  asciitrace.TraceAllNetDeviceRx ();
    1.60 + // AsciiTrace asciitrace ("csma-cd-one-subnet.tr");
    1.61 +//  asciitrace.TraceAllNetDeviceRx ();
    1.62    //  asciitrace.TraceAllQueues ();
    1.63  
    1.64    Simulator::Run ();