A Discrete-Event Network Simulator
API
ns3::PyViz Class Reference

helper class to be used by the visualizer More...

#include "pyviz.h"

+ Collaboration diagram for ns3::PyViz:

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< PacketDropSamplePacketDropSampleList
 
typedef std::vector< TransmissionSampleTransmissionSampleList
 

Public Member Functions

 PyViz ()
 
 ~PyViz ()
 
LastPacketsSample GetLastPackets (uint32_t nodeId) const
 
std::vector< NodeStatisticsGetNodesStatistics () 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)
 
NetDeviceStatisticsFindNetDeviceStatistics (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, LastPacketsSamplem_lastPackets
 
std::set< uint32_t > m_nodesOfInterest
 
std::map< uint32_t, std::vector< NetDeviceStatistics > > m_nodesStatistics
 
std::map< uint32_t, PacketCaptureOptionsm_packetCaptureOptions
 
std::map< Ptr< Node >, uint32_t > m_packetDrops
 
std::map< uint32_t, Timem_packetsOfInterest
 
std::vector< std::string > m_pauseMessages
 
Time m_runUntil
 
bool m_stop
 
std::map< TransmissionSampleKey, TransmissionSampleValuem_transmissionSamples
 
std::map< TxRecordKey, TxRecordValuem_txRecords
 

Detailed Description

helper class to be used by the visualizer

Internal:

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.

Definition at line 51 of file pyviz.h.

Member Typedef Documentation

Definition at line 84 of file pyviz.h.

Definition at line 76 of file pyviz.h.

typedef std::pair<Ptr<Channel>, uint32_t> ns3::PyViz::TxRecordKey
private

Definition at line 160 of file pyviz.h.

Constructor & Destructor Documentation

ns3::PyViz::~PyViz ( )

Definition at line 235 of file pyviz.cc.

References NS_ASSERT, and NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

void ns3::PyViz::CallbackStopSimulation ( )
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::DoPause ( std::string const &  message)
private

Definition at line 243 of file pyviz.cc.

References m_pauseMessages, m_stop, ns3::Simulator::Now(), and NS_LOG_LOGIC.

Referenced by Pause().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PyViz::NetDeviceStatistics & ns3::PyViz::FindNetDeviceStatistics ( int  node,
int  interface 
)
inlineprivate

Definition at line 378 of file pyviz.cc.

References ns3::NodeList::GetNode(), and m_nodesStatistics.

Referenced by TraceNetDevRxCommon(), and TraceNetDevTxCommon().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

bool ns3::PyViz::GetPacketCaptureOptions ( uint32_t  nodeId,
const PacketCaptureOptions **  outOptions 
) const
private

Definition at line 395 of file pyviz.cc.

References m_packetCaptureOptions.

Referenced by TraceDevQueueDrop(), TraceNetDevRxCommon(), and TraceNetDevTxCommon().

+ Here is the caller graph for this function:

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.

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

void ns3::PyViz::LineClipping ( double  boundsX1,
double  boundsY1,
double  boundsX2,
double  boundsY2,
double &  lineX1,
double &  lineY1,
double &  lineX2,
double &  lineY2 
)
static

Definition at line 1417 of file pyviz.cc.

void ns3::PyViz::Pause ( std::string const &  message)
static

Definition at line 251 of file pyviz.cc.

References DoPause(), and NS_ASSERT.

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

void ns3::PyViz::RegisterDropTracePath ( std::string const &  tracePath)

Definition at line 230 of file pyviz.cc.

References ns3::Config::Connect(), ns3::MakeCallback(), and TraceDevQueueDrop().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

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 
)
void ns3::PyViz::TraceIpv4Drop ( std::string  context,
ns3::Ipv4Header const &  hdr,
Ptr< const Packet packet,
ns3::Ipv4L3Protocol::DropReason  reason,
Ptr< Ipv4 dummy_ipv4,
uint32_t  interface 
)
private

Definition at line 506 of file pyviz.cc.

References ns3::Packet::AddHeader(), ns3::Packet::Copy(), and TraceDevQueueDrop().

