summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2019-04-06 18:19:38 -0700
committerVernon Mauery <vernon.mauery@linux.intel.com>2019-09-27 17:18:29 +0000
commitc514d874e4ce3ed1f747cfcb4bab5990393c55e8 (patch)
tree3f53b6aee184df63fed0e12be530fb0ab1e7184d /include
parente7023926675030a5976dffda0825445ca0b5ef84 (diff)
downloadphosphor-host-ipmid-c514d874e4ce3ed1f747cfcb4bab5990393c55e8.tar.gz
phosphor-host-ipmid-c514d874e4ce3ed1f747cfcb4bab5990393c55e8.zip
transporthandler: Rewrite + New Handler
This rewrites the old transport handler to use the new ipmi handler registration functions. It attempts to clean up the old code, by refactoring any business logic out of the code that parses the IPMI messages. This makes the code paths easier to understand and allows for better code re-use. This also gets rid of the concept of the settings change timer. Clients expect to see their settings take effect as soon as they are set, regardless of the "Set In Progress" flag. This means we no longer need a cache for our network settings that are about to be set by the daemon, and a client can hold the BMC in "Set In Progress" while it verifies settings like other BMC implementations. Change-Id: I5406a674f087600afdfc2c0b3adeacde10986abc Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/ipmid/types.hpp21
-rw-r--r--include/ipmid/utils.hpp70
2 files changed, 1 insertions, 90 deletions
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index fcc635c..e2f80c0 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -215,12 +215,7 @@ using EntityInfoMap = std::map<Id, EntityInfo>;
namespace network
{
-using ChannelEthMap = std::map<int, std::string>;
-
constexpr auto MAC_ADDRESS_FORMAT = "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx";
-constexpr auto IP_ADDRESS_FORMAT = "%u.%u.%u.%u";
-constexpr auto PREFIX_FORMAT = "%hhd";
-constexpr auto ADDR_TYPE_FORMAT = "%hhx";
constexpr auto IPV4_ADDRESS_SIZE_BYTE = 4;
constexpr auto IPV6_ADDRESS_SIZE_BYTE = 16;
@@ -228,20 +223,6 @@ constexpr auto IPV6_ADDRESS_SIZE_BYTE = 16;
constexpr auto DEFAULT_MAC_ADDRESS = "00:00:00:00:00:00";
constexpr auto DEFAULT_ADDRESS = "0.0.0.0";
-constexpr auto MAC_ADDRESS_SIZE_BYTE = 6;
-constexpr auto VLAN_SIZE_BYTE = 2;
-constexpr auto IPSRC_SIZE_BYTE = 1;
-constexpr auto BITS_32 = 32;
-constexpr auto MASK_32_BIT = 0xFFFFFFFF;
-constexpr auto VLAN_ID_MASK = 0x00000FFF;
-constexpr auto VLAN_ENABLE_MASK = 0x8000;
-
-enum class IPOrigin : uint8_t
-{
- UNSPECIFIED = 0,
- STATIC = 1,
- DHCP = 2,
-};
-
} // namespace network
+
} // namespace ipmi
diff --git a/include/ipmid/utils.hpp b/include/ipmid/utils.hpp
index 45c9c1a..3515eb6 100644
--- a/include/ipmid/utils.hpp
+++ b/include/ipmid/utils.hpp
@@ -113,20 +113,6 @@ DbusObjectInfo getDbusObject(sdbusplus::bus::bus& bus,
const std::string& subtreePath = ROOT,
const std::string& match = {});
-/** @brief Get the ipObject of first dbus IP object of Non-LinkLocalIPAddress
- * type from the given subtree, if not available gets IP object of
- * LinkLocalIPAddress type.
- * @param[in] bus - DBUS Bus Object.
- * @param[in] interface - Dbus interface.
- * @param[in] subtreePath - subtree from where the search should start.
- * @param[in] match - identifier for object.
- * @return On success returns the object having objectpath and servicename.
- */
-DbusObjectInfo getIPObject(sdbusplus::bus::bus& bus,
- const std::string& interface,
- const std::string& subtreePath,
- const std::string& match);
-
/** @brief Gets the value associated with the given object
* and the interface.
* @param[in] bus - DBUS Bus Object.
@@ -251,62 +237,6 @@ void callDbusMethod(sdbusplus::bus::bus& bus, const std::string& service,
} // namespace method_no_args
-namespace network
-{
-
-constexpr auto ROOT = "/xyz/openbmc_project/network";
-constexpr auto SERVICE = "xyz.openbmc_project.Network";
-constexpr auto IP_TYPE = "ipv4";
-constexpr auto IPV4_PREFIX = "169.254";
-constexpr auto IPV6_PREFIX = "fe80";
-constexpr auto IP_INTERFACE = "xyz.openbmc_project.Network.IP";
-constexpr auto MAC_INTERFACE = "xyz.openbmc_project.Network.MACAddress";
-constexpr auto SYSTEMCONFIG_INTERFACE =
- "xyz.openbmc_project.Network.SystemConfiguration";
-constexpr auto ETHERNET_INTERFACE =
- "xyz.openbmc_project.Network.EthernetInterface";
-constexpr auto IP_CREATE_INTERFACE = "xyz.openbmc_project.Network.IP.Create";
-constexpr auto VLAN_CREATE_INTERFACE =
- "xyz.openbmc_project.Network.VLAN.Create";
-constexpr auto VLAN_INTERFACE = "xyz.openbmc_project.Network.VLAN";
-
-/* @brief converts the given subnet into prefix notation.
- * @param[in] addressFamily - IP address family(AF_INET/AF_INET6).
- * @param[in] mask - Subnet Mask.
- * @returns prefix.
- */
-uint8_t toPrefix(int addressFamily, const std::string& subnetMask);
-
-/** @brief Sets the ip on the system.
- * @param[in] bus - DBUS Bus Object.
- * @param[in] service - Dbus service name.
- * @param[in] objPath - Dbus object path.
- * @param[in] protocolType - Protocol type
- * @param[in] ipaddress - IPaddress.
- * @param[in] prefix - Prefix length.
- */
-void createIP(sdbusplus::bus::bus& bus, const std::string& service,
- const std::string& objPath, const std::string& protocolType,
- const std::string& ipaddress, uint8_t prefix);
-
-/** @brief Creates the VLAN on the given interface.
- * @param[in] bus - DBUS Bus Object.
- * @param[in] service - Dbus service name.
- * @param[in] objPath - Dbus object path.
- * @param[in] interface - EthernetInterface.
- * @param[in] vlanID - Vlan ID.
- */
-void createVLAN(sdbusplus::bus::bus& bus, const std::string& service,
- const std::string& objPath, const std::string& interface,
- uint32_t vlanID);
-
-/** @brief Gets the vlan id from the given object path.
- * @param[in] path - Dbus object path.
- */
-uint32_t getVLAN(const std::string& path);
-
-} // namespace network
-
/** @brief Perform the low-level i2c bus write-read.
* @param[in] i2cBus - i2c bus device node name, such as /dev/i2c-2.
* @param[in] slaveAddr - i2c device slave address.
OpenPOWER on IntegriCloud