RINASim  October 2016
Documentation of framework for OMNeT++
EFCPPolicySet.cc
Go to the documentation of this file.
1 //
2 // Copyright © 2015 PRISTINE Consortium (http://ict-pristine.eu)
3 // The MIT License (MIT)
4 //
5 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
8 // of this software and associated documentation files (the "Software"), to deal
9 // in the Software without restriction, including without limitation the rights
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 // copies of the Software, and to permit persons to whom the Software is
12 // furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 // THE SOFTWARE.
24 
25 /*
26  * @file EFCPPolicySet.cc
27  * @author Marcel Marek (imarek@fit.vutbr.cz)
28  * @date April 3, 2015
29  * @brief Holds names of EFCP policies to be used in specific QoSCube.
30  * @detail
31  */
32 
33 #include <EFCPPolicySet.h>
34 
35 const char* ELEM_INITSEQNUM = "InitialSeqNum";
36 const char* DEFAULT_INITSEQNUM = "InitialSeqNumPolicyDefault";
37 const char* ELEM_RCVRINACTIV = "RcvrInactivity";
38 const char* DEFAULT_RCVRINACTIV = "RcvrInactivityPolicyDefault";
39 const char* ELEM_RTTESTIMAT = "RTTEstimator";
40 const char* DEFAULT_RTTESTIMAT = "RTTEstimatorPolicyDefault";
41 const char* ELEM_SENDERINACTIV = "SenderInactivity";
42 const char* DEFAULT_SENDERINACTIV = "SenderInactivityPolicyDefault";
43 const char* ELEM_SNDFCOVERRUN = "SndFCOverrun";
44 const char* DEFAULT_SNDFCOVERRUN = "SndFCOverrunPolicyDefault";
45 const char* ELEM_RCVFCOVERRUN = "RcvFCOverrun";
46 const char* DEFAULT_RCVFCOVERRUN = "RcvFCOverrunPolicyDefault";
47 const char* ELEM_LOSTCONTROLPDU = "LostControlPDU";
48 const char* DEFAULT_LOSTCONTROLPDU = "LostControlPDUPolicyDefault";
49 const char* ELEM_NOOVERRIDEPEAK = "NoOverridePeak";
50 const char* DEFAULT_NOOVERRIDEPEAK = "NoOverridePeakPolicyDefault";
51 const char* ELEM_NORATESLOWDOWN = "NoRateSlowDown";
52 const char* DEFAULT_NORATESLOWDOWN = "NoRateSlowDownPolicyDefault";
53 const char* ELEM_RATEREDUCTION = "RateReduction";
54 const char* DEFAULT_RATEREDUCTION = "RateReductionPolicyDefault";
55 const char* ELEM_RCVRACK = "RcvrAck";
56 const char* DEFAULT_RCVRACK = "RcvrAckPolicyDefault";
57 const char* ELEM_RCVRCONTROLACK = "RcvrControlAck";
58 const char* DEFAULT_RCVRCONTROLACK = "RcvrControlAckPolicyDefault";
59 const char* ELEM_RCVRFC = "RcvrFC";
60 const char* DEFAULT_RCVRFC = "RcvrFCPolicyDefault";
61 const char* ELEM_RECEIVINGFC = "ReceivingFC";
62 const char* DEFAULT_RECEIVINGFC = "ReceivingFCPolicyDefault";
63 const char* ELEM_RECONCILEFC = "ReconcileFC";
64 const char* DEFAULT_RECONCILEFC = "ReconcileFCPolicyDefault";
65 const char* ELEM_SENDERACK = "SenderAck";
66 const char* DEFAULT_SENDERACK = "SenderAckPolicyDefault";
67 const char* ELEM_SENDINGACK = "SendingAck";
68 const char* DEFAULT_SENDINGACK = "SendingAckPolicyDefault";
69 const char* ELEM_TXCONTROL = "TxControl";
70 const char* DEFAULT_TXCONTROL = "TxControlPolicyDefault";
71 const char* ELEM_RXTIMEREXPIRY = "RxTimerExpiry";
72 const char* DEFAULT_RXTIMEREXPIRY = "RxTimerExpiryPolicyDefault";
73 const char* ELEM_ECN = "ECN";
74 const char* DEFAULT_ECN = "ECNPolicyDefault";
75 const char* ELEM_ECNSLOWDOWN = "ECNSlowDown";
76 const char* DEFAULT_ECNSLOWDOWN = "ECNSlowDownPolicyDefault";
77 
78 
80  rttEstimat(DEFAULT_RTTESTIMAT), senderInactiv(DEFAULT_SENDERINACTIV), sndFcOverrun(DEFAULT_SNDFCOVERRUN),
81  rcvFcOverrun(DEFAULT_RCVFCOVERRUN), lostControlPDU(DEFAULT_LOSTCONTROLPDU),
82  noOverridePeak(DEFAULT_NOOVERRIDEPEAK), noRateSlowDown(DEFAULT_NORATESLOWDOWN),
83  rateReduction(DEFAULT_RATEREDUCTION), rcvrAck(DEFAULT_RCVRACK), rcvrControlAck(DEFAULT_RCVRCONTROLACK),
84  rcvrFC(DEFAULT_RCVRFC), receivingFC(DEFAULT_RECEIVINGFC), reconcileFC(DEFAULT_RECONCILEFC),
85  senderAck(DEFAULT_SENDERACK), sendingAck(DEFAULT_SENDINGACK), txControl(DEFAULT_TXCONTROL), rxTimerExpiry(DEFAULT_RXTIMEREXPIRY),
86  ecn(DEFAULT_ECN), ecnSlowDown(DEFAULT_ECNSLOWDOWN) {
87 
88 
89 }
90 
92 {
93 
94 }
95 
96 
98 {
99  return initialSeqNum;
100 }
101 
102 const char* EFCPPolicySet::getRcvrInactiv() const
103 {
104  return rcvrInactiv;
105 }
106 
107 const char* EFCPPolicySet::getRttEstimat() const
108 {
109  return rttEstimat;
110 }
111 
113 {
114  return senderInactiv;
115 }
116 
118 {
119  return sndFcOverrun;
120 }
121 
123 {
124  return lostControlPDU;
125 }
126 
128 {
129  return noOverridePeak;
130 }
131 
133 {
134  return noRateSlowDown;
135 }
136 
138 {
139  return rateReduction;
140 }
141 
142 const char* EFCPPolicySet::getRcvrAck() const
143 {
144  return rcvrAck;
145 }
146 
148 {
149  return rcvrControlAck;
150 }
151 
152 const char* EFCPPolicySet::getRcvrFc() const
153 {
154  return rcvrFC;
155 }
156 
157 const char* EFCPPolicySet::getReceivingFc() const
158 {
159  return receivingFC;
160 }
161 
162 const char* EFCPPolicySet::getReconcileFc() const
163 {
164  return reconcileFC;
165 }
166 
167 const char* EFCPPolicySet::getSenderAck() const
168 {
169  return senderAck;
170 }
171 
172 const char* EFCPPolicySet::getSendingAck() const
173 {
174  return sendingAck;
175 }
176 
177 const char* EFCPPolicySet::getTxControl() const
178 {
179  return txControl;
180 }
181 
183 {
184  return rxTimerExpiry;
185 }
186 
187 const char* EFCPPolicySet::getEcn() const
188 {
189  return ecn;
190 }
191 
192 const char* EFCPPolicySet::getEcnSlowDown() const
193 {
194  return ecnSlowDown;
195 }
196 
198 {
199  return rcvFcOverrun;
200 }
201 
202 bool EFCPPolicySet::init(cXMLElement* parent)
203 {
204 
205 
206  cXMLElementList attrs = parent->getChildren();
207  for (cXMLElementList::iterator jt = attrs.begin(); jt != attrs.end(); ++jt)
208  {
209  cXMLElement* policyTag = *jt;
210  if (!strcmp(policyTag->getTagName(), ELEM_INITSEQNUM))
211  {
212  initialSeqNum = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_INITSEQNUM;
213  }
214  else if (!strcmp(policyTag->getTagName(), ELEM_RCVRINACTIV))
215  {
216  rcvrInactiv = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RCVRINACTIV;
217  }
218  else if (!strcmp(policyTag->getTagName(), ELEM_RTTESTIMAT))
219  {
220  rttEstimat = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RTTESTIMAT;
221  }
222  else if (!strcmp(policyTag->getTagName(), ELEM_SENDERINACTIV))
223  {
224  senderInactiv = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_SENDERINACTIV;
225  }
226  else if (!strcmp(policyTag->getTagName(), ELEM_SNDFCOVERRUN))
227  {
228  sndFcOverrun = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_SNDFCOVERRUN;
229  }
230  else if (!strcmp(policyTag->getTagName(), ELEM_RCVFCOVERRUN))
231  {
232  rcvFcOverrun = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RCVFCOVERRUN;
233  }
234  else if (!strcmp(policyTag->getTagName(), ELEM_LOSTCONTROLPDU))
235  {
236  lostControlPDU = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_LOSTCONTROLPDU;
237  }
238  else if (!strcmp(policyTag->getTagName(), ELEM_NOOVERRIDEPEAK))
239  {
240  noOverridePeak = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_NOOVERRIDEPEAK;
241  }
242  else if (!strcmp(policyTag->getTagName(), ELEM_NORATESLOWDOWN))
243  {
244  noRateSlowDown = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_NORATESLOWDOWN;
245  }
246  else if (!strcmp(policyTag->getTagName(), ELEM_RATEREDUCTION))
247  {
248  rateReduction = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RATEREDUCTION;
249  }
250  else if (!strcmp(policyTag->getTagName(), ELEM_RCVRACK))
251  {
252  rcvrAck = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RCVRACK;
253  }
254  else if (!strcmp(policyTag->getTagName(), ELEM_RCVRCONTROLACK))
255  {
256  rcvrControlAck = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RCVRCONTROLACK;
257  }
258  else if (!strcmp(policyTag->getTagName(), ELEM_RCVRFC))
259  {
260  rcvrFC = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RCVRFC;
261  }
262  else if (!strcmp(policyTag->getTagName(), ELEM_RECEIVINGFC))
263  {
264  receivingFC = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RECEIVINGFC;
265  }
266  else if (!strcmp(policyTag->getTagName(), ELEM_RECONCILEFC))
267  {
268  reconcileFC = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RECONCILEFC;
269  }
270  else if (!strcmp(policyTag->getTagName(), ELEM_SENDERACK))
271  {
272  senderAck = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_SENDERACK;
273  }
274  else if (!strcmp(policyTag->getTagName(), ELEM_SENDINGACK))
275  {
276  sendingAck = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_SENDINGACK;
277  }
278  else if (!strcmp(policyTag->getTagName(), ELEM_TXCONTROL))
279  {
280  txControl = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_TXCONTROL;
281  }
282  else if (!strcmp(policyTag->getTagName(), ELEM_RXTIMEREXPIRY))
283  {
284  rxTimerExpiry = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_RXTIMEREXPIRY;
285  }
286  else if (!strcmp(policyTag->getTagName(), ELEM_ECN))
287  {
288  ecn = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_ECN;
289  }
290  else if (!strcmp(policyTag->getTagName(), ELEM_ECNSLOWDOWN))
291  {
292  ecnSlowDown = policyTag->getNodeValue() ? policyTag->getNodeValue() : DEFAULT_ECNSLOWDOWN;
293  }
294  }
295  return true;
296 }
297 
const char * ELEM_RCVRINACTIV
const char * rttEstimat
Definition: EFCPPolicySet.h:42
const char * ELEM_RCVRCONTROLACK
const char * rcvrInactiv
Definition: EFCPPolicySet.h:41
const char * DEFAULT_RTTESTIMAT
const char * getRttEstimat() const
const char * ELEM_RATEREDUCTION
const char * getRxTimerExpiry() const
const char * initialSeqNum
Definition: EFCPPolicySet.h:40
const char * getLostControlPdu() const
const char * ELEM_SENDERACK
const char * getInitialSeqNum() const
const char * DEFAULT_RECEIVINGFC
const char * DEFAULT_NOOVERRIDEPEAK
const char * receivingFC
Definition: EFCPPolicySet.h:53
const char * ELEM_ECNSLOWDOWN
const char * ecn
Definition: EFCPPolicySet.h:59
const char * ELEM_RTTESTIMAT
const char * ELEM_TXCONTROL
const char * rcvrFC
Definition: EFCPPolicySet.h:52
const char * noOverridePeak
Definition: EFCPPolicySet.h:47
const char * ELEM_RXTIMEREXPIRY
const char * DEFAULT_LOSTCONTROLPDU
const char * DEFAULT_RCVRINACTIV
const char * getReconcileFc() const
const char * lostControlPDU
Definition: EFCPPolicySet.h:46
const char * DEFAULT_TXCONTROL
const char * getEcn() const
const char * getReceivingFc() const
const char * DEFAULT_RCVFCOVERRUN
const char * getSenderAck() const
const char * getSndFcOverrun() const
bool init(cXMLElement *parent)
const char * getTxControl() const
const char * DEFAULT_SNDFCOVERRUN
const char * noRateSlowDown
Definition: EFCPPolicySet.h:48
const char * DEFAULT_ECN
const char * getRcvrAck() const
virtual ~EFCPPolicySet()
const char * rcvFcOverrun
Definition: EFCPPolicySet.h:45
const char * ELEM_INITSEQNUM
const char * getRcvrFc() const
const char * ELEM_RCVRACK
const char * ELEM_SENDINGACK
const char * getSenderInactiv() const
const char * DEFAULT_RATEREDUCTION
const char * ecnSlowDown
Definition: EFCPPolicySet.h:60
const char * getNoRateSlowDown() const
const char * senderInactiv
Definition: EFCPPolicySet.h:43
const char * ELEM_RCVFCOVERRUN
const char * DEFAULT_SENDERACK
const char * ELEM_NOOVERRIDEPEAK
const char * DEFAULT_RXTIMEREXPIRY
const char * DEFAULT_RCVRFC
const char * ELEM_RCVRFC
const char * sndFcOverrun
Definition: EFCPPolicySet.h:44
const char * ELEM_NORATESLOWDOWN
const char * DEFAULT_RECONCILEFC
const char * rcvrAck
Definition: EFCPPolicySet.h:50
const char * getSendingAck() const
const char * reconcileFC
Definition: EFCPPolicySet.h:54
const char * sendingAck
Definition: EFCPPolicySet.h:56
const char * DEFAULT_INITSEQNUM
const char * DEFAULT_RCVRACK
const char * rateReduction
Definition: EFCPPolicySet.h:49
const char * ELEM_SENDERINACTIV
const char * txControl
Definition: EFCPPolicySet.h:57
const char * DEFAULT_SENDINGACK
const char * rcvrControlAck
Definition: EFCPPolicySet.h:51
const char * ELEM_RECEIVINGFC
const char * DEFAULT_RCVRCONTROLACK
const char * DEFAULT_ECNSLOWDOWN
const char * getRcvrControlAck() const
const char * ELEM_LOSTCONTROLPDU
const char * DEFAULT_SENDERINACTIV
const char * ELEM_SNDFCOVERRUN
const char * getRateReduction() const
const char * DEFAULT_NORATESLOWDOWN
const char * getEcnSlowDown() const
const char * getNoOverridePeak() const
const char * getRcvrInactiv() const
const char * ELEM_ECN
const char * getRcvFcOverrun() const
const char * ELEM_RECONCILEFC
const char * rxTimerExpiry
Definition: EFCPPolicySet.h:58
const char * senderAck
Definition: EFCPPolicySet.h:55