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 | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 9 | using namespace std; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 10 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 11 | 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) |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 37 | { |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 38 | routerName=rn; |
| 39 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 40 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 41 | string getRouterName() |
| 42 | { |
| 43 | return routerName; |
| 44 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 45 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 46 | void setSiteName(const string& sn) |
| 47 | { |
| 48 | siteName=sn; |
| 49 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 50 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 51 | string getSiteName() |
| 52 | { |
| 53 | return siteName; |
| 54 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 55 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 56 | void setNetwork(const string& nn) |
| 57 | { |
| 58 | network=nn; |
| 59 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 60 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 61 | string getNetwork() |
| 62 | { |
| 63 | return network; |
| 64 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 65 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 66 | void buildRouterPrefix() |
| 67 | { |
| 68 | routerPrefix="/"+network+"/"+siteName+"/"+routerName; |
| 69 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 70 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 71 | string getRouterPrefix() |
| 72 | { |
| 73 | return routerPrefix; |
| 74 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 75 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 76 | string getRootKeyPrefix() |
| 77 | { |
| 78 | return rootKeyPrefix; |
| 79 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 80 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 81 | void setRootKeyPrefix(string rkp) |
| 82 | { |
| 83 | rootKeyPrefix=rkp; |
| 84 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 85 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 86 | void setInterestRetryNumber(int irn) |
| 87 | { |
| 88 | interestRetryNumber=irn; |
| 89 | } |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 90 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 91 | int getInterestRetryNumber() |
| 92 | { |
| 93 | return interestRetryNumber; |
| 94 | } |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 95 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 96 | void setInterestResendTime(int irt) |
| 97 | { |
| 98 | interestResendTime=irt; |
| 99 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 100 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 101 | int getInterestResendTime() |
| 102 | { |
| 103 | return interestResendTime; |
| 104 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 105 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 106 | void setLsaRefreshTime(int lrt) |
| 107 | { |
| 108 | lsaRefreshTime=lrt; |
| 109 | routerDeadInterval=2*lsaRefreshTime; |
| 110 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 111 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 112 | int getLsaRefreshTime() |
| 113 | { |
| 114 | return lsaRefreshTime; |
| 115 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 116 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 117 | void setRouterDeadInterval(int rdt) |
| 118 | { |
| 119 | routerDeadInterval=rdt; |
| 120 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 121 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 122 | long int getRouterDeadInterval() |
| 123 | { |
| 124 | return routerDeadInterval; |
| 125 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 126 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 127 | void setMaxFacesPerPrefix(int mfpp) |
| 128 | { |
| 129 | maxFacesPerPrefix=mfpp; |
| 130 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 131 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 132 | int getMaxFacesPerPrefix() |
| 133 | { |
| 134 | return maxFacesPerPrefix; |
| 135 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 136 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 137 | void setLogDir(string ld) |
| 138 | { |
| 139 | logDir=ld; |
| 140 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 141 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 142 | string getLogDir() |
| 143 | { |
| 144 | return logDir; |
| 145 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 146 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 147 | void setCertDir(std::string cd) |
| 148 | { |
| 149 | certDir=cd; |
| 150 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 151 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 152 | std::string getCertDir() |
| 153 | { |
| 154 | return certDir; |
| 155 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 156 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 157 | void setSeqFileDir(string ssfd) |
| 158 | { |
| 159 | seqFileDir=ssfd; |
| 160 | } |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 161 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 162 | string getSeqFileDir() |
| 163 | { |
| 164 | return seqFileDir; |
| 165 | } |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 166 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 167 | void setDetailedLogging(int dl) |
| 168 | { |
| 169 | detailedLogging=dl; |
| 170 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 171 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 172 | int getDetailedLogging() |
| 173 | { |
| 174 | return detailedLogging; |
| 175 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 176 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 177 | void setDebugging(int d) |
| 178 | { |
| 179 | debugging=d; |
| 180 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 181 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 182 | int getDebugging() |
| 183 | { |
| 184 | return debugging; |
| 185 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 186 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 187 | void setIsHyperbolicCalc(int ihc) |
| 188 | { |
| 189 | isHyperbolicCalc=ihc; |
| 190 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 191 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 192 | int getIsHyperbolicCalc() |
| 193 | { |
| 194 | return isHyperbolicCalc; |
| 195 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 196 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 197 | void setCorR(double cr) |
| 198 | { |
| 199 | corR=cr; |
| 200 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 201 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 202 | double getCorR() |
| 203 | { |
| 204 | return corR; |
| 205 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 206 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 207 | void setCorTheta(double ct) |
| 208 | { |
| 209 | corTheta=ct; |
| 210 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 211 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 212 | double getCorTheta() |
| 213 | { |
| 214 | return corTheta; |
| 215 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 216 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 217 | void setTunnelType(int tt) |
| 218 | { |
| 219 | tunnelType=tt; |
| 220 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 221 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 222 | int getTunnelType() |
| 223 | { |
| 224 | return tunnelType; |
| 225 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 226 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 227 | void setChronosyncSyncPrefix(const string& csp) |
| 228 | { |
| 229 | chronosyncSyncPrefix=csp; |
| 230 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 231 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 232 | string getChronosyncSyncPrefix() |
| 233 | { |
| 234 | return chronosyncSyncPrefix; |
| 235 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 236 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 237 | void setChronosyncLsaPrefix(string clp) |
| 238 | { |
| 239 | chronosyncLsaPrefix=clp; |
| 240 | } |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 241 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 242 | string getChronosyncLsaPrefix() |
| 243 | { |
| 244 | return chronosyncLsaPrefix; |
| 245 | } |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 246 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 247 | int getInfoInterestInterval() |
| 248 | { |
| 249 | return infoInterestInterval; |
| 250 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 251 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 252 | void setInfoInterestInterval(int iii) |
| 253 | { |
| 254 | infoInterestInterval=iii; |
| 255 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 256 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 257 | private: |
| 258 | string routerName; |
| 259 | string siteName; |
| 260 | string network; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 261 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 262 | string routerPrefix; |
| 263 | string lsaRouterPrefix; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 264 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 265 | string chronosyncSyncPrefix; |
| 266 | string chronosyncLsaPrefix; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 267 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 268 | string rootKeyPrefix; |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 269 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 270 | int interestRetryNumber; |
| 271 | int interestResendTime; |
| 272 | int infoInterestInterval; |
| 273 | int lsaRefreshTime; |
| 274 | int routerDeadInterval; |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 275 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 276 | int maxFacesPerPrefix; |
| 277 | string logDir; |
| 278 | string certDir; |
| 279 | string seqFileDir; |
| 280 | string logFile; |
| 281 | int detailedLogging; |
| 282 | int debugging; |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 283 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 284 | int isHyperbolicCalc; |
| 285 | double corR; |
| 286 | double corTheta; |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 287 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 288 | int tunnelType; |
| 289 | int isStrictHierchicalKeyCheck; |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 290 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 291 | }; |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 292 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 293 | std::ostream& |
| 294 | operator << (std::ostream &os, ConfParameter &cfp); |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 295 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 296 | } // namespace nlsr |
| 297 | |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 298 | #endif |