DCMI: Add  get/set Configuration Parameters command

1.Systemd-networkd doesn't allow to configure DHCP timings, so set is
not implemented.
2.Get command to DHCP timings will return hardcoded values from
systemd-networkd source code.
3.Systemd-networkd doesn't support Random Back off, so not implemented.
4.As the info about VendorClassIdentifier is not clear in the spec,
Right now we are not supporting DHCP Option 60 and Option 43. We will
open new issue for it.

Resolves openbmc/openbmc#2752

Change-Id: I2682e5e43ceb19647e5240b095f601777213530b
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
diff --git a/dcmihandler.hpp b/dcmihandler.hpp
index e2a4c10..5388344 100644
--- a/dcmihandler.hpp
+++ b/dcmihandler.hpp
@@ -27,6 +27,8 @@
     GET_MGMNT_CTRL_ID_STR = 0x09,
     SET_MGMNT_CTRL_ID_STR = 0x0A,
     GET_TEMP_READINGS = 0x10,
+    SET_CONF_PARAMS = 0x12,
+    GET_CONF_PARAMS = 0x13,
 };
 
 static constexpr auto propIntf = "org.freedesktop.DBus.Properties";
@@ -43,6 +45,16 @@
 static constexpr auto maxInstances = 255;
 static constexpr auto configFile =
     "/usr/share/ipmi-providers/dcmi_sensors.json";
+static constexpr auto ethernetIntf =
+        "xyz.openbmc_project.Network.EthernetInterface";
+static constexpr auto ethernetDefaultChannelNum = 0x1;
+static constexpr auto networkRoot = "/xyz/openbmc_project/network";
+static constexpr auto dhcpObj = "/xyz/openbmc_project/network/config/dhcp";
+static constexpr auto dhcpIntf =
+        "xyz.openbmc_project.Network.DHCPConfiguration";
+static constexpr auto systemBusName = "org.freedesktop.systemd1";
+static constexpr auto systemPath = "/org/freedesktop/systemd1";
+static constexpr auto systemIntf = "org.freedesktop.systemd1.Manager";
 
 namespace assettag
 {
@@ -552,6 +564,70 @@
     uint8_t numInstances;           //!< No. of instances for requested id
     uint8_t numRecords;             //!< No. of record ids in the response
 } __attribute__((packed));
+/**
+ *  @brief Parameters for DCMI Configuration Parameters
+ */
+enum class DCMIConfigParameters: uint8_t
+{
+    ActivateDHCP = 1,
+    DiscoveryConfig,
+    DHCPTiming1,
+    DHCPTiming2,
+    DHCPTiming3,
+};
+
+/** @struct SetConfParamsRequest
+ *
+ *  DCMI Set DCMI Configuration Parameters Command.
+ *  Refer DCMI specification Version 1.1 Section 6.1.2
+ */
+struct SetConfParamsRequest
+{
+    uint8_t groupID;        //!< Group extension identification.
+    uint8_t paramSelect;    //!< Parameter selector.
+    uint8_t setSelect;      //!< Set Selector (use 00h for parameters that only
+                            //!< have one set).
+    uint8_t data[];         //!< Configuration parameter data.
+} __attribute__((packed));
+
+/** @struct SetConfParamsResponse
+ *
+ *  DCMI Set DCMI Configuration Parameters Command response.
+ *  Refer DCMI specification Version 1.1 Section 6.1.2
+ */
+struct SetConfParamsResponse
+{
+    uint8_t  groupID;        //!< Group extension identification.
+} __attribute__((packed));
+
+/** @struct GetConfParamsRequest
+ *
+ *  DCMI Get DCMI Configuration Parameters Command.
+ *  Refer DCMI specification Version 1.1 Section 6.1.3
+ */
+struct GetConfParamsRequest
+{
+    uint8_t groupID;        //!< Group extension identification.
+    uint8_t paramSelect;    //!< Parameter selector.
+    uint8_t setSelect;      //!< Set Selector. Selects a given set of parameters
+                            //!< under a given Parameter selector value. 00h if
+                            //!< parameter doesn't use a Set Selector.
+} __attribute__((packed));
+
+/** @struct GetConfParamsResponse
+ *
+ *  DCMI Get DCMI Configuration Parameters Command response.
+ *  Refer DCMI specification Version 1.1 Section 6.1.3
+ */
+struct GetConfParamsResponse
+{
+    uint8_t groupID;         //!< Group extension identification.
+    uint8_t major;           //!< DCMI Spec Conformance - major ver = 01h.
+    uint8_t minor;           //!< DCMI Spec Conformance - minor ver = 05h.
+    uint8_t paramRevision;   //!< Parameter Revision = 01h.
+    uint8_t data[];          //!< Parameter data.
+
+} __attribute__((packed));
 
 } // namespace dcmi