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

(-)a/src/flow-monitor/model/ipv4-flow-probe.cc (+25 lines)
 Lines 252-257   Ipv4FlowProbe::Ipv4FlowProbe (Ptr<FlowMonitor> monitor, Link Here 
252
      NS_FATAL_ERROR ("trace fail");
252
      NS_FATAL_ERROR ("trace fail");
253
    }
253
    }
254
254
255
  std::ostringstream qd;
256
  qd << "/NodeList/" << node->GetId () << "/$ns3::TrafficControlLayer/RootQueueDiscList/*/Drop";
257
  Config::ConnectWithoutContext (qd.str (), MakeCallback (&Ipv4FlowProbe::QueueDiscDropLogger, Ptr<Ipv4FlowProbe> (this)));
258
255
  // code copied from point-to-point-helper.cc
259
  // code copied from point-to-point-helper.cc
256
  std::ostringstream oss;
260
  std::ostringstream oss;
257
  oss << "/NodeList/" << node->GetId () << "/DeviceList/*/TxQueue/Drop";
261
  oss << "/NodeList/" << node->GetId () << "/DeviceList/*/TxQueue/Drop";
 Lines 463-468   Ipv4FlowProbe::QueueDropLogger (Ptr<const Packet> ipPayload) Link Here 
463
  m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE);
467
  m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE);
464
}
468
}
465
469
470
void
471
Ipv4FlowProbe::QueueDiscDropLogger (Ptr<const QueueItem> item)
472
{
473
  Ipv4FlowProbeTag fTag;
474
  bool tagFound = item->GetPacket ()->FindFirstMatchingByteTag (fTag);
475
476
  if (!tagFound)
477
    {
478
      return;
479
    }
480
481
  FlowId flowId = fTag.GetFlowId ();
482
  FlowPacketId packetId = fTag.GetPacketId ();
483
  uint32_t size = fTag.GetPacketSize ();
484
485
  NS_LOG_DEBUG ("Drop ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<", " << DROP_QUEUE_DISC
486
                        << "); ");
487
488
  m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE_DISC);
489
}
490
466
} // namespace ns3
491
} // namespace ns3
467
492
468
493
(-)a/src/flow-monitor/model/ipv4-flow-probe.h (+6 lines)
 Lines 70-75   public: Link Here 
70
    /// PointToPoint devices, but not with WiFi or WiMax.
70
    /// PointToPoint devices, but not with WiFi or WiMax.
71
    DROP_QUEUE,
71
    DROP_QUEUE,
72
72
73
    /// Packet dropped by the queue disc
74
    DROP_QUEUE_DISC,
75
73
    DROP_INTERFACE_DOWN,   /**< Interface is down so can not send packet */
76
    DROP_INTERFACE_DOWN,   /**< Interface is down so can not send packet */
74
    DROP_ROUTE_ERROR,   /**< Route error */
77
    DROP_ROUTE_ERROR,   /**< Route error */
75
    DROP_FRAGMENT_TIMEOUT, /**< Fragment timeout exceeded */
78
    DROP_FRAGMENT_TIMEOUT, /**< Fragment timeout exceeded */
 Lines 108-113   private: Link Here 
108
  /// Log a packet being dropped by a queue
111
  /// Log a packet being dropped by a queue
109
  /// \param ipPayload IP payload
112
  /// \param ipPayload IP payload
110
  void QueueDropLogger (Ptr<const Packet> ipPayload);
113
  void QueueDropLogger (Ptr<const Packet> ipPayload);
114
  /// Log a packet being dropped by a queue disc
115
  /// \param item queue item
116
  void QueueDiscDropLogger (Ptr<const QueueItem> item);
111
117
112
  Ptr<Ipv4FlowClassifier> m_classifier; //!< the Ipv4FlowClassifier this probe is associated with
118
  Ptr<Ipv4FlowClassifier> m_classifier; //!< the Ipv4FlowClassifier this probe is associated with
