akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 1 | #ifndef CONF_PARAM_HPP |
2 | #define CONF_PARAM_HPP | ||||
3 | |||||
4 | #include<iostream> | ||||
5 | |||||
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 6 | namespace nlsr |
7 | { | ||||
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 8 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 9 | using namespace std; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 10 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 11 | class ConfParameter |
12 | { | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 13 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 14 | public: |
15 | ConfParameter() | ||||
16 | :chronosyncSyncPrefix("ndn/nlsr/sync") | ||||
17 | ,chronosyncLsaPrefix("/ndn/nlsr/LSA") | ||||
18 | { | ||||
19 | isStrictHierchicalKeyCheck=0; | ||||
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 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 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 31 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 32 | void setRouterName(const string& rn) |
33 | { | ||||
34 | routerName=rn; | ||||
35 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 36 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 37 | string getRouterName() |
38 | { | ||||
39 | return routerName; | ||||
40 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 41 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 42 | void setSiteName(const string& sn) |
43 | { | ||||
44 | siteName=sn; | ||||
45 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 46 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 47 | string getSiteName() |
48 | { | ||||
49 | return siteName; | ||||
50 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 51 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 52 | void setNetwork(const string& nn) |
53 | { | ||||
54 | network=nn; | ||||
55 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 56 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 57 | string getNetwork() |
58 | { | ||||
59 | return network; | ||||
60 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 61 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 62 | void buildRouterPrefix() |
63 | { | ||||
64 | routerPrefix="/"+network+"/"+siteName+"/"+routerName; | ||||
65 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 66 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 67 | string getRouterPrefix() |
68 | { | ||||
69 | return routerPrefix; | ||||
70 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 71 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 72 | void setInterestRetryNumber(int irn) |
73 | { | ||||
74 | interestRetryNumber=irn; | ||||
75 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 76 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 77 | int getInterestRetryNumber() |
78 | { | ||||
79 | return interestRetryNumber; | ||||
80 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 81 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 82 | void setInterestResendTime(int irt) |
83 | { | ||||
84 | interestResendTime=irt; | ||||
85 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 86 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 87 | int getInterestResendTime() |
88 | { | ||||
89 | return interestResendTime; | ||||
90 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 91 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 92 | void setLsaRefreshTime(int lrt) |
93 | { | ||||
94 | lsaRefreshTime=lrt; | ||||
95 | routerDeadInterval=2*lsaRefreshTime; | ||||
96 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 97 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 98 | int getLsaRefreshTime() |
99 | { | ||||
100 | return lsaRefreshTime; | ||||
101 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 102 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 103 | void setRouterDeadInterval(int rdt) |
104 | { | ||||
105 | routerDeadInterval=rdt; | ||||
106 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 107 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 108 | long int getRouterDeadInterval() |
109 | { | ||||
110 | return routerDeadInterval; | ||||
111 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 112 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 113 | void setMaxFacesPerPrefix(int mfpp) |
114 | { | ||||
115 | maxFacesPerPrefix=mfpp; | ||||
116 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 117 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 118 | int getMaxFacesPerPrefix() |
119 | { | ||||
120 | return maxFacesPerPrefix; | ||||
121 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 122 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 123 | void setLogDir(string ld) |
124 | { | ||||
125 | logDir=ld; | ||||
126 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 127 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 128 | string getLogDir() |
129 | { | ||||
130 | return logDir; | ||||
131 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 132 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 133 | void setDetailedLogging(int dl) |
134 | { | ||||
135 | detailedLogging=dl; | ||||
136 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 137 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 138 | int getDetailedLogging() |
139 | { | ||||
140 | return detailedLogging; | ||||
141 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 142 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 143 | void setDebugging(int d) |
144 | { | ||||
145 | debugging=d; | ||||
146 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 147 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 148 | int getDebugging() |
149 | { | ||||
150 | return debugging; | ||||
151 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 152 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 153 | void setIsHyperbolicCalc(int ihc) |
154 | { | ||||
155 | isHyperbolicCalc=ihc; | ||||
156 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 157 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 158 | int getIsHyperbolicCalc() |
159 | { | ||||
160 | return isHyperbolicCalc; | ||||
161 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 162 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 163 | void setCorR(double cr) |
164 | { | ||||
165 | corR=cr; | ||||
166 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 167 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 168 | double getCorR() |
169 | { | ||||
170 | return corR; | ||||
171 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 172 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 173 | void setCorTheta(double ct) |
174 | { | ||||
175 | corTheta=ct; | ||||
176 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 177 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 178 | double getCorTheta() |
179 | { | ||||
180 | return corTheta; | ||||
181 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 182 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 183 | void setTunnelType(int tt) |
184 | { | ||||
185 | tunnelType=tt; | ||||
186 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 187 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 188 | int getTunnelType() |
189 | { | ||||
190 | return tunnelType; | ||||
191 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 192 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 193 | void setChronosyncSyncPrefix(const string& csp) |
194 | { | ||||
195 | chronosyncSyncPrefix=csp; | ||||
196 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 197 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 198 | string getChronosyncSyncPrefix() |
199 | { | ||||
200 | return chronosyncSyncPrefix; | ||||
201 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 202 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 203 | int getInfoInterestInterval() |
204 | { | ||||
205 | return infoInterestInterval; | ||||
206 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 207 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 208 | void setInfoInterestInterval(int iii) |
209 | { | ||||
210 | infoInterestInterval=iii; | ||||
211 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 212 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 213 | private: |
214 | string routerName; | ||||
215 | string siteName; | ||||
216 | string network; | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 217 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 218 | string routerPrefix; |
219 | string lsaRouterPrefix; | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 220 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 221 | string chronosyncSyncPrefix; |
222 | string chronosyncLsaPrefix; | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 223 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 224 | 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); | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 247 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 248 | } // namespace nlsr |
249 | |||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 250 | #endif |