SetLan: Apply the network changes once the timer expires

Start the timer once the set in progress parameter set to
set complete as part of Set LAN Configuration Parameters
command.

Resolves openbmc/openbmc#2932
Resolves openbmc/openbmc#2993

Change-Id: Ie6f3b331531da23c74fa44bb52fa1ddccffabd13
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/transporthandler.hpp b/transporthandler.hpp
index 42bf717..f440403 100644
--- a/transporthandler.hpp
+++ b/transporthandler.hpp
@@ -47,6 +47,7 @@
     // vlan id is in 12 bits and the 16th bit is for enable mask.
     uint32_t vlanID = ipmi::network::VLAN_ID_MASK;
     uint8_t lan_set_in_progress = SET_COMPLETE;
+    bool flush = false;
 
     void clear()
     {
@@ -57,6 +58,7 @@
         vlanID = ipmi::network::VLAN_ID_MASK;
         ipsrc = ipmi::network::IPOrigin::UNSPECIFIED;
         lan_set_in_progress = SET_COMPLETE;
+        flush = false;
     }
 };
 
@@ -66,3 +68,19 @@
 // @param[in] channel the channel
 // @return the ChannelConfig_t pointer.
 struct ChannelConfig_t* getChannelConfig(int channel);
+
+/** @brief Iterate over all the channelconfig and if
+ *         user has given the data for a channel then
+ *         apply the network changes for that channel.
+ */
+void commitNetworkChanges();
+
+/* @brief  Apply the network changes which is there in the
+ *         network cache for a given channel which gets filled
+ *         through setLan command. If some of the network
+ *         parameter was not given by the setLan then this function
+ *         gets the value of that parameter which is already
+ *         configured on the system.
+ * @param[in] channel: channel number.
+ */
+void applyChanges(int channel);