summaryrefslogtreecommitdiff
path: root/redfish-core/lib/ethernet.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2021-12-20 20:34:41 +0300
committerEd Tanous <ed@tanous.net>2022-01-10 20:36:54 +0300
commit711ac7a931dd3f151fc4064063b5ea90404b9054 (patch)
treec765543008faaa9c4a82489231aa5ba29d86d2d5 /redfish-core/lib/ethernet.hpp
parent6e3b67ecec7c66d674a6707b6211786fc0704d8a (diff)
downloadbmcweb-711ac7a931dd3f151fc4064063b5ea90404b9054.tar.xz
Consistently use ManagedObjectType
Some subsystems seem to have invented their own typedefs for this stuff, move to using the one typedef in dbus::utility so we're consistent, and we reduce our templates. Tested: code compiles This saves a negligible amount (104 bytes compressed) on our binary size. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I952ea1f960aa703808d0ac80f35dc24cdd8d5027
Diffstat (limited to 'redfish-core/lib/ethernet.hpp')
-rw-r--r--redfish-core/lib/ethernet.hpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index b726eccf17..1097aec750 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -37,12 +37,6 @@ namespace redfish
using PropertiesMapType =
boost::container::flat_map<std::string, dbus::utility::DbusVariantType>;
-using GetManagedObjects = std::vector<std::pair<
- sdbusplus::message::object_path,
- std::vector<std::pair<std::string,
- boost::container::flat_map<
- std::string, dbus::utility::DbusVariantType>>>>>;
-
enum class LinkType
{
Local,
@@ -196,9 +190,10 @@ inline std::string
return "";
}
-inline bool extractEthernetInterfaceData(const std::string& ethifaceId,
- GetManagedObjects& dbusData,
- EthernetInterfaceData& ethData)
+inline bool
+ extractEthernetInterfaceData(const std::string& ethifaceId,
+ dbus::utility::ManagedObjectType& dbusData,
+ EthernetInterfaceData& ethData)
{
bool idFound = false;
for (auto& objpath : dbusData)
@@ -432,7 +427,7 @@ inline bool extractEthernetInterfaceData(const std::string& ethifaceId,
// Helper function that extracts data for single ethernet ipv6 address
inline void
extractIPV6Data(const std::string& ethifaceId,
- const GetManagedObjects& dbusData,
+ const dbus::utility::ManagedObjectType& dbusData,
boost::container::flat_set<IPv6AddressData>& ipv6Config)
{
const std::string ipv6PathStart =
@@ -510,7 +505,7 @@ inline void
// Helper function that extracts data for single ethernet ipv4 address
inline void
extractIPData(const std::string& ethifaceId,
- const GetManagedObjects& dbusData,
+ const dbus::utility::ManagedObjectType& dbusData,
boost::container::flat_set<IPv4AddressData>& ipv4Config)
{
const std::string ipv4PathStart =
@@ -938,7 +933,7 @@ void getEthernetIfaceData(const std::string& ethifaceId,
crow::connections::systemBus->async_method_call(
[ethifaceId{std::string{ethifaceId}}, callback{std::move(callback)}](
const boost::system::error_code errorCode,
- GetManagedObjects& resp) {
+ dbus::utility::ManagedObjectType& resp) {
EthernetInterfaceData ethData{};
boost::container::flat_set<IPv4AddressData> ipv4Data;
boost::container::flat_set<IPv6AddressData> ipv6Data;
@@ -989,7 +984,7 @@ void getEthernetIfaceList(CallbackFunc&& callback)
crow::connections::systemBus->async_method_call(
[callback{std::move(callback)}](
const boost::system::error_code errorCode,
- GetManagedObjects& resp) {
+ dbus::utility::ManagedObjectType& resp) {
// Callback requires vector<string> to retrieve all available
// ethernet interfaces
boost::container::flat_set<std::string> ifaceList;