29 #include "ns3/simple-net-device.h"
30 #include "ns3/simple-channel.h"
31 #include "ns3/address.h"
32 #include "ns3/mac48-address.h"
33 #include "ns3/packet.h"
34 #include "ns3/callback.h"
36 #include "ns3/simulator.h"
37 #include "ns3/error-model.h"
38 #include "ns3/pointer.h"
39 #include "ns3/double.h"
40 #include "ns3/string.h"
41 #include "ns3/rng-seed-manager.h"
47 for (
int i = 0; i < num; i++)
50 device->
Send (pkt, addr, 0);
74 virtual void DoRun (
void);
83 :
TestCase (
"ErrorModel and PhyRxDrop trace for SimpleNetDevice"), m_count (0), m_drops (0)
108 RngSeedManager::SetSeed (7);
109 RngSeedManager::SetRun (2);
130 output->SetAttribute (
"ReceiveErrorModel",
PointerValue (em));
134 Simulator::Schedule (Seconds (0), &
SendPacket, 10000, input, output->GetAddress ());
137 Simulator::Destroy ();
152 virtual void DoRun (
void);
161 :
TestCase (
"ErrorModel and PhyRxDrop trace for SimpleNetDevice"), m_count (0), m_drops (0)
186 RngSeedManager::SetSeed (5);
187 RngSeedManager::SetRun (8);
210 output->SetAttribute (
"ReceiveErrorModel",
PointerValue (em));
214 Simulator::Schedule (Seconds (0), &
SendPacket, 10000, input, output->GetAddress ());
217 Simulator::Destroy ();
smart pointer class similar to boost::intrusive_ptr
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
static void BuildSimpleTopology(Ptr< Node > a, Ptr< Node > b, Ptr< SimpleNetDevice > input, Ptr< SimpleNetDevice > output, Ptr< SimpleChannel > channel)
hold variables of type string
void DropEvent(Ptr< const Packet > p)
virtual void DoRun(void)
Implementation to actually run this TestCase.
a polymophic address class
virtual void SetNode(Ptr< Node > node)
static Mac48Address Allocate(void)
Allocate a new Mac48Address.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
virtual ~ErrorModelSimple()
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
bool Receive(Ptr< NetDevice > nd, Ptr< const Packet > p, uint16_t protocol, const Address &addr)
void SetRandomVariable(Ptr< RandomVariableStream > ranVar)
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)=0
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
void DropEvent(Ptr< const Packet > p)
uint32_t AddDevice(Ptr< NetDevice > device)
virtual void SetAddress(Address address)
Set the address of this interface.
void SetRandomVariable(Ptr< RandomVariableStream >)
bool Receive(Ptr< NetDevice > nd, Ptr< const Packet > p, uint16_t protocol, const Address &addr)
static ErrorModelTestSuite errorModelTestSuite
Hold a floating point type.
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.
void SetAttribute(std::string name, const AttributeValue &value)
static void SendPacket(int num, Ptr< NetDevice > device, Address &addr)
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~BurstErrorModelSimple()
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.