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