Add support for Get SOL configuration parameters command.

Change-Id: I711cbcd66caea7939d7604551ea4d80a1576244e
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/command/sol_cmds.cpp b/command/sol_cmds.cpp
index f18bc8b..f475c03 100644
--- a/command/sol_cmds.cpp
+++ b/command/sol_cmds.cpp
@@ -153,6 +153,92 @@
     return outPayload;
 }
 
+std::vector<uint8_t> getConfParams(const std::vector<uint8_t>& inPayload,
+                                   const message::Handler& handler)
+{
+    std::vector<uint8_t> outPayload(sizeof(GetConfParamsResponse));
+    auto request = reinterpret_cast<const GetConfParamsRequest*>
+                   (inPayload.data());
+    auto response = reinterpret_cast<GetConfParamsResponse*>
+                    (outPayload.data());
+    response->completionCode = IPMI_CC_OK;
+    response->paramRev = parameterRevision;
+
+    if (request->getParamRev)
+    {
+        return outPayload;
+    }
+
+    switch (static_cast<Parameter>(request->paramSelector))
+    {
+        case Parameter::PROGRESS:
+        {
+            outPayload.push_back(std::get<sol::Manager&>
+                    (singletonPool).progress);
+            break;
+        }
+        case Parameter::ENABLE:
+        {
+            outPayload.push_back(std::get<sol::Manager&>
+                    (singletonPool).enable);
+            break;
+        }
+        case Parameter::AUTHENTICATION:
+        {
+            Auth value {0};
+
+            value.encrypt = std::get<sol::Manager&>(singletonPool).forceEncrypt;
+            value.auth = std::get<sol::Manager&>(singletonPool).forceAuth;
+            value.privilege  = static_cast<uint8_t>(std::get<sol::Manager&>
+                    (singletonPool).solMinPrivilege);
+            auto buffer = reinterpret_cast<const uint8_t *>(&value);
+
+            std::copy_n(buffer, sizeof(value), std::back_inserter(outPayload));
+            break;
+        }
+        case Parameter::ACCUMULATE:
+        {
+            Accumulate value {0};
+
+            value.interval = std::get<sol::Manager&>(singletonPool)
+                            .accumulateInterval.count()/sol::accIntervalFactor;
+            value.threshold = std::get<sol::Manager&>
+                            (singletonPool).sendThreshold;
+            auto buffer = reinterpret_cast<const uint8_t *>(&value);
+
+            std::copy_n(buffer, sizeof(value), std::back_inserter(outPayload));
+            break;
+        }
+        case Parameter::RETRY:
+        {
+            Retry value {0};
+
+            value.count = std::get<sol::Manager&>(singletonPool).retryCount;
+            value.interval = std::get<sol::Manager&>(singletonPool)
+                    .retryInterval.count()/sol::retryIntervalFactor;
+            auto buffer = reinterpret_cast<const uint8_t *>(&value);
+
+            std::copy_n(buffer, sizeof(value), std::back_inserter(outPayload));
+            break;
+        }
+        case Parameter::PORT:
+        {
+            auto port = endian::to_ipmi<uint16_t>(IPMI_STD_PORT);
+            auto buffer = reinterpret_cast<const uint8_t *>(&port);
+
+            std::copy_n(buffer, sizeof(port), std::back_inserter(outPayload));
+            break;
+        }
+        case Parameter::NVBITRATE:
+        case Parameter::VBITRATE:
+        case Parameter::CHANNEL:
+        default:
+            response->completionCode = ipmiCCParamNotSupported;
+    }
+
+    return outPayload;
+}
+
 } // namespace command
 
 } // namespace sol