blob: 7fc51f29e97043c7515a9d2b21c67b8f26430dc9 [file] [log] [blame]
akmhoque298385a2014-02-13 14:13:09 -06001#ifndef CONF_PARAM_HPP
2#define CONF_PARAM_HPP
3
4#include<iostream>
5
akmhoque1fd8c1e2014-02-19 19:41:49 -06006namespace nlsr
7{
akmhoqueb1710aa2014-02-19 17:13:36 -06008
akmhoque1fd8c1e2014-02-19 19:41:49 -06009 using namespace std;
akmhoque298385a2014-02-13 14:13:09 -060010
akmhoque1fd8c1e2014-02-19 19:41:49 -060011 class ConfParameter
12 {
akmhoque298385a2014-02-13 14:13:09 -060013
akmhoque1fd8c1e2014-02-19 19:41:49 -060014 public:
15 ConfParameter()
akmhoque2bb198e2014-02-28 11:46:27 -060016 : chronosyncSyncPrefix("ndn/nlsr/sync")
17 , chronosyncLsaPrefix("/ndn/nlsr/LSA")
18 , rootKeyPrefix("/ndn/keys")
19 , isStrictHierchicalKeyCheck(0)
20 , interestRetryNumber(3)
21 , interestResendTime(5)
22 , infoInterestInterval(60)
23 , lsaRefreshTime(1800)
24 , routerDeadInterval(3600)
25 , maxFacesPerPrefix(0)
26 , tunnelType(0)
27 , detailedLogging(0)
28 , debugging(0)
29 , isHyperbolicCalc(0)
30 , seqFileDir()
31 , corR(0)
32 , corTheta(0)
33 {}
akmhoque298385a2014-02-13 14:13:09 -060034
akmhoque1fd8c1e2014-02-19 19:41:49 -060035 void setRouterName(const string& rn)
36 {
37 routerName=rn;
38 }
akmhoque298385a2014-02-13 14:13:09 -060039
akmhoque1fd8c1e2014-02-19 19:41:49 -060040 string getRouterName()
41 {
42 return routerName;
43 }
akmhoque298385a2014-02-13 14:13:09 -060044
akmhoque1fd8c1e2014-02-19 19:41:49 -060045 void setSiteName(const string& sn)
46 {
47 siteName=sn;
48 }
akmhoque298385a2014-02-13 14:13:09 -060049
akmhoque1fd8c1e2014-02-19 19:41:49 -060050 string getSiteName()
51 {
52 return siteName;
53 }
akmhoque298385a2014-02-13 14:13:09 -060054
akmhoque1fd8c1e2014-02-19 19:41:49 -060055 void setNetwork(const string& nn)
56 {
57 network=nn;
58 }
akmhoque298385a2014-02-13 14:13:09 -060059
akmhoque1fd8c1e2014-02-19 19:41:49 -060060 string getNetwork()
61 {
62 return network;
63 }
akmhoque298385a2014-02-13 14:13:09 -060064
akmhoque1fd8c1e2014-02-19 19:41:49 -060065 void buildRouterPrefix()
66 {
67 routerPrefix="/"+network+"/"+siteName+"/"+routerName;
68 }
akmhoque298385a2014-02-13 14:13:09 -060069
akmhoque1fd8c1e2014-02-19 19:41:49 -060070 string getRouterPrefix()
71 {
72 return routerPrefix;
73 }
akmhoque298385a2014-02-13 14:13:09 -060074
akmhoque2bb198e2014-02-28 11:46:27 -060075 string getRootKeyPrefix()
76 {
77 return rootKeyPrefix;
78 }
79
80 void setRootKeyPrefix(string rkp)
81 {
82 rootKeyPrefix=rkp;
83 }
84
akmhoque1fd8c1e2014-02-19 19:41:49 -060085 void setInterestRetryNumber(int irn)
86 {
87 interestRetryNumber=irn;
88 }
akmhoque298385a2014-02-13 14:13:09 -060089
akmhoque1fd8c1e2014-02-19 19:41:49 -060090 int getInterestRetryNumber()
91 {
92 return interestRetryNumber;
93 }
akmhoque298385a2014-02-13 14:13:09 -060094
akmhoque1fd8c1e2014-02-19 19:41:49 -060095 void setInterestResendTime(int irt)
96 {
97 interestResendTime=irt;
98 }
akmhoque298385a2014-02-13 14:13:09 -060099
akmhoque1fd8c1e2014-02-19 19:41:49 -0600100 int getInterestResendTime()
101 {
102 return interestResendTime;
103 }
akmhoque298385a2014-02-13 14:13:09 -0600104
akmhoque1fd8c1e2014-02-19 19:41:49 -0600105 void setLsaRefreshTime(int lrt)
106 {
107 lsaRefreshTime=lrt;
108 routerDeadInterval=2*lsaRefreshTime;
109 }
akmhoque298385a2014-02-13 14:13:09 -0600110
akmhoque1fd8c1e2014-02-19 19:41:49 -0600111 int getLsaRefreshTime()
112 {
113 return lsaRefreshTime;
114 }
akmhoque298385a2014-02-13 14:13:09 -0600115
akmhoque1fd8c1e2014-02-19 19:41:49 -0600116 void setRouterDeadInterval(int rdt)
117 {
118 routerDeadInterval=rdt;
119 }
akmhoque298385a2014-02-13 14:13:09 -0600120
akmhoque1fd8c1e2014-02-19 19:41:49 -0600121 long int getRouterDeadInterval()
122 {
123 return routerDeadInterval;
124 }
akmhoque298385a2014-02-13 14:13:09 -0600125
akmhoque1fd8c1e2014-02-19 19:41:49 -0600126 void setMaxFacesPerPrefix(int mfpp)
127 {
128 maxFacesPerPrefix=mfpp;
129 }
akmhoque298385a2014-02-13 14:13:09 -0600130
akmhoque1fd8c1e2014-02-19 19:41:49 -0600131 int getMaxFacesPerPrefix()
132 {
133 return maxFacesPerPrefix;
134 }
akmhoque298385a2014-02-13 14:13:09 -0600135
akmhoque1fd8c1e2014-02-19 19:41:49 -0600136 void setLogDir(string ld)
137 {
138 logDir=ld;
139 }
akmhoque298385a2014-02-13 14:13:09 -0600140
akmhoque1fd8c1e2014-02-19 19:41:49 -0600141 string getLogDir()
142 {
143 return logDir;
144 }
akmhoque298385a2014-02-13 14:13:09 -0600145
akmhoque2bb198e2014-02-28 11:46:27 -0600146 void setSeqFileDir(string ssfd)
147 {
148 seqFileDir=ssfd;
149 }
150
151 string getSeqFileDir()
152 {
153 return seqFileDir;
154 }
155
akmhoque1fd8c1e2014-02-19 19:41:49 -0600156 void setDetailedLogging(int dl)
157 {
158 detailedLogging=dl;
159 }
akmhoque298385a2014-02-13 14:13:09 -0600160
akmhoque1fd8c1e2014-02-19 19:41:49 -0600161 int getDetailedLogging()
162 {
163 return detailedLogging;
164 }
akmhoque298385a2014-02-13 14:13:09 -0600165
akmhoque1fd8c1e2014-02-19 19:41:49 -0600166 void setDebugging(int d)
167 {
168 debugging=d;
169 }
akmhoque298385a2014-02-13 14:13:09 -0600170
akmhoque1fd8c1e2014-02-19 19:41:49 -0600171 int getDebugging()
172 {
173 return debugging;
174 }
akmhoque298385a2014-02-13 14:13:09 -0600175
akmhoque1fd8c1e2014-02-19 19:41:49 -0600176 void setIsHyperbolicCalc(int ihc)
177 {
178 isHyperbolicCalc=ihc;
179 }
akmhoque298385a2014-02-13 14:13:09 -0600180
akmhoque1fd8c1e2014-02-19 19:41:49 -0600181 int getIsHyperbolicCalc()
182 {
183 return isHyperbolicCalc;
184 }
akmhoque298385a2014-02-13 14:13:09 -0600185
akmhoque1fd8c1e2014-02-19 19:41:49 -0600186 void setCorR(double cr)
187 {
188 corR=cr;
189 }
akmhoque298385a2014-02-13 14:13:09 -0600190
akmhoque1fd8c1e2014-02-19 19:41:49 -0600191 double getCorR()
192 {
193 return corR;
194 }
akmhoque298385a2014-02-13 14:13:09 -0600195
akmhoque1fd8c1e2014-02-19 19:41:49 -0600196 void setCorTheta(double ct)
197 {
198 corTheta=ct;
199 }
akmhoque298385a2014-02-13 14:13:09 -0600200
akmhoque1fd8c1e2014-02-19 19:41:49 -0600201 double getCorTheta()
202 {
203 return corTheta;
204 }
akmhoque298385a2014-02-13 14:13:09 -0600205
akmhoque1fd8c1e2014-02-19 19:41:49 -0600206 void setTunnelType(int tt)
207 {
208 tunnelType=tt;
209 }
akmhoque298385a2014-02-13 14:13:09 -0600210
akmhoque1fd8c1e2014-02-19 19:41:49 -0600211 int getTunnelType()
212 {
213 return tunnelType;
214 }
akmhoque298385a2014-02-13 14:13:09 -0600215
akmhoque1fd8c1e2014-02-19 19:41:49 -0600216 void setChronosyncSyncPrefix(const string& csp)
217 {
218 chronosyncSyncPrefix=csp;
219 }
akmhoque298385a2014-02-13 14:13:09 -0600220
akmhoque1fd8c1e2014-02-19 19:41:49 -0600221 string getChronosyncSyncPrefix()
222 {
223 return chronosyncSyncPrefix;
224 }
akmhoque298385a2014-02-13 14:13:09 -0600225
akmhoque2bb198e2014-02-28 11:46:27 -0600226 void setChronosyncLsaPrefix(string clp)
227 {
228 chronosyncLsaPrefix=clp;
229 }
230
231 string getChronosyncLsaPrefix()
232 {
233 return chronosyncLsaPrefix;
234 }
235
akmhoque1fd8c1e2014-02-19 19:41:49 -0600236 int getInfoInterestInterval()
237 {
238 return infoInterestInterval;
239 }
akmhoque298385a2014-02-13 14:13:09 -0600240
akmhoque1fd8c1e2014-02-19 19:41:49 -0600241 void setInfoInterestInterval(int iii)
242 {
243 infoInterestInterval=iii;
244 }
akmhoque298385a2014-02-13 14:13:09 -0600245
akmhoque1fd8c1e2014-02-19 19:41:49 -0600246 private:
247 string routerName;
248 string siteName;
249 string network;
akmhoque298385a2014-02-13 14:13:09 -0600250
akmhoque1fd8c1e2014-02-19 19:41:49 -0600251 string routerPrefix;
252 string lsaRouterPrefix;
akmhoque298385a2014-02-13 14:13:09 -0600253
akmhoque1fd8c1e2014-02-19 19:41:49 -0600254 string chronosyncSyncPrefix;
255 string chronosyncLsaPrefix;
akmhoque298385a2014-02-13 14:13:09 -0600256
akmhoque2bb198e2014-02-28 11:46:27 -0600257 string rootKeyPrefix;
258
akmhoque1fd8c1e2014-02-19 19:41:49 -0600259 int interestRetryNumber;
260 int interestResendTime;
261 int infoInterestInterval;
262 int lsaRefreshTime;
263 int routerDeadInterval;
264
265 int maxFacesPerPrefix;
266 string logDir;
akmhoque2bb198e2014-02-28 11:46:27 -0600267 string seqFileDir;
akmhoque1fd8c1e2014-02-19 19:41:49 -0600268 string logFile;
269 int detailedLogging;
270 int debugging;
271
272 int isHyperbolicCalc;
273 double corR;
274 double corTheta;
275
276 int tunnelType;
277 int isStrictHierchicalKeyCheck;
278
279 };
280
281 std::ostream&
282 operator << (std::ostream &os, ConfParameter &cfp);
akmhoque298385a2014-02-13 14:13:09 -0600283
akmhoqueb1710aa2014-02-19 17:13:36 -0600284} // namespace nlsr
285
akmhoque298385a2014-02-13 14:13:09 -0600286#endif