Accommodate n-Dimensional HR coordinates
refs: #3751
Change-Id: Ib705b671daba56f58e09876a48d8b31649bd7ab1
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index 211609a..789efc4 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -528,17 +528,32 @@
}
try {
- /* Radius and angle is mandatory configuration parameter in hyperbolic section.
+ /* Radius and angle(s) are mandatory configuration parameters in hyperbolic section.
* Even if router can have hyperbolic routing calculation off but other router
* in the network may use hyperbolic routing calculation for FIB generation.
* So each router need to advertise its hyperbolic coordinates in the network
*/
double radius = section.get<double>("radius");
- double angle = section.get<double>("angle");
+ std::string angleString = section.get<std::string>("angle");
+
+ std::stringstream ss(angleString);
+ std::vector<double> angles;
+
+ double angle;
+
+ while (ss >> angle)
+ {
+ angles.push_back(angle);
+ if (ss.peek() == ',' || ss.peek() == ' ')
+ {
+ ss.ignore();
+ }
+ }
+
if (!m_nlsr.getConfParameter().setCorR(radius)) {
return false;
}
- m_nlsr.getConfParameter().setCorTheta(angle);
+ m_nlsr.getConfParameter().setCorTheta(angles);
}
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;