|
a |
|
b/src/DAF/IRM/IRM.h |
|
|
1 |
//
|
|
|
2 |
// This program is free software: you can redistribute it and/or modify
|
|
|
3 |
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
4 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
5 |
// (at your option) any later version.
|
|
|
6 |
//
|
|
|
7 |
// This program is distributed in the hope that it will be useful,
|
|
|
8 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
9 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
10 |
// GNU Lesser General Public License for more details.
|
|
|
11 |
//
|
|
|
12 |
// You should have received a copy of the GNU Lesser General Public License
|
|
|
13 |
// along with this program. If not, see http://www.gnu.org/licenses/.
|
|
|
14 |
//
|
|
|
15 |
|
|
|
16 |
#ifndef IRM_H_
|
|
|
17 |
#define IRM_H_
|
|
|
18 |
|
|
|
19 |
//Standard libraries
|
|
|
20 |
#include <omnetpp.h>
|
|
|
21 |
//RINASim libraries
|
|
|
22 |
#include "IRMListeners.h"
|
|
|
23 |
#include "ConnectionTable.h"
|
|
|
24 |
#include "ModuleAccess.h"
|
|
|
25 |
#include "RINASignals.h"
|
|
|
26 |
#include "DA.h"
|
|
|
27 |
#include "FABase.h"
|
|
|
28 |
#include "ExternConsts.h"
|
|
|
29 |
|
|
|
30 |
class IRM : public cSimpleModule {
|
|
|
31 |
public:
|
|
|
32 |
IRM();
|
|
|
33 |
virtual ~IRM();
|
|
|
34 |
|
|
|
35 |
void receiveAllocationRequest(cObject* obj);
|
|
|
36 |
void receiveDeallocationRequest(cObject* obj);
|
|
|
37 |
void receiveAllocationResponseNegativeAppNotFound(cObject* obj);
|
|
|
38 |
void receiveAllocationResponseNegative(cObject* obj);
|
|
|
39 |
void receiveAllocationRequestFromFAI(cObject* obj);
|
|
|
40 |
|
|
|
41 |
protected:
|
|
|
42 |
virtual void initialize();
|
|
|
43 |
virtual void handleMessage(cMessage *msg);
|
|
|
44 |
void initPointers();
|
|
|
45 |
|
|
|
46 |
private:
|
|
|
47 |
|
|
|
48 |
ConnectionTable* ConTable;
|
|
|
49 |
DA* DifAllocator;
|
|
|
50 |
|
|
|
51 |
void initSignalsAndListeners();
|
|
|
52 |
bool createBindings(Flow* flow);
|
|
|
53 |
|
|
|
54 |
//Signals
|
|
|
55 |
simsignal_t sigIRMAllocReq;
|
|
|
56 |
simsignal_t sigIRMDeallocReq;
|
|
|
57 |
simsignal_t sigIRMAllocResPosi;
|
|
|
58 |
simsignal_t sigIRMAllocResNega;
|
|
|
59 |
|
|
|
60 |
//Listeners
|
|
|
61 |
LisIRMAllocResNegaFa* lisAllocResNegaFa;
|
|
|
62 |
LisIRMAllocResNegaFai* lisAllocResNegaFai;
|
|
|
63 |
LisIRMAllocReqFai* lisAllocReqFai;
|
|
|
64 |
LisIRMAllocReq* lisAllocReq;
|
|
|
65 |
LisIRMDeallocReq* lisDeallocReq;
|
|
|
66 |
|
|
|
67 |
//Signaling
|
|
|
68 |
void signalizeAllocateRequest(Flow* flow);
|
|
|
69 |
void signalizeDeallocateRequest(Flow* flow);
|
|
|
70 |
void signalizeAllocateResponsePositive(Flow* flow);
|
|
|
71 |
void signalizeAllocateResponseNegative(Flow* flow);
|
|
|
72 |
|
|
|
73 |
};
|
|
|
74 |
|
|
|
75 |
#endif /* IRM_H_ */
|