helper class to be used by the visualizer More...
#include <pyviz.h>
Classes | |
struct | LastPacketsSample |
struct | NetDeviceStatistics |
struct | NodeStatistics |
struct | PacketCaptureOptions |
struct | PacketDropSample |
struct | PacketSample |
struct | RxPacketSample |
struct | TransmissionSample |
struct | TransmissionSampleKey |
struct | TransmissionSampleValue |
struct | TxPacketSample |
struct | TxRecordValue |
Public Types | |
enum | PacketCaptureMode { PACKET_CAPTURE_DISABLED =1, PACKET_CAPTURE_FILTER_HEADERS_OR, PACKET_CAPTURE_FILTER_HEADERS_AND } |
typedef std::vector< PacketDropSample > | PacketDropSampleList |
typedef std::vector< TransmissionSample > | TransmissionSampleList |
Public Member Functions | |
PyViz () | |
~PyViz () | |
LastPacketsSample | GetLastPackets (uint32_t nodeId) const |
std::vector< NodeStatistics > | GetNodesStatistics () const |
PacketDropSampleList | GetPacketDropSamples () const |
std::vector< std::string > | GetPauseMessages () const |
TransmissionSampleList | GetTransmissionSamples () const |
void | RegisterCsmaLikeDevice (std::string const &deviceTypeName) |
void | RegisterDropTracePath (std::string const &tracePath) |
void | RegisterPointToPointLikeDevice (std::string const &deviceTypeName) |
void | RegisterWifiLikeDevice (std::string const &deviceTypeName) |
void | SetNodesOfInterest (std::set< uint32_t > nodes) |
void | SetPacketCaptureOptions (uint32_t nodeId, PacketCaptureOptions options) |
void | SimulatorRunUntil (Time time) |
Static Public Member Functions | |
static void | LineClipping (double boundsX1, double boundsY1, double boundsX2, double boundsY2, double &lineX1, double &lineY1, double &lineX2, double &lineY2) |
static void | Pause (std::string const &message) |
Private Types | |
typedef std::pair< Ptr< Channel >, uint32_t > | TxRecordKey |
Private Member Functions | |
void | CallbackStopSimulation () |
void | DoPause (std::string const &message) |
NetDeviceStatistics & | FindNetDeviceStatistics (int node, int interface) |
bool | GetPacketCaptureOptions (uint32_t nodeId, const PacketCaptureOptions **outOptions) const |
void | TraceDevQueueDrop (std::string context, Ptr< const Packet > packet) |
void | TraceIpv4Drop (std::string context, ns3::Ipv4Header const &hdr, Ptr< const Packet > packet, ns3::Ipv4L3Protocol::DropReason reason, Ptr< Ipv4 > dummy_ipv4, uint32_t interface) |
void | TraceNetDevPromiscRxCsma (std::string context, Ptr< const Packet > packet) |
void | TraceNetDevRxCommon (std::string const &context, Ptr< const Packet > packet, Mac48Address const &source) |
void | TraceNetDevRxCsma (std::string context, Ptr< const Packet > packet) |
void | TraceNetDevRxLte (std::string context, Ptr< const Packet > packet, Mac48Address const &source) |
void | TraceNetDevRxPointToPoint (std::string context, Ptr< const Packet > packet) |
void | TraceNetDevRxWifi (std::string context, Ptr< const Packet > packet) |
void | TraceNetDevRxWimax (std::string context, Ptr< const Packet > packet, Mac48Address const &source) |
void | TraceNetDevTxCommon (std::string const &context, Ptr< const Packet > packet, Mac48Address const &destination) |
void | TraceNetDevTxCsma (std::string context, Ptr< const Packet > packet) |
void | TraceNetDevTxLte (std::string context, Ptr< const Packet > packet, Mac48Address const &destination) |
void | TraceNetDevTxPointToPoint (std::string context, Ptr< const Packet > packet) |
void | TraceNetDevTxWifi (std::string context, Ptr< const Packet > packet) |
void | TraceNetDevTxWimax (std::string context, Ptr< const Packet > packet, Mac48Address const &destination) |
Static Private Member Functions | |
static bool | FilterPacket (Ptr< const Packet > packet, const PacketCaptureOptions &options) |
Private Attributes | |
std::map< uint32_t, LastPacketsSample > | m_lastPackets |
std::set< uint32_t > | m_nodesOfInterest |
std::map< uint32_t, std::vector< NetDeviceStatistics > > | m_nodesStatistics |
std::map< uint32_t, PacketCaptureOptions > | m_packetCaptureOptions |
std::map< Ptr< Node >, uint32_t > | m_packetDrops |
std::map< uint32_t, Time > | m_packetsOfInterest |
std::vector< std::string > | m_pauseMessages |
Time | m_runUntil |
bool | m_stop |
std::map< TransmissionSampleKey, TransmissionSampleValue > | m_transmissionSamples |
std::map< TxRecordKey, TxRecordValue > | m_txRecords |
helper class to be used by the visualizer
This class is not meant to be used by simulations. It is only meant to be used by the visualizer tool (PyViz). The only reason it is public is because Python bindings for it are needed, otherwise it should be considered private.
typedef std::vector<PacketDropSample> ns3::PyViz::PacketDropSampleList |
typedef std::vector<TransmissionSample> ns3::PyViz::TransmissionSampleList |
|
private |
ns3::PyViz::PyViz | ( | ) |
Definition at line 125 of file pyviz.cc.
References ns3::Config::Connect(), ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION_NOARGS, TraceDevQueueDrop(), TraceIpv4Drop(), TraceNetDevPromiscRxCsma(), TraceNetDevRxCsma(), TraceNetDevRxLte(), TraceNetDevRxPointToPoint(), TraceNetDevRxWifi(), TraceNetDevRxWimax(), TraceNetDevTxCsma(), TraceNetDevTxLte(), TraceNetDevTxPointToPoint(), TraceNetDevTxWifi(), and TraceNetDevTxWimax().
ns3::PyViz::~PyViz | ( | ) |
Definition at line 235 of file pyviz.cc.
References NS_ASSERT, and NS_LOG_FUNCTION_NOARGS.
|
private |
Definition at line 267 of file pyviz.cc.
References m_runUntil, m_stop, ns3::Simulator::Now(), NS_LOG_FUNCTION_NOARGS, ns3::Seconds(), and ns3::Simulator::Stop().
Referenced by SimulatorRunUntil().
|
private |
Definition at line 243 of file pyviz.cc.
References m_pauseMessages, m_stop, ns3::Simulator::Now(), and NS_LOG_LOGIC.
Referenced by Pause().
|
staticprivate |
Definition at line 409 of file pyviz.cc.
References ns3::Packet::BeginItem(), ns3::PacketMetadata::ItemIterator::HasNext(), ns3::PyViz::PacketCaptureOptions::headers, ns3::PyViz::PacketCaptureOptions::mode, ns3::PacketMetadata::ItemIterator::Next(), NS_FATAL_ERROR, PACKET_CAPTURE_DISABLED, PACKET_CAPTURE_FILTER_HEADERS_AND, PACKET_CAPTURE_FILTER_HEADERS_OR, and ns3::PacketMetadata::Item::tid.
Referenced by TraceDevQueueDrop(), TraceNetDevRxCommon(), and TraceNetDevTxCommon().
|
inlineprivate |
Definition at line 378 of file pyviz.cc.
References ns3::NodeList::GetNode(), and m_nodesStatistics.
Referenced by TraceNetDevRxCommon(), and TraceNetDevTxCommon().
PyViz::LastPacketsSample ns3::PyViz::GetLastPackets | ( | uint32_t | nodeId | ) | const |
Definition at line 916 of file pyviz.cc.
References m_lastPackets, and NS_LOG_DEBUG.
std::vector< PyViz::NodeStatistics > ns3::PyViz::GetNodesStatistics | ( | ) | const |
Definition at line 902 of file pyviz.cc.
References m_nodesStatistics.
|
private |
Definition at line 395 of file pyviz.cc.
References m_packetCaptureOptions.
Referenced by TraceDevQueueDrop(), TraceNetDevRxCommon(), and TraceNetDevTxCommon().
PyViz::PacketDropSampleList ns3::PyViz::GetPacketDropSamples | ( | ) | const |
Definition at line 875 of file pyviz.cc.
References ns3::PyViz::PacketDropSample::bytes, ns3::Node::GetId(), list, m_packetDrops, NS_LOG_DEBUG, and ns3::PyViz::PacketDropSample::transmitter.
std::vector< std::string > ns3::PyViz::GetPauseMessages | ( | ) | const |
Definition at line 258 of file pyviz.cc.
References m_pauseMessages, ns3::Simulator::Now(), and NS_LOG_LOGIC.
PyViz::TransmissionSampleList ns3::PyViz::GetTransmissionSamples | ( | ) | const |
Definition at line 852 of file pyviz.cc.
References ns3::PyViz::TransmissionSample::bytes, ns3::PyViz::TransmissionSample::channel, ns3::Node::GetId(), list, m_transmissionSamples, NS_LOG_DEBUG, ns3::PyViz::TransmissionSample::receiver, and ns3::PyViz::TransmissionSample::transmitter.
|
static |
|
static |
void ns3::PyViz::RegisterCsmaLikeDevice | ( | std::string const & | deviceTypeName | ) |
Definition at line 174 of file pyviz.cc.
References ns3::Config::Connect(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), TraceNetDevPromiscRxCsma(), TraceNetDevRxCsma(), and TraceNetDevTxCsma().
void ns3::PyViz::RegisterDropTracePath | ( | std::string const & | tracePath | ) |
Definition at line 230 of file pyviz.cc.
References ns3::Config::Connect(), ns3::MakeCallback(), and TraceDevQueueDrop().
void ns3::PyViz::RegisterPointToPointLikeDevice | ( | std::string const & | deviceTypeName | ) |
Definition at line 206 of file pyviz.cc.
References ns3::Config::Connect(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), TraceNetDevRxPointToPoint(), and TraceNetDevTxPointToPoint().
void ns3::PyViz::RegisterWifiLikeDevice | ( | std::string const & | deviceTypeName | ) |
Definition at line 192 of file pyviz.cc.
References ns3::Config::Connect(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), TraceNetDevRxWifi(), and TraceNetDevTxWifi().
void ns3::PyViz::SetNodesOfInterest | ( | std::set< uint32_t > | nodes | ) |
Definition at line 896 of file pyviz.cc.
References m_nodesOfInterest, and first::nodes.
void ns3::PyViz::SetPacketCaptureOptions | ( | uint32_t | nodeId, |
PacketCaptureOptions | options | ||
) |
Definition at line 220 of file pyviz.cc.
References ns3::PyViz::PacketCaptureOptions::headers, m_packetCaptureOptions, ns3::PyViz::PacketCaptureOptions::mode, NS_LOG_DEBUG, and ns3::PyViz::PacketCaptureOptions::numLastPackets.
void ns3::PyViz::SimulatorRunUntil | ( | Time | time | ) |
Definition at line 278 of file pyviz.cc.
References CallbackStopSimulation(), ns3::Simulator::GetImplementation(), m_packetDrops, m_packetsOfInterest, m_pauseMessages, m_runUntil, m_stop, m_transmissionSamples, m_txRecords, ns3::Simulator::Now(), NS_LOG_LOGIC, ns3::Simulator::ScheduleWithContext(), and ns3::Seconds().
Definition at line 460 of file pyviz.cc.
References ns3::Packet::Copy(), ns3::PyViz::PacketSample::device, FilterPacket(), ns3::NodeList::GetNode(), GetPacketCaptureOptions(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::PyViz::LastPacketsSample::lastDroppedPackets, m_lastPackets, m_nodesOfInterest, m_packetDrops, m_packetsOfInterest, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::PyViz::PacketCaptureOptions::numLastPackets, ns3::PyViz::PacketSample::packet, PathSplit(), and ns3::PyViz::PacketSample::time.
Referenced by PyViz(), RegisterDropTracePath(), and TraceIpv4Drop().
|
private |
Definition at line 506 of file pyviz.cc.
References ns3::Packet::AddHeader(), ns3::Packet::Copy(), and TraceDevQueueDrop().
Referenced by PyViz().
|
private |
Definition at line 806 of file pyviz.cc.
References ns3::EthernetHeader::GetDestination(), NS_ABORT_IF, ns3::NetDevice::PACKET_OTHERHOST, ns3::Packet::PeekHeader(), and TraceNetDevRxCommon().
Referenced by PyViz(), and RegisterCsmaLikeDevice().
|
private |
Definition at line 639 of file pyviz.cc.
References ns3::PyViz::TransmissionSampleValue::bytes, ns3::Packet::Copy(), ns3::PyViz::PacketSample::device, FilterPacket(), ns3::Packet::FindFirstMatchingByteTag(), FindNetDeviceStatistics(), ns3::PyViz::RxPacketSample::from, ns3::Node::GetDevice(), ns3::Node::GetId(), ns3::NodeList::GetNode(), GetPacketCaptureOptions(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::PyViz::LastPacketsSample::lastReceivedPackets, ns3::LOG_DEBUG, m_lastPackets, ns3::PyVizPacketTag::m_packetId, m_packetsOfInterest, m_transmissionSamples, m_txRecords, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, ns3::PyViz::PacketCaptureOptions::numLastPackets, ns3::PyViz::PacketSample::packet, PathSplit(), ns3::PyViz::NetDeviceStatistics::receivedBytes, ns3::PyViz::NetDeviceStatistics::receivedPackets, ns3::PyViz::TransmissionSampleKey::receiver, ns3::PyViz::TxRecordValue::srcNode, ns3::PyViz::PacketSample::time, and ns3::PyViz::TransmissionSampleKey::transmitter.
Referenced by TraceNetDevPromiscRxCsma(), TraceNetDevRxCsma(), TraceNetDevRxLte(), TraceNetDevRxPointToPoint(), TraceNetDevRxWifi(), and TraceNetDevRxWimax().
Definition at line 792 of file pyviz.cc.
References ns3::EthernetHeader::GetSource(), NS_ABORT_IF, ns3::Packet::PeekHeader(), and TraceNetDevRxCommon().
Referenced by PyViz(), and RegisterCsmaLikeDevice().
|
private |
Definition at line 843 of file pyviz.cc.
References NS_LOG_FUNCTION, and TraceNetDevRxCommon().
Referenced by PyViz().
|
private |
Definition at line 800 of file pyviz.cc.
References TraceNetDevRxCommon().
Referenced by PyViz(), and RegisterPointToPointLikeDevice().
Definition at line 753 of file pyviz.cc.
References ns3::Packet::GetUid(), NS_ABORT_IF, NS_LOG_FUNCTION, ns3::Packet::PeekHeader(), and TraceNetDevRxCommon().
Referenced by PyViz(), and RegisterWifiLikeDevice().
|
private |
Definition at line 829 of file pyviz.cc.
References NS_LOG_FUNCTION, and TraceNetDevRxCommon().
Referenced by PyViz().
|
private |
Definition at line 518 of file pyviz.cc.
References ns3::Packet::AddByteTag(), ns3::Packet::Copy(), ns3::PyViz::PacketSample::device, FilterPacket(), FindNetDeviceStatistics(), ns3::Node::GetDevice(), ns3::NodeList::GetNode(), GetPacketCaptureOptions(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::PyViz::TxRecordValue::isBroadcast, ns3::PyViz::LastPacketsSample::lastTransmittedPackets, m_lastPackets, m_nodesOfInterest, ns3::PyVizPacketTag::m_packetId, m_packetsOfInterest, m_txRecords, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::PyViz::PacketCaptureOptions::numLastPackets, ns3::PyViz::PacketSample::packet, PathSplit(), ns3::PyViz::PacketSample::time, ns3::PyViz::TxPacketSample::to, ns3::PyViz::NetDeviceStatistics::transmittedBytes, and ns3::PyViz::NetDeviceStatistics::transmittedPackets.
Referenced by TraceNetDevTxCsma(), TraceNetDevTxLte(), TraceNetDevTxPointToPoint(), TraceNetDevTxWifi(), and TraceNetDevTxWimax().
Definition at line 620 of file pyviz.cc.
References ns3::EthernetHeader::GetDestination(), NS_ABORT_IF, ns3::Packet::PeekHeader(), and TraceNetDevTxCommon().
Referenced by PyViz(), and RegisterCsmaLikeDevice().
|
private |
Definition at line 836 of file pyviz.cc.
References NS_LOG_FUNCTION, and TraceNetDevTxCommon().
Referenced by PyViz().
|
private |
Definition at line 628 of file pyviz.cc.
References TraceNetDevTxCommon().
Referenced by PyViz(), and RegisterPointToPointLikeDevice().
Definition at line 584 of file pyviz.cc.
References ns3::Packet::GetUid(), NS_ABORT_IF, NS_LOG_FUNCTION, ns3::Packet::PeekHeader(), and TraceNetDevTxCommon().
Referenced by PyViz(), and RegisterWifiLikeDevice().
|
private |
Definition at line 822 of file pyviz.cc.
References NS_LOG_FUNCTION, and TraceNetDevTxCommon().
Referenced by PyViz().
|
private |
Definition at line 191 of file pyviz.h.
Referenced by GetLastPackets(), TraceDevQueueDrop(), TraceNetDevRxCommon(), and TraceNetDevTxCommon().
|
private |
Definition at line 189 of file pyviz.h.
Referenced by SetNodesOfInterest(), TraceDevQueueDrop(), and TraceNetDevTxCommon().
|
private |
Definition at line 192 of file pyviz.h.
Referenced by FindNetDeviceStatistics(), and GetNodesStatistics().
|
private |
Definition at line 184 of file pyviz.h.
Referenced by GetPacketCaptureOptions(), and SetPacketCaptureOptions().
Definition at line 188 of file pyviz.h.
Referenced by GetPacketDropSamples(), SimulatorRunUntil(), and TraceDevQueueDrop().
|
private |
Definition at line 190 of file pyviz.h.
Referenced by SimulatorRunUntil(), TraceDevQueueDrop(), TraceNetDevRxCommon(), and TraceNetDevTxCommon().
|
private |
Definition at line 185 of file pyviz.h.
Referenced by DoPause(), GetPauseMessages(), and SimulatorRunUntil().
|
private |
Definition at line 223 of file pyviz.h.
Referenced by CallbackStopSimulation(), and SimulatorRunUntil().
|
private |
Definition at line 222 of file pyviz.h.
Referenced by CallbackStopSimulation(), DoPause(), and SimulatorRunUntil().
|
private |
Definition at line 187 of file pyviz.h.
Referenced by GetTransmissionSamples(), SimulatorRunUntil(), and TraceNetDevRxCommon().
|
private |
Definition at line 186 of file pyviz.h.
Referenced by SimulatorRunUntil(), TraceNetDevRxCommon(), and TraceNetDevTxCommon().