Referenced by PyViz().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevPromiscRxCsma ( std::string  context,
Ptr< const Packet packet 
)
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevRxCsma ( std::string  context,
Ptr< const Packet packet 
)
private

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevRxLte ( std::string  context,
Ptr< const Packet packet,
Mac48Address const &  source 
)
private

Definition at line 843 of file pyviz.cc.

References NS_LOG_FUNCTION, and TraceNetDevRxCommon().

Referenced by PyViz().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevRxPointToPoint ( std::string  context,
Ptr< const Packet packet 
)
private

Definition at line 800 of file pyviz.cc.

References TraceNetDevRxCommon().

Referenced by PyViz(), and RegisterPointToPointLikeDevice().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevRxWifi ( std::string  context,
Ptr< const Packet packet 
)
private

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevRxWimax ( std::string  context,
Ptr< const Packet packet,
Mac48Address const &  source 
)
private

Definition at line 829 of file pyviz.cc.

References NS_LOG_FUNCTION, and TraceNetDevRxCommon().

Referenced by PyViz().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevTxCsma ( std::string  context,
Ptr< const Packet packet 
)
private

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevTxLte ( std::string  context,
Ptr< const Packet packet,
Mac48Address const &  destination 
)
private

Definition at line 836 of file pyviz.cc.

References NS_LOG_FUNCTION, and TraceNetDevTxCommon().

Referenced by PyViz().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevTxPointToPoint ( std::string  context,
Ptr< const Packet packet 
)
private

Definition at line 628 of file pyviz.cc.

References TraceNetDevTxCommon().

Referenced by PyViz(), and RegisterPointToPointLikeDevice().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevTxWifi ( std::string  context,
Ptr< const Packet packet 
)
private

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PyViz::TraceNetDevTxWimax ( std::string  context,
Ptr< const Packet packet,
Mac48Address const &  destination 
)
private

Definition at line 822 of file pyviz.cc.

References NS_LOG_FUNCTION, and TraceNetDevTxCommon().

Referenced by PyViz().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::map<uint32_t, LastPacketsSample> ns3::PyViz::m_lastPackets
private
std::set<uint32_t> ns3::PyViz::m_nodesOfInterest
private

Definition at line 189 of file pyviz.h.

Referenced by SetNodesOfInterest(), TraceDevQueueDrop(), and TraceNetDevTxCommon().

std::map<uint32_t, std::vector<NetDeviceStatistics> > ns3::PyViz::m_nodesStatistics
private

Definition at line 192 of file pyviz.h.

Referenced by FindNetDeviceStatistics(), and GetNodesStatistics().

std::map<uint32_t, PacketCaptureOptions> ns3::PyViz::m_packetCaptureOptions
private

Definition at line 184 of file pyviz.h.

Referenced by GetPacketCaptureOptions(), and SetPacketCaptureOptions().

std::map<Ptr<Node>, uint32_t> ns3::PyViz::m_packetDrops
private

Definition at line 188 of file pyviz.h.

Referenced by GetPacketDropSamples(), SimulatorRunUntil(), and TraceDevQueueDrop().

std::map<uint32_t, Time> ns3::PyViz::m_packetsOfInterest
private
std::vector<std::string> ns3::PyViz::m_pauseMessages
private

Definition at line 185 of file pyviz.h.

Referenced by DoPause(), GetPauseMessages(), and SimulatorRunUntil().

Time ns3::PyViz::m_runUntil
private

Definition at line 223 of file pyviz.h.

Referenced by CallbackStopSimulation(), and SimulatorRunUntil().

bool ns3::PyViz::m_stop
private

Definition at line 222 of file pyviz.h.

Referenced by CallbackStopSimulation(), DoPause(), and SimulatorRunUntil().

std::map<TransmissionSampleKey, TransmissionSampleValue> ns3::PyViz::m_transmissionSamples
private

Definition at line 187 of file pyviz.h.

Referenced by GetTransmissionSamples(), SimulatorRunUntil(), and TraceNetDevRxCommon().

std::map<TxRecordKey, TxRecordValue> ns3::PyViz::m_txRecords
private

Definition at line 186 of file pyviz.h.

Referenced by SimulatorRunUntil(), TraceNetDevRxCommon(), and TraceNetDevTxCommon().


The documentation for this class was generated from the following files: