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

Collects data about incoming packets. More...

#include "mpi-test-fixtures.h"

+ Collaboration diagram for ns3::SinkTracer:

Static Public Member Functions

static std::string FormatAddress (const ns3::Address address)
 Get the source address and port, as a formatted string. More...
 
static int GetLineCount (void)
 Get current line count and increment it. More...
 
static int GetWorldRank (void)
 Get the MPI rank in the world communicator. More...
 
static int GetWorldSize (void)
 Get the MPI size of the world communicator. More...
 
static void Init (void)
 PacketSink Init. More...
 
static void SinkTrace (const ns3::Ptr< const ns3::Packet > packet, const ns3::Address &srcAddress, const ns3::Address &destAddress)
 PacketSink receive trace callback. More...
 
static void Verify (unsigned long expectedCount)
 Verify the sink trace count observed matches the expected count. More...
 

Static Private Attributes

static unsigned long m_line = 0
 Current output line number for ordering output. More...
 
static unsigned long m_sinkCount = 0
 Running sum of number of SinkTrace calls observed. More...
 
static int m_worldRank = -1
 MPI CommWorld rank. More...
 
static int m_worldSize = -1
 MPI CommWorld size. More...
 

Detailed Description

Collects data about incoming packets.

Definition at line 90 of file mpi-test-fixtures.h.

Member Function Documentation

◆ FormatAddress()

std::string ns3::SinkTracer::FormatAddress ( const ns3::Address  address)
static

Get the source address and port, as a formatted string.

Parameters
[in]addressThe ns3::Address.
Returns
A string with the formatted address and port number.

Definition at line 80 of file mpi-test-fixtures.cc.

References first::address, ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::Inet6SocketAddress::GetIpv6(), ns3::InetSocketAddress::GetPort(), ns3::Inet6SocketAddress::GetPort(), ns3::Inet6SocketAddress::IsMatchingType(), and ns3::InetSocketAddress::IsMatchingType().

+ Here is the call graph for this function:

◆ GetLineCount()

static int ns3::SinkTracer::GetLineCount ( void  )
inlinestatic

Get current line count and increment it.

Returns
the line count.

Definition at line 147 of file mpi-test-fixtures.h.

References m_line.

◆ GetWorldRank()

static int ns3::SinkTracer::GetWorldRank ( void  )
inlinestatic

Get the MPI rank in the world communicator.

Returns
MPI world rank.

Definition at line 128 of file mpi-test-fixtures.h.

References m_worldRank.

Referenced by ReportRank().

+ Here is the caller graph for this function:

◆ GetWorldSize()

static int ns3::SinkTracer::GetWorldSize ( void  )
inlinestatic

Get the MPI size of the world communicator.

Returns
MPI world size.

Definition at line 138 of file mpi-test-fixtures.h.

References m_worldSize.

Referenced by ReportRank().

+ Here is the caller graph for this function:

◆ Init()

void ns3::SinkTracer::Init ( void  )
static

PacketSink Init.

Definition at line 40 of file mpi-test-fixtures.cc.

References m_line, m_sinkCount, m_worldRank, and m_worldSize.

◆ SinkTrace()

void ns3::SinkTracer::SinkTrace ( const ns3::Ptr< const ns3::Packet packet,
const ns3::Address srcAddress,
const ns3::Address destAddress 
)
static

PacketSink receive trace callback.

Parameters
[in]packetThe packet.
[in]srcAddressThe source address.
[in]destAddressThe destination address.

Definition at line 50 of file mpi-test-fixtures.cc.

References m_sinkCount.

◆ Verify()

void ns3::SinkTracer::Verify ( unsigned long  expectedCount)
static

Verify the sink trace count observed matches the expected count.

Prints message to std::cout indicating success or fail.

Parameters
expectedCountExpected number of packet received.

Definition at line 58 of file mpi-test-fixtures.cc.

References m_sinkCount, and RANK0COUT.

Member Data Documentation

◆ m_line

unsigned long ns3::SinkTracer::m_line = 0
staticprivate

Current output line number for ordering output.

Definition at line 154 of file mpi-test-fixtures.h.

Referenced by GetLineCount(), and Init().

◆ m_sinkCount

unsigned long ns3::SinkTracer::m_sinkCount = 0
staticprivate

Running sum of number of SinkTrace calls observed.

Definition at line 153 of file mpi-test-fixtures.h.

Referenced by Init(), SinkTrace(), and Verify().

◆ m_worldRank

int ns3::SinkTracer::m_worldRank = -1
staticprivate

MPI CommWorld rank.

Definition at line 155 of file mpi-test-fixtures.h.

Referenced by GetWorldRank(), and Init().

◆ m_worldSize

int ns3::SinkTracer::m_worldSize = -1
staticprivate

MPI CommWorld size.

Definition at line 156 of file mpi-test-fixtures.h.

Referenced by GetWorldSize(), and Init().


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