blob: 944600918985758a6cae72df322a70da5a614596 [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
akmhoque5a44dd42014-03-12 18:11:32 -05009 using namespace std;
akmhoque298385a2014-02-13 14:13:09 -060010
akmhoque5a44dd42014-03-12 18:11:32 -050011 class ConfParameter
12 {
13
14 public:
15 ConfParameter()
16 : 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 , certDir()
29 , debugging(0)
30 , isHyperbolicCalc(0)
31 , seqFileDir()
32 , corR(0)
33 , corTheta(0)
34 {}
35
36 void setRouterName(const string& rn)
akmhoque1fd8c1e2014-02-19 19:41:49 -060037 {
akmhoque5a44dd42014-03-12 18:11:32 -050038 routerName=rn;
39 }
akmhoque298385a2014-02-13 14:13:09 -060040
akmhoque5a44dd42014-03-12 18:11:32 -050041 string getRouterName()
42 {
43 return routerName;
44 }
akmhoque298385a2014-02-13 14:13:09 -060045
akmhoque5a44dd42014-03-12 18:11:32 -050046 void setSiteName(const string& sn)
47 {
48 siteName=sn;
49 }
akmhoque298385a2014-02-13 14:13:09 -060050
akmhoque5a44dd42014-03-12 18:11:32 -050051 string getSiteName()
52 {
53 return siteName;
54 }
akmhoque298385a2014-02-13 14:13:09 -060055
akmhoque5a44dd42014-03-12 18:11:32 -050056 void setNetwork(const string& nn)
57 {
58 network=nn;
59 }
akmhoque298385a2014-02-13 14:13:09 -060060
akmhoque5a44dd42014-03-12 18:11:32 -050061 string getNetwork()
62 {
63 return network;
64 }
akmhoque298385a2014-02-13 14:13:09 -060065
akmhoque5a44dd42014-03-12 18:11:32 -050066 void buildRouterPrefix()
67 {
68 routerPrefix="/"+network+"/"+siteName+"/"+routerName;
69 }
akmhoque298385a2014-02-13 14:13:09 -060070
akmhoque5a44dd42014-03-12 18:11:32 -050071 string getRouterPrefix()
72 {
73 return routerPrefix;
74 }
akmhoque298385a2014-02-13 14:13:09 -060075
akmhoque5a44dd42014-03-12 18:11:32 -050076 string getRootKeyPrefix()
77 {
78 return rootKeyPrefix;
79 }
akmhoque298385a2014-02-13 14:13:09 -060080
akmhoque5a44dd42014-03-12 18:11:32 -050081 void setRootKeyPrefix(string rkp)
82 {
83 rootKeyPrefix=rkp;
84 }
akmhoque298385a2014-02-13 14:13:09 -060085
akmhoque5a44dd42014-03-12 18:11:32 -050086 void setInterestRetryNumber(int irn)
87 {
88 interestRetryNumber=irn;
89 }
akmhoque2bb198e2014-02-28 11:46:27 -060090
akmhoque5a44dd42014-03-12 18:11:32 -050091 int getInterestRetryNumber()
92 {
93 return interestRetryNumber;
94 }
akmhoque2bb198e2014-02-28 11:46:27 -060095
akmhoque5a44dd42014-03-12 18:11:32 -050096 void setInterestResendTime(int irt)
97 {
98 interestResendTime=irt;
99 }
akmhoque298385a2014-02-13 14:13:09 -0600100
akmhoque5a44dd42014-03-12 18:11:32 -0500101 int getInterestResendTime()
102 {
103 return interestResendTime;
104 }
akmhoque298385a2014-02-13 14:13:09 -0600105
akmhoque5a44dd42014-03-12 18:11:32 -0500106 void setLsaRefreshTime(int lrt)
107 {
108 lsaRefreshTime=lrt;
109 routerDeadInterval=2*lsaRefreshTime;
110 }
akmhoque298385a2014-02-13 14:13:09 -0600111
akmhoque5a44dd42014-03-12 18:11:32 -0500112 int getLsaRefreshTime()
113 {
114 return lsaRefreshTime;
115 }
akmhoque298385a2014-02-13 14:13:09 -0600116
akmhoque5a44dd42014-03-12 18:11:32 -0500117 void setRouterDeadInterval(int rdt)
118 {
119 routerDeadInterval=rdt;
120 }
akmhoque298385a2014-02-13 14:13:09 -0600121
akmhoque5a44dd42014-03-12 18:11:32 -0500122 long int getRouterDeadInterval()
123 {
124 return routerDeadInterval;
125 }
akmhoque298385a2014-02-13 14:13:09 -0600126
akmhoque5a44dd42014-03-12 18:11:32 -0500127 void setMaxFacesPerPrefix(int mfpp)
128 {
129 maxFacesPerPrefix=mfpp;
130 }
akmhoque298385a2014-02-13 14:13:09 -0600131
akmhoque5a44dd42014-03-12 18:11:32 -0500132 int getMaxFacesPerPrefix()
133 {
134 return maxFacesPerPrefix;
135 }
akmhoque298385a2014-02-13 14:13:09 -0600136
akmhoque5a44dd42014-03-12 18:11:32 -0500137 void setLogDir(string ld)
138 {
139 logDir=ld;
140 }
akmhoque298385a2014-02-13 14:13:09 -0600141
akmhoque5a44dd42014-03-12 18:11:32 -0500142 string getLogDir()
143 {
144 return logDir;
145 }
akmhoque298385a2014-02-13 14:13:09 -0600146
akmhoque5a44dd42014-03-12 18:11:32 -0500147 void setCertDir(std::string cd)
148 {
149 certDir=cd;
150 }
akmhoque298385a2014-02-13 14:13:09 -0600151
akmhoque5a44dd42014-03-12 18:11:32 -0500152 std::string getCertDir()
153 {
154 return certDir;
155 }
akmhoque298385a2014-02-13 14:13:09 -0600156
akmhoque5a44dd42014-03-12 18:11:32 -0500157 void setSeqFileDir(string ssfd)
158 {
159 seqFileDir=ssfd;
160 }
akmhoque2bb198e2014-02-28 11:46:27 -0600161
akmhoque5a44dd42014-03-12 18:11:32 -0500162 string getSeqFileDir()
163 {
164 return seqFileDir;
165 }
akmhoque2bb198e2014-02-28 11:46:27 -0600166
akmhoque5a44dd42014-03-12 18:11:32 -0500167 void setDetailedLogging(int dl)
168 {
169 detailedLogging=dl;
170 }
akmhoque298385a2014-02-13 14:13:09 -0600171
akmhoque5a44dd42014-03-12 18:11:32 -0500172 int getDetailedLogging()
173 {
174 return detailedLogging;
175 }
akmhoque298385a2014-02-13 14:13:09 -0600176
akmhoque5a44dd42014-03-12 18:11:32 -0500177 void setDebugging(int d)
178 {
179 debugging=d;
180 }
akmhoque298385a2014-02-13 14:13:09 -0600181
akmhoque5a44dd42014-03-12 18:11:32 -0500182 int getDebugging()
183 {
184 return debugging;
185 }
akmhoque298385a2014-02-13 14:13:09 -0600186
akmhoque5a44dd42014-03-12 18:11:32 -0500187 void setIsHyperbolicCalc(int ihc)
188 {
189 isHyperbolicCalc=ihc;
190 }
akmhoque298385a2014-02-13 14:13:09 -0600191
akmhoque5a44dd42014-03-12 18:11:32 -0500192 int getIsHyperbolicCalc()
193 {
194 return isHyperbolicCalc;
195 }
akmhoque298385a2014-02-13 14:13:09 -0600196
akmhoque5a44dd42014-03-12 18:11:32 -0500197 void setCorR(double cr)
198 {
199 corR=cr;
200 }
akmhoque298385a2014-02-13 14:13:09 -0600201
akmhoque5a44dd42014-03-12 18:11:32 -0500202 double getCorR()
203 {
204 return corR;
205 }
akmhoque298385a2014-02-13 14:13:09 -0600206
akmhoque5a44dd42014-03-12 18:11:32 -0500207 void setCorTheta(double ct)
208 {
209 corTheta=ct;
210 }
akmhoque298385a2014-02-13 14:13:09 -0600211
akmhoque5a44dd42014-03-12 18:11:32 -0500212 double getCorTheta()
213 {
214 return corTheta;
215 }
akmhoque298385a2014-02-13 14:13:09 -0600216
akmhoque5a44dd42014-03-12 18:11:32 -0500217 void setTunnelType(int tt)
218 {
219 tunnelType=tt;
220 }
akmhoque298385a2014-02-13 14:13:09 -0600221
akmhoque5a44dd42014-03-12 18:11:32 -0500222 int getTunnelType()
223 {
224 return tunnelType;
225 }
akmhoque298385a2014-02-13 14:13:09 -0600226
akmhoque5a44dd42014-03-12 18:11:32 -0500227 void setChronosyncSyncPrefix(const string& csp)
228 {
229 chronosyncSyncPrefix=csp;
230 }
akmhoque298385a2014-02-13 14:13:09 -0600231
akmhoque5a44dd42014-03-12 18:11:32 -0500232 string getChronosyncSyncPrefix()
233 {
234 return chronosyncSyncPrefix;
235 }
akmhoque298385a2014-02-13 14:13:09 -0600236
akmhoque5a44dd42014-03-12 18:11:32 -0500237 void setChronosyncLsaPrefix(string clp)
238 {
239 chronosyncLsaPrefix=clp;
240 }
akmhoque2bb198e2014-02-28 11:46:27 -0600241
akmhoque5a44dd42014-03-12 18:11:32 -0500242 string getChronosyncLsaPrefix()
243 {
244 return chronosyncLsaPrefix;
245 }
akmhoque2bb198e2014-02-28 11:46:27 -0600246
akmhoque5a44dd42014-03-12 18:11:32 -0500247 int getInfoInterestInterval()
248 {
249 return infoInterestInterval;
250 }
akmhoque298385a2014-02-13 14:13:09 -0600251
akmhoque5a44dd42014-03-12 18:11:32 -0500252 void setInfoInterestInterval(int iii)
253 {
254 infoInterestInterval=iii;
255 }
akmhoque298385a2014-02-13 14:13:09 -0600256
akmhoque5a44dd42014-03-12 18:11:32 -0500257 private:
258 string routerName;
259 string siteName;
260 string network;
akmhoque298385a2014-02-13 14:13:09 -0600261
akmhoque5a44dd42014-03-12 18:11:32 -0500262 string routerPrefix;
263 string lsaRouterPrefix;
akmhoque298385a2014-02-13 14:13:09 -0600264
akmhoque5a44dd42014-03-12 18:11:32 -0500265 string chronosyncSyncPrefix;
266 string chronosyncLsaPrefix;
akmhoque298385a2014-02-13 14:13:09 -0600267
akmhoque5a44dd42014-03-12 18:11:32 -0500268 string rootKeyPrefix;
akmhoque2bb198e2014-02-28 11:46:27 -0600269
akmhoque5a44dd42014-03-12 18:11:32 -0500270 int interestRetryNumber;
271 int interestResendTime;
272 int infoInterestInterval;
273 int lsaRefreshTime;
274 int routerDeadInterval;
akmhoque1fd8c1e2014-02-19 19:41:49 -0600275
akmhoque5a44dd42014-03-12 18:11:32 -0500276 int maxFacesPerPrefix;
277 string logDir;
278 string certDir;
279 string seqFileDir;
280 string logFile;
281 int detailedLogging;
282 int debugging;
akmhoque1fd8c1e2014-02-19 19:41:49 -0600283
akmhoque5a44dd42014-03-12 18:11:32 -0500284 int isHyperbolicCalc;
285 double corR;
286 double corTheta;
akmhoque1fd8c1e2014-02-19 19:41:49 -0600287
akmhoque5a44dd42014-03-12 18:11:32 -0500288 int tunnelType;
289 int isStrictHierchicalKeyCheck;
akmhoque1fd8c1e2014-02-19 19:41:49 -0600290
akmhoque5a44dd42014-03-12 18:11:32 -0500291 };
akmhoque1fd8c1e2014-02-19 19:41:49 -0600292
akmhoque5a44dd42014-03-12 18:11:32 -0500293 std::ostream&
294 operator << (std::ostream &os, ConfParameter &cfp);
akmhoque298385a2014-02-13 14:13:09 -0600295
akmhoqueb1710aa2014-02-19 17:13:36 -0600296} // namespace nlsr
297
akmhoque298385a2014-02-13 14:13:09 -0600298#endif