blob: b2413ba5278010f6de213000715c274c95ef9f3e [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()
16 :chronosyncSyncPrefix("ndn/nlsr/sync")
17 ,chronosyncLsaPrefix("/ndn/nlsr/LSA")
18 {
19 isStrictHierchicalKeyCheck=0;
akmhoque1fd8c1e2014-02-19 19:41:49 -060020 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 }
akmhoque298385a2014-02-13 14:13:09 -060031
akmhoque1fd8c1e2014-02-19 19:41:49 -060032 void setRouterName(const string& rn)
33 {
34 routerName=rn;
35 }
akmhoque298385a2014-02-13 14:13:09 -060036
akmhoque1fd8c1e2014-02-19 19:41:49 -060037 string getRouterName()
38 {
39 return routerName;
40 }
akmhoque298385a2014-02-13 14:13:09 -060041
akmhoque1fd8c1e2014-02-19 19:41:49 -060042 void setSiteName(const string& sn)
43 {
44 siteName=sn;
45 }
akmhoque298385a2014-02-13 14:13:09 -060046
akmhoque1fd8c1e2014-02-19 19:41:49 -060047 string getSiteName()
48 {
49 return siteName;
50 }
akmhoque298385a2014-02-13 14:13:09 -060051
akmhoque1fd8c1e2014-02-19 19:41:49 -060052 void setNetwork(const string& nn)
53 {
54 network=nn;
55 }
akmhoque298385a2014-02-13 14:13:09 -060056
akmhoque1fd8c1e2014-02-19 19:41:49 -060057 string getNetwork()
58 {
59 return network;
60 }
akmhoque298385a2014-02-13 14:13:09 -060061
akmhoque1fd8c1e2014-02-19 19:41:49 -060062 void buildRouterPrefix()
63 {
64 routerPrefix="/"+network+"/"+siteName+"/"+routerName;
65 }
akmhoque298385a2014-02-13 14:13:09 -060066
akmhoque1fd8c1e2014-02-19 19:41:49 -060067 string getRouterPrefix()
68 {
69 return routerPrefix;
70 }
akmhoque298385a2014-02-13 14:13:09 -060071
akmhoque1fd8c1e2014-02-19 19:41:49 -060072 void setInterestRetryNumber(int irn)
73 {
74 interestRetryNumber=irn;
75 }
akmhoque298385a2014-02-13 14:13:09 -060076
akmhoque1fd8c1e2014-02-19 19:41:49 -060077 int getInterestRetryNumber()
78 {
79 return interestRetryNumber;
80 }
akmhoque298385a2014-02-13 14:13:09 -060081
akmhoque1fd8c1e2014-02-19 19:41:49 -060082 void setInterestResendTime(int irt)
83 {
84 interestResendTime=irt;
85 }
akmhoque298385a2014-02-13 14:13:09 -060086
akmhoque1fd8c1e2014-02-19 19:41:49 -060087 int getInterestResendTime()
88 {
89 return interestResendTime;
90 }
akmhoque298385a2014-02-13 14:13:09 -060091
akmhoque1fd8c1e2014-02-19 19:41:49 -060092 void setLsaRefreshTime(int lrt)
93 {
94 lsaRefreshTime=lrt;
95 routerDeadInterval=2*lsaRefreshTime;
96 }
akmhoque298385a2014-02-13 14:13:09 -060097
akmhoque1fd8c1e2014-02-19 19:41:49 -060098 int getLsaRefreshTime()
99 {
100 return lsaRefreshTime;
101 }
akmhoque298385a2014-02-13 14:13:09 -0600102
akmhoque1fd8c1e2014-02-19 19:41:49 -0600103 void setRouterDeadInterval(int rdt)
104 {
105 routerDeadInterval=rdt;
106 }
akmhoque298385a2014-02-13 14:13:09 -0600107
akmhoque1fd8c1e2014-02-19 19:41:49 -0600108 long int getRouterDeadInterval()
109 {
110 return routerDeadInterval;
111 }
akmhoque298385a2014-02-13 14:13:09 -0600112
akmhoque1fd8c1e2014-02-19 19:41:49 -0600113 void setMaxFacesPerPrefix(int mfpp)
114 {
115 maxFacesPerPrefix=mfpp;
116 }
akmhoque298385a2014-02-13 14:13:09 -0600117
akmhoque1fd8c1e2014-02-19 19:41:49 -0600118 int getMaxFacesPerPrefix()
119 {
120 return maxFacesPerPrefix;
121 }
akmhoque298385a2014-02-13 14:13:09 -0600122
akmhoque1fd8c1e2014-02-19 19:41:49 -0600123 void setLogDir(string ld)
124 {
125 logDir=ld;
126 }
akmhoque298385a2014-02-13 14:13:09 -0600127
akmhoque1fd8c1e2014-02-19 19:41:49 -0600128 string getLogDir()
129 {
130 return logDir;
131 }
akmhoque298385a2014-02-13 14:13:09 -0600132
akmhoque1fd8c1e2014-02-19 19:41:49 -0600133 void setDetailedLogging(int dl)
134 {
135 detailedLogging=dl;
136 }
akmhoque298385a2014-02-13 14:13:09 -0600137
akmhoque1fd8c1e2014-02-19 19:41:49 -0600138 int getDetailedLogging()
139 {
140 return detailedLogging;
141 }
akmhoque298385a2014-02-13 14:13:09 -0600142
akmhoque1fd8c1e2014-02-19 19:41:49 -0600143 void setDebugging(int d)
144 {
145 debugging=d;
146 }
akmhoque298385a2014-02-13 14:13:09 -0600147
akmhoque1fd8c1e2014-02-19 19:41:49 -0600148 int getDebugging()
149 {
150 return debugging;
151 }
akmhoque298385a2014-02-13 14:13:09 -0600152
akmhoque1fd8c1e2014-02-19 19:41:49 -0600153 void setIsHyperbolicCalc(int ihc)
154 {
155 isHyperbolicCalc=ihc;
156 }
akmhoque298385a2014-02-13 14:13:09 -0600157
akmhoque1fd8c1e2014-02-19 19:41:49 -0600158 int getIsHyperbolicCalc()
159 {
160 return isHyperbolicCalc;
161 }
akmhoque298385a2014-02-13 14:13:09 -0600162
akmhoque1fd8c1e2014-02-19 19:41:49 -0600163 void setCorR(double cr)
164 {
165 corR=cr;
166 }
akmhoque298385a2014-02-13 14:13:09 -0600167
akmhoque1fd8c1e2014-02-19 19:41:49 -0600168 double getCorR()
169 {
170 return corR;
171 }
akmhoque298385a2014-02-13 14:13:09 -0600172
akmhoque1fd8c1e2014-02-19 19:41:49 -0600173 void setCorTheta(double ct)
174 {
175 corTheta=ct;
176 }
akmhoque298385a2014-02-13 14:13:09 -0600177
akmhoque1fd8c1e2014-02-19 19:41:49 -0600178 double getCorTheta()
179 {
180 return corTheta;
181 }
akmhoque298385a2014-02-13 14:13:09 -0600182
akmhoque1fd8c1e2014-02-19 19:41:49 -0600183 void setTunnelType(int tt)
184 {
185 tunnelType=tt;
186 }
akmhoque298385a2014-02-13 14:13:09 -0600187
akmhoque1fd8c1e2014-02-19 19:41:49 -0600188 int getTunnelType()
189 {
190 return tunnelType;
191 }
akmhoque298385a2014-02-13 14:13:09 -0600192
akmhoque1fd8c1e2014-02-19 19:41:49 -0600193 void setChronosyncSyncPrefix(const string& csp)
194 {
195 chronosyncSyncPrefix=csp;
196 }
akmhoque298385a2014-02-13 14:13:09 -0600197
akmhoque1fd8c1e2014-02-19 19:41:49 -0600198 string getChronosyncSyncPrefix()
199 {
200 return chronosyncSyncPrefix;
201 }
akmhoque298385a2014-02-13 14:13:09 -0600202
akmhoque1fd8c1e2014-02-19 19:41:49 -0600203 int getInfoInterestInterval()
204 {
205 return infoInterestInterval;
206 }
akmhoque298385a2014-02-13 14:13:09 -0600207
akmhoque1fd8c1e2014-02-19 19:41:49 -0600208 void setInfoInterestInterval(int iii)
209 {
210 infoInterestInterval=iii;
211 }
akmhoque298385a2014-02-13 14:13:09 -0600212
akmhoque1fd8c1e2014-02-19 19:41:49 -0600213 private:
214 string routerName;
215 string siteName;
216 string network;
akmhoque298385a2014-02-13 14:13:09 -0600217
akmhoque1fd8c1e2014-02-19 19:41:49 -0600218 string routerPrefix;
219 string lsaRouterPrefix;
akmhoque298385a2014-02-13 14:13:09 -0600220
akmhoque1fd8c1e2014-02-19 19:41:49 -0600221 string chronosyncSyncPrefix;
222 string chronosyncLsaPrefix;
akmhoque298385a2014-02-13 14:13:09 -0600223
akmhoque1fd8c1e2014-02-19 19:41:49 -0600224 int interestRetryNumber;
225 int interestResendTime;
226 int infoInterestInterval;
227 int lsaRefreshTime;
228 int routerDeadInterval;
229
230 int maxFacesPerPrefix;
231 string logDir;
232 string logFile;
233 int detailedLogging;
234 int debugging;
235
236 int isHyperbolicCalc;
237 double corR;
238 double corTheta;
239
240 int tunnelType;
241 int isStrictHierchicalKeyCheck;
242
243 };
244
245 std::ostream&
246 operator << (std::ostream &os, ConfParameter &cfp);
akmhoque298385a2014-02-13 14:13:09 -0600247
akmhoqueb1710aa2014-02-19 17:13:36 -0600248} // namespace nlsr
249
akmhoque298385a2014-02-13 14:13:09 -0600250#endif