RINASim  October 2016
Documentation of framework for OMNeT++
FA.h
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 
29 #ifndef FA_H_
30 #define FA_H_
31 
32 //Standard libraries
33 #include <omnetpp.h>
34 #include <string>
35 //RINASim libraries
36 #include "FABase.h"
37 #include "FAListeners.h"
38 #include "FAI.h"
39 #include "Flow.h"
40 #include "NFlowTable.h"
41 #include "RINASignals.h"
42 #include "EFCP.h"
43 #include "ExternConsts.h"
44 #include "DA.h"
45 #include "RABase.h"
46 #include "NewFlowRequestBase.h"
47 #include "EnrollmentStateTable.h"
48 
49 //Constants
50 
51 extern const int RANDOM_NUMBER_GENERATOR;
52 extern const int MAX_PORTID;
53 extern const int MAX_CEPID;
54 extern const char* MOD_NEWFLOWREQPOLICY;
55 
56 class FA : public FABase
57 {
58  public:
59  FA();
60  virtual ~FA();
61 
62  virtual bool receiveAllocateRequest(Flow* flow);
63  virtual bool receiveMgmtAllocateRequest(Flow* mgmtflow);
65  virtual bool receiveMgmtAllocateFinish();
66  virtual void receiveNM1FlowCreated(Flow* flow);
67  virtual bool receiveDeallocateRequest(Flow* flow);
68  virtual bool receiveCreateFlowRequestFromRibd(Flow* flow);
69 
70  virtual void deinstantiateFai(Flow* flow);
71 
72  virtual bool setOriginalAddresses(Flow* flow);
73  virtual bool setNeighborAddresses(Flow* flow);
74 
75  bool invokeNewFlowRequestPolicy(Flow* flow);
76 
77  //Signals
78  simsignal_t sigFACreReqFwd;
79  simsignal_t sigFACreResNega;
80  simsignal_t sigFACreResPosiFwd;
81  simsignal_t sigFAAllocFinMgmt;
82 
83  //Listeners
84  //LisFAAllocReq* lisAllocReq;
85  //LisFADeallocReq* lisDeallocReq;
89 
90  protected:
91  //SimpleModule overloads
92  virtual void initialize();
93  virtual void handleMessage(cMessage *msg);
94  void initPointers();
95 
96  private:
102 
103  bool isMalformedFlow(Flow* flow);
104  FAI* createFAI(Flow* flow);
105 
107 
110 
111  const Address getAddressFromDa(const APN& apn, bool useNeighbor, bool isMgmtFlow);
112 
113  bool changeDstAddresses(Flow* flow, bool useNeighbor);
114  bool changeSrcAddress(Flow* flow, bool useNeighbor);
115 
116 };
117 
118 #endif /* FLOWALLOCATOR_H_ */
Class representing flow object with attributes from specs.
Definition: Flow.h:45
void signalizeCreateFlowResponseNegative(Flow *flow)
Definition: FA.cc:513
EnrollmentStateTable * Enrollment
Definition: FA.h:101
virtual bool setOriginalAddresses(Flow *flow)
Definition: FA.cc:191
Enrollment state table .
void signalizeCreateFlowRequestForward(Flow *flow)
Definition: FA.cc:509
bool changeSrcAddress(Flow *flow, bool useNeighbor)
Definition: FA.cc:149
Application Process Name class.
Definition: APN.h:36
bool isMalformedFlow(Flow *flow)
Definition: FA.cc:122
virtual void receiveNM1FlowCreated(Flow *flow)
Definition: FA.cc:444
FAI * createFAI(Flow *flow)
Definition: FA.cc:459
NewFlowRequestBase * NFloReqPolicy
Definition: FA.h:100
simsignal_t sigFACreResNega
Definition: FA.h:79
const int MAX_CEPID
Definition: FA.cc:28
bool invokeNewFlowRequestPolicy(Flow *flow)
Definition: FA.cc:455
EFCP * Efcp
Definition: FA.h:97
const int RANDOM_NUMBER_GENERATOR
Class representing Flow allocator component.
Definition: FA.cc:26
FA()
Definition: FA.cc:33
virtual bool receiveMgmtAllocateRequest(Flow *mgmtflow)
Definition: FA.cc:285
simsignal_t sigFAAllocFinMgmt
Definition: FA.h:81
Definition: EFCP.h:54
APNamingInfo holds complete naming info for particular application process.
Definition: APNamingInfo.h:43
virtual ~FA()
Definition: FA.cc:37
LisFACreReq * lisCreReq
Definition: FA.h:88
virtual bool receiveMgmtAllocateFinish()
Definition: FA.cc:327
Definition: FAI.h:47
virtual bool receiveAllocateRequest(Flow *flow)
Definition: FA.cc:220
virtual bool setNeighborAddresses(Flow *flow)
Definition: FA.cc:204
Definition: FA.h:56
Definition: DA.h:43
const Address getAddressFromDa(const APN &apn, bool useNeighbor, bool isMgmtFlow)
Definition: FA.cc:93
virtual void deinstantiateFai(Flow *flow)
Definition: FA.cc:503
LisFACreFloPosi * lisCreFloPosi
Definition: FA.h:87
Definition: RABase.h:36
virtual void handleMessage(cMessage *msg)
Definition: FA.cc:129
LisFAAllocFinMgmt * lisEnrollFin
Definition: FA.h:86
DA * DifAllocator
Definition: FA.h:98
simsignal_t sigFACreResPosiFwd
Definition: FA.h:80
RABase * RaModule
Definition: FA.h:99
const char * MOD_NEWFLOWREQPOLICY
void initSignalsAndListeners()
Definition: FA.cc:51
bool changeDstAddresses(Flow *flow, bool useNeighbor)
Definition: FA.cc:167
const int MAX_PORTID
Definition: FA.cc:27
Definition: FABase.h:33
virtual bool receiveCreateFlowRequestFromRibd(Flow *flow)
Definition: FA.cc:334
virtual bool receiveDeallocateRequest(Flow *flow)
Definition: FA.cc:421
simsignal_t sigFACreReqFwd
Definition: FA.h:78
void initPointers()
Definition: FA.cc:41
virtual void initialize()
Definition: FA.cc:85
Address class holds IPC Process identification.
Definition: Address.h:42