oem-ibm: State effecter for rename operation

This commit adds an effecter that says "do a side rename"
during inband code update.

When the inband code update is initialized, the host sets
this effecter, the bmc sets the current bootside
(currBootSide) variable and sends the event to host
indicating that the rename has taken place.

Tested with pldmtool.

Output:
./pldmtool platform SetStateEffecterStates -v -i 118 -c 1 -d 1 2
{
    "Response": "SUCCESS"
}

Change-Id: I8ef062b407736e0753017f3a484c04e86047e0d3
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index 15ab665..567d14f 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -164,6 +164,15 @@
                 slotHandler->enableSlot(effecterId, entityAssociationMap,
                                         stateField[currState].effecter_state);
             }
+            else if (entityType == PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE &&
+                     stateSetId == PLDM_OEM_IBM_BOOT_SIDE_RENAME)
+            {
+                if (stateField[currState].effecter_state ==
+                    PLDM_OEM_IBM_BOOT_SIDE_RENAME_STATE_RENAMED)
+                {
+                    codeUpdate->processRenameEvent();
+                }
+            }
             else
             {
                 rc = PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE;
@@ -217,7 +226,8 @@
     possibleStates->possible_states_size = 2;
     auto state =
         reinterpret_cast<state_effecter_possible_states*>(possibleStates);
-    if (stateSetID == PLDM_OEM_IBM_BOOT_STATE)
+    if ((stateSetID == PLDM_OEM_IBM_BOOT_STATE) ||
+        (stateSetID == PLDM_OEM_IBM_BOOT_SIDE_RENAME))
         state->states[0].byte = 6;
     else if (stateSetID == PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE)
         state->states[0].byte = 126;