|
INET Framework for OMNeT++/OMNEST
|
Server-side process EtherAppClient.
More...
#include <EtherAppServer.h>
Server-side process EtherAppClient.
◆ finish()
| void inet::EtherAppServer::finish |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ handleCrashOperation()
◆ handleMessageWhenUp()
| void inet::EtherAppServer::handleMessageWhenUp |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
◆ handleStartOperation()
◆ handleStopOperation()
◆ initialize()
| void inet::EtherAppServer::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ numInitStages()
| virtual int inet::EtherAppServer::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ registerDsap()
| void inet::EtherAppServer::registerDsap |
( |
int |
dsap | ) |
|
|
protected |
◆ sendPacket()
| void inet::EtherAppServer::sendPacket |
( |
Packet * |
datapacket, |
|
|
int |
interfaceId, |
|
|
const MacAddress & |
destAddr, |
|
|
int |
destSap |
|
) |
| |
|
protected |
114 datapacket->addTag<
InterfaceReq>()->setInterfaceId(interfaceId);
115 datapacket->addTag<MacAddressReq>()->setDestAddress(destAddr);
116 auto ieee802SapReq = datapacket->addTag<Ieee802SapReq>();
118 ieee802SapReq->setDsap(destSap);
Referenced by socketDataArrived().
◆ socketClosed()
◆ socketDataArrived()
Implements inet::Ieee8022LlcSocket::ICallback.
76 EV_INFO <<
"Received packet `" << msg->getName() <<
"'\n";
77 const auto& req = msg->peekAtFront<EtherAppReq>();
79 throw cRuntimeError(
"data type error: not an EtherAppReq arrived in packet %s", msg->str().c_str());
83 MacAddress srcAddr = msg->getTag<MacAddressInd>()->getSrcAddress();
84 int srcInterfaceId = msg->getTag<InterfaceInd>()->getInterfaceId();
85 int srcSap = msg->getTag<Ieee802SapInd>()->getSsap();
86 long requestId = req->getRequestId();
87 long replyBytes = req->getResponseBytes();
90 for (
int k = 0; replyBytes > 0;
k++) {
95 s << msg->getName() <<
"-resp-" <<
k;
98 const auto& outPayload = makeShared<EtherAppResp>();
99 outPayload->setRequestId(requestId);
100 outPayload->setChunkLength(
B(l));
101 outPayload->addTag<CreationTimeTag>()->setCreationTime(simTime());
102 outPacket->insertAtBack(outPayload);
104 EV_INFO <<
"Send response `" << outPacket->getName() <<
"' to " << srcAddr <<
" ssap=" <<
localSap <<
" dsap=" << srcSap <<
" length=" << l <<
"B requestId=" << requestId <<
"\n";
106 sendPacket(outPacket, srcInterfaceId, srcAddr, srcSap);
◆ llcSocket
◆ localSap
| int inet::EtherAppServer::localSap = 0 |
|
protected |
◆ packetsReceived
| long inet::EtherAppServer::packetsReceived = 0 |
|
protected |
◆ packetsSent
| long inet::EtherAppServer::packetsSent = 0 |
|
protected |
The documentation for this class was generated from the following files:
void setCallback(ICallback *callback)
Sets a callback object, to be used with processMessage().
Definition: Ieee8022LlcSocket.h:49
State operationalState
Definition: OperationalMixin.h:23
void setOutputGate(cGate *gate)
Sets the gate on which to send messages.
Definition: SocketBase.h:36
Ieee8022LlcSocket llcSocket
Definition: EtherAppServer.h:28
@ IEEE802CTRL_DATA
Definition: Ieee802Ctrl_m.h:58
void sendPacket(Packet *datapacket, int interfaceId, const MacAddress &destAddr, int destSap)
Definition: EtherAppServer.cc:112
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
#define MAX_REPLY_CHUNK_SIZE
Definition: EtherAppServer.h:18
simsignal_t packetSentSignal
Definition: Simsignals.cc:96
value< double, units::s > s
Definition: Units.h:1235
intscale< b, 1, 8 > B
Definition: Units.h:1168
long packetsSent
Definition: EtherAppServer.h:31
simsignal_t packetReceivedSignal
Definition: Simsignals.cc:97
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
virtual bool isOpen() const override
Returns true if the socket is open.
Definition: SocketBase.h:55
const double k
Definition: Qam1024Modulation.cc:14
virtual void close() override
Unbinds the socket.
Definition: SocketBase.cc:43
long packetsReceived
Definition: EtherAppServer.h:32
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
virtual void open(int interfaceId, int localSap, int remoteSap)
Definition: Ieee8022LlcSocket.cc:40
virtual void delayActiveOperationFinish(simtime_t timeout)
Definition: OperationalMixinImpl.h:161
void registerDsap(int dsap)
Definition: EtherAppServer.cc:125
virtual void startActiveOperationExtraTimeOrFinish(simtime_t extraTime)
Definition: OperationalMixinImpl.h:179
virtual void processMessage(cMessage *msg) override
Examines the message, takes ownership, and updates socket state.
Definition: Ieee8022LlcSocket.cc:57
int localSap
Definition: EtherAppServer.h:26
virtual void destroy() override
Notify the protocol that the owner of ISocket has destroyed the socket.
Definition: SocketBase.cc:52