|
INET Framework for OMNeT++/OMNEST
|
Simple traffic generator for the Ethernet model.
More...
#include <EtherTrafGen.h>
Simple traffic generator for the Ethernet model.
◆ Kinds
◆ EtherTrafGen()
| inet::EtherTrafGen::EtherTrafGen |
( |
| ) |
|
◆ ~EtherTrafGen()
| inet::EtherTrafGen::~EtherTrafGen |
( |
| ) |
|
|
virtual |
◆ cancelNextPacket()
| void inet::EtherTrafGen::cancelNextPacket |
( |
| ) |
|
|
protectedvirtual |
◆ finish()
| void inet::EtherTrafGen::finish |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ handleCrashOperation()
◆ handleMessageWhenUp()
| void inet::EtherTrafGen::handleMessageWhenUp |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
◆ handleStartOperation()
◆ handleStopOperation()
◆ initialize()
| void inet::EtherTrafGen::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ isGenerator()
| bool inet::EtherTrafGen::isGenerator |
( |
| ) |
|
|
protectedvirtual |
◆ numInitStages()
| virtual int inet::EtherTrafGen::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ receivePacket()
| void inet::EtherTrafGen::receivePacket |
( |
Packet * |
msg | ) |
|
|
protectedvirtual |
176 EV_INFO <<
"Received packet `" << msg->getName() <<
"' length= " << msg->getByteLength() <<
"B\n";
Referenced by handleMessageWhenUp().
◆ resolveDestMacAddress()
| MacAddress inet::EtherTrafGen::resolveDestMacAddress |
( |
| ) |
|
|
protectedvirtual |
◆ scheduleNextPacket()
| void inet::EtherTrafGen::scheduleNextPacket |
( |
simtime_t |
previous | ) |
|
|
protectedvirtual |
◆ sendBurstPackets()
| void inet::EtherTrafGen::sendBurstPackets |
( |
| ) |
|
|
protectedvirtual |
149 for (
int i = 0; i < n; i++) {
153 sprintf(msgname,
"pk-%d-%ld", getId(),
seqNum);
157 const auto& payload = makeShared<ByteCountChunk>(
B(len));
158 payload->addTag<CreationTimeTag>()->setCreationTime(simTime());
159 datapacket->insertAtBack(payload);
161 datapacket->addTag<MacAddressReq>()->setDestAddress(
destMacAddress);
163 auto sapTag = datapacket->addTag<Ieee802SapReq>();
164 sapTag->setSsap(
ssap);
165 sapTag->setDsap(
dsap);
167 EV_INFO <<
"Send packet `" << msgname <<
"' dest=" <<
destMacAddress <<
" length=" << len <<
"B ssap/dsap=" <<
ssap <<
"/" <<
dsap <<
"\n";
169 send(datapacket,
"out");
Referenced by handleMessageWhenUp().
◆ destMacAddress
◆ dsap
| int inet::EtherTrafGen::dsap = -1 |
|
protected |
◆ interfaceTable
◆ llcSocket
◆ numPacketsPerBurst
| cPar* inet::EtherTrafGen::numPacketsPerBurst = nullptr |
|
protected |
◆ outInterface
| int inet::EtherTrafGen::outInterface = -1 |
|
protected |
◆ packetLength
| cPar* inet::EtherTrafGen::packetLength = nullptr |
|
protected |
◆ packetsReceived
| long inet::EtherTrafGen::packetsReceived = 0 |
|
protected |
◆ packetsSent
| long inet::EtherTrafGen::packetsSent = 0 |
|
protected |
◆ sendInterval
| cPar* inet::EtherTrafGen::sendInterval = nullptr |
|
protected |
◆ seqNum
| long inet::EtherTrafGen::seqNum = 0 |
|
protected |
◆ ssap
| int inet::EtherTrafGen::ssap = -1 |
|
protected |
◆ startTime
| simtime_t inet::EtherTrafGen::startTime |
|
protected |
◆ stopTime
| simtime_t inet::EtherTrafGen::stopTime |
|
protected |
◆ timerMsg
| cMessage* inet::EtherTrafGen::timerMsg = nullptr |
|
protected |
The documentation for this class was generated from the following files:
#define CHK(x)
Definition: INETDefs.h:87
cPar * packetLength
Definition: EtherTrafGen.h:35
int ssap
Definition: EtherTrafGen.h:36
void setOutputGate(cGate *gate)
Sets the gate on which to send messages.
Definition: SocketBase.h:36
virtual void scheduleNextPacket(simtime_t previous)
Definition: EtherTrafGen.cc:117
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
virtual void initialize(int stage) override
Definition: OperationalMixinImpl.h:26
removed InterfaceReq
Definition: IUdp-gates.txt:11
int dsap
Definition: EtherTrafGen.h:37
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
MacAddress destMacAddress
Definition: EtherTrafGen.h:38
virtual MacAddress resolveDestMacAddress()
Definition: EtherTrafGen.cc:137
simsignal_t packetSentSignal
Definition: Simsignals.cc:96
simtime_t startTime
Definition: EtherTrafGen.h:44
@ ADDR_MAC
Definition: L3AddressResolver.h:72
long packetsReceived
Definition: EtherTrafGen.h:49
static const Protocol ieee8022llc
Definition: Protocol.h:88
cPar * numPacketsPerBurst
Definition: EtherTrafGen.h:34
intscale< b, 1, 8 > B
Definition: Units.h:1168
simsignal_t packetReceivedSignal
Definition: Simsignals.cc:97
long seqNum
Definition: EtherTrafGen.h:30
virtual void cancelNextPacket()
Definition: EtherTrafGen.cc:132
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
ModuleRefByPar< IInterfaceTable > interfaceTable
Definition: EtherTrafGen.h:28
long packetsSent
Definition: EtherTrafGen.h:48
simtime_t stopTime
Definition: EtherTrafGen.h:45
@ SOCKET_C_DATA
Definition: SocketCommand_m.h:64
virtual void close() override
Unbinds the socket.
Definition: SocketBase.cc:43
bool isUnspecified() const
Returns true if all address bytes are zero.
Definition: MacAddress.h:136
INET_API InitStage INITSTAGE_APPLICATION_LAYER
Initialization of applications.
virtual void open(int interfaceId, int localSap, int remoteSap)
Definition: Ieee8022LlcSocket.cc:40
cPar * sendInterval
Definition: EtherTrafGen.h:33
cMessage * timerMsg
Definition: EtherTrafGen.h:43
@ NEXT
Definition: EtherTrafGen.h:26
Ieee8022LlcSocket llcSocket
Definition: EtherTrafGen.h:41
virtual void sendBurstPackets()
Definition: EtherTrafGen.cc:146
virtual void receivePacket(Packet *msg)
Definition: EtherTrafGen.cc:174
virtual void destroy() override
Notify the protocol that the owner of ISocket has destroyed the socket.
Definition: SocketBase.cc:52
virtual bool isGenerator()
Definition: EtherTrafGen.cc:112
int outInterface
Definition: EtherTrafGen.h:39
@ START
Definition: EtherTrafGen.h:26