|
INET Framework for OMNeT++/OMNEST
|
Simple traffic generator for the Ethernet model.
More...
#include <EtherAppClient.h>
Simple traffic generator for the Ethernet model.
◆ Kinds
◆ EtherAppClient()
| inet::EtherAppClient::EtherAppClient |
( |
| ) |
|
|
inline |
◆ ~EtherAppClient()
| inet::EtherAppClient::~EtherAppClient |
( |
| ) |
|
|
virtual |
◆ cancelNextPacket()
| void inet::EtherAppClient::cancelNextPacket |
( |
| ) |
|
|
protectedvirtual |
◆ finish()
| void inet::EtherAppClient::finish |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ handleCrashOperation()
◆ handleMessageWhenUp()
| void inet::EtherAppClient::handleMessageWhenUp |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
◆ handleStartOperation()
◆ handleStopOperation()
◆ initialize()
| void inet::EtherAppClient::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ isGenerator()
| bool inet::EtherAppClient::isGenerator |
( |
| ) |
|
|
protectedvirtual |
◆ numInitStages()
| virtual int inet::EtherAppClient::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ resolveDestMacAddress()
| MacAddress inet::EtherAppClient::resolveDestMacAddress |
( |
| ) |
|
|
protectedvirtual |
141 const char *destAddress = par(
"destAddress");
142 if (destAddress[0]) {
Referenced by handleMessageWhenUp().
◆ scheduleNextPacket()
| void inet::EtherAppClient::scheduleNextPacket |
( |
bool |
start | ) |
|
|
protectedvirtual |
◆ sendPacket()
| void inet::EtherAppClient::sendPacket |
( |
| ) |
|
|
protectedvirtual |
154 sprintf(msgname,
"req-%d-%ld", getId(),
seqNum);
155 EV_INFO <<
"Generating packet `" << msgname <<
"'\n";
157 Packet *datapacket =
new Packet(msgname);
158 const auto& data = makeShared<EtherAppReq>();
161 data->setChunkLength(
B(len));
162 data->setRequestId(
seqNum);
165 data->setResponseBytes(respLen);
167 data->addTag<CreationTimeTag>()->setCreationTime(simTime());
169 datapacket->insertAtBack(data);
171 datapacket->addTag<MacAddressReq>()->setDestAddress(
destMacAddress);
172 auto ieee802SapReq = datapacket->addTag<Ieee802SapReq>();
Referenced by handleMessageWhenUp().
◆ socketClosed()
◆ socketDataArrived()
◆ destMacAddress
◆ interfaceTable
◆ llcSocket
◆ localSap
| int inet::EtherAppClient::localSap = -1 |
|
protected |
◆ packetsReceived
| long inet::EtherAppClient::packetsReceived = 0 |
|
protected |
◆ packetsSent
| long inet::EtherAppClient::packetsSent = 0 |
|
protected |
◆ remoteSap
| int inet::EtherAppClient::remoteSap = -1 |
|
protected |
◆ reqLength
| cPar* inet::EtherAppClient::reqLength = nullptr |
|
protected |
◆ respLength
| cPar* inet::EtherAppClient::respLength = nullptr |
|
protected |
◆ sendInterval
| cPar* inet::EtherAppClient::sendInterval = nullptr |
|
protected |
◆ seqNum
| long inet::EtherAppClient::seqNum = 0 |
|
protected |
◆ startTime
| simtime_t inet::EtherAppClient::startTime |
|
protected |
◆ stopTime
| simtime_t inet::EtherAppClient::stopTime |
|
protected |
◆ timerMsg
| cMessage* inet::EtherAppClient::timerMsg = nullptr |
|
protected |
The documentation for this class was generated from the following files:
#define CHK(x)
Definition: INETDefs.h:87
void setCallback(ICallback *callback)
Sets a callback object, to be used with processMessage().
Definition: Ieee8022LlcSocket.h:49
State operationalState
Definition: OperationalMixin.h:23
cPar * sendInterval
Definition: EtherAppClient.h:32
void setOutputGate(cGate *gate)
Sets the gate on which to send messages.
Definition: SocketBase.h:36
bool tryParse(const char *hexstr)
Sets the address and returns true if the syntax of the string is correct.
Definition: MacAddress.cc:39
virtual bool isGenerator()
Definition: EtherAppClient.cc:111
cPar * respLength
Definition: EtherAppClient.h:31
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
@ NEXT
Definition: EtherAppClient.h:26
cPar * reqLength
Definition: EtherAppClient.h:30
simsignal_t packetSentSignal
Definition: Simsignals.cc:96
@ ADDR_MAC
Definition: L3AddressResolver.h:72
ModuleRefByPar< IInterfaceTable > interfaceTable
Definition: EtherAppClient.h:37
intscale< b, 1, 8 > B
Definition: Units.h:1168
MacAddress destMacAddress
Definition: EtherAppClient.h:36
simsignal_t packetReceivedSignal
Definition: Simsignals.cc:97
Ieee8022LlcSocket llcSocket
Definition: EtherAppClient.h:44
long packetsSent
Definition: EtherAppClient.h:47
virtual void cancelNextPacket()
Definition: EtherAppClient.cc:132
simtime_t startTime
Definition: EtherAppClient.h:41
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
int localSap
Definition: EtherAppClient.h:34
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
virtual bool isOpen() const override
Returns true if the socket is open.
Definition: SocketBase.h:55
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
virtual void send(Packet *packet) override
Sends a data packet to the address and port specified previously in a connect() call.
Definition: SocketBase.cc:36
INET_API InitStage INITSTAGE_APPLICATION_LAYER
Initialization of applications.
virtual void open(int interfaceId, int localSap, int remoteSap)
Definition: Ieee8022LlcSocket.cc:40
virtual void delayActiveOperationFinish(simtime_t timeout)
Definition: OperationalMixinImpl.h:161
virtual void startActiveOperationExtraTimeOrFinish(simtime_t extraTime)
Definition: OperationalMixinImpl.h:179
long seqNum
Definition: EtherAppClient.h:29
virtual void sendPacket()
Definition: EtherAppClient.cc:149
int remoteSap
Definition: EtherAppClient.h:35
cMessage * timerMsg
Definition: EtherAppClient.h:40
long packetsReceived
Definition: EtherAppClient.h:48
simtime_t stopTime
Definition: EtherAppClient.h:42
virtual void processMessage(cMessage *msg) override
Examines the message, takes ownership, and updates socket state.
Definition: Ieee8022LlcSocket.cc:57
virtual void scheduleNextPacket(bool start)
Definition: EtherAppClient.cc:116
virtual MacAddress resolveDestMacAddress()
Definition: EtherAppClient.cc:138
@ START
Definition: EtherAppClient.h:26
virtual void destroy() override
Notify the protocol that the owner of ISocket has destroyed the socket.
Definition: SocketBase.cc:52