blob: 2bd7cd3d4e1110aa4e0cc5929bd1331e43c93c0a [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)
akmhoqueeb764c52014-03-11 16:01:09 -050028 , certDir()
akmhoque2bb198e2014-02-28 11:46:27 -060029 , debugging(0)
30 , isHyperbolicCalc(0)
31 , seqFileDir()
32 , corR(0)
33 , corTheta(0)
34 {}
akmhoque298385a2014-02-13 14:13:09 -060035
akmhoque1fd8c1e2014-02-19 19:41:49 -060036 void setRouterName(const string& rn)
37 {
38 routerName=rn;
39 }
akmhoque298385a2014-02-13 14:13:09 -060040
akmhoque1fd8c1e2014-02-19 19:41:49 -060041 string getRouterName()
42 {
43 return routerName;
44 }
akmhoque298385a2014-02-13 14:13:09 -060045
akmhoque1fd8c1e2014-02-19 19:41:49 -060046 void setSiteName(const string& sn)
47 {
48 siteName=sn;
49 }
akmhoque298385a2014-02-13 14:13:09 -060050
akmhoque1fd8c1e2014-02-19 19:41:49 -060051 string getSiteName()
52 {
53 return siteName;
54 }
akmhoque298385a2014-02-13 14:13:09 -060055
akmhoque1fd8c1e2014-02-19 19:41:49 -060056 void setNetwork(const string& nn)
57 {
58 network=nn;
59 }
akmhoque298385a2014-02-13 14:13:09 -060060
akmhoque1fd8c1e2014-02-19 19:41:49 -060061 string getNetwork()
62 {
63 return network;
64 }
akmhoque298385a2014-02-13 14:13:09 -060065
akmhoque1fd8c1e2014-02-19 19:41:49 -060066 void buildRouterPrefix()
67 {
68 routerPrefix="/"+network+"/"+siteName+"/"+routerName;
69 }
akmhoque298385a2014-02-13 14:13:09 -060070
akmhoque1fd8c1e2014-02-19 19:41:49 -060071 string getRouterPrefix()
72 {
73 return routerPrefix;
74 }
akmhoque298385a2014-02-13 14:13:09 -060075
akmhoque2bb198e2014-02-28 11:46:27 -060076 string getRootKeyPrefix()
77 {
78 return rootKeyPrefix;
79 }
80
81 void setRootKeyPrefix(string rkp)
82 {
83 rootKeyPrefix=rkp;
84 }
85
akmhoque1fd8c1e2014-02-19 19:41:49 -060086 void setInterestRetryNumber(int irn)
87 {
88 interestRetryNumber=irn;
89 }
akmhoque298385a2014-02-13 14:13:09 -060090
akmhoque1fd8c1e2014-02-19 19:41:49 -060091 int getInterestRetryNumber()
92 {
93 return interestRetryNumber;
94 }
akmhoque298385a2014-02-13 14:13:09 -060095
akmhoque1fd8c1e2014-02-19 19:41:49 -060096 void setInterestResendTime(int irt)
97 {
98 interestResendTime=irt;
99 }
akmhoque298385a2014-02-13 14:13:09 -0600100
akmhoque1fd8c1e2014-02-19 19:41:49 -0600101 int getInterestResendTime()
102 {
103 return interestResendTime;
104 }
akmhoque298385a2014-02-13 14:13:09 -0600105
akmhoque1fd8c1e2014-02-19 19:41:49 -0600106 void setLsaRefreshTime(int lrt)
107 {
108 lsaRefreshTime=lrt;
109 routerDeadInterval=2*lsaRefreshTime;
110 }
akmhoque298385a2014-02-13 14:13:09 -0600111
akmhoque1fd8c1e2014-02-19 19:41:49 -0600112 int getLsaRefreshTime()
113 {
114 return lsaRefreshTime;
115 }
akmhoque298385a2014-02-13 14:13:09 -0600116
akmhoque1fd8c1e2014-02-19 19:41:49 -0600117 void setRouterDeadInterval(int rdt)
118 {
119 routerDeadInterval=rdt;
120 }
akmhoque298385a2014-02-13 14:13:09 -0600121
akmhoque1fd8c1e2014-02-19 19:41:49 -0600122 long int getRouterDeadInterval()
123 {
124 return routerDeadInterval;
125 }
akmhoque298385a2014-02-13 14:13:09 -0600126
akmhoque1fd8c1e2014-02-19 19:41:49 -0600127 void setMaxFacesPerPrefix(int mfpp)
128 {
129 maxFacesPerPrefix=mfpp;
130 }
akmhoque298385a2014-02-13 14:13:09 -0600131
akmhoque1fd8c1e2014-02-19 19:41:49 -0600132 int getMaxFacesPerPrefix()
133 {
134 return maxFacesPerPrefix;
135 }
akmhoque298385a2014-02-13 14:13:09 -0600136
akmhoque1fd8c1e2014-02-19 19:41:49 -0600137 void setLogDir(string ld)
138 {
139 logDir=ld;
140 }
akmhoque298385a2014-02-13 14:13:09 -0600141
akmhoque1fd8c1e2014-02-19 19:41:49 -0600142 string getLogDir()
143 {
144 return logDir;
145 }
akmhoqueeb764c52014-03-11 16:01:09 -0500146
147 void setCertDir(std::string cd)
148 {
149 certDir=cd;
150 }
151
152 std::string getCertDir()
153 {
154 return certDir;
155 }
akmhoque298385a2014-02-13 14:13:09 -0600156
akmhoque2bb198e2014-02-28 11:46:27 -0600157 void setSeqFileDir(string ssfd)
158 {
159 seqFileDir=ssfd;
160 }
161
162 string getSeqFileDir()
163 {
164 return seqFileDir;
165 }
166
akmhoque1fd8c1e2014-02-19 19:41:49 -0600167 void setDetailedLogging(int dl)
168 {
169 detailedLogging=dl;
170 }
akmhoque298385a2014-02-13 14:13:09 -0600171
akmhoque1fd8c1e2014-02-19 19:41:49 -0600172 int getDetailedLogging()
173 {
174 return detailedLogging;
175 }
akmhoque298385a2014-02-13 14:13:09 -0600176
akmhoque1fd8c1e2014-02-19 19:41:49 -0600177 void setDebugging(int d)
178 {
179 debugging=d;
180 }
akmhoque298385a2014-02-13 14:13:09 -0600181
akmhoque1fd8c1e2014-02-19 19:41:49 -0600182 int getDebugging()
183 {
184 return debugging;
185 }
akmhoque298385a2014-02-13 14:13:09 -0600186
akmhoque1fd8c1e2014-02-19 19:41:49 -0600187 void setIsHyperbolicCalc(int ihc)
188 {
189 isHyperbolicCalc=ihc;
190 }
akmhoque298385a2014-02-13 14:13:09 -0600191
akmhoque1fd8c1e2014-02-19 19:41:49 -0600192 int getIsHyperbolicCalc()
193 {
194 return isHyperbolicCalc;
195 }
akmhoque298385a2014-02-13 14:13:09 -0600196
akmhoque1fd8c1e2014-02-19 19:41:49 -0600197 void setCorR(double cr)
198 {
199 corR=cr;
200 }
akmhoque298385a2014-02-13 14:13:09 -0600201
akmhoque1fd8c1e2014-02-19 19:41:49 -0600202 double getCorR()
203 {
204 return corR;
205 }
akmhoque298385a2014-02-13 14:13:09 -0600206
akmhoque1fd8c1e2014-02-19 19:41:49 -0600207 void setCorTheta(double ct)
208 {
209 corTheta=ct;
210 }
akmhoque298385a2014-02-13 14:13:09 -0600211
akmhoque1fd8c1e2014-02-19 19:41:49 -0600212 double getCorTheta()
213 {
214 return corTheta;
215 }
akmhoque298385a2014-02-13 14:13:09 -0600216
akmhoque1fd8c1e2014-02-19 19:41:49 -0600217 void setTunnelType(int tt)
218 {
219 tunnelType=tt;
220 }
akmhoque298385a2014-02-13 14:13:09 -0600221
akmhoque1fd8c1e2014-02-19 19:41:49 -0600222 int getTunnelType()
223 {
224 return tunnelType;
225 }
akmhoque298385a2014-02-13 14:13:09 -0600226
akmhoque1fd8c1e2014-02-19 19:41:49 -0600227 void setChronosyncSyncPrefix(const string& csp)
228 {
229 chronosyncSyncPrefix=csp;
230 }
akmhoque298385a2014-02-13 14:13:09 -0600231
akmhoque1fd8c1e2014-02-19 19:41:49 -0600232 string getChronosyncSyncPrefix()
233 {
234 return chronosyncSyncPrefix;
235 }
akmhoque298385a2014-02-13 14:13:09 -0600236
akmhoque2bb198e2014-02-28 11:46:27 -0600237 void setChronosyncLsaPrefix(string clp)
238 {
239 chronosyncLsaPrefix=clp;
240 }
241
242 string getChronosyncLsaPrefix()
243 {
244 return chronosyncLsaPrefix;
245 }
246
akmhoque1fd8c1e2014-02-19 19:41:49 -0600247 int getInfoInterestInterval()
248 {
249 return infoInterestInterval;
250 }
akmhoque298385a2014-02-13 14:13:09 -0600251
akmhoque1fd8c1e2014-02-19 19:41:49 -0600252 void setInfoInterestInterval(int iii)
253 {
254 infoInterestInterval=iii;
255 }
akmhoque298385a2014-02-13 14:13:09 -0600256
akmhoque1fd8c1e2014-02-19 19:41:49 -0600257 private:
258 string routerName;
259 string siteName;
260 string network;
akmhoque298385a2014-02-13 14:13:09 -0600261
akmhoque1fd8c1e2014-02-19 19:41:49 -0600262 string routerPrefix;
263 string lsaRouterPrefix;
akmhoque298385a2014-02-13 14:13:09 -0600264
akmhoque1fd8c1e2014-02-19 19:41:49 -0600265 string chronosyncSyncPrefix;
266 string chronosyncLsaPrefix;
akmhoque298385a2014-02-13 14:13:09 -0600267
akmhoque2bb198e2014-02-28 11:46:27 -0600268 string rootKeyPrefix;
269
akmhoque1fd8c1e2014-02-19 19:41:49 -0600270 int interestRetryNumber;
271 int interestResendTime;
272 int infoInterestInterval;
273 int lsaRefreshTime;
274 int routerDeadInterval;
275
276 int maxFacesPerPrefix;
277 string logDir;
akmhoqueeb764c52014-03-11 16:01:09 -0500278 string certDir;
akmhoque2bb198e2014-02-28 11:46:27 -0600279 string seqFileDir;
akmhoque1fd8c1e2014-02-19 19:41:49 -0600280 string logFile;
281 int detailedLogging;
282 int debugging;
283
284 int isHyperbolicCalc;
285 double corR;
286 double corTheta;
287
288 int tunnelType;
289 int isStrictHierchicalKeyCheck;
290
291 };
292
293 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