diff options
author | Vernon Mauery <vernon.mauery@linux.intel.com> | 2019-04-09 11:44:36 -0700 |
---|---|---|
committer | Vernon Mauery <vernon.mauery@linux.intel.com> | 2019-04-18 22:40:32 +0000 |
commit | f442e119aed2dc87f320bf230ad39e7dc5c72524 (patch) | |
tree | fe834d199e48249934b3c84aa92db536aea3ef25 /transporthandler.cpp | |
parent | 5b2535f89023d0ea220ccc24200a9b51c142c08d (diff) | |
download | phosphor-host-ipmid-f442e119aed2dc87f320bf230ad39e7dc5c72524.tar.gz phosphor-host-ipmid-f442e119aed2dc87f320bf230ad39e7dc5c72524.zip |
move variant to std namespace
sdbusplus::message::variant_ns has been std for a while now. This moves
ipmid away from sdbusplus::message::variant_ns to directly use
std::variant.
Tested-by: built, compiles, and runs the same as before.
Change-Id: I8caa945f31c926c2721319f001b9d7f83fd3f1b7
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Diffstat (limited to 'transporthandler.cpp')
-rw-r--r-- | transporthandler.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/transporthandler.cpp b/transporthandler.cpp index 59d933a..d0768ac 100644 --- a/transporthandler.cpp +++ b/transporthandler.cpp @@ -36,7 +36,6 @@ using namespace phosphor::logging; using namespace sdbusplus::xyz::openbmc_project::Common::Error; namespace fs = std::filesystem; -namespace variant_ns = sdbusplus::message::variant_ns; void register_netfn_transport_functions() __attribute__((constructor)); @@ -88,7 +87,7 @@ ipmi_ret_t getNetworkData(uint8_t lan_param, uint8_t* data, int channel) ipmi::network::IP_INTERFACE); ipaddress = - variant_ns::get<std::string>(properties["Address"]); + std::get<std::string>(properties["Address"]); } // ignore the exception, as it is a valid condition that // the system is not configured with any IP. @@ -162,7 +161,7 @@ ipmi_ret_t getNetworkData(uint8_t lan_param, uint8_t* data, int channel) bus, ipmi::network::SERVICE, networkInterfacePath, ipmi::network::ETHERNET_INTERFACE, "DHCPEnabled"); - auto dhcpEnabled = variant_ns::get<bool>(variant); + auto dhcpEnabled = std::get<bool>(variant); // As per IPMI spec 2=>DHCP, 1=STATIC auto ipsrc = dhcpEnabled ? ipmi::network::IPOrigin::DHCP : ipmi::network::IPOrigin::STATIC; @@ -192,8 +191,8 @@ ipmi_ret_t getNetworkData(uint8_t lan_param, uint8_t* data, int channel) bus, ipObjectInfo.second, ipObjectInfo.first, ipmi::network::IP_INTERFACE); - auto prefix = variant_ns::get<uint8_t>( - properties["PrefixLength"]); + auto prefix = + std::get<uint8_t>(properties["PrefixLength"]); mask = ipmi::network::MASK_32_BIT; mask = htonl(mask << (ipmi::network::BITS_32 - prefix)); } @@ -230,7 +229,7 @@ ipmi_ret_t getNetworkData(uint8_t lan_param, uint8_t* data, int channel) bus, systemObject.second, systemObject.first, ipmi::network::SYSTEMCONFIG_INTERFACE); - gateway = variant_ns::get<std::string>( + gateway = std::get<std::string>( systemProperties["DefaultGateway"]); } // ignore the exception, as it is a valid condition that @@ -263,7 +262,7 @@ ipmi_ret_t getNetworkData(uint8_t lan_param, uint8_t* data, int channel) bus, macObjectInfo.second, macObjectInfo.first, ipmi::network::MAC_INTERFACE, "MACAddress"); - macAddress = variant_ns::get<std::string>(variant); + macAddress = std::get<std::string>(variant); } else if (channelConf->lan_set_in_progress == SET_IN_PROGRESS) { @@ -799,7 +798,7 @@ void applyChanges(int channel) } // get the configured mode on the system. - auto enableDHCP = variant_ns::get<bool>(ipmi::getDbusProperty( + auto enableDHCP = std::get<bool>(ipmi::getDbusProperty( bus, ipmi::network::SERVICE, networkInterfacePath, ipmi::network::ETHERNET_INTERFACE, "DHCPEnabled")); @@ -843,14 +842,13 @@ void applyChanges(int channel) bus, ipObject.second, ipObject.first, ipmi::network::IP_INTERFACE); - ipaddress = channelConf->ipaddr.empty() - ? variant_ns::get<std::string>( - properties["Address"]) - : channelConf->ipaddr; + ipaddress = + channelConf->ipaddr.empty() + ? std::get<std::string>(properties["Address"]) + : channelConf->ipaddr; prefix = channelConf->netmask.empty() - ? variant_ns::get<uint8_t>( - properties["PrefixLength"]) + ? std::get<uint8_t>(properties["PrefixLength"]) : ipmi::network::toPrefix( AF_INET, channelConf->netmask); } @@ -867,7 +865,7 @@ void applyChanges(int channel) ipmi::network::SYSTEMCONFIG_INTERFACE); gateway = channelConf->gateway.empty() - ? variant_ns::get<std::string>( + ? std::get<std::string>( systemProperties["DefaultGateway"]) : channelConf->gateway; } |