google-ipmi-sys: Add "Entity Id:Entity Instance" mapping to Entity name

Say the system has a JSON file like :
{
    "cpu": [
        {"instance": 1, "name": "CPU0"},
        {"instance": 2, "name": "CPU1"}
    ],
    "memory_module": [
        {"instance": 1, "name": "DIMM_A1"},
        {"instance": 2, "name": "DIMM_A2"},
        {"instance": 3, "name": "DIMM_B1"},
        {"instance": 4, "name": "DIMM_B2"},
        {"instance": 5, "name": "DIMM_C1"},
        {"instance": 6, "name": "DIMM_C2"},
        {"instance": 7, "name": "DIMM_D1"},
        {"instance": 8, "name": "DIMM_D2"},
        {"instance": 9, "name": "DIMM_E1"},
        {"instance": 10, "name": "DIMM_E2"},
        {"instance": 11, "name": "DIMM_F1"},
    ],
    "add_in_card": [
        {"instance": 1, "name": "slot1"},
        {"instance": 2, "name": "slot2"},
        {"instance": 3, "name": "slot3"},
        {"instance": 4, "name": "slot5"}
    ],
    "storage_device": [
        {"instance": 1, "name": "SATA0"},
        {"instance": 2, "name": "SATA1"},
        {"instance": 3, "name": "SATA2"},
        {"instance": 4, "name": "SATA3"}
    ]
}

The system can query the BMC for an Entity name given the Entity ID and Entity Instance.

Tested:
Yes;
1) Sending GetEntityName command; Expecting error since entity ID and
entity instance are not specified.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32
rsp=0xc7): Request data length invalid

2) Sending GetEntityName command; Expecting error since entity instance
is not specified.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x01
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32
rsp=0xc7): Request data length invalid

3) Sending GetEntityName command; Expecting error since Entity Id = 0x07
is not supported.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x07 0x01
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32
rsp=0xcc): Invalid data field in request

4) Sending GetEntityName command; Expecting error since Entity Instance
= 0x06 is not added in the JSON file.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x3
0x06
Unable to send RAW command (channel=0x0 netfn=0x2e lun=0x0 cmd=0x32
rsp=0xcc): Invalid data field in request

5) Sending GetEntityName command; Expecting success.
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x3
0x01
 79 2b 00 06 04 43 50 55 30
root@adler:~# ipmitool -I dbus raw 0x2e 0x32 0x79 0x2b 0x00 0x06 0x0B
0x01
 79 2b 00 06 05 73 6c 6f 74 31
root@adler:~#

Change-Id: Idf6caae863acacd62460cbb7f73bf56fc927bcff
Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>
diff --git a/main.cpp b/main.cpp
index f0c61a9..673174a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -18,6 +18,7 @@
 
 #include "cable.hpp"
 #include "cpld.hpp"
+#include "entity_name.hpp"
 #include "eth.hpp"
 #include "pcie_i2c.hpp"
 #include "psu.hpp"
@@ -67,6 +68,8 @@
             return PcieSlotCount(reqBuf, replyCmdBuf, dataLen);
         case SysPcieSlotI2cBusMapping:
             return PcieSlotI2cBusMapping(reqBuf, replyCmdBuf, dataLen);
+        case SysEntityName:
+            return GetEntityName(reqBuf, replyCmdBuf, dataLen);
         default:
             std::fprintf(stderr, "Invalid subcommand: 0x%x\n", reqBuf[0]);
             return IPMI_CC_INVALID;