A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< PacketDropSample
PacketDropSampleList
 
typedef std::vector
< TransmissionSample
TransmissionSampleList
 

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,
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, Timem_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
 

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.

Member Enumeration Documentation

Enumerator
PACKET_CAPTURE_DISABLED 
PACKET_CAPTURE_FILTER_HEADERS_OR 
PACKET_CAPTURE_FILTER_HEADERS_AND 

Definition at line 132 of file pyviz.h.

Constructor & Destructor Documentation

ns3::PyViz::~PyViz ( )

Definition at line 233 of file pyviz.cc.

References ns3::g_visualizer, NS_ASSERT, and NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

void ns3::PyViz::CallbackStopSimulation ( )
private

Definition at line 265 of file pyviz.cc.

References m_runUntil, m_stop, ns3::Simulator::Now(), NS_LOG_FUNCTION_NOARGS, 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 241 of file pyviz.cc.

References ns3::g_visualizer, 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 376 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 914 of file pyviz.cc.

References m_lastPackets, and NS_LOG_DEBUG.

std::vector< PyViz::NodeStatistics > ns3::PyViz::GetNodesStatistics ( ) const

Definition at line 900 of file pyviz.cc.

References m_nodesStatistics.

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

Definition at line 393 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 873 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 256 of file pyviz.cc.

References ns3::g_visualizer, 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 1415 of file pyviz.cc.

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

Definition at line 249 of file pyviz.cc.

References DoPause(), ns3::g_visualizer, and NS_ASSERT.

+ Here is the call graph for this function:

void ns3::PyViz::RegisterCsmaLikeDevice ( std::string const &  deviceTypeName)

Definition at line 172 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 228 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 204 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 190 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 894 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 504 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 804 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 790 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 841 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 798 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 751 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 827 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 618 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 834 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 626 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 582 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 820 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: