utility: Add Get All Properties

Add a utility function to call the D-Bus GetAll method. This will be
used to get the values of all the properties from the Supported
Configuration interface from Entity Manager. Start with the variant
values for the properties in the Supported Configuration interface which
are uint64_t (count), string (type), and array of strings (models).

Make the service parameter optional since the caller may already have
the service name from another D-Bus call like getSubTree, or the caller
may decide to call getService() before the getAll function if they are
going to call getAll multiple times and the service name can be reused.
If the service name is not passed, the new getAll will call getService().

Tested: Verified that calling the new function worked as expected
        calling it with and without a service name.

Change-Id: I4d679f0e5d28248d38050b6aed44d4ea86b83c59
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/utility.cpp b/utility.cpp
index cec9d8b..ee65cff 100644
--- a/utility.cpp
+++ b/utility.cpp
@@ -63,6 +63,31 @@
     return response.begin()->first;
 }
 
+DbusPropertyMap getAllProperties(sdbusplus::bus::bus& bus,
+                                 const std::string& path,
+                                 const std::string& interface,
+                                 const std::string& service)
+{
+    DbusPropertyMap properties;
+
+    auto serviceStr = service;
+    if (serviceStr.empty())
+    {
+        serviceStr = getService(path, interface, bus);
+        if (serviceStr.empty())
+        {
+            return properties;
+        }
+    }
+
+    auto method = bus.new_method_call(serviceStr.c_str(), path.c_str(),
+                                      PROPERTY_INTF, "GetAll");
+    method.append(interface);
+    auto reply = bus.call(method);
+    reply.read(properties);
+    return properties;
+}
+
 DbusSubtree getSubTree(sdbusplus::bus::bus& bus, const std::string& path,
                        const std::string& interface, int32_t depth)
 {