RINASim  October 2016
Documentation of framework for OMNeT++
RAListeners.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 <RAListeners.h>
24 
25 
27 {
28 }
29 
31 {
32  ra = nullptr;
33 }
34 
35 void LisRACreFlow::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
36 {
37  Flow* flow = dynamic_cast<Flow*>(obj);
38  if (flow)
39  {
41  }
42 }
43 
44 void LisRAAllocResPos::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
45 {
46  Flow* flow = dynamic_cast<Flow*>(obj);
47  if (flow && !flow->isDdtFlag())
48  {
49  ra->postNFlowAllocation(flow);
50  }
51 }
52 
53 void LisRACreAllocResPos::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
54 {
55  Flow* flow = dynamic_cast<Flow*>(obj);
56  if (flow && !flow->isDdtFlag())
57  {
58  ra->postNFlowAllocation(flow);
59  }
60 }
61 
62 void LisRACreResPosi::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
63 {
64  Flow* flow = dynamic_cast<Flow*>(obj);
65  const APN& dstApn = flow->getDstApni().getApn();
66  const std::string& qosId = flow->getConId().getQoSId();
67 
68  auto item = ra->getFlowTable()->findFlowByDstApni(dstApn.getName(), qosId);
69  if (item != nullptr)
70  {
72  }
73 }
74 
75 void LisRADelFlow::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
76 {
77  Flow* flow = dynamic_cast<Flow*>(obj);
78  const APN& dstApn = flow->getDstApni().getApn();
79  const std::string& qosId = flow->getConId().getQoSId();
80 
81  auto item = ra->getFlowTable()->findFlowByDstApni(dstApn.getName(), qosId);
82  if (item != nullptr)
83  {
85  }
86 }
87 
88 void LisEFCPStopSending::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
89 {
90  Flow* flow = dynamic_cast<Flow*>(obj);
91  auto item = ra->getFlowTable()->lookup(flow);
92 
93  if (item)
94  {
95  ra->blockNM1PortOutput(item);
96  }
97 }
98 
99 void LisEFCPStartSending::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
100 {
101  Flow* flow = dynamic_cast<Flow*>(obj);
102  auto item = ra->getFlowTable()->lookup(flow);
103 
104  if (item)
105  {
106  ra->unblockNM1PortOutput(item);
107  }
108 }
109 
110 void LisRMTSlowdownRequest::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
111 {
112  cPacket* pdu = dynamic_cast<cPacket*>(obj);
113  if (pdu)
114  {
116  }
117 }
118 
119 void LisRIBCongNotif::receiveSignal(cComponent* src, simsignal_t id, cObject* obj, cObject *detail)
120 {
122 }
123 
virtual NM1FlowTable * getFlowTable()=0
virtual void removeNM1FlowBindings(NM1FlowTableItem *ftItem)=0
Class representing flow object with attributes from specs.
Definition: Flow.h:45
Application Process Name class.
Definition: APN.h:36
std::string getQoSId() const
Getter of selected QoS-cube identifier.
Definition: ConnectionId.cc:44
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:99
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:110
bool isDdtFlag() const
Gets whether flow is for Degenerate Data Transfer.
Definition: Flow.cc:293
virtual void unblockNM1PortOutput(NM1FlowTableItem *ftItem)=0
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:119
const APN & getApn() const
Getter of APN.
Definition: APNamingInfo.h:142
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:88
virtual ~RAListeners()
Definition: RAListeners.cc:30
virtual void signalizeSlowdownRequestToRIBd(cPacket *pdu)=0
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:75
NM1FlowTableItem * findFlowByDstApni(const std::string &addr, const std::string &qosId)
Definition: NM1FlowTable.cc:60
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:53
virtual void createNM1FlowWithoutAllocate(Flow *flow)=0
Definition: RABase.h:36
virtual void signalizeSlowdownRequestToEFCP(cObject *pdu)=0
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:35
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:62
const ConnectionId & getConId() const
Gets read-only Flow's ConnectionId.
Definition: Flow.cc:86
RABase * ra
Definition: RAListeners.h:42
virtual void postNFlowAllocation(Flow *flow)=0
NM1FlowTableItem * lookup(Flow *flow)
Definition: NM1FlowTable.cc:48
const std::string & getName() const
Gets APN string name representation.
Definition: APN.cc:40
virtual void receiveSignal(cComponent *src, simsignal_t id, cObject *obj, cObject *detail)
Definition: RAListeners.cc:44
virtual void blockNM1PortOutput(NM1FlowTableItem *ftItem)=0
const APNamingInfo & getDstApni() const
Gets read-only destination APNamingInfo.
Definition: Flow.cc:102
virtual void postNM1FlowAllocation(NM1FlowTableItem *ftItem)=0
RAListeners(RABase *nra)
Definition: RAListeners.cc:26