RINASim  October 2016
Documentation of framework for OMNeT++
FAI.cc
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 #include "FAI.h"
24 
25 const char* TIM_CREREQ = "CreateRequestTimer";
26 const char* MOD_ALLOCRETRYPOLICY= "allocateRetryPolicy";
27 
29 
31  FaModule = NULL;
32  //creReqTimer = NULL;
33 }
34 
36  FaModule = NULL;
37  FlowObject = NULL;
38  degenerateDataTransfer = false;
43 
44  //if (creReqTimer)
45  // cancelAndDelete(creReqTimer);
46 }
47 
53 
54  //creReqTimeout = par(PAR_CREREQTIMEOUT).doubleValue();
55 
56  AllocRetryPolicy = getRINAModule<AllocateRetryBase*>(this, 1, {MOD_ALLOCRETRYPOLICY});
57 
59  WATCH_PTR(FlowObject);
60 
62 }
63 
64 void FAI::postInitialize(FABase* fa, Flow* fl, EFCP* efcp) {
65  //Initialize pointers! It cannot be done during model creation :(
66  this->FaModule = fa;
67  this->FlowObject = fl;
68  this->EfcpModule = efcp;
69 }
70 
72  Enter_Method("receiveAllocateRequest()");
73 
74  //Check for proper FSM state
78  EV << "Cannot allocate flow which is not in pending state" << endl;
79  return false;
80  }
81 
82  //Invoke NewFlowReqPolicy
83  bool status = this->FaModule->invokeNewFlowRequestPolicy(this->FlowObject);
84  if (!status){
85  EV << "invokeNewFlowPolicy() failed" << endl;
88  return false;
89  }
90 
91  status = this->createEFCPI();
92  if (!status) {
93  EV << "createEFCP() failed" << endl;
96  return false;
97  }
98 
99  status = this->createBindings();
100  if (!status) {
101  EV << "createBindings() failed" << endl;
104  return false;
105  }
106 
107  //EV << "!!!!!!" << FlowObject->info() << endl << FlowObject->getDstNeighbor() << endl;
108 
109  // bind this flow to a suitable (N-1)-flow
110  RABase* raModule = getRINAModule<RABase*>(this, 2, {MOD_RESALLOC, MOD_RA});
111 
112  status = isDegenerateDataTransfer() ? true : raModule->bindNFlowToNM1Flow(FlowObject);
113  //IF flow is already available then schedule M_Create(Flow)
114  if (status) {
116  }
117 
118  //Everything went fine
119  return true;
120 }
121 
123  Enter_Method("receiveAllocateResponsePositive()");
124 
125  //Check for proper FSM state
129  EV << "Cannot continue allocation of flow which is not in pending state" << endl;
130  return false;
131  }
132 
133 
134  //Instantiate EFCPi
135  bool status = this->createEFCPI();
136  if (!status) {
137  EV << "createEFCP() failed" << endl;
139  //Schedule negative M_Create_R(Flow)
141  return false;
142  }
143 
144  //Interconnect IPC <-> EFCPi <-> RMT
145  status = this->createBindings();
146  if (!status) {
147  EV << "createBindings() failed" << endl;
149  //Schedule M_Create_R(Flow-)
151  return false;
152  }
153 
154  // bind this flow to a suitable (N-1)-flow
155  RABase* raModule = getRINAModule<RABase*>(this, 2, {MOD_RESALLOC, MOD_RA});
156  status = isDegenerateDataTransfer() ? true : raModule->bindNFlowToNM1Flow(FlowObject);
157 
159  //Signalizes M_Create_R(flow)
160  if (status) {
162  }
163 
164  return true;
165 }
166 
168  Enter_Method("receiveAllocateResponseNegative()");
169  //Check for proper FSM state
173  EV << "Cannot continue allocation of flow which is not in pending state" << endl;
174  return;
175  }
176 
178 
179  //IF it is not DDT then retry M_CREATE
180  //if (!isDegenerateDataTransfer())
182 }
183 
185  Enter_Method("receiveCreateRequest()");
186 
187  //Check for proper FSM state
191  EV << "Cannot allocate flow which is not in pending state" << endl;
192  return false;
193  }
194 
195  //Invoke NewFlowReqPolicy
196  bool status = this->FaModule->invokeNewFlowRequestPolicy(this->FlowObject);
197  if (!status){
198  EV << "invokeNewFlowPolicy() failed" << endl;
199  //Schedule negative M_Create_R(Flow)
202  return false;
203  }
204 
205  //Create IPC north gates
207 
208  //Pass AllocationRequest to AP or RIBd
210 
211  //Everything went fine
212  return true;
213 }
214 
216  Enter_Method("receiveDeallocateRequest()");
217 
218  //Check for proper FSM state
222  EV << "Cannot deallocate flow which is not in deallocate pending state" << endl;
223  return false;
224  }
225 
226  //deleteBindings
227  bool status = this->deleteBindings();
228 
229  //Signalize M_Delete(Flow)
231 
232  return status;
233 }
234 
236  Enter_Method("receiveDeleteRequest()");
237 
238  //Check for proper FSM state
242  EV << "Cannot deallocate flow which is not in transfer state" << endl;
243  return;
244  }
245 
247 
248  //Get deallocation invokeId from Request
250 
251  //Notify application
253 
254  //DeleteBindings
255  this->deleteBindings();
256 
257  //Signalizes M_Delete_R(Flow)
259 
261  fte->setTimeDeleted(simTime());
262 }
263 
265  Enter_Method("receiveCreResNegative()");
266 
267  //invokeAllocateRetryPolicy
268  bool status = this->invokeAllocateRetryPolicy();
269 
270  //If number of retries IS NOT reached THEN ...
271  if (status) {
273  }
274  //...otherwise signalize to AE or RIBd failure
275  else {
276  EV << "invokeAllocateRetryPolicy() failed" << endl;
279  }
280 
281  return status;
282 }
283 
285  Enter_Method("receiveCreResPositive()");
286  //TODO: Vesely - D-Base-2011-015.pdf, p.9
287  // Create bindings. WTF? Bindings should be already created!''
288 
289  //cancelEvent(creReqTimer);
290 
291  //Change dstCep-Id and dstPortId according to new information
294  remotePortId = flow->getDstPortId();
295  remoteCEPId = flow->getConId().getDstCepId();
298 
299  //Change status
301 
302  //if (FlowObject->isManagementFlowLocalToIPCP()) {
303  // signalizeAllocateRequestToOtherFais( FlowObject );
304  //}
305  //else {
306  //Pass Allocate Response to AE or RIBd
308  //}
309 
310  //FIXME: Vesely - always true
311  return true;
312 }
313 
315  Enter_Method("receiveDeleteResponse()");
316 
317  //Check for proper FSM state
321  EV << "Cannot deallocate flow which is not in deallocatre pending state" << endl;
322  return;
323  }
324 
325  //Notify application
327 
329  fte->setTimeDeleted(simTime());
330 }
331 
332 void FAI::handleMessage(cMessage *msg) {
333  /*
334  //CreateRequest was not delivered in time
335  if ( !strcmp(msg->getName(), TIM_CREREQ) ) {
336  //Increment and resend
337  bool status = receiveCreateResponseNegative();
338  if (!status)
339  EV << "CreateRequest retries reached its maximum!" << endl;
340  }
341  */
342 }
343 
344 std::string FAI::info() const {
345  std::stringstream os;
346  os << "FAI>" << endl
347  << "\tlocal Port-ID: " << this->localPortId << "\tCEP-ID: " << this->localCEPId << endl
348  << "\tremote Port-ID: " << this->remotePortId << "\tCEP-ID: " << this->remoteCEPId;
349  return os.str();
350 }
351 
352 //Free function
353 std::ostream& operator<< (std::ostream& os, const FAI& fai) {
354  return os << fai.info();
355 }
356 
358  EV << this->getFullPath() << " attempts to create EFCP instance" << endl;
359  //Create EFCPI for local bindings
361  return efcpi ? true : false;
362 }
363 
365  EV << this->getFullPath() << " attempts to bind EFCP and RMT" << endl;
366 
367  cModule* IPCModule = FaModule->getModuleByPath("^.^");
368 
369  std::ostringstream nameEfcpNorth;
370  nameEfcpNorth << GATE_APPIO_ << localPortId;
371  cModule* efcpModule = getRINAModule<cModule*>(IPCModule, 0, {MOD_EFCP});
372  cGate* gateEfcpUpIn = efcpModule->gateHalf(nameEfcpNorth.str().c_str(), cGate::INPUT);
373  cGate* gateEfcpUpOut = efcpModule->gateHalf(nameEfcpNorth.str().c_str(), cGate::OUTPUT);
374 
375  //Management Flow should be connected with RIBd
377  std::ostringstream ribdName;
378  ribdName << GATE_EFCPIO_ << localPortId;
379  cModule* ribdModule = getRINAModule<cModule*>(IPCModule, 0, {MOD_RIBDAEMON});
380  cModule* ribdSplitterModule =
381  getRINAModule<cModule*>(IPCModule, 0, {MOD_RIBDAEMON, MOD_RIBDSPLITTER});
382 
383  if (!ribdModule->hasGate(ribdName.str().c_str()))
384  {createNorthGates();}
385 
386  cGate* gateRibdIn = ribdModule->gateHalf(ribdName.str().c_str(), cGate::INPUT);
387  cGate* gateRibdOut = ribdModule->gateHalf(ribdName.str().c_str(), cGate::OUTPUT);
388  cGate* gateRibdSplitIn = ribdSplitterModule->gateHalf(ribdName.str().c_str(), cGate::INPUT);
389  cGate* gateRibdSplitOut = ribdSplitterModule->gateHalf(ribdName.str().c_str(), cGate::OUTPUT);
390 
391  //EFCPi.efcpio <--> RIBDaemon.efcpIo_ <--> RIBDaemon.ribdSplitter.efcpIo_
392  gateEfcpUpOut->connectTo(gateRibdIn);
393  gateRibdIn->connectTo(gateRibdSplitIn);
394  gateRibdSplitOut->connectTo(gateRibdOut);
395  gateRibdOut->connectTo(gateEfcpUpIn);
396  }
397  //Data flow
398  else {
399  std::ostringstream nameIpcDown;
400  nameIpcDown << GATE_NORTHIO_ << localPortId;
401 
402  //IF called as consequence of AllocateRequest then createNorthGate
403  //ELSE (called as consequence of CreateRequestFlow) skip
404  if (!IPCModule->hasGate(nameIpcDown.str().c_str()))
405  {createNorthGates();}
406 
407  cGate* gateIpcDownIn = IPCModule->gateHalf(nameIpcDown.str().c_str(), cGate::INPUT);
408  cGate* gateIpcDownOut = IPCModule->gateHalf(nameIpcDown.str().c_str(), cGate::OUTPUT);
409 
410  //IPCModule.northIo <--> Efcp.fai
411  gateEfcpUpOut->connectTo(gateIpcDownOut);
412  gateIpcDownIn->connectTo(gateEfcpUpIn);
413  }
414 
415  //Create bindings in RMT
416  RMT* rmtModule = getRINAModule<RMT*>(IPCModule, 0, {MOD_RELAYANDMUX, MOD_RMT});
417  rmtModule->createEfcpiGate(localCEPId);
418 
419  std::ostringstream nameRmtUp;
420  nameRmtUp << GATE_EFCPIO_ << localCEPId;
421  cGate* gateRmtUpIn = rmtModule->getParentModule()->gateHalf(nameRmtUp.str().c_str(), cGate::INPUT);
422  cGate* gateRmtUpOut = rmtModule->getParentModule()->gateHalf(nameRmtUp.str().c_str(), cGate::OUTPUT);
423 
424  std::ostringstream nameEfcpDown;
425  nameEfcpDown << GATE_RMT_ << localCEPId;
426  cGate* gateEfcpDownIn = efcpModule->gateHalf(nameEfcpDown.str().c_str(), cGate::INPUT);
427  cGate* gateEfcpDownOut = efcpModule->gateHalf(nameEfcpDown.str().c_str(), cGate::OUTPUT);
428 
429  //Efcp.rmt <--> Rmt.efcpIo
430  gateRmtUpOut->connectTo(gateEfcpDownIn);
431  gateEfcpDownOut->connectTo(gateRmtUpIn);
432 
433  return gateEfcpDownIn->isConnected() && gateEfcpDownOut->isConnected()
434  && gateEfcpUpIn->isConnected() && gateEfcpUpOut->isConnected()
435  && gateRmtUpIn->isConnected() && gateRmtUpOut->isConnected();
436 
437 }
438 
440  EV << this->getFullPath() << " attempts to disconnect bindings between EFCP, IPC and RMT" << endl;
441 
442  //Flush All messages in EFCPI
443  EfcpModule->deleteEFCPI(this->getFlow());
444 
445  //Management flow
447  std::ostringstream ribdName;
448  ribdName << GATE_EFCPIO_ << localPortId;
449  cModule* ribdModule = getRINAModule<cModule*>(this, 2, {MOD_RIBDAEMON});
450  cModule* ribdSplitterModule = getRINAModule<cModule*>(this, 2, {MOD_RIBDAEMON, MOD_RIBDSPLITTER});
451 
452  cGate* gateRibdIn = ribdModule->gateHalf(ribdName.str().c_str(), cGate::INPUT);
453  cGate* gateRibdOut = ribdModule->gateHalf(ribdName.str().c_str(), cGate::OUTPUT);
454  cGate* gateRibdSplitIn = ribdSplitterModule->gateHalf(ribdName.str().c_str(), cGate::INPUT);
455  cGate* gateRibdSplitOut = ribdSplitterModule->gateHalf(ribdName.str().c_str(), cGate::OUTPUT);
456 
457  gateRibdIn->disconnect();
458  gateRibdOut->disconnect();
459  gateRibdSplitIn->disconnect();
460  gateRibdSplitOut->disconnect();
461  }
462  //Data flow
463  else {
464  cModule* IPCModule = FaModule->getModuleByPath("^.^");
465  std::ostringstream nameIpcDown;
466  nameIpcDown << GATE_NORTHIO_ << localPortId;
467  cGate* gateIpcDownIn = IPCModule->gateHalf(nameIpcDown.str().c_str(), cGate::INPUT);
468  cGate* gateIpcDownOut = IPCModule->gateHalf(nameIpcDown.str().c_str(), cGate::OUTPUT);
469 
470  //IPCModule.northIo
471  gateIpcDownOut->disconnect();
472  gateIpcDownIn->disconnect();
473  }
474 
475  //Delete EFCP bindings
476  std::ostringstream nameEfcpNorth;
477  nameEfcpNorth << GATE_APPIO_ << localPortId;
478  cModule* efcpModule = getRINAModule<cModule*>(this, 2, {MOD_EFCP});
479  cGate* gateEfcpUpIn = efcpModule->gateHalf(nameEfcpNorth.str().c_str(), cGate::INPUT);
480  cGate* gateEfcpUpOut = efcpModule->gateHalf(nameEfcpNorth.str().c_str(), cGate::OUTPUT);
481  gateEfcpUpIn->disconnect();
482  gateEfcpUpOut->disconnect();
483 
484  //Delete bindings in RMT
485  RMT* rmtModule = getRINAModule<RMT*>(this, 2, {MOD_RELAYANDMUX, MOD_RMT});
486 
487  std::ostringstream nameRmtUp;
488  nameRmtUp << GATE_EFCPIO_ << localCEPId;
489  cGate* gateRmtUpIn = rmtModule->getParentModule()->gateHalf(nameRmtUp.str().c_str(), cGate::INPUT);
490  cGate* gateRmtUpOut = rmtModule->getParentModule()->gateHalf(nameRmtUp.str().c_str(), cGate::OUTPUT);
491 
492  std::ostringstream nameEfcpDown;
493  nameEfcpDown << GATE_RMT_ << localCEPId;
494  cGate* gateEfcpDownIn = efcpModule->gateHalf(nameEfcpDown.str().c_str(), cGate::INPUT);
495  cGate* gateEfcpDownOut = efcpModule->gateHalf(nameEfcpDown.str().c_str(), cGate::OUTPUT);
496 
497  //Efcp.rmt <- XX -> Rmt.efcpIo
498  gateRmtUpOut->disconnect();
499  gateRmtUpIn->disconnect();
500  gateEfcpDownIn->disconnect();
501  gateEfcpDownOut->disconnect();
502 
503  rmtModule->deleteEfcpiGate(localCEPId);
504 
505  return true;
506 }
507 
509  //Increase CreateFlowRetries
510  //cancelEvent(creReqTimer);
511  return AllocRetryPolicy->run(*getFlow());
512 }
513 
515  cModule* catcher2 = this->getModuleByPath("^.^");
516  cModule* catcher3 = this->getModuleByPath("^.^.^");
517  //Signals that module emits
518  sigFAIAllocReq = registerSignal(SIG_FAI_AllocateRequest);
523  sigFAICreReq = registerSignal(SIG_FAI_CreateFlowRequest);
524  sigFAIDelReq = registerSignal(SIG_FAI_DeleteFlowRequest);
525  sigFAIDelRes = registerSignal(SIG_FAI_DeleteFlowResponse);
528 
529  //Signals that module processes
530  // AllocationRequest
531  this->lisAllocReq = new LisFAIAllocReq(this);
532  catcher3->subscribe(SIG_toFAI_AllocateRequest, this->lisAllocReq);
533  // AllocationRespNegative
534  this->lisAllocResNega = new LisFAIAllocResNega(this);
535  catcher3->subscribe(SIG_AERIBD_AllocateResponseNegative, this->lisAllocResNega);
536  // AllocationRespPositive
537  this->lisAllocResPosi = new LisFAIAllocResPosi(this);
538  catcher3->subscribe(SIG_AERIBD_AllocateResponsePositive, this->lisAllocResPosi);
539 // // CreateFlowRequest
540 // this->lisCreReq = new LisFAICreReq(this);
541 // catcher->subscribe(SIG_FAI_CreateFlowRequest, this->lisCreReq);
542  // CreateFlowResponseNegative
543  this->lisCreResNega = new LisFAICreResNega(this);
544  catcher3->subscribe(SIG_RIBD_CreateFlowResponseNegative, this->lisCreResNega);
545  // CreateFlowResponsePositive
546  this->lisCreResPosi = new LisFAICreResPosi(this);
547  catcher3->subscribe(SIG_RIBD_CreateFlowResponsePositive, this->lisCreResPosi);
548 
549  // CreateFlowResponseNegative
552  // CreateFlowResponsePositive
555 
556  //DeleteRequestFlow
557  lisDelReq = new LisFAIDelReq(this);
558  catcher2->subscribe(SIG_RIBD_DeleteRequestFlow, lisDelReq);
559 
560  //DeleteResponseFlow
561  lisDelRes = new LisFAIDelRes(this);
562  catcher2->subscribe(SIG_RIBD_DeleteResponseFlow, lisDelRes);
563 
564 }
565 
567  //creReqTimer = new cMessage(TIM_CREREQ);
568  //Start timer
569  //scheduleAt(simTime() + creReqTimeout, creReqTimer);
570  //Signalize RIBd to send M_CREATE(flow)
571  emit(this->sigFAICreReq, FlowObject);
572 }
573 
575  emit(this->sigFAIDelRes, this->FlowObject);
576 
577 }
578 
580  emit(this->sigFAICreResPosi, FlowObject);
581 }
582 
584  emit(this->sigFAICreResNega, FlowObject);
585 }
586 
588  EV << "Trying to notify " << FlowObject->getSrcApni() << endl;
589  emit(sigFAIAllocReq, FlowObject);
590 }
591 
593  emit(this->sigFAIDelReq, this->FlowObject);
594 }
595 
597  emit(this->sigFAIAllocResNega, this->FlowObject);
598 }
599 
601  emit(this->sigFAIDeallocReq, this->FlowObject);
602 }
603 
605  emit(this->sigFAIDeallocRes, this->FlowObject);
606 }
607 
608 int FAI::getLocalCepId() const {
609  return localCEPId;
610 }
611 
612 void FAI::setLocalCepId(int localCepId) {
613  localCEPId = localCepId;
614 }
615 
616 int FAI::getLocalPortId() const {
617  return localPortId;
618 }
619 
620 void FAI::setLocalPortId(int localPortId) {
621  this->localPortId = localPortId;
622 }
623 
624 int FAI::getRemoteCepId() const {
625  return remoteCEPId;
626 }
627 
628 void FAI::setRemoteCepId(int remoteCepId) {
629  remoteCEPId = remoteCepId;
630 }
631 
632 int FAI::getRemotePortId() const {
633  return remotePortId;
634 }
635 
636 void FAI::setRemotePortId(int remotePortId) {
637  this->remotePortId = remotePortId;
638 }
639 
641  emit(this->sigFAIAllocResPosi, this->FlowObject);
642 }
643 
645  //Management flow
647  std::ostringstream ribdName;
648  ribdName << GATE_EFCPIO_ << localPortId;
649  cModule* ribdModule = getRINAModule<cModule*>(this, 2, {MOD_RIBDAEMON});
650  cModule* ribdSplitterModule =
651  getRINAModule<cModule*>(this, 2, {MOD_RIBDAEMON, MOD_RIBDSPLITTER});
652  ribdModule->addGate(ribdName.str().c_str(), cGate::INOUT, false);
653  ribdSplitterModule->addGate(ribdName.str().c_str(), cGate::INOUT, false);
654  }
655  //Data flow
656  else {
657  std::ostringstream nameIpcDown;
658  nameIpcDown << GATE_NORTHIO_ << localPortId;
659  cModule* IPCModule = FaModule->getModuleByPath("^.^");
660  IPCModule->addGate(nameIpcDown.str().c_str(), cGate::INOUT, false);
661  }
662  return;
663 }
664 
666  Enter_Method("receiveCreFlowResPositiveFromNminusOne()");
667  //Schedule M_Create(Flow)
669 }
670 
673 }
674 
EFCP * EfcpModule
Definition: FAI.h:123
std::ostream & operator<<(std::ostream &os, const FAI &fai)
Definition: FAI.cc:353
virtual void receiveDeleteRequest(Flow *flow)
Definition: FAI.cc:235
LisFAIDelRes * lisDelRes
Definition: FAI.h:115
Class representing flow object with attributes from specs.
Definition: Flow.h:45
AllocateRetryBase * AllocRetryPolicy
Definition: FAI.h:89
const char * MOD_RESALLOC
Definition: ExternConsts.cc:58
const APNamingInfo & getSrcApni() const
Gets read-only source APNamingInfo.
Definition: Flow.cc:134
NFlowTableEntry::EAllocateStatus getAllocateStatus() const
const char * SIG_FAI_DeallocateRequest
Definition: RINASignals.cc:106
int getRemotePortId() const
Definition: FAI.cc:632
void signalizeDeleteFlowRequest()
Definition: FAI.cc:592
simsignal_t sigFAIDeallocReq
Definition: FAI.h:98
const char * SIG_AERIBD_AllocateResponsePositive
Definition: RINASignals.cc:91
Flow * getFlow()
Definition: FAIBase.h:49
const char * GATE_RMT_
const char * SIG_FAI_CreateFlowRequest
Definition: RINASignals.cc:110
const int VAL_UNDEF_PORTID
Definition: Flow.cc:25
ConnectionId & getConnectionId()
Gets Flow's ConnectionId.
Definition: Flow.cc:209
int getLocalPortId() const
Definition: FAI.cc:616
const char * SIG_RIBD_DeleteRequestFlow
Definition: RINASignals.cc:47
void createNorthGates()
Definition: FAI.cc:644
void signalizeAllocateResponsePositive()
Definition: FAI.cc:640
void signalizeCreateFlowRequest()
Definition: FAI.cc:566
void signalizeCreateFlowResponsePositive()
Definition: FAI.cc:579
const char * MOD_EFCP
Definition: ExternConsts.cc:40
void signalizeDeallocateResponseFromFai()
Definition: FAI.cc:604
Define_Module(FAI)
virtual bool receiveAllocateResponsePositive()
Definition: FAI.cc:122
int remoteCEPId
Definition: FAI.h:87
const char * SIG_RIBD_DeleteResponseFlow
Definition: RINASignals.cc:48
const char * SIG_FAI_CreateFlowResponseNegative
Definition: RINASignals.cc:113
void setRemotePortId(int remotePortId)
Definition: FAI.cc:636
int localPortId
Definition: FAI.h:84
std::string info() const
Definition: FAI.cc:344
EFCPInstance * createEFCPI(const Flow *flow, int cepId, int portId)
Definition: EFCP.cc:128
void initSignalsAndListeners()
Definition: FAI.cc:514
const char * SIG_toFAI_AllocateRequest
Definition: RINASignals.cc:102
virtual void handleMessage(cMessage *msg)
Definition: FAI.cc:332
bool invokeAllocateRetryPolicy()
Definition: FAI.cc:508
const char * GATE_NORTHIO_
void changeAllocStatus(Flow *flow, NFlowTableEntry::EAllocateStatus status)
Definition: NFlowTable.cc:173
const char * SIG_FAI_DeleteFlowRequest
Definition: RINASignals.cc:111
void setDstPortId(int dstPortId)
Sets destination PortId.
Definition: Flow.cc:114
LisFAIAllocResNega * lisAllocResNega
Definition: FAI.h:110
void deleteEfcpiGate(unsigned int efcpiId)
Definition: RMT.cc:373
LisFAIAllocReq * lisAllocReq
Definition: FAI.h:109
const char * MOD_RIBDSPLITTER
Definition: ExternConsts.cc:61
const char * GATE_APPIO_
FAI()
Definition: FAI.cc:30
const char * SIG_FAI_AllocateResponseNegative
Definition: RINASignals.cc:109
LisFAIDelReq * lisDelReq
Definition: FAI.h:114
virtual void receiveDeleteResponse()
Definition: FAI.cc:314
const char * MOD_RIBDAEMON
Definition: ExternConsts.cc:60
void setDstCepId(int destCepId)
Setter of destination Connection-Endpoint identifier.
Definition: ConnectionId.cc:39
LisFAICreResNega * lisCreResNega
Definition: FAI.h:112
const int VAL_UNDEF_CEPID
Definition: ConnectionId.cc:26
int getDstPortId() const
Gets destination PortId.
Definition: Flow.cc:110
bool createBindings()
Definition: FAI.cc:364
Definition: EFCP.h:54
int getLocalCepId() const
Definition: FAI.cc:608
const char * SIG_FAI_DeleteFlowResponse
Definition: RINASignals.cc:114
const char * SIG_FAI_DeallocateResponse
Definition: RINASignals.cc:107
virtual void receiveAllocateResponseNegative()
Definition: FAI.cc:167
Definition: FAI.h:47
bool createEFCPI()
Definition: FAI.cc:357
LisFAICreResNegaNminusOne * lisCreResNegaNmO
Definition: FAI.h:117
FABase * FaModule
Definition: FAI.h:94
int remotePortId
Definition: FAI.h:86
virtual bool receiveCreateResponseNegative()
Definition: FAI.cc:264
virtual bool bindNFlowToNM1Flow(Flow *flow)=0
LisFAICreResPosiNminusOne * lisCreResPosiNmO
Definition: FAI.h:116
const char * MOD_RELAYANDMUX
Definition: ExternConsts.cc:57
void setTimeDeleted(const simtime_t &timDel)
simsignal_t sigFAIAllocResPosi
Definition: FAI.h:100
virtual void receiveCreateFlowResponsePositiveFromNminusOne()
Definition: FAI.cc:665
virtual bool receiveAllocateRequest()
Definition: FAI.cc:71
const char * SIG_FAI_CreateFlowResponsePositive
Definition: RINASignals.cc:112
void setLocalPortId(int localPortId)
Definition: FAI.cc:620
simsignal_t sigFAIDelReq
Definition: FAI.h:103
virtual bool receiveCreateRequest()
Definition: FAI.cc:184
simsignal_t sigFAICreResPosi
Definition: FAI.h:106
LisFAIAllocResPosi * lisAllocResPosi
Definition: FAI.h:111
int getDstCepId() const
Getter of destination Connection-Endpoint identifier.
Definition: ConnectionId.cc:34
bool isDegenerateDataTransfer() const
Definition: FAIBase.h:53
simsignal_t sigFAIAllocResNega
Definition: FAI.h:101
Definition: RMT.h:60
void setLocalCepId(int localCepId)
Definition: FAI.cc:612
bool degenerateDataTransfer
Definition: FAIBase.h:63
simsignal_t sigFAIDeallocRes
Definition: FAI.h:99
void signalizeDeleteFlowResponse()
Definition: FAI.cc:574
Definition: RABase.h:36
virtual void receiveCreateFlowResponseNegativeFromNminusOne()
Definition: FAI.cc:671
virtual bool receiveCreateResponsePositive(Flow *flow)
Definition: FAI.cc:284
int getRemoteCepId() const
Definition: FAI.cc:624
simsignal_t sigFAICreReq
Definition: FAI.h:102
void setRemoteCepId(int remoteCepId)
Definition: FAI.cc:628
void createEfcpiGate(unsigned int efcpiId)
Definition: RMT.cc:339
NFlowTable * getNFlowTable() const
Definition: FABase.cc:36
const char * SIG_FAI_AllocateResponsePositive
Definition: RINASignals.cc:108
const char * SIG_AERIBD_AllocateResponseNegative
Definition: RINASignals.cc:92
const ConnectionId & getConId() const
Gets read-only Flow's ConnectionId.
Definition: Flow.cc:86
const char * MOD_RA
Definition: ExternConsts.cc:55
const char * TIM_CREREQ
FlowAllocatorInstance class.
Definition: FAI.cc:25
LisFAICreResPosi * lisCreResPosi
Definition: FAI.h:113
const char * SIG_RIBD_CreateFlowResponsePositive
Definition: RINASignals.cc:51
const char * PAR_LOCALPORTID
Definition: ExternConsts.cc:95
const char * PAR_LOCALCEPID
Definition: ExternConsts.cc:96
bool deleteEFCPI(Flow *flow)
Definition: EFCP.cc:360
void signalizeAllocationRequestFromFai()
Definition: FAI.cc:587
const char * PAR_REMOTECEPID
Definition: ExternConsts.cc:98
Flow * FlowObject
Definition: FAIBase.h:62
const char * PAR_REMOTEPORTID
Definition: ExternConsts.cc:97
virtual void initialize()
Definition: FAI.cc:48
virtual ~FAI()
Definition: FAI.cc:35
Definition: FABase.h:33
void postInitialize(FABase *fa, Flow *fl, EFCP *efcp)
Definition: FAI.cc:64
bool deleteBindings()
Definition: FAI.cc:439
const char * GATE_EFCPIO_
virtual bool invokeNewFlowRequestPolicy(Flow *flow)=0
simsignal_t sigFAIAllocReq
Definition: FAI.h:97
const char * MOD_RMT
Definition: ExternConsts.cc:62
void signalizeCreateFlowResponseNegative()
Definition: FAI.cc:583
void signalizeAllocateResponseNegative()
Definition: FAI.cc:596
void signalizeDeallocateRequestFromFai()
Definition: FAI.cc:600
bool isManagementFlowLocalToIPCP() const
Definition: Flow.cc:370
virtual bool receiveDeallocateRequest()
Definition: FAI.cc:215
const char * MOD_ALLOCRETRYPOLICY
Definition: FAI.cc:26
int localCEPId
Definition: FAI.h:85
const char * SIG_FAI_AllocateRequest
Definition: RINASignals.cc:105
const char * SIG_RIBD_CreateFlowResponseNegative
Definition: RINASignals.cc:50
NFlowTableEntry * findEntryByFlow(const Flow *flow)
Definition: NFlowTable.cc:155
simsignal_t sigFAIDelRes
Definition: FAI.h:104
virtual bool run(Flow &flow)
void setDeallocInvokeId(long deallocInvokeId)
Sets deallocation InvokeId.
Definition: Flow.cc:289
simsignal_t sigFAICreResNega
Definition: FAI.h:105
long getDeallocInvokeId() const
Gets deallocation InvokeId Used inside M_DELETE(_R)(flow) messages.
Definition: Flow.cc:285