49 error(
"ConTab is NULL!");
59 if (!msg->isSelfMessage()) {
61 bool isGoingUp =
false;
64 cPacket* packet =
dynamic_cast<cPacket*
>(msg);
70 outPacket = packet->decapsulate();
78 sduData->encapsulate(packet);
87 EV <<
"Received message but destination gate is not in the ConnectionTable!" << endl;
102 cModule* catcher = this->getModuleByPath(
"^.^");
121 Enter_Method(
"createBindings()");
122 EV <<
"Attempts to create bindings and bind registration of gates"<< endl;
130 cModule* Ipc = cte->
getIpc();
131 cModule* IrmMod = this->getParentModule();
145 std::ostringstream nam1;
147 cGate* g1i = Ipc->gateHalf(nam1.str().c_str(), cGate::INPUT);
148 cGate* g1o = Ipc->gateHalf(nam1.str().c_str(), cGate::OUTPUT);
151 std::ostringstream nam2;
153 if (!IrmMod->hasGate(nam2.str().c_str()))
154 IrmMod->addGate(nam2.str().c_str(), cGate::INOUT,
false);
155 cGate* g2i = IrmMod->gateHalf(nam2.str().c_str(), cGate::INPUT);
156 cGate* g2o = IrmMod->gateHalf(nam2.str().c_str(), cGate::OUTPUT);
159 if (!this->hasGate(nam2.str().c_str()))
160 this->addGate(nam2.str().c_str(), cGate::INOUT,
false);
161 cGate* g3i = this->gateHalf(nam2.str().c_str(), cGate::INPUT);
162 cGate* g3o = this->gateHalf(nam2.str().c_str(), cGate::OUTPUT);
167 if (!g1o->getNextGate())
169 if (!g2i->getNextGate())
172 if (!g3o->getNextGate())
174 if (!g2o->getNextGate())
185 Enter_Method(
"receiveAllocateRequest()");
186 EV << this->getFullPath() <<
" received Allocation Request" << endl;
197 EV <<
"Flow not allocated!\n" << flow << endl;
200 EV <<
"FA could not be found in ConnectionTable!" << endl;
206 Enter_Method(
"receiveDeallocateRequest()");
207 EV << this->getFullPath() <<
" received DeallocationRequest" << endl;
216 && cte->getSouthGateOut() && cte->getSouthGateIn() ) {
220 EV <<
"Connection not in proper state or south gates are missing!" << endl;
224 EV <<
"There is no valid entry in Connection Table!" << endl;
236 Enter_Method(
"newFlow()");
244 EV <<
"DifAllocator returned NULL for resolving " << flow->
getDstApni().
getApn() << endl;
251 EV <<
"Local CS does not have any IPC in DIF " << addr.
getDifName() << endl;
263 std::ostringstream os;
277 Enter_Method(
"allocationResponsePositive()");
288 Enter_Method(
"deleteBindings()");
289 EV <<
"Attempts to delete bindings"<< endl;
293 cModule* Ipc = cte->
getIpc();
294 cModule* IrmMod = this->getParentModule();
300 std::ostringstream nam1;
302 cGate* g1i = Ipc->gateHalf(nam1.str().c_str(), cGate::INPUT);
303 cGate* g1o = Ipc->gateHalf(nam1.str().c_str(), cGate::OUTPUT);
306 std::ostringstream nam2;
308 cGate* g2i = IrmMod->gateHalf(nam2.str().c_str(), cGate::INPUT);
309 cGate* g2o = IrmMod->gateHalf(nam2.str().c_str(), cGate::OUTPUT);
312 cGate* g3i = this->gateHalf(nam2.str().c_str(), cGate::INPUT);
313 cGate* g3o = this->gateHalf(nam2.str().c_str(), cGate::OUTPUT);
324 return !g1o->isConnected() && !g1i->isConnected()
325 && !g2o->isConnected() && !g2i->isConnected()
326 && !g3o->isConnected() && !g3i->isConnected();
349 std::string desc = cte->
getNorthGateIn()->getPreviousGate()->getPreviousGate()->getFullName();
351 return cte->
getNorthGateIn()->getPreviousGate()->getPreviousGate()->getIndex();
const DAP & getDifName() const
Getter of common DIF name.
FABase * getFlowAlloc() const
bool setStatus(Flow *flow, ConnectionTableEntry::ConnectionStatus status)
Class representing flow object with attributes from specs.
bool deleteBindings(Flow *flow)
LisIRMDeallocReq * lisDeallocReq
void initSignalsAndListeners()
const char * MOD_DIFALLOC
cGate * findOutputGate(cGate *input, bool &isGoingUp)
const char * SIG_STAT_IRM_DOWN
virtual bool receiveAllocateRequest(Flow *flow)=0
bool setNorthGates(Flow *flow, cGate *nIn, cGate *nOut)
simsignal_t sigStatIRMPassDown
const char * SIG_AE_DeallocateRequest
const char * GATE_NORTHIO_
bool isDifLocal(const DAP &difName)
void changeStatus(Flow *flow, ConnectionTableEntry::ConnectionStatus status)
virtual void initialize()
FABase * getFa(Flow *flow)
bool receiveAllocationRequestFromAe(Flow *flow)
ConnectionTable * getConTable() const
const APN & getApn() const
Getter of APN.
simsignal_t sigStatIRMPassUp
const char * GATE_SOUTHIO_
const char * SIG_AE_AllocateRequest
FABase * findFaInsideIpc(cModule *ipc)
bool setFa(Flow *flow, FABase *fa)
bool receiveDeallocationRequestFromAe(Flow *flow)
void insertNew(Flow *flow)
ConnectionTableEntry * findEntryByFlow(Flow *flow)
const char * MOD_CONNTABLE
int getApGateHandle(Flow *flow) const
int getSrcPortId() const
Gets source PortId.
const char * SIG_STAT_IRM_UP
cGate * getNorthGateIn() const
void setPolicyDisplayString(cModule *mod, const char *str)
virtual bool receiveDeallocateRequest(Flow *flow)=0
LisIRMAllocReq * lisAllocReq
virtual void handleMessage(cMessage *msg)
void setNorthGates(Flow *flow, cGate *nIn, cGate *nOut)
void updateDisplayString()
bool setSouthGates(Flow *flow, cGate *sIn, cGate *sOut)
bool createBindings(Flow *flow)
cModule * getDifMember(const DAP &difName)
bool receiveAllocationResponsePositiveFromIpc(Flow *flow)
ConnectionTable * ConTable
Address class holds IPC Process identification.
const APNamingInfo & getDstApni() const
Gets read-only destination APNamingInfo.
const int VAL_UNDEF_HANDLE
const Address * resolveApnToBestAddress(const APN &apn)
int getIrmGateHandle(Flow *flow) const