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