62 error(
"Pointers to Cdap !");
64 error(
"Pointers to Irm or ConnectionTable or Cdap are not initialized!");
68 cModule* catcher1 = this->getParentModule();
69 cModule* catcher2 = this->getModuleByPath(
"^.^.^.^");
70 cModule* catcher3 = this->getModuleByPath(
"^.^.^");
120 EV << this->getFullPath() <<
" created bindings and registered a new flow" << endl;
124 Irm->getOrCreateFirstUnconnectedGatePair(
GATE_AEIO,
false,
true, *&gIrmIn, *&gIrmOut);
126 cModule* IrmMod =
Irm->getParentModule();
129 IrmMod->getOrCreateFirstUnconnectedGatePair(
GATE_NORTHIO,
false,
true, *&gIrmModIn, *&gIrmModOut);
131 cModule* ApMon = this->getModuleByPath(
"^.^.^");
134 ApMon->getOrCreateFirstUnconnectedGatePair(
GATE_SOUTHIO,
false,
true, *&gApIn, *&gApOut);
137 cModule* AeMod = this->getModuleByPath(
"^.^");
140 AeMod->getOrCreateFirstUnconnectedGatePair(
"southIo",
false,
true, *&gAeIn, *&gAeOut);
143 cModule* AeInstanceMod = this->getModuleByPath(
"^");
146 AeInstanceMod->getOrCreateFirstUnconnectedGatePair(
"aeIo",
false,
true, *&gAeInstIn, *&gAeInstOut);
149 cModule* SocketMod = this->getModuleByPath(
"^.socket");
152 SocketMod->getOrCreateFirstUnconnectedGatePair(
"southIo",
false,
true, *&gSocketIn, *&gSocketOut);
155 cGate* gSocketCdapIn = SocketMod->gateHalf(
"cdapIo", cGate::INPUT);
172 gIrmOut->connectTo(gIrmModOut);
173 gIrmModOut->connectTo(gApIn);
174 gApIn->connectTo(gAeIn);
175 gAeIn->connectTo(gAeInstIn);
176 gAeInstIn->connectTo(gSocketIn);
180 gSocketOut->connectTo(gAeInstOut);
181 gAeInstOut->connectTo(gAeOut);
182 gAeOut->connectTo(gApOut);
183 gApOut->connectTo(gIrmModIn);
184 gIrmModIn->connectTo(gIrmIn);
191 return gIrmIn->isConnected()
192 && gAeIn->isConnected()
193 && gIrmModIn->isConnected()
194 && gApIn->isConnected()
195 && gAeInstIn->isConnected()
196 && gSocketCdapIn->isConnected();
210 EV <<
"Gate inconsistency during creation of a new flow!" << endl;
241 EV <<
"IRM was unable to create bindings!" << endl;
247 std::string dstApName = this->par(
"dstApName").stringValue();
248 std::string dstApInstance = this->par(
"dstApInstance").stringValue();
249 std::string dstAeName = this->par(
"dstAeName").stringValue();
250 std::string dstAeInstance = this->par(
"dstAeInstance").stringValue();
253 dstAeName, dstAeInstance);
271 Enter_Method(
"onA_read()");
275 Enter_Method(
"onA_write()");
279 Enter_Method(
"onA_close()");
285 Enter_Method(
"receiveData()");
287 if (dynamic_cast<CDAP_M_Read*>(msg)) {
288 Enter_Method(
"processMRead()");
292 else if (dynamic_cast<CDAP_M_Read_R*>(msg)) {
293 Enter_Method(
"processMReadR()");
296 else if (dynamic_cast<CDAP_M_Connect_R*>(msg)) {
297 Enter_Method(
"processMConnectR()");
306 else if (dynamic_cast<CDAP_M_Connect*>(msg)) {
310 else if (dynamic_cast<CDAP_M_Write*>(msg)) {
314 else if (dynamic_cast<CDAP_M_Write_R*>(msg)) {
322 Enter_Method(
"receiveAllocationRequestFromFai()");
339 EV <<
"IRM was unable to create bindings!" << endl;
343 EV <<
"QoS Requirement cannot be met, please check AE attributes!" << endl;
350 Enter_Method(
"receiveAllocationResponseNegative()");
361 Enter_Method(
"receiveAllocationResponsePositive()");
389 if (dynamic_cast<CDAP_M_Connect*>(msg) != NULL &&
393 else if(dynamic_cast<CDAP_M_Release*>(msg) != NULL){
405 EV <<
"Sending data before flow is allocated!" << endl;
415 Enter_Method(
"receiveDeallocationRequestFromFai()");
420 EV <<
"deleteBindings() failed during DeallocateRequest processing!" << endl;
426 EV <<
"IRM.deleteBindings() failed during DeallocateRequest processing!" << endl;
434 EV << this->getFullPath() <<
" deleted bindings" << endl;
440 error(
"Delete gates before flow allocation is impossible!");
443 cGate* gIrmIn =
Irm->gateHalf(
GATE_AEIO, cGate::INPUT, handle1);
444 cGate* gIrmOut =
Irm->gateHalf(
GATE_AEIO, cGate::OUTPUT, handle1);
446 cModule* IrmMod =
Irm->getParentModule();
447 cGate* gIrmModIn = IrmMod->gateHalf(
GATE_NORTHIO,cGate::INPUT, handle1);
448 cGate* gIrmModOut = IrmMod->gateHalf(
GATE_NORTHIO,cGate::OUTPUT, handle1);
452 cModule* SocketMod = this->getModuleByPath(
"^.socket");
453 cGate* gSocketIn = SocketMod->gateHalf(
GATE_SOUTHIO, cGate::INPUT, 0);
454 cGate* gSocketOut = SocketMod->gateHalf(
GATE_SOUTHIO, cGate::OUTPUT, 0);
456 cGate* gAeInstIn = gSocketIn->getPreviousGate();
457 cGate* gAeInstOut = gSocketOut->getNextGate();
459 cGate* gAeIn = gAeInstIn->getPreviousGate();
460 cGate* gAeOut = gAeInstOut->getNextGate();
462 cGate* gApIn = gAeIn->getPreviousGate();
465 cModule* CdapMod = this->getModuleByPath(
"^.commonDistributedApplicationProtocol");
466 cGate* gCdapIn = CdapMod->gateHalf(
GATE_SOUTHIO, cGate::INPUT);
467 cGate* gCdapOut = CdapMod->gateHalf(
GATE_SOUTHIO, cGate::OUTPUT);
469 cGate* gCdapSocketOut = gCdapIn->getPreviousGate();
472 gCdapSocketOut->disconnect();
473 gCdapOut->disconnect();
475 gSocketOut->disconnect();
476 gAeInstIn->disconnect();
478 gAeInstOut->disconnect();
481 gAeOut->disconnect();
485 gIrmOut->disconnect();
486 gIrmModOut->disconnect();
487 gIrmModIn->disconnect();
488 gIrmIn->disconnect();
493 del->
setObjName(this->getModuleByPath(
"^")->getFullName());
498 return !gIrmIn->isConnected()
499 && !gIrmOut->isConnected()
500 && !gIrmModIn->isConnected()
501 && !gIrmModOut->isConnected()
502 && !gApIn->isConnected()
503 && !gAeOut->isConnected()
504 && !gAeIn->isConnected()
505 && !gAeInstOut->isConnected()
506 && !gSocketOut->isConnected()
507 && !gCdapOut->isConnected()
508 && !gCdapSocketOut->isConnected();
564 EV <<
"Emits SendData signal for message " << msg->getName() << endl;
simsignal_t sigAEDeallocReq
LisAEAllResPosi * lisAEAllResPosi
Class representing flow object with attributes from specs.
void setQosRequirements(const QoSReq &qosReqs)
Sets QoS parameters wanted by flow initiator.
simsignal_t sigAESendData
void signalizeDeallocateRequest(Flow *flow)
bool createBindings(Flow &flow)
void receivePositiveConnectResponse(CDAPMessage *msg)
bool deleteBindings(Flow *flow)
const char * SIG_FAI_DeallocateRequest
const char * SIG_AE_AP_API
simsignal_t sigAEEnrolled
const char * SIG_AERIBD_AllocateResponsePositive
void signalizeConnectionRequest(CDAPMessage *msg)
void apiSwitcher(APIReqObj *obj)
void signalizeAllocateResponsePositive(Flow *flow)
virtual void processMReadR(CDAPMessage *msg)
CDAPConnectionState connectionState
Application Process Name class.
void receiveAllocationResponseNegative(Flow *flow)
const APNamingInfo & getApni() const
void signalizeSendData(cMessage *msg)
void signalizeAllocateResponseNegative(Flow *flow)
const char * SIG_AE_DeallocateRequest
void receiveAllocationResponsePositive(Flow *flow)
simsignal_t sigAEAllocReq
void receiveData(CDAPMessage *obj)
void changeStatus(Flow *flow, ConnectionTableEntry::ConnectionStatus status)
void signalizeAllocateRequest(Flow *flow)
virtual bool onA_write(APIReqObj *obj)
bool receiveAllocationRequestFromAe(Flow *flow)
void startCACE(Flow *flow)
virtual void initialize()
const char * SIG_AE_AllocateRequest
APIReqObj::APIReqType getAPIReqType()
const char * SIG_FAI_AllocateResponseNegative
LisAEEnrolled * lisAEEnrolled
APNamingInfo holds complete naming info for particular application process.
void receiveConnectRequest(CDAPMessage *msg)
const QoSReq & getQosRequirements() const
Gets QoS parameters wanted by flow initiator.
bool receiveDeallocationRequestFromAe(Flow *flow)
simsignal_t sigAEAllocResPosi
const char * SIG_FAI_DeallocateResponse
void setObjName(std::string objName)
const char * SIG_AE_DataSend
virtual void afterOnStart()
void receiveAllocationRequestFromFAI(Flow *flow)
virtual void processMWriteR(CDAPMessage *msg)
virtual void handleMessage(cMessage *msg)
const char * SIG_AE_ReleaseRequest
const char * GATE_SOUTHIO
const char * SIG_AP_AE_API
void signalizeAEAPAPI(APIResult *obj)
void signalizeReleaseRequest(CDAPMessage *msg)
virtual void processMRead(CDAPMessage *msg)
const char * SIG_AE_Enrolled
void setAPIResType(APIResult::APIResType type)
void setInvokeId(unsigned long id)
const char * GATE_NORTHIO
virtual result_t & getResult()
void sendDeallocationRequest(Flow *flow)
CDAPConnectionState getConStatus()
const char * SIG_FAI_AllocateResponsePositive
const char * SIG_AERIBD_AllocateResponseNegative
const QoSReq & getQoSRequirements() const
virtual bool onA_read(APIReqObj *obj)
void initSignalsAndListeners()
void setNorthGates(Flow *flow, cGate *nIn, cGate *nOut)
void setCDAPConId(unsigned long id)
LisAEDeallReqFromFai * lisAEDeallResFromFai
LisAEAllResNega * lisAEAllResNega
bool compare(const QoSReq &other) const
const char * SIG_AE_ConnectionRequest
void receiveDeallocationRequestFromFAI(Flow *flow)
LisAEDeallReqFromFai * lisAEDeallReqFromFai
void sendData(Flow *flow, CDAPMessage *msg)
bool receiveAllocationResponsePositiveFromIpc(Flow *flow)
simsignal_t sigAEAllocResNega
void changeConStatus(CDAPConnectionState conState)
virtual void processMWrite(CDAPMessage *msg)
const char * SIG_CDAP_DateReceive
void receiveNegativeConnectResponse(CDAPMessage *msg)
LisAEReceiveData * lisAERcvData
const int VAL_UNDEF_HANDLE
const char * MOD_IPCRESMANAGER
void sendAllocationRequest(Flow *flow)
bool deleteBindings(Flow &flow)
int getIrmGateHandle(Flow *flow) const