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