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