blob: c51962306cd78099baa5b6996a69923db09cd7b5 [file] [log] [blame]
Ratan Gupta8c834932017-04-14 16:30:24 +05301#pragma once
2
William A. Kennington IIIa520a392022-08-08 12:17:34 -07003#include "config_parser.hpp"
Ratan Gupta82549cc2017-04-21 08:45:23 +05304#include "types.hpp"
Ratan Gupta8804feb2017-05-25 10:49:57 +05305#include "util.hpp"
Ratan Gupta82549cc2017-04-21 08:45:23 +05306#include "xyz/openbmc_project/Network/IP/Create/server.hpp"
William A. Kennington III08505792019-01-30 16:00:04 -08007#include "xyz/openbmc_project/Network/Neighbor/CreateStatic/server.hpp"
Ratan Gupta8c834932017-04-14 16:30:24 +05308
Manojkiran Edaa879baa2020-06-13 14:39:08 +05309#include <filesystem>
Ratan Gupta8c834932017-04-14 16:30:24 +053010#include <sdbusplus/bus.hpp>
11#include <sdbusplus/server/object.hpp>
Ratan Gupta8c834932017-04-14 16:30:24 +053012#include <string>
Patrick Venture189d44e2018-07-09 12:30:59 -070013#include <xyz/openbmc_project/Collection/DeleteAll/server.hpp>
14#include <xyz/openbmc_project/Network/EthernetInterface/server.hpp>
15#include <xyz/openbmc_project/Network/MACAddress/server.hpp>
Ratan Gupta8c834932017-04-14 16:30:24 +053016
17namespace phosphor
18{
19namespace network
20{
Ratan Gupta8c834932017-04-14 16:30:24 +053021
Patrick Williamsc38b0712022-07-22 19:26:54 -050022using Ifaces = sdbusplus::server::object_t<
Gunnar Mills57d9c502018-09-14 14:42:34 -050023 sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface,
24 sdbusplus::xyz::openbmc_project::Network::server::MACAddress,
25 sdbusplus::xyz::openbmc_project::Network::IP::server::Create,
William A. Kennington III08505792019-01-30 16:00:04 -080026 sdbusplus::xyz::openbmc_project::Network::Neighbor::server::CreateStatic,
Gunnar Mills57d9c502018-09-14 14:42:34 -050027 sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll>;
Ratan Gupta8c834932017-04-14 16:30:24 +053028
Ratan Gupta82549cc2017-04-21 08:45:23 +053029using IP = sdbusplus::xyz::openbmc_project::Network::server::IP;
Ratan Gupta87c13982017-06-15 09:27:27 +053030
31using EthernetInterfaceIntf =
32 sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface;
Ratan Guptabd303b12017-08-18 17:10:07 +053033using MacAddressIntf =
34 sdbusplus::xyz::openbmc_project::Network::server::MACAddress;
Ratan Gupta87c13982017-06-15 09:27:27 +053035
Ratan Gupta497c0c92017-08-22 19:15:59 +053036using ServerList = std::vector<std::string>;
raviteja-bce379562019-03-28 05:59:36 -050037using ObjectPath = sdbusplus::message::object_path;
Ratan Gupta497c0c92017-08-22 19:15:59 +053038
Manojkiran Edaa879baa2020-06-13 14:39:08 +053039namespace fs = std::filesystem;
Ratan Gupta5978dd12017-07-25 13:47:13 +053040
Ratan Gupta4f1c18b2017-05-25 12:59:35 +053041class Manager; // forward declaration of network manager.
Ratan Gupta8c834932017-04-14 16:30:24 +053042
Ratan Gupta47722dc2017-05-26 18:32:23 +053043class TestEthernetInterface;
44
Ratan Gupta5978dd12017-07-25 13:47:13 +053045class VlanInterface;
46
47class IPAddress;
48
William A. Kennington III08505792019-01-30 16:00:04 -080049class Neighbor;
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 Gupta29b0e432017-05-25 12:51:40 +053061using AddressMap = std::map<std::string, std::shared_ptr<IPAddress>>;
William A. Kennington III08505792019-01-30 16:00:04 -080062using NeighborMap = std::map<std::string, std::shared_ptr<Neighbor>>;
Gunnar Mills57d9c502018-09-14 14:42:34 -050063using VlanInterfaceMap =
64 std::map<InterfaceName, std::unique_ptr<VlanInterface>>;
Ratan Gupta8c834932017-04-14 16:30:24 +053065
66/** @class EthernetInterface
67 * @brief OpenBMC Ethernet Interface implementation.
68 * @details A concrete implementation for the
69 * xyz.openbmc_project.Network.EthernetInterface DBus API.
70 */
Ratan Gupta82549cc2017-04-21 08:45:23 +053071class EthernetInterface : public Ifaces
Ratan Gupta8c834932017-04-14 16:30:24 +053072{
Gunnar Mills57d9c502018-09-14 14:42:34 -050073 public:
74 EthernetInterface() = delete;
75 EthernetInterface(const EthernetInterface&) = delete;
76 EthernetInterface& operator=(const EthernetInterface&) = delete;
77 EthernetInterface(EthernetInterface&&) = delete;
78 EthernetInterface& operator=(EthernetInterface&&) = delete;
79 virtual ~EthernetInterface() = default;
Ratan Gupta8c834932017-04-14 16:30:24 +053080
Gunnar Mills57d9c502018-09-14 14:42:34 -050081 /** @brief Constructor to put object onto bus at a dbus path.
82 * @param[in] bus - Bus to attach to.
83 * @param[in] objPath - Path to attach at.
William A. Kennington IIIa520a392022-08-08 12:17:34 -070084 * @param[in] config - The parsed configuation file.
Gunnar Mills57d9c502018-09-14 14:42:34 -050085 * @param[in] dhcpEnabled - is dhcp enabled(true/false).
86 * @param[in] parent - parent object.
87 * @param[in] emitSignal - true if the object added signal needs to be
88 * send.
William A. Kennington III26275a32021-07-13 20:32:42 -070089 * @param[in] enabled - Override the lookup of nicEnabled
Gunnar Mills57d9c502018-09-14 14:42:34 -050090 */
Patrick Williamsc38b0712022-07-22 19:26:54 -050091 EthernetInterface(sdbusplus::bus_t& bus, const std::string& objPath,
William A. Kennington IIIa520a392022-08-08 12:17:34 -070092 const config::Parser& config, DHCPConf dhcpEnabled,
93 Manager& parent, bool emitSignal = true,
William A. Kennington III26275a32021-07-13 20:32:42 -070094 std::optional<bool> enabled = std::nullopt);
Ratan Gupta82549cc2017-04-21 08:45:23 +053095
Manojkiran Edaacd6dd52019-10-15 15:00:51 +053096 /** @brief Function used to load the nameservers.
97 */
William A. Kennington IIIa520a392022-08-08 12:17:34 -070098 void loadNameServers(const config::Parser& config);
Manojkiran Edaacd6dd52019-10-15 15:00:51 +053099
Patrick Williams6aef7692021-05-01 06:39:41 -0500100 /** @brief Function to create ipAddress dbus object.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500101 * @param[in] addressType - Type of ip address.
Patrick Williams6aef7692021-05-01 06:39:41 -0500102 * @param[in] ipAddress- IP address.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500103 * @param[in] prefixLength - Length of prefix.
104 * @param[in] gateway - Gateway ip address.
105 */
Ratan Gupta82549cc2017-04-21 08:45:23 +0530106
Patrick Williams6aef7692021-05-01 06:39:41 -0500107 ObjectPath ip(IP::Protocol addressType, std::string ipAddress,
raviteja-bce379562019-03-28 05:59:36 -0500108 uint8_t prefixLength, std::string gateway) override;
Ratan Gupta8c834932017-04-14 16:30:24 +0530109
William A. Kennington III08505792019-01-30 16:00:04 -0800110 /** @brief Function to create static neighbor dbus object.
111 * @param[in] ipAddress - IP address.
112 * @param[in] macAddress - Low level MAC address.
113 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500114 ObjectPath neighbor(std::string ipAddress, std::string macAddress) override;
William A. Kennington III08505792019-01-30 16:00:04 -0800115
Patrick Williams6aef7692021-05-01 06:39:41 -0500116 /* @brief delete the dbus object of the given ipAddress.
117 * @param[in] ipAddress - IP address.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500118 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500119 void deleteObject(const std::string& ipAddress);
Ratan Gupta8c834932017-04-14 16:30:24 +0530120
Patrick Williams6aef7692021-05-01 06:39:41 -0500121 /* @brief delete the dbus object of the given ipAddress.
122 * @param[in] ipAddress - IP address.
William A. Kennington III08505792019-01-30 16:00:04 -0800123 */
124 void deleteStaticNeighborObject(const std::string& ipAddress);
125
Gunnar Mills57d9c502018-09-14 14:42:34 -0500126 /* @brief delete the vlan dbus object of the given interface.
127 * Also deletes the device file and the network file.
128 * @param[in] interface - VLAN Interface.
129 */
130 void deleteVLANObject(const std::string& interface);
Ratan Guptabc886292017-07-25 18:29:57 +0530131
Gunnar Mills57d9c502018-09-14 14:42:34 -0500132 /* @brief creates the dbus object(IPaddres) given in the address list.
133 * @param[in] addrs - address list for which dbus objects needs
134 * to create.
135 */
136 void createIPAddressObjects();
Ratan Gupta29b0e432017-05-25 12:51:40 +0530137
William A. Kennington III08505792019-01-30 16:00:04 -0800138 /* @brief creates the dbus object(Neighbor) given in the neighbor list.
139 */
140 void createStaticNeighborObjects();
141
William A. Kennington IIId7946a72019-04-19 14:24:09 -0700142 /* @brief Gets the index of the interface on the system
143 */
144 unsigned ifIndex() const;
145
Gunnar Mills57d9c502018-09-14 14:42:34 -0500146 /* @brief Gets all the ip addresses.
Patrick Williams6aef7692021-05-01 06:39:41 -0500147 * @returns the list of ipAddress.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500148 */
149 const AddressMap& getAddresses() const
150 {
151 return addrs;
152 }
Ratan Gupta8c834932017-04-14 16:30:24 +0530153
William A. Kennington III08505792019-01-30 16:00:04 -0800154 /* @brief Gets all the static neighbor entries.
155 * @returns Static neighbor map.
156 */
157 const NeighborMap& getStaticNeighbors() const
158 {
159 return staticNeighbors;
160 }
161
Gunnar Mills57d9c502018-09-14 14:42:34 -0500162 /** Set value of DHCPEnabled */
Patrick Williams6aef7692021-05-01 06:39:41 -0500163 DHCPConf dhcpEnabled(DHCPConf value) override;
Johnathan Mantey817012a2020-01-30 15:07:39 -0800164
165 /** @brief Selectively disables DHCP
166 * @param[in] protocol - The IPv4 or IPv6 protocol to return to static
167 * addressing mode
168 */
169 void disableDHCP(IP::Protocol protocol);
Ratan Gupta87c13982017-06-15 09:27:27 +0530170
Johnathan Manteyfaa72e52020-01-08 10:38:58 -0800171 /** Retrieve Link State */
172 bool linkUp() const override;
173
Tejas Patil2c0fc562021-08-03 19:13:46 +0530174 /** Retrieve MTU Size */
175 size_t mtu() const override;
176
177 /** Set size of MTU */
178 size_t mtu(size_t value) override;
179
Johnathan Manteyd0679f92019-10-29 16:20:28 -0700180 /** Set value of NICEnabled */
Patrick Williams6aef7692021-05-01 06:39:41 -0500181 bool nicEnabled(bool value) override;
Johnathan Manteyd0679f92019-10-29 16:20:28 -0700182
Gunnar Mills57d9c502018-09-14 14:42:34 -0500183 /** @brief sets the MAC address.
184 * @param[in] value - MAC address which needs to be set on the system.
185 * @returns macAddress of the interface or throws an error.
186 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500187 std::string macAddress(std::string value) override;
Ratan Guptabd303b12017-08-18 17:10:07 +0530188
Johnathan Mantey5b023f52019-06-24 16:06:37 -0700189 /** @brief check conf file for Router Advertisements
190 *
191 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500192 bool ipv6AcceptRA(bool value) override;
Johnathan Mantey5b023f52019-06-24 16:06:37 -0700193
Gunnar Mills57d9c502018-09-14 14:42:34 -0500194 /** @brief sets the NTP servers.
195 * @param[in] value - vector of NTP servers.
196 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500197 ServerList ntpServers(ServerList value) override;
Ratan Gupta497c0c92017-08-22 19:15:59 +0530198
Manojkiran Edaacd6dd52019-10-15 15:00:51 +0530199 /** @brief sets the Static DNS/nameservers.
200 * @param[in] value - vector of DNS servers.
201 */
202
203 ServerList staticNameServers(ServerList value) override;
204
Gunnar Mills57d9c502018-09-14 14:42:34 -0500205 /** @brief create Vlan interface.
206 * @param[in] id- VLAN identifier.
207 */
William A. Kennington IIIf4b4ff82019-04-09 19:06:52 -0700208 ObjectPath createVLAN(VlanId id);
Ratan Gupta5978dd12017-07-25 13:47:13 +0530209
Gunnar Mills57d9c502018-09-14 14:42:34 -0500210 /** @brief load the vlan info from the system
211 * and creates the ip address dbus objects.
212 * @param[in] vlanID- VLAN identifier.
213 */
214 void loadVLAN(VlanId vlanID);
Ratan Gupta92bc2fe2017-07-26 22:40:21 +0530215
Gunnar Mills57d9c502018-09-14 14:42:34 -0500216 /** @brief write the network conf file with the in-memory objects.
217 */
218 void writeConfigurationFile();
Ratan Gupta2b106532017-07-25 16:05:02 +0530219
Gunnar Mills57d9c502018-09-14 14:42:34 -0500220 /** @brief delete all dbus objects.
221 */
222 void deleteAll();
Ratan Guptae9c9b812017-09-22 17:15:37 +0530223
Ravi Tejaa5a09442020-07-17 00:57:33 -0500224 /** @brief set the default v4 gateway of the interface.
225 * @param[in] gateway - default v4 gateway of the interface.
226 */
227 std::string defaultGateway(std::string gateway) override;
228
229 /** @brief set the default v6 gateway of the interface.
230 * @param[in] gateway - default v6 gateway of the interface.
231 */
232 std::string defaultGateway6(std::string gateway) override;
233
Patrick Williams6aef7692021-05-01 06:39:41 -0500234 using EthernetInterfaceIntf::dhcpEnabled;
Gunnar Mills57d9c502018-09-14 14:42:34 -0500235 using EthernetInterfaceIntf::interfaceName;
Johnathan Manteyfaa72e52020-01-08 10:38:58 -0800236 using EthernetInterfaceIntf::linkUp;
Tejas Patil2c0fc562021-08-03 19:13:46 +0530237 using EthernetInterfaceIntf::mtu;
Patrick Williams6aef7692021-05-01 06:39:41 -0500238 using EthernetInterfaceIntf::nicEnabled;
239 using MacAddressIntf::macAddress;
Ratan Gupta5978dd12017-07-25 13:47:13 +0530240
Ravi Tejaa5a09442020-07-17 00:57:33 -0500241 using EthernetInterfaceIntf::defaultGateway;
242 using EthernetInterfaceIntf::defaultGateway6;
Gunnar Mills57d9c502018-09-14 14:42:34 -0500243 /** @brief Absolute path of the resolv conf file */
244 static constexpr auto resolvConfFile = "/etc/resolv.conf";
Ratan Gupta6dec390f2017-08-20 15:28:12 +0530245
Gunnar Mills57d9c502018-09-14 14:42:34 -0500246 protected:
247 /** @brief get the info of the ethernet interface.
248 * @return tuple having the link speed,autonegotiation,duplexmode .
249 */
250 InterfaceInfo getInterfaceInfo() const;
Ratan Gupta8c834932017-04-14 16:30:24 +0530251
Gunnar Mills57d9c502018-09-14 14:42:34 -0500252 /* @brief delete the vlan interface from system.
253 * @param[in] interface - vlan Interface.
254 */
255 void deleteVLANFromSystem(const std::string& interface);
Ratan Guptae9c9b812017-09-22 17:15:37 +0530256
Gunnar Mills57d9c502018-09-14 14:42:34 -0500257 /** @brief get the mac address of the interface.
258 * @param[in] interfaceName - Network interface name.
259 * @return macaddress on success
260 */
Ratan Gupta8c834932017-04-14 16:30:24 +0530261
Gunnar Mills57d9c502018-09-14 14:42:34 -0500262 std::string getMACAddress(const std::string& interfaceName) const;
Ratan Gupta8c834932017-04-14 16:30:24 +0530263
Gunnar Mills57d9c502018-09-14 14:42:34 -0500264 /** @brief construct the ip address dbus object path.
265 * @param[in] addressType - Type of ip address.
Patrick Williams6aef7692021-05-01 06:39:41 -0500266 * @param[in] ipAddress - IP address.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500267 * @param[in] prefixLength - Length of prefix.
268 * @param[in] gateway - Gateway address.
Lei YU34027572021-08-11 15:23:52 +0800269 * @param[in] origin - The origin entry of the IP::Address
Ratan Gupta65e5abe2017-05-23 13:20:44 +0530270
Gunnar Mills57d9c502018-09-14 14:42:34 -0500271 * @return path of the address object.
272 */
Ratan Gupta82549cc2017-04-21 08:45:23 +0530273
Gunnar Mills57d9c502018-09-14 14:42:34 -0500274 std::string generateObjectPath(IP::Protocol addressType,
Patrick Williams6aef7692021-05-01 06:39:41 -0500275 const std::string& ipAddress,
Gunnar Mills57d9c502018-09-14 14:42:34 -0500276 uint8_t prefixLength,
Lei YU34027572021-08-11 15:23:52 +0800277 const std::string& gateway,
278 IP::AddressOrigin origin) const;
Ratan Gupta82549cc2017-04-21 08:45:23 +0530279
William A. Kennington III08505792019-01-30 16:00:04 -0800280 std::string
Patrick Williams6aef7692021-05-01 06:39:41 -0500281 generateStaticNeighborObjectPath(const std::string& ipAddress,
282 const std::string& macAddress) const;
William A. Kennington III08505792019-01-30 16:00:04 -0800283
Patrick Williams6aef7692021-05-01 06:39:41 -0500284 /** @brief generates the id by doing hash of ipAddress,
Gunnar Mills57d9c502018-09-14 14:42:34 -0500285 * prefixlength and the gateway.
Patrick Williams6aef7692021-05-01 06:39:41 -0500286 * @param[in] ipAddress - IP address.
Gunnar Mills57d9c502018-09-14 14:42:34 -0500287 * @param[in] prefixLength - Length of prefix.
288 * @param[in] gateway - Gateway address.
Lei YU34027572021-08-11 15:23:52 +0800289 * @param[in] origin - The string of the address origin
Gunnar Mills57d9c502018-09-14 14:42:34 -0500290 * @return hash string.
291 */
Ratan Gupta82549cc2017-04-21 08:45:23 +0530292
Patrick Williams6aef7692021-05-01 06:39:41 -0500293 static std::string generateId(const std::string& ipAddress,
Gunnar Mills57d9c502018-09-14 14:42:34 -0500294 uint8_t prefixLength,
Lei YU34027572021-08-11 15:23:52 +0800295 const std::string& gateway,
296 const std::string& origin);
Ratan Gupta82549cc2017-04-21 08:45:23 +0530297
Patrick Williams6aef7692021-05-01 06:39:41 -0500298 /** @brief generates the id by doing hash of ipAddress
William A. Kennington III08505792019-01-30 16:00:04 -0800299 * and the mac address.
Patrick Williams6aef7692021-05-01 06:39:41 -0500300 * @param[in] ipAddress - IP address.
301 * @param[in] macAddress - Gateway address.
William A. Kennington III08505792019-01-30 16:00:04 -0800302 * @return hash string.
303 */
Patrick Williams6aef7692021-05-01 06:39:41 -0500304 static std::string generateNeighborId(const std::string& ipAddress,
305 const std::string& macAddress);
William A. Kennington III08505792019-01-30 16:00:04 -0800306
Gunnar Mills57d9c502018-09-14 14:42:34 -0500307 /** @brief write the dhcp section **/
308 void writeDHCPSection(std::fstream& stream);
Ratan Gupta2b106532017-07-25 16:05:02 +0530309
Gunnar Mills57d9c502018-09-14 14:42:34 -0500310 /** @brief get the NTP server list from the network conf
311 *
312 */
313 ServerList getNTPServersFromConf();
Ratan Gupta497c0c92017-08-22 19:15:59 +0530314
Gunnar Mills57d9c502018-09-14 14:42:34 -0500315 /** @brief get the name server details from the network conf
316 *
317 */
Manojkiran Edaacd6dd52019-10-15 15:00:51 +0530318 virtual ServerList getNameServerFromResolvd();
Ratan Gupta6dec390f2017-08-20 15:28:12 +0530319
Gunnar Mills57d9c502018-09-14 14:42:34 -0500320 /** @brief Persistent sdbusplus DBus bus connection. */
Patrick Williamsc38b0712022-07-22 19:26:54 -0500321 sdbusplus::bus_t& bus;
Ratan Gupta82549cc2017-04-21 08:45:23 +0530322
Gunnar Mills57d9c502018-09-14 14:42:34 -0500323 /** @brief Network Manager object. */
324 Manager& manager;
Ratan Gupta4f1c18b2017-05-25 12:59:35 +0530325
Gunnar Mills57d9c502018-09-14 14:42:34 -0500326 /** @brief Persistent map of IPAddress dbus objects and their names */
327 AddressMap addrs;
Ratan Gupta82549cc2017-04-21 08:45:23 +0530328
William A. Kennington III08505792019-01-30 16:00:04 -0800329 /** @brief Persistent map of Neighbor dbus objects and their names */
330 NeighborMap staticNeighbors;
331
Gunnar Mills57d9c502018-09-14 14:42:34 -0500332 /** @brief Persistent map of VLAN interface dbus objects and their names */
333 VlanInterfaceMap vlanInterfaces;
Ratan Gupta5978dd12017-07-25 13:47:13 +0530334
Gunnar Mills57d9c502018-09-14 14:42:34 -0500335 /** @brief Dbus object path */
336 std::string objPath;
Ratan Gupta47722dc2017-05-26 18:32:23 +0530337
Gunnar Mills57d9c502018-09-14 14:42:34 -0500338 friend class TestEthernetInterface;
Johnathan Mantey817012a2020-01-30 15:07:39 -0800339
340 private:
341 /** @brief Determines if DHCP is active for the IP::Protocol supplied.
342 * @param[in] protocol - Either IPv4 or IPv6
Johnathan Mantey817012a2020-01-30 15:07:39 -0800343 * @returns true/false value if DHCP is active for the input protocol
344 */
William A. Kennington III24957b92021-12-03 13:59:19 -0800345 bool dhcpIsEnabled(IP::Protocol protocol);
Johnathan Mantey817012a2020-01-30 15:07:39 -0800346
Johnathan Mantey817012a2020-01-30 15:07:39 -0800347 /** @brief Determines if the address is manually assigned
348 * @param[in] origin - The origin entry of the IP::Address
349 * @returns true/false value if the address is static
350 */
351 bool originIsManuallyAssigned(IP::AddressOrigin origin);
William A. Kennington III26275a32021-07-13 20:32:42 -0700352
353 /** @brief Determines if the NIC is enabled in systemd
354 * @returns true/false value if the NIC is enabled
355 */
356 bool queryNicEnabled() const;
William A. Kennington IIIa520a392022-08-08 12:17:34 -0700357
358 std::string vlanIntfName(VlanId id) const;
359 std::string vlanObjPath(VlanId id) const;
Ratan Gupta8c834932017-04-14 16:30:24 +0530360};
361
362} // namespace network
363} // namespace phosphor