RINASim  October 2016
Documentation of framework for OMNeT++
IRM.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 
23 #ifndef IRM_H_
24 #define IRM_H_
25 
26 //Standard libraries
27 #include <omnetpp.h>
28 //RINASim libraries
29 #include "IRMListeners.h"
30 #include "ConnectionTable.h"
31 #include "RINASignals.h"
32 #include "DA.h"
33 #include "FABase.h"
34 #include "ExternConsts.h"
35 #include "SDUData_m.h"
36 
37 extern const int VAL_UNDEF_HANDLE;
38 extern const char* SIG_STAT_IRM_UP;
39 extern const char* SIG_STAT_IRM_DOWN;
40 
41 class IRM : public cSimpleModule {
42  public:
43  IRM();
44  virtual ~IRM();
45 
48 
50 
51  void newFlow(Flow* flow);
53  int getIrmGateHandle(Flow* flow) const;
54  int getApGateHandle(Flow* flow) const;
55  void setNorthGates(Flow* flow, cGate* nIn, cGate* nOut);
56 
58  bool deleteBindings(Flow* flow);
59 
60  protected:
61  virtual void initialize();
62  virtual void handleMessage(cMessage *msg);
63  void initPointers();
64 
65  void updateDisplayString();
69 
72 
74  bool createBindings(Flow* flow);
75 
76 
77  //Signals
78  simsignal_t sigIRMAllocReq;
79  simsignal_t sigIRMDeallocReq;
80 
81  simsignal_t sigStatIRMPassUp;
82  simsignal_t sigStatIRMPassDown;
83 
84  //Listeners
87 
88  /*
89  //Signaling
90  void signalizeAllocateRequest(Flow* flow);
91  void signalizeDeallocateRequest(Flow* flow);
92  */
93 
94 };
95 
96 #endif /* IRM_H_ */
Class representing flow object with attributes from specs.
Definition: Flow.h:45
bool deleteBindings(Flow *flow)
Definition: IRM.cc:287
LisIRMDeallocReq * lisDeallocReq
Definition: IRM.h:86
void initSignalsAndListeners()
Definition: IRM.cc:101
int statPassDown
Definition: IRM.h:67
ConnectionStatus
simsignal_t sigIRMAllocReq
Definition: IRM.h:78
Definition: IRM.h:41
simsignal_t sigStatIRMPassDown
Definition: IRM.h:82
virtual ~IRM()
Definition: IRM.cc:38
const char * SIG_STAT_IRM_DOWN
Definition: IRM.cc:28
void changeStatus(Flow *flow, ConnectionTableEntry::ConnectionStatus status)
Definition: IRM.cc:329
virtual void initialize()
Definition: IRM.cc:53
IRM()
Definition: IRM.cc:32
bool receiveAllocationRequestFromAe(Flow *flow)
Definition: IRM.cc:184
ConnectionTable * getConTable() const
Definition: IRM.cc:272
simsignal_t sigStatIRMPassUp
Definition: IRM.h:81
void initPointers()
Definition: IRM.cc:46
bool receiveDeallocationRequestFromAe(Flow *flow)
Definition: IRM.cc:205
int statPassUp
Definition: IRM.h:66
DA * DifAllocator
Definition: IRM.h:71
const int VAL_UNDEF_HANDLE
Definition: IRM.cc:26
void newFlow(Flow *flow)
Definition: IRM.cc:235
simsignal_t sigIRMDeallocReq
Definition: IRM.h:79
Definition: DA.h:43
int getApGateHandle(Flow *flow) const
Definition: IRM.cc:346
int statDiscarded
Definition: IRM.h:68
LisIRMAllocReq * lisAllocReq
Definition: IRM.h:85
virtual void handleMessage(cMessage *msg)
Definition: IRM.cc:58
void setNorthGates(Flow *flow, cGate *nIn, cGate *nOut)
Definition: IRM.cc:342
const char * SIG_STAT_IRM_UP
Definition: IRM.cc:27
void updateDisplayString()
Definition: IRM.cc:262
bool createBindings(Flow *flow)
Definition: IRM.cc:120
bool receiveAllocationResponsePositiveFromIpc(Flow *flow)
Definition: IRM.cc:276
ConnectionTable * ConTable
Definition: IRM.h:70
int getIrmGateHandle(Flow *flow) const
Definition: IRM.cc:333