Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 3 | #include "types.hpp" |
Ratan Gupta | 8804feb | 2017-05-25 10:49:57 +0530 | [diff] [blame] | 4 | #include "util.hpp" |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 5 | #include "xyz/openbmc_project/Network/IP/Create/server.hpp" |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 6 | #include "xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp" |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 7 | |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 8 | #include <experimental/filesystem> |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 9 | #include <sdbusplus/bus.hpp> |
| 10 | #include <sdbusplus/server/object.hpp> |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 11 | #include <string> |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 12 | #include <xyz/openbmc_project/Collection/DeleteAll/server.hpp> |
| 13 | #include <xyz/openbmc_project/Network/EthernetInterface/server.hpp> |
| 14 | #include <xyz/openbmc_project/Network/MACAddress/server.hpp> |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 15 | |
| 16 | namespace phosphor |
| 17 | { |
| 18 | namespace network |
| 19 | { |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 20 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 21 | using Ifaces = sdbusplus::server::object::object< |
| 22 | sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface, |
| 23 | sdbusplus::xyz::openbmc_project::Network::server::MACAddress, |
| 24 | sdbusplus::xyz::openbmc_project::Network::IP::server::Create, |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 25 | sdbusplus::xyz::openbmc_project::Network::Neighbor::server::CreateStatic, |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 26 | sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll>; |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 27 | |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 28 | using IP = sdbusplus::xyz::openbmc_project::Network::server::IP; |
Ratan Gupta | 87c1398 | 2017-06-15 09:27:27 +0530 | [diff] [blame] | 29 | |
| 30 | using EthernetInterfaceIntf = |
| 31 | sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface; |
Ratan Gupta | bd303b1 | 2017-08-18 17:10:07 +0530 | [diff] [blame] | 32 | using MacAddressIntf = |
| 33 | sdbusplus::xyz::openbmc_project::Network::server::MACAddress; |
Ratan Gupta | 87c1398 | 2017-06-15 09:27:27 +0530 | [diff] [blame] | 34 | |
Ratan Gupta | 497c0c9 | 2017-08-22 19:15:59 +0530 | [diff] [blame] | 35 | using ServerList = std::vector<std::string>; |
raviteja-b | ce37956 | 2019-03-28 05:59:36 -0500 | [diff] [blame] | 36 | using ObjectPath = sdbusplus::message::object_path; |
Ratan Gupta | 497c0c9 | 2017-08-22 19:15:59 +0530 | [diff] [blame] | 37 | |
Ratan Gupta | 5978dd1 | 2017-07-25 13:47:13 +0530 | [diff] [blame] | 38 | namespace fs = std::experimental::filesystem; |
| 39 | |
Ratan Gupta | 4f1c18b | 2017-05-25 12:59:35 +0530 | [diff] [blame] | 40 | class Manager; // forward declaration of network manager. |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 41 | |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 42 | class TestEthernetInterface; |
| 43 | |
Ratan Gupta | 5978dd1 | 2017-07-25 13:47:13 +0530 | [diff] [blame] | 44 | class VlanInterface; |
| 45 | |
| 46 | class IPAddress; |
| 47 | |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 48 | class Neighbor; |
| 49 | |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 50 | using LinkSpeed = uint16_t; |
| 51 | using DuplexMode = uint8_t; |
| 52 | using Autoneg = uint8_t; |
Johnathan Mantey | faa72e5 | 2020-01-08 10:38:58 -0800 | [diff] [blame] | 53 | using LinkUp = bool; |
Johnathan Mantey | d0679f9 | 2019-10-29 16:20:28 -0700 | [diff] [blame^] | 54 | using NICEnabled = bool; |
Ratan Gupta | 5978dd1 | 2017-07-25 13:47:13 +0530 | [diff] [blame] | 55 | using VlanId = uint32_t; |
| 56 | using InterfaceName = std::string; |
Johnathan Mantey | d0679f9 | 2019-10-29 16:20:28 -0700 | [diff] [blame^] | 57 | using InterfaceInfo = |
| 58 | std::tuple<LinkSpeed, DuplexMode, Autoneg, LinkUp, NICEnabled>; |
Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 59 | using AddressMap = std::map<std::string, std::shared_ptr<IPAddress>>; |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 60 | using NeighborMap = std::map<std::string, std::shared_ptr<Neighbor>>; |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 61 | using VlanInterfaceMap = |
| 62 | std::map<InterfaceName, std::unique_ptr<VlanInterface>>; |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 63 | |
| 64 | /** @class EthernetInterface |
| 65 | * @brief OpenBMC Ethernet Interface implementation. |
| 66 | * @details A concrete implementation for the |
| 67 | * xyz.openbmc_project.Network.EthernetInterface DBus API. |
| 68 | */ |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 69 | class EthernetInterface : public Ifaces |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 70 | { |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 71 | public: |
| 72 | EthernetInterface() = delete; |
| 73 | EthernetInterface(const EthernetInterface&) = delete; |
| 74 | EthernetInterface& operator=(const EthernetInterface&) = delete; |
| 75 | EthernetInterface(EthernetInterface&&) = delete; |
| 76 | EthernetInterface& operator=(EthernetInterface&&) = delete; |
| 77 | virtual ~EthernetInterface() = default; |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 78 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 79 | /** @brief Constructor to put object onto bus at a dbus path. |
| 80 | * @param[in] bus - Bus to attach to. |
| 81 | * @param[in] objPath - Path to attach at. |
| 82 | * @param[in] dhcpEnabled - is dhcp enabled(true/false). |
| 83 | * @param[in] parent - parent object. |
| 84 | * @param[in] emitSignal - true if the object added signal needs to be |
| 85 | * send. |
| 86 | */ |
| 87 | EthernetInterface(sdbusplus::bus::bus& bus, const std::string& objPath, |
| 88 | bool dhcpEnabled, Manager& parent, |
| 89 | bool emitSignal = true); |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 90 | |
Manojkiran Eda | acd6dd5 | 2019-10-15 15:00:51 +0530 | [diff] [blame] | 91 | /** @brief Function used to load the nameservers. |
| 92 | */ |
| 93 | virtual void loadNameServers(); |
| 94 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 95 | /** @brief Function to create ipaddress dbus object. |
| 96 | * @param[in] addressType - Type of ip address. |
| 97 | * @param[in] ipaddress- IP address. |
| 98 | * @param[in] prefixLength - Length of prefix. |
| 99 | * @param[in] gateway - Gateway ip address. |
| 100 | */ |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 101 | |
raviteja-b | ce37956 | 2019-03-28 05:59:36 -0500 | [diff] [blame] | 102 | ObjectPath iP(IP::Protocol addressType, std::string ipaddress, |
| 103 | uint8_t prefixLength, std::string gateway) override; |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 104 | |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 105 | /** @brief Function to create static neighbor dbus object. |
| 106 | * @param[in] ipAddress - IP address. |
| 107 | * @param[in] macAddress - Low level MAC address. |
| 108 | */ |
| 109 | ObjectPath neighbor(std::string iPAddress, std::string mACAddress) override; |
| 110 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 111 | /* @brief delete the dbus object of the given ipaddress. |
| 112 | * @param[in] ipaddress - IP address. |
| 113 | */ |
| 114 | void deleteObject(const std::string& ipaddress); |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 115 | |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 116 | /* @brief delete the dbus object of the given ipaddress. |
| 117 | * @param[in] ipaddress - IP address. |
| 118 | */ |
| 119 | void deleteStaticNeighborObject(const std::string& ipAddress); |
| 120 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 121 | /* @brief delete the vlan dbus object of the given interface. |
| 122 | * Also deletes the device file and the network file. |
| 123 | * @param[in] interface - VLAN Interface. |
| 124 | */ |
| 125 | void deleteVLANObject(const std::string& interface); |
Ratan Gupta | bc88629 | 2017-07-25 18:29:57 +0530 | [diff] [blame] | 126 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 127 | /* @brief creates the dbus object(IPaddres) given in the address list. |
| 128 | * @param[in] addrs - address list for which dbus objects needs |
| 129 | * to create. |
| 130 | */ |
| 131 | void createIPAddressObjects(); |
Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 132 | |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 133 | /* @brief creates the dbus object(Neighbor) given in the neighbor list. |
| 134 | */ |
| 135 | void createStaticNeighborObjects(); |
| 136 | |
William A. Kennington III | d7946a7 | 2019-04-19 14:24:09 -0700 | [diff] [blame] | 137 | /* @brief Gets the index of the interface on the system |
| 138 | */ |
| 139 | unsigned ifIndex() const; |
| 140 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 141 | /* @brief Gets all the ip addresses. |
| 142 | * @returns the list of ipaddress. |
| 143 | */ |
| 144 | const AddressMap& getAddresses() const |
| 145 | { |
| 146 | return addrs; |
| 147 | } |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 148 | |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 149 | /* @brief Gets all the static neighbor entries. |
| 150 | * @returns Static neighbor map. |
| 151 | */ |
| 152 | const NeighborMap& getStaticNeighbors() const |
| 153 | { |
| 154 | return staticNeighbors; |
| 155 | } |
| 156 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 157 | /** Set value of DHCPEnabled */ |
| 158 | bool dHCPEnabled(bool value) override; |
Ratan Gupta | 87c1398 | 2017-06-15 09:27:27 +0530 | [diff] [blame] | 159 | |
Johnathan Mantey | faa72e5 | 2020-01-08 10:38:58 -0800 | [diff] [blame] | 160 | /** Retrieve Link State */ |
| 161 | bool linkUp() const override; |
| 162 | |
Johnathan Mantey | d0679f9 | 2019-10-29 16:20:28 -0700 | [diff] [blame^] | 163 | /** Retrieve NIC State */ |
| 164 | bool nICEnabled() const override; |
| 165 | |
| 166 | /** Set value of NICEnabled */ |
| 167 | bool nICEnabled(bool value) override; |
| 168 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 169 | /** @brief sets the MAC address. |
| 170 | * @param[in] value - MAC address which needs to be set on the system. |
| 171 | * @returns macAddress of the interface or throws an error. |
| 172 | */ |
| 173 | std::string mACAddress(std::string value) override; |
Ratan Gupta | bd303b1 | 2017-08-18 17:10:07 +0530 | [diff] [blame] | 174 | |
Johnathan Mantey | 5b023f5 | 2019-06-24 16:06:37 -0700 | [diff] [blame] | 175 | /** @brief get the IPv6AcceptRA flag from the network configuration file |
| 176 | * |
| 177 | */ |
| 178 | bool getIPv6AcceptRAFromConf(); |
| 179 | |
| 180 | /** @brief check conf file for Router Advertisements |
| 181 | * |
| 182 | */ |
| 183 | bool iPv6AcceptRA(bool value) override; |
| 184 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 185 | /** @brief sets the NTP servers. |
| 186 | * @param[in] value - vector of NTP servers. |
| 187 | */ |
| 188 | ServerList nTPServers(ServerList value) override; |
Ratan Gupta | 497c0c9 | 2017-08-22 19:15:59 +0530 | [diff] [blame] | 189 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 190 | /** @brief sets the DNS/nameservers. |
| 191 | * @param[in] value - vector of DNS servers. |
| 192 | */ |
| 193 | ServerList nameservers(ServerList value) override; |
Ratan Gupta | 6dec390f | 2017-08-20 15:28:12 +0530 | [diff] [blame] | 194 | |
Manojkiran Eda | acd6dd5 | 2019-10-15 15:00:51 +0530 | [diff] [blame] | 195 | /** @brief sets the Static DNS/nameservers. |
| 196 | * @param[in] value - vector of DNS servers. |
| 197 | */ |
| 198 | |
| 199 | ServerList staticNameServers(ServerList value) override; |
| 200 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 201 | /** @brief create Vlan interface. |
| 202 | * @param[in] id- VLAN identifier. |
| 203 | */ |
William A. Kennington III | f4b4ff8 | 2019-04-09 19:06:52 -0700 | [diff] [blame] | 204 | ObjectPath createVLAN(VlanId id); |
Ratan Gupta | 5978dd1 | 2017-07-25 13:47:13 +0530 | [diff] [blame] | 205 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 206 | /** @brief load the vlan info from the system |
| 207 | * and creates the ip address dbus objects. |
| 208 | * @param[in] vlanID- VLAN identifier. |
| 209 | */ |
| 210 | void loadVLAN(VlanId vlanID); |
Ratan Gupta | 92bc2fe | 2017-07-26 22:40:21 +0530 | [diff] [blame] | 211 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 212 | /** @brief write the network conf file with the in-memory objects. |
| 213 | */ |
| 214 | void writeConfigurationFile(); |
Ratan Gupta | 2b10653 | 2017-07-25 16:05:02 +0530 | [diff] [blame] | 215 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 216 | /** @brief delete all dbus objects. |
| 217 | */ |
| 218 | void deleteAll(); |
Ratan Gupta | e9c9b81 | 2017-09-22 17:15:37 +0530 | [diff] [blame] | 219 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 220 | using EthernetInterfaceIntf::dHCPEnabled; |
| 221 | using EthernetInterfaceIntf::interfaceName; |
Johnathan Mantey | faa72e5 | 2020-01-08 10:38:58 -0800 | [diff] [blame] | 222 | using EthernetInterfaceIntf::linkUp; |
Johnathan Mantey | d0679f9 | 2019-10-29 16:20:28 -0700 | [diff] [blame^] | 223 | using EthernetInterfaceIntf::nICEnabled; |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 224 | using MacAddressIntf::mACAddress; |
Ratan Gupta | 5978dd1 | 2017-07-25 13:47:13 +0530 | [diff] [blame] | 225 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 226 | /** @brief Absolute path of the resolv conf file */ |
| 227 | static constexpr auto resolvConfFile = "/etc/resolv.conf"; |
Ratan Gupta | 6dec390f | 2017-08-20 15:28:12 +0530 | [diff] [blame] | 228 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 229 | protected: |
| 230 | /** @brief get the info of the ethernet interface. |
| 231 | * @return tuple having the link speed,autonegotiation,duplexmode . |
| 232 | */ |
| 233 | InterfaceInfo getInterfaceInfo() const; |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 234 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 235 | /* @brief delete the vlan interface from system. |
| 236 | * @param[in] interface - vlan Interface. |
| 237 | */ |
| 238 | void deleteVLANFromSystem(const std::string& interface); |
Ratan Gupta | e9c9b81 | 2017-09-22 17:15:37 +0530 | [diff] [blame] | 239 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 240 | /** @brief get the mac address of the interface. |
| 241 | * @param[in] interfaceName - Network interface name. |
| 242 | * @return macaddress on success |
| 243 | */ |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 244 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 245 | std::string getMACAddress(const std::string& interfaceName) const; |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 246 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 247 | /** @brief construct the ip address dbus object path. |
| 248 | * @param[in] addressType - Type of ip address. |
| 249 | * @param[in] ipaddress - IP address. |
| 250 | * @param[in] prefixLength - Length of prefix. |
| 251 | * @param[in] gateway - Gateway address. |
Ratan Gupta | 65e5abe | 2017-05-23 13:20:44 +0530 | [diff] [blame] | 252 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 253 | * @return path of the address object. |
| 254 | */ |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 255 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 256 | std::string generateObjectPath(IP::Protocol addressType, |
| 257 | const std::string& ipaddress, |
| 258 | uint8_t prefixLength, |
| 259 | const std::string& gateway) const; |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 260 | |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 261 | std::string |
| 262 | generateStaticNeighborObjectPath(const std::string& iPAddress, |
| 263 | const std::string& mACAddress) const; |
| 264 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 265 | /** @brief generates the id by doing hash of ipaddress, |
| 266 | * prefixlength and the gateway. |
| 267 | * @param[in] ipaddress - IP address. |
| 268 | * @param[in] prefixLength - Length of prefix. |
| 269 | * @param[in] gateway - Gateway address. |
| 270 | * @return hash string. |
| 271 | */ |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 272 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 273 | static std::string generateId(const std::string& ipaddress, |
| 274 | uint8_t prefixLength, |
| 275 | const std::string& gateway); |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 276 | |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 277 | /** @brief generates the id by doing hash of ipaddress |
| 278 | * and the mac address. |
| 279 | * @param[in] iPAddress - IP address. |
| 280 | * @param[in] mACAddress - Gateway address. |
| 281 | * @return hash string. |
| 282 | */ |
| 283 | static std::string generateNeighborId(const std::string& iPAddress, |
| 284 | const std::string& mACAddress); |
| 285 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 286 | /** @brief write the dhcp section **/ |
| 287 | void writeDHCPSection(std::fstream& stream); |
Ratan Gupta | 2b10653 | 2017-07-25 16:05:02 +0530 | [diff] [blame] | 288 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 289 | /** @brief get the NTP server list from the network conf |
| 290 | * |
| 291 | */ |
| 292 | ServerList getNTPServersFromConf(); |
Ratan Gupta | 497c0c9 | 2017-08-22 19:15:59 +0530 | [diff] [blame] | 293 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 294 | /** @brief get the name server details from the network conf |
| 295 | * |
| 296 | */ |
Manojkiran Eda | acd6dd5 | 2019-10-15 15:00:51 +0530 | [diff] [blame] | 297 | virtual ServerList getNameServerFromResolvd(); |
| 298 | ServerList getstaticNameServerFromConf(); |
Ratan Gupta | 6dec390f | 2017-08-20 15:28:12 +0530 | [diff] [blame] | 299 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 300 | /** @brief Persistent sdbusplus DBus bus connection. */ |
| 301 | sdbusplus::bus::bus& bus; |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 302 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 303 | /** @brief Network Manager object. */ |
| 304 | Manager& manager; |
Ratan Gupta | 4f1c18b | 2017-05-25 12:59:35 +0530 | [diff] [blame] | 305 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 306 | /** @brief Persistent map of IPAddress dbus objects and their names */ |
| 307 | AddressMap addrs; |
Ratan Gupta | 82549cc | 2017-04-21 08:45:23 +0530 | [diff] [blame] | 308 | |
William A. Kennington III | 0850579 | 2019-01-30 16:00:04 -0800 | [diff] [blame] | 309 | /** @brief Persistent map of Neighbor dbus objects and their names */ |
| 310 | NeighborMap staticNeighbors; |
| 311 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 312 | /** @brief Persistent map of VLAN interface dbus objects and their names */ |
| 313 | VlanInterfaceMap vlanInterfaces; |
Ratan Gupta | 5978dd1 | 2017-07-25 13:47:13 +0530 | [diff] [blame] | 314 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 315 | /** @brief Dbus object path */ |
| 316 | std::string objPath; |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 317 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 318 | friend class TestEthernetInterface; |
Ratan Gupta | 8c83493 | 2017-04-14 16:30:24 +0530 | [diff] [blame] | 319 | }; |
| 320 | |
| 321 | } // namespace network |
| 322 | } // namespace phosphor |