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 | |
| 97 | long int setRouterDeadInterval(){ |
| 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 | |
| 181 | private: |
| 182 | string routerName; |
| 183 | string siteName; |
| 184 | string network; |
| 185 | |
| 186 | string routerPrefix; |
| 187 | string lsaRouterPrefix; |
| 188 | |
| 189 | string chronosyncSyncPrefix; |
| 190 | string chronosyncLsaPrefix; |
| 191 | |
| 192 | int interestRetryNumber; |
| 193 | int interestResendTime; |
| 194 | int infoInterestInterval; |
| 195 | int lsaRefreshTime; |
| 196 | int routerDeadInterval; |
| 197 | |
| 198 | int maxFacesPerPrefix; |
| 199 | string logDir; |
| 200 | string logFile; |
| 201 | int detailedLogging; |
| 202 | int debugging; |
| 203 | |
| 204 | int isHyperbolicCalc; |
| 205 | double corR; |
| 206 | double corTheta; |
| 207 | |
| 208 | int tunnelType; |
| 209 | |
| 210 | int adjBuildFlag; |
| 211 | long int adjBuildCount; |
| 212 | int isBuildAdjLsaSheduled; |
| 213 | int isRouteCalculationScheduled; |
| 214 | |
| 215 | int isRoutingTableCalculating; |
| 216 | int isStrictHierchicalKeyCheck; |
| 217 | |
| 218 | |
| 219 | |
| 220 | }; |
| 221 | |
| 222 | std::ostream& |
| 223 | operator << (std::ostream &os, ConfParameter &cfp); |
| 224 | |
| 225 | #endif |