system_queries: Migrate system queries into a single place

This provides better separation of the DBus interface and the underlying
system interactions.

Change-Id: I8bf7a44c679ab065f959af19a00c29897c1d5c48
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/system_queries.hpp b/src/system_queries.hpp
new file mode 100644
index 0000000..3182cd6
--- /dev/null
+++ b/src/system_queries.hpp
@@ -0,0 +1,39 @@
+#pragma once
+#include "types.hpp"
+
+#include <netinet/ether.h>
+
+#include <cstdint>
+#include <optional>
+#include <stdplus/zstring.hpp>
+#include <stdplus/zstring_view.hpp>
+#include <string_view>
+
+namespace phosphor::network::system
+{
+
+struct EthInfo
+{
+    bool autoneg;
+    uint16_t speed;
+};
+EthInfo getEthInfo(stdplus::zstring_view ifname);
+
+bool intfIsRunning(std::string_view ifname);
+
+unsigned intfIndex(stdplus::const_zstring ifname);
+
+std::optional<ether_addr> getMAC(stdplus::zstring_view ifname);
+
+std::optional<unsigned> getMTU(stdplus::zstring_view ifname);
+
+void setMTU(std::string_view ifname, unsigned mtu);
+
+void setNICUp(std::string_view ifname, bool up);
+
+/** @brief Get all the interfaces from the system.
+ *  @returns list of interface names.
+ */
+string_uset getInterfaces();
+
+} // namespace phosphor::network::system