blob: f726f484106a6a18a897d60372d97bda233e5e89 [file] [log] [blame]
Ratan Gupta8c834932017-04-14 16:30:24 +05301#pragma once
William A. Kennington III9a20a6e2022-10-05 13:41:12 -07002#include "ipaddress.hpp"
3#include "neighbor.hpp"
Ratan Gupta82549cc2017-04-21 08:45:23 +05304#include "types.hpp"
Ratan Gupta82549cc2017-04-21 08:45:23 +05305#include "xyz/openbmc_project/Network/IP/Create/server.hpp"
William A. Kennington III08505792019-01-30 16:00:04 -08006#include "xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp"
Ratan Gupta8c834932017-04-14 16:30:24 +05307
8#include <sdbusplus/bus.hpp>
9#include <sdbusplus/server/object.hpp>
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -070010#include <stdplus/zstring.hpp>
11#include <stdplus/zstring_view.hpp>
Ratan Gupta8c834932017-04-14 16:30:24 +053012#include <string>
William A. Kennington III95530ec2022-08-19 01:44:39 -070013#include <vector>
Patrick Venture189d44e2018-07-09 12:30:59 -070014#include <xyz/openbmc_project/Collection/DeleteAll/server.hpp>
15#include <xyz/openbmc_project/Network/EthernetInterface/server.hpp>
16#include <xyz/openbmc_project/Network/MACAddress/server.hpp>
Ratan Gupta8c834932017-04-14 16:30:24 +053017
18namespace phosphor
19{
20namespace network
21{
Ratan Gupta8c834932017-04-14 16:30:24 +053022
Patrick Williamsc38b0712022-07-22 19:26:54 -050023using Ifaces = sdbusplus::server::object_t<
Gunnar Mills57d9c502018-09-14 14:42:34 -050024 sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface,
25 sdbusplus::xyz::openbmc_project::Network::server::MACAddress,
26 sdbusplus::xyz::openbmc_project::Network::IP::server::Create,
William A. Kennington III08505792019-01-30 16:00:04 -080027 sdbusplus::xyz::openbmc_project::Network::Neighbor::server::CreateStatic,
Gunnar Mills57d9c502018-09-14 14:42:34 -050028 sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll>;
Ratan Gupta8c834932017-04-14 16:30:24 +053029
Ratan Gupta82549cc2017-04-21 08:45:23 +053030using IP = sdbusplus::xyz::openbmc_project::Network::server::IP;
Ratan Gupta87c13982017-06-15 09:27:27 +053031
32using EthernetInterfaceIntf =
33 sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface;
Ratan Guptabd303b12017-08-18 17:10:07 +053034using MacAddressIntf =
35 sdbusplus::xyz::openbmc_project::Network::server::MACAddress;
Ratan Gupta87c13982017-06-15 09:27:27 +053036
Ratan Gupta497c0c92017-08-22 19:15:59 +053037using ServerList = std::vector<std::string>;
raviteja-bce379562019-03-28 05:59:36 -050038using ObjectPath = sdbusplus::message::object_path;
Ratan Gupta497c0c92017-08-22 19:15:59 +053039
William A. Kennington III9a20a6e2022-10-05 13:41:12 -070040class Manager;
Ratan Gupta8c834932017-04-14 16:30:24 +053041
Ratan Gupta47722dc2017-05-26 18:32:23 +053042class TestEthernetInterface;
43
Ratan Gupta5978dd12017-07-25 13:47:13 +053044class VlanInterface;
45
William A. Kennington III95530ec2022-08-19 01:44:39 -070046namespace config
47{
48class Parser;
49}
50
Ratan Gupta8c834932017-04-14 16:30:24 +053051using LinkSpeed = uint16_t;
52using DuplexMode = uint8_t;
53using Autoneg = uint8_t;
Johnathan Manteyfaa72e52020-01-08 10:38:58 -080054using LinkUp = bool;
Johnathan Manteyd0679f92019-10-29 16:20:28 -070055using NICEnabled = bool;
Tejas Patil2c0fc562021-08-03 19:13:46 +053056using MTU = size_t;
Ratan Gupta5978dd12017-07-25 13:47:13 +053057using VlanId = uint32_t;
58using InterfaceName = std::string;
Johnathan Manteyd0679f92019-10-29 16:20:28 -070059using InterfaceInfo =
Tejas Patil2c0fc562021-08-03 19:13:46 +053060 std::tuple<LinkSpeed, DuplexMode, Autoneg, LinkUp, NICEnabled, MTU>;
Ratan Gupta8c834932017-04-14 16:30:24 +053061
62/** @class EthernetInterface
63 * @brief OpenBMC Ethernet Interface implementation.
64 * @details A concrete implementation for the
65 * xyz.openbmc_project.Network.EthernetInterface DBus API.
66 */
Ratan Gupta82549cc2017-04-21 08:45:23 +053067class EthernetInterface : public Ifaces
Ratan Gupta8c834932017-04-14 16:30:24 +053068{
Gunnar Mills57d9c502018-09-14 14:42:34 -050069 public:
70 EthernetInterface() = delete;
71 EthernetInterface(const EthernetInterface&) = delete;
72 EthernetInterface& operator=(const EthernetInterface&) = delete;
73 EthernetInterface(EthernetInterface&&) = delete;
74 EthernetInterface& operator=(EthernetInterface&&) = delete;
75 virtual ~EthernetInterface() = default;
Ratan Gupta8c834932017-04-14 16:30:24 +053076
Gunnar Mills57d9c502018-09-14 14:42:34 -050077 /** @brief Constructor to put object onto bus at a dbus path.
78 * @param[in] bus - Bus to attach to.
79 * @param[in] objPath - Path to attach at.
William A. Kennington IIIa520a392022-08-08 12:17:34 -070080 * @param[in] config - The parsed configuation file.
Gunnar Mills57d9c502018-09-14 14:42:34 -050081 * @param[in] parent - parent object.
82 * @param[in] emitSignal - true if the object added signal needs to be
83 * send.
William A. Kennington III26275a32021-07-13 20:32:42 -070084 * @param[in] enabled - Override the lookup of nicEnabled
Gunnar Mills57d9c502018-09-14 14:42:34 -050085 */
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -070086 EthernetInterface(sdbusplus::bus_t& bus, stdplus::zstring_view objPath,
William A. Kennington III0caf2212022-08-18 18:15:51 -070087 const config::Parser& config, Manager& parent,
88 bool emitSignal = true,
William A. Kennington III26275a32021-07-13 20:32:42 -070089 std::optional<bool> enabled = std::nullopt);
Ratan Gupta82549cc2017-04-21 08:45:23 +053090
Manojkiran Edaacd6dd52019-10-15 15:00:51 +053091 /** @brief Function used to load the nameservers.
92 */
William A. Kennington IIIa520a392022-08-08 12:17:34 -070093 void loadNameServers(const config::Parser& config);
Manojkiran Edaacd6dd52019-10-15 15:00:51 +053094
Patrick Williams6aef7692021-05-01 06:39:41 -050095 /** @brief Function to create ipAddress dbus object.
Gunnar Mills57d9c502018-09-14 14:42:34 -050096 * @param[in] addressType - Type of ip address.
Patrick Williams6aef7692021-05-01 06:39:41 -050097 * @param[in] ipAddress- IP address.
Gunnar Mills57d9c502018-09-14 14:42:34 -050098 * @param[in] prefixLength - Length of prefix.
99 * @param[in] gateway - Gateway ip address.
100 */
Ratan Gupta82549cc2017-04-21 08:45:23 +0530101
Patrick Williams6aef7692021-05-01 06:39:41 -0500102 ObjectPath ip(IP::Protocol addressType, std::string ipAddress,
raviteja-bce379562019-03-28 05:59:36 -0500103 uint8_t prefixLength, std::string gateway) override;
Ratan Gupta8c834932017-04-14 16:30:24 +0530104
William A. Kennington III08505792019-01-30 16:00:04 -0800105 /** @brief Function to create static neighbor dbus object.
106 * @param[in] ipAddress - IP address.
107 * @param[in] macAddress - Low level MAC address.
108 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500109 ObjectPath neighbor(std::string ipAddress, std::string macAddress) override;
William A. Kennington III08505792019-01-30 16:00:04 -0800110
Patrick Williams6aef7692021-05-01 06:39:41 -0500111 /* @brief delete the dbus object of the given ipAddress.
112 * @param[in] ipAddress - IP address.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500113 */
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700114 void deleteObject(std::string_view ipAddress);
Ratan Gupta8c834932017-04-14 16:30:24 +0530115
Patrick Williams6aef7692021-05-01 06:39:41 -0500116 /* @brief delete the dbus object of the given ipAddress.
117 * @param[in] ipAddress - IP address.
William A. Kennington III08505792019-01-30 16:00:04 -0800118 */
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700119 void deleteStaticNeighborObject(std::string_view ipAddress);
William A. Kennington III08505792019-01-30 16:00:04 -0800120
Gunnar Mills57d9c502018-09-14 14:42:34 -0500121 /* @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 */
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700125 void deleteVLANObject(stdplus::zstring_view interface);
Ratan Guptabc886292017-07-25 18:29:57 +0530126
Gunnar Mills57d9c502018-09-14 14:42:34 -0500127 /* @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 Gupta29b0e432017-05-25 12:51:40 +0530132
William A. Kennington III08505792019-01-30 16:00:04 -0800133 /* @brief creates the dbus object(Neighbor) given in the neighbor list.
134 */
135 void createStaticNeighborObjects();
136
William A. Kennington IIId7946a72019-04-19 14:24:09 -0700137 /* @brief Gets the index of the interface on the system
138 */
139 unsigned ifIndex() const;
140
Gunnar Mills57d9c502018-09-14 14:42:34 -0500141 /* @brief Gets all the ip addresses.
Patrick Williams6aef7692021-05-01 06:39:41 -0500142 * @returns the list of ipAddress.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500143 */
William A. Kennington III9a20a6e2022-10-05 13:41:12 -0700144 inline const auto& getAddresses() const
Gunnar Mills57d9c502018-09-14 14:42:34 -0500145 {
146 return addrs;
147 }
Ratan Gupta8c834932017-04-14 16:30:24 +0530148
William A. Kennington III08505792019-01-30 16:00:04 -0800149 /* @brief Gets all the static neighbor entries.
150 * @returns Static neighbor map.
151 */
William A. Kennington III9a20a6e2022-10-05 13:41:12 -0700152 inline const auto& getStaticNeighbors() const
William A. Kennington III08505792019-01-30 16:00:04 -0800153 {
154 return staticNeighbors;
155 }
156
Gunnar Mills57d9c502018-09-14 14:42:34 -0500157 /** Set value of DHCPEnabled */
William A. Kennington III8060c0d2022-08-18 19:19:34 -0700158 DHCPConf dhcpEnabled() const override;
Patrick Williams6aef7692021-05-01 06:39:41 -0500159 DHCPConf dhcpEnabled(DHCPConf value) override;
William A. Kennington III8060c0d2022-08-18 19:19:34 -0700160 using EthernetInterfaceIntf::dhcp4;
161 bool dhcp4(bool value) override;
162 using EthernetInterfaceIntf::dhcp6;
163 bool dhcp6(bool value) override;
Ratan Gupta87c13982017-06-15 09:27:27 +0530164
Johnathan Manteyfaa72e52020-01-08 10:38:58 -0800165 /** Retrieve Link State */
166 bool linkUp() const override;
167
Tejas Patil2c0fc562021-08-03 19:13:46 +0530168 /** Retrieve MTU Size */
169 size_t mtu() const override;
170
171 /** Set size of MTU */
172 size_t mtu(size_t value) override;
173
Johnathan Manteyd0679f92019-10-29 16:20:28 -0700174 /** Set value of NICEnabled */
Patrick Williams6aef7692021-05-01 06:39:41 -0500175 bool nicEnabled(bool value) override;
Johnathan Manteyd0679f92019-10-29 16:20:28 -0700176
Gunnar Mills57d9c502018-09-14 14:42:34 -0500177 /** @brief sets the MAC address.
178 * @param[in] value - MAC address which needs to be set on the system.
179 * @returns macAddress of the interface or throws an error.
180 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500181 std::string macAddress(std::string value) override;
Ratan Guptabd303b12017-08-18 17:10:07 +0530182
Johnathan Mantey5b023f52019-06-24 16:06:37 -0700183 /** @brief check conf file for Router Advertisements
184 *
185 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500186 bool ipv6AcceptRA(bool value) override;
William A. Kennington III8060c0d2022-08-18 19:19:34 -0700187 using EthernetInterfaceIntf::ipv6AcceptRA;
Johnathan Mantey5b023f52019-06-24 16:06:37 -0700188
Gunnar Mills57d9c502018-09-14 14:42:34 -0500189 /** @brief sets the NTP servers.
190 * @param[in] value - vector of NTP servers.
191 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500192 ServerList ntpServers(ServerList value) override;
Ratan Gupta497c0c92017-08-22 19:15:59 +0530193
Manojkiran Edaacd6dd52019-10-15 15:00:51 +0530194 /** @brief sets the Static DNS/nameservers.
195 * @param[in] value - vector of DNS servers.
196 */
197
198 ServerList staticNameServers(ServerList value) override;
199
Gunnar Mills57d9c502018-09-14 14:42:34 -0500200 /** @brief create Vlan interface.
201 * @param[in] id- VLAN identifier.
202 */
William A. Kennington IIIf4b4ff82019-04-09 19:06:52 -0700203 ObjectPath createVLAN(VlanId id);
Ratan Gupta5978dd12017-07-25 13:47:13 +0530204
Gunnar Mills57d9c502018-09-14 14:42:34 -0500205 /** @brief load the vlan info from the system
206 * and creates the ip address dbus objects.
207 * @param[in] vlanID- VLAN identifier.
208 */
209 void loadVLAN(VlanId vlanID);
Ratan Gupta92bc2fe2017-07-26 22:40:21 +0530210
Gunnar Mills57d9c502018-09-14 14:42:34 -0500211 /** @brief write the network conf file with the in-memory objects.
212 */
213 void writeConfigurationFile();
Ratan Gupta2b106532017-07-25 16:05:02 +0530214
Gunnar Mills57d9c502018-09-14 14:42:34 -0500215 /** @brief delete all dbus objects.
216 */
217 void deleteAll();
Ratan Guptae9c9b812017-09-22 17:15:37 +0530218
Ravi Tejaa5a09442020-07-17 00:57:33 -0500219 /** @brief set the default v4 gateway of the interface.
220 * @param[in] gateway - default v4 gateway of the interface.
221 */
222 std::string defaultGateway(std::string gateway) override;
223
224 /** @brief set the default v6 gateway of the interface.
225 * @param[in] gateway - default v6 gateway of the interface.
226 */
227 std::string defaultGateway6(std::string gateway) override;
228
Gunnar Mills57d9c502018-09-14 14:42:34 -0500229 using EthernetInterfaceIntf::interfaceName;
Johnathan Manteyfaa72e52020-01-08 10:38:58 -0800230 using EthernetInterfaceIntf::linkUp;
Tejas Patil2c0fc562021-08-03 19:13:46 +0530231 using EthernetInterfaceIntf::mtu;
Patrick Williams6aef7692021-05-01 06:39:41 -0500232 using EthernetInterfaceIntf::nicEnabled;
233 using MacAddressIntf::macAddress;
Ratan Gupta5978dd12017-07-25 13:47:13 +0530234
Ravi Tejaa5a09442020-07-17 00:57:33 -0500235 using EthernetInterfaceIntf::defaultGateway;
236 using EthernetInterfaceIntf::defaultGateway6;
Gunnar Mills57d9c502018-09-14 14:42:34 -0500237 /** @brief Absolute path of the resolv conf file */
238 static constexpr auto resolvConfFile = "/etc/resolv.conf";
Ratan Gupta6dec390f2017-08-20 15:28:12 +0530239
Gunnar Mills57d9c502018-09-14 14:42:34 -0500240 protected:
241 /** @brief get the info of the ethernet interface.
242 * @return tuple having the link speed,autonegotiation,duplexmode .
243 */
244 InterfaceInfo getInterfaceInfo() const;
Ratan Gupta8c834932017-04-14 16:30:24 +0530245
Gunnar Mills57d9c502018-09-14 14:42:34 -0500246 /* @brief delete the vlan interface from system.
247 * @param[in] interface - vlan Interface.
248 */
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700249 void deleteVLANFromSystem(stdplus::zstring_view interface);
Ratan Guptae9c9b812017-09-22 17:15:37 +0530250
Gunnar Mills57d9c502018-09-14 14:42:34 -0500251 /** @brief get the mac address of the interface.
252 * @param[in] interfaceName - Network interface name.
253 * @return macaddress on success
254 */
Ratan Gupta8c834932017-04-14 16:30:24 +0530255
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700256 std::string getMACAddress(stdplus::const_zstring interfaceName) const;
Ratan Gupta8c834932017-04-14 16:30:24 +0530257
Gunnar Mills57d9c502018-09-14 14:42:34 -0500258 /** @brief construct the ip address dbus object path.
259 * @param[in] addressType - Type of ip address.
Patrick Williams6aef7692021-05-01 06:39:41 -0500260 * @param[in] ipAddress - IP address.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500261 * @param[in] prefixLength - Length of prefix.
262 * @param[in] gateway - Gateway address.
Lei YU34027572021-08-11 15:23:52 +0800263 * @param[in] origin - The origin entry of the IP::Address
Ratan Gupta65e5abe2017-05-23 13:20:44 +0530264
Gunnar Mills57d9c502018-09-14 14:42:34 -0500265 * @return path of the address object.
266 */
Ratan Gupta82549cc2017-04-21 08:45:23 +0530267
Gunnar Mills57d9c502018-09-14 14:42:34 -0500268 std::string generateObjectPath(IP::Protocol addressType,
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700269 std::string_view ipAddress,
Gunnar Mills57d9c502018-09-14 14:42:34 -0500270 uint8_t prefixLength,
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700271 std::string_view gateway,
Lei YU34027572021-08-11 15:23:52 +0800272 IP::AddressOrigin origin) const;
Ratan Gupta82549cc2017-04-21 08:45:23 +0530273
William A. Kennington III08505792019-01-30 16:00:04 -0800274 std::string
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700275 generateStaticNeighborObjectPath(std::string_view ipAddress,
276 std::string_view macAddress) const;
William A. Kennington III08505792019-01-30 16:00:04 -0800277
Patrick Williams6aef7692021-05-01 06:39:41 -0500278 /** @brief generates the id by doing hash of ipAddress,
Gunnar Mills57d9c502018-09-14 14:42:34 -0500279 * prefixlength and the gateway.
Patrick Williams6aef7692021-05-01 06:39:41 -0500280 * @param[in] ipAddress - IP address.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500281 * @param[in] prefixLength - Length of prefix.
282 * @param[in] gateway - Gateway address.
Lei YU34027572021-08-11 15:23:52 +0800283 * @param[in] origin - The string of the address origin
Gunnar Mills57d9c502018-09-14 14:42:34 -0500284 * @return hash string.
285 */
Ratan Gupta82549cc2017-04-21 08:45:23 +0530286
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700287 static std::string generateId(std::string_view ipAddress,
Gunnar Mills57d9c502018-09-14 14:42:34 -0500288 uint8_t prefixLength,
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700289 std::string_view gateway,
290 std::string_view origin);
Ratan Gupta82549cc2017-04-21 08:45:23 +0530291
Patrick Williams6aef7692021-05-01 06:39:41 -0500292 /** @brief generates the id by doing hash of ipAddress
William A. Kennington III08505792019-01-30 16:00:04 -0800293 * and the mac address.
Patrick Williams6aef7692021-05-01 06:39:41 -0500294 * @param[in] ipAddress - IP address.
295 * @param[in] macAddress - Gateway address.
William A. Kennington III08505792019-01-30 16:00:04 -0800296 * @return hash string.
297 */
William A. Kennington IIIbe3bd2f2022-10-11 14:11:27 -0700298 static std::string generateNeighborId(std::string_view ipAddress,
299 std::string_view macAddress);
William A. Kennington III08505792019-01-30 16:00:04 -0800300
Gunnar Mills57d9c502018-09-14 14:42:34 -0500301 /** @brief get the NTP server list from the network conf
302 *
303 */
304 ServerList getNTPServersFromConf();
Ratan Gupta497c0c92017-08-22 19:15:59 +0530305
Gunnar Mills57d9c502018-09-14 14:42:34 -0500306 /** @brief get the name server details from the network conf
307 *
308 */
Manojkiran Edaacd6dd52019-10-15 15:00:51 +0530309 virtual ServerList getNameServerFromResolvd();
Ratan Gupta6dec390f2017-08-20 15:28:12 +0530310
Gunnar Mills57d9c502018-09-14 14:42:34 -0500311 /** @brief Persistent sdbusplus DBus bus connection. */
Patrick Williamsc38b0712022-07-22 19:26:54 -0500312 sdbusplus::bus_t& bus;
Ratan Gupta82549cc2017-04-21 08:45:23 +0530313
Gunnar Mills57d9c502018-09-14 14:42:34 -0500314 /** @brief Network Manager object. */
315 Manager& manager;
Ratan Gupta4f1c18b2017-05-25 12:59:35 +0530316
Gunnar Mills57d9c502018-09-14 14:42:34 -0500317 /** @brief Persistent map of IPAddress dbus objects and their names */
William A. Kennington III9a20a6e2022-10-05 13:41:12 -0700318 string_umap<std::unique_ptr<IPAddress>> addrs;
Ratan Gupta82549cc2017-04-21 08:45:23 +0530319
William A. Kennington III08505792019-01-30 16:00:04 -0800320 /** @brief Persistent map of Neighbor dbus objects and their names */
William A. Kennington III9a20a6e2022-10-05 13:41:12 -0700321 string_umap<std::unique_ptr<Neighbor>> staticNeighbors;
William A. Kennington III08505792019-01-30 16:00:04 -0800322
Gunnar Mills57d9c502018-09-14 14:42:34 -0500323 /** @brief Persistent map of VLAN interface dbus objects and their names */
William A. Kennington III9a20a6e2022-10-05 13:41:12 -0700324 string_umap<std::unique_ptr<VlanInterface>> vlanInterfaces;
Ratan Gupta5978dd12017-07-25 13:47:13 +0530325
Gunnar Mills57d9c502018-09-14 14:42:34 -0500326 /** @brief Dbus object path */
327 std::string objPath;
Ratan Gupta47722dc2017-05-26 18:32:23 +0530328
Gunnar Mills57d9c502018-09-14 14:42:34 -0500329 friend class TestEthernetInterface;
Johnathan Mantey817012a2020-01-30 15:07:39 -0800330
331 private:
332 /** @brief Determines if DHCP is active for the IP::Protocol supplied.
333 * @param[in] protocol - Either IPv4 or IPv6
Johnathan Mantey817012a2020-01-30 15:07:39 -0800334 * @returns true/false value if DHCP is active for the input protocol
335 */
William A. Kennington III24957b92021-12-03 13:59:19 -0800336 bool dhcpIsEnabled(IP::Protocol protocol);
Johnathan Mantey817012a2020-01-30 15:07:39 -0800337
Johnathan Mantey817012a2020-01-30 15:07:39 -0800338 /** @brief Determines if the address is manually assigned
339 * @param[in] origin - The origin entry of the IP::Address
340 * @returns true/false value if the address is static
341 */
342 bool originIsManuallyAssigned(IP::AddressOrigin origin);
William A. Kennington III26275a32021-07-13 20:32:42 -0700343
344 /** @brief Determines if the NIC is enabled in systemd
345 * @returns true/false value if the NIC is enabled
346 */
347 bool queryNicEnabled() const;
William A. Kennington IIIa520a392022-08-08 12:17:34 -0700348
349 std::string vlanIntfName(VlanId id) const;
350 std::string vlanObjPath(VlanId id) const;
Ratan Gupta8c834932017-04-14 16:30:24 +0530351};
352
353} // namespace network
354} // namespace phosphor