Implement OriginatedBy interface in dump entry dbus obj
This new interface "OriginatedBy" will be implemented
by all the dump entry dbus objects. It contains a property
"OriginatorId" which stores the unique id of the user that
has initiated the dump. The unique id in this case is a string
that contains the ip address of the client that initiated
the dump.
The dbus interface change for the same is at:
[1] https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/47057
Tested By:
[1] busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/bmc xyz.openbmc_project.Dump.Create CreateDump a{sv} 2 "xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorId" s "<unique-id>" "xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorType" s "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Client" o "/xyz/openbmc_project/dump/bmc/entry/2"
[2] busctl --verbose call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/resource xyz.openbmc_project.Dump.Create CreateDump a{sv} 4 "com.ibm.Dump.Create.CreateParameters.VSPString" s "vsp" "com.ibm.Dump.Create.CreateParameters.Password" s "password" "com.ibm.Dump.Create.CreateParameters.OriginatorId" s "<unique-id>" "xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorType" s "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Client"
MESSAGE "o" {
OBJECT_PATH "/xyz/openbmc_project/dump/resource/entry/1";
};
[3] busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/system xyz.openbmc_project.Dump.Create CreateDump a{sv} 2 "com.ibm.Dump.Create.CreateParameters.OriginatorId" s "<unique-id>" "xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorType" s "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Client" o "/xyz/openbmc_project/dump/system/entry/1"
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Change-Id: I23c9f769fd39cd84e042d6effbb3d71c7af4e889
diff --git a/bmc_dump_entry.hpp b/bmc_dump_entry.hpp
index 964f3a7..267a0ef 100644
--- a/bmc_dump_entry.hpp
+++ b/bmc_dump_entry.hpp
@@ -23,6 +23,9 @@
using EntryIfaces = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::Dump::Entry::server::BMC>;
+using originatorTypes = sdbusplus::xyz::openbmc_project::Common::server::
+ OriginatedBy::OriginatorTypes;
+
class Manager;
/** @class Entry
@@ -49,16 +52,18 @@
* @param[in] fileSize - Dump file size in bytes.
* @param[in] file - Name of dump file.
* @param[in] status - status of the dump.
+ * @param[in] originatorId - Id of the originator of the dump
+ * @param[in] originatorType - Originator type
* @param[in] parent - The dump entry's parent.
*/
Entry(sdbusplus::bus_t& bus, const std::string& objPath, uint32_t dumpId,
uint64_t timeStamp, uint64_t fileSize,
const std::filesystem::path& file,
- phosphor::dump::OperationStatus status,
- phosphor::dump::Manager& parent) :
+ phosphor::dump::OperationStatus status, std::string originatorId,
+ originatorTypes originatorType, phosphor::dump::Manager& parent) :
EntryIfaces(bus, objPath.c_str(), EntryIfaces::action::defer_emit),
phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, fileSize,
- status, parent),
+ status, originatorId, originatorType, parent),
file(file)
{
// Emit deferred signal.