113
  Ptr<Ipv4L3Protocol> m_ipv4; //!< the Ipv4L3Protocol this probe is bound to
119
  Ptr<Ipv4L3Protocol> m_ipv4; //!< the Ipv4L3Protocol this probe is bound to
(-)a/src/flow-monitor/model/ipv6-flow-probe.cc (+25 lines)
 Lines 222-227   Ipv6FlowProbe::Ipv6FlowProbe (Ptr<FlowMonitor> monitor, Link Here 
222
      NS_FATAL_ERROR ("trace fail");
222
      NS_FATAL_ERROR ("trace fail");
223
    }
223
    }
224
224
225
  std::ostringstream qd;
226
  qd << "/NodeList/" << node->GetId () << "/$ns3::TrafficControlLayer/RootQueueDiscList/*/Drop";
227
  Config::ConnectWithoutContext (qd.str (), MakeCallback (&Ipv6FlowProbe::QueueDiscDropLogger, Ptr<Ipv6FlowProbe> (this)));
228
225
  // code copied from point-to-point-helper.cc
229
  // code copied from point-to-point-helper.cc
226
  std::ostringstream oss;
230
  std::ostringstream oss;
227
  oss << "/NodeList/" << node->GetId () << "/DeviceList/*/TxQueue/Drop";
231
  oss << "/NodeList/" << node->GetId () << "/DeviceList/*/TxQueue/Drop";
 Lines 407-412   Ipv6FlowProbe::QueueDropLogger (Ptr<const Packet> ipPayload) Link Here 
407
  m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE);
411
  m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE);
408
}
412
}
409
413
414
void
415
Ipv6FlowProbe::QueueDiscDropLogger (Ptr<const QueueItem> item)
416
{
417
  Ipv6FlowProbeTag fTag;
418
  bool tagFound = item->GetPacket ()->FindFirstMatchingByteTag (fTag);
419
420
  if (!tagFound)
421
    {
422
      return;
423
    }
424
425
  FlowId flowId = fTag.GetFlowId ();
426
  FlowPacketId packetId = fTag.GetPacketId ();
427
  uint32_t size = fTag.GetPacketSize ();
428
429
  NS_LOG_DEBUG ("Drop ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<", " << DROP_QUEUE_DISC
430
                        << "); ");
431
432
  m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE_DISC);
433
}
434
410
} // namespace ns3
435
} // namespace ns3
411
436
412
437
(-)a/src/flow-monitor/model/ipv6-flow-probe.h (+6 lines)
 Lines 71-76   public: Link Here 
71
    /// PointToPoint devices, but not with WiFi or WiMax.
71
    /// PointToPoint devices, but not with WiFi or WiMax.
72
    DROP_QUEUE,
72
    DROP_QUEUE,
73
73
74
    /// Packet dropped by the queue disc
75
    DROP_QUEUE_DISC,
76
74
    DROP_INTERFACE_DOWN,   /**< Interface is down so can not send packet */
77
    DROP_INTERFACE_DOWN,   /**< Interface is down so can not send packet */
75
    DROP_ROUTE_ERROR,   /**< Route error */
78
    DROP_ROUTE_ERROR,   /**< Route error */
76
79
 Lines 114-119   private: Link Here 
114
  /// Log a packet being dropped by a queue
117
  /// Log a packet being dropped by a queue
115
  /// \param ipPayload IP payload
118
  /// \param ipPayload IP payload
116
  void QueueDropLogger (Ptr<const Packet> ipPayload);
119
  void QueueDropLogger (Ptr<const Packet> ipPayload);
120
  /// Log a packet being dropped by a queue disc
121
  /// \param item queue item
122
  void QueueDiscDropLogger (Ptr<const QueueItem> item);
117
123
118
  Ptr<Ipv6FlowClassifier> m_classifier; //!< the Ipv6FlowClassifier this probe is associated with
124
  Ptr<Ipv6FlowClassifier> m_classifier; //!< the Ipv6FlowClassifier this probe is associated with
119
};
125
};

Return to bug 2479