Public Methods | |
| Module_Class_Members (EtherAppSrv, cSimpleModule, 0) | |
| virtual void | initialize () |
| virtual void | handleMessage (cMessage *msg) |
| virtual void | finish () |
| void | registerDSAP (int dsap) |
| void | sendPacket (cMessage *datapacket, const MACAddress &destAddr) |
Protected Attributes | |
| int | localSAP |
| int | remoteSAP |
| long | packetsSent |
| long | packetsReceived |
| cOutVector | eedVector |
| cStdDev | eedStats |
Definition at line 34 of file EtherAppSrv.cc.
|
|
Definition at line 139 of file EtherAppSrv.cc. References eedStats, packetsReceived, and packetsSent.
00140 {
00141 if (par("writeScalars").boolValue())
00142 {
00143 recordScalar("packets sent", packetsSent);
00144 recordScalar("packets rcvd", packetsReceived);
00145 recordScalar("end-to-end delay mean", eedStats.mean());
00146 recordScalar("end-to-end delay stddev", eedStats.stddev());
00147 recordScalar("end-to-end delay min", eedStats.min());
00148 recordScalar("end-to-end delay max", eedStats.max());
00149 }
00150 }
|
|
|
Definition at line 73 of file EtherAppSrv.cc. References eedStats, eedVector, ETHCTRL_DATA, EV, EtherAppReq::getRequestId(), EtherAppReq::getResponseBytes(), EtherCtrl::getSrc(), MAX_REPLY_CHUNK_SIZE, packetsReceived, packetsSent, cMessage30::removeControlInfo(), sendPacket(), and EtherAppResp::setRequestId().
00074 {
00075 EV << "Received packet `" << msg->name() << "'\n";
00076
00077 packetsReceived++;
00078 simtime_t lastEED = simTime() - msg->creationTime();
00079 eedVector.record(lastEED);
00080 eedStats.collect(lastEED);
00081
00082 EtherAppReq *req = check_and_cast<EtherAppReq *>(msg);
00083 EtherCtrl *ctrl = check_and_cast<EtherCtrl *>(req->removeControlInfo());
00084 MACAddress srcAddr = ctrl->getSrc();
00085 long requestId = req->getRequestId();
00086 long replyBytes = req->getResponseBytes();
00087 char msgname[30];
00088 strcpy(msgname,msg->name());
00089
00090 delete msg;
00091 delete ctrl;
00092
00093 // send back packets asked by EtherAppCli side
00094 int k = 0;
00095 strcat(msgname,"-resp-");
00096 char *s = msgname+strlen(msgname);
00097 while (replyBytes>0)
00098 {
00099 int l = replyBytes>MAX_REPLY_CHUNK_SIZE ? MAX_REPLY_CHUNK_SIZE : replyBytes;
00100 replyBytes -= l;
00101
00102 sprintf(s,"%d",k);
00103
00104 EV << "Generating packet `" << msgname << "'\n";
00105
00106 EtherAppResp *datapacket = new EtherAppResp(msgname, ETHCTRL_DATA);
00107 datapacket->setRequestId(requestId);
00108 datapacket->setLength(8*l);
00109 sendPacket(datapacket, srcAddr);
00110 packetsSent++;
00111
00112 k++;
00113 }
00114
00115 }
|
|
|
Definition at line 58 of file EtherAppSrv.cc. References eedStats, eedVector, ETHERAPP_CLI_SAP, ETHERAPP_SRV_SAP, localSAP, packetsReceived, packetsSent, registerDSAP(), and remoteSAP.
00059 {
00060 localSAP = ETHERAPP_SRV_SAP;
00061 remoteSAP = ETHERAPP_CLI_SAP;
00062
00063 // statistics
00064 packetsSent = packetsReceived = 0;
00065 eedVector.setName("end-to-end delay");
00066 eedStats.setName("end-to-end delay");
00067 WATCH(packetsSent);
00068 WATCH(packetsReceived);
00069
00070 registerDSAP(localSAP);
00071 }
|
|
||||||||||||||||
|
|
|
|
Definition at line 127 of file EtherAppSrv.cc. References ETHCTRL_REGISTER_DSAP, EV, cMessage30::setControlInfo(), and EtherCtrl::setDsap(). Referenced by initialize().
00128 {
00129 EV << fullPath() << " registering DSAP " << dsap << "\n";
00130
00131 EtherCtrl *etherctrl = new EtherCtrl();
00132 etherctrl->setDsap(dsap);
00133 cMessage30 *msg = new cMessage30("register_DSAP", ETHCTRL_REGISTER_DSAP);
00134 msg->setControlInfo(etherctrl);
00135
00136 send(msg, "out");
00137 }
|
|
||||||||||||
|
Definition at line 117 of file EtherAppSrv.cc. References localSAP, M30, remoteSAP, EtherCtrl::setDest(), EtherCtrl::setDsap(), and EtherCtrl::setSsap(). Referenced by handleMessage().
|
|
|
Definition at line 43 of file EtherAppSrv.cc. Referenced by finish(), handleMessage(), and initialize(). |
|
|
Definition at line 42 of file EtherAppSrv.cc. Referenced by handleMessage(), and initialize(). |
|
|
Definition at line 37 of file EtherAppSrv.cc. Referenced by initialize(), and sendPacket(). |
|
|
Definition at line 41 of file EtherAppSrv.cc. Referenced by finish(), handleMessage(), and initialize(). |
|
|
Definition at line 40 of file EtherAppSrv.cc. Referenced by finish(), handleMessage(), and initialize(). |
|
|
Definition at line 38 of file EtherAppSrv.cc. Referenced by initialize(), and sendPacket(). |
1.2.17