ipaddress.cpp (9ede1b74c0feaee6abaa228cd097133dd74edb3e) ipaddress.cpp (a2947b4b2351d5592bc6f305325bc1be6ff44dff)
1#include "ipaddress.hpp"
2
3#include "ethernet_interface.hpp"
4#include "network_manager.hpp"
5#include "util.hpp"
6
7#include <phosphor-logging/elog-errors.hpp>
1#include "ipaddress.hpp"
2
3#include "ethernet_interface.hpp"
4#include "network_manager.hpp"
5#include "util.hpp"
6
7#include <phosphor-logging/elog-errors.hpp>
8#include <phosphor-logging/log.hpp>
8#include <phosphor-logging/lg2.hpp>
9#include <stdexcept>
10#include <string>
11#include <string_view>
12#include <xyz/openbmc_project/Common/error.hpp>
13
14namespace phosphor
15{
16namespace network

--- 69 unchanged lines hidden (view full) ---

86IP::AddressOrigin IPAddress::origin(IP::AddressOrigin /*origin*/)
87{
88 elog<NotAllowed>(Reason("Property update is not allowed"));
89}
90void IPAddress::delete_()
91{
92 if (origin() != IP::AddressOrigin::Static)
93 {
9#include <stdexcept>
10#include <string>
11#include <string_view>
12#include <xyz/openbmc_project/Common/error.hpp>
13
14namespace phosphor
15{
16namespace network

--- 69 unchanged lines hidden (view full) ---

86IP::AddressOrigin IPAddress::origin(IP::AddressOrigin /*origin*/)
87{
88 elog<NotAllowed>(Reason("Property update is not allowed"));
89}
90void IPAddress::delete_()
91{
92 if (origin() != IP::AddressOrigin::Static)
93 {
94 log<level::ERR>("Tried to delete a non-static address"),
95 entry("ADDRESS=%s", address().c_str()),
96 entry("PREFIX=%" PRIu8, prefixLength()),
97 entry("INTERFACE=%s", parent.get().interfaceName().c_str());
94 lg2::error("Tried to delete a non-static address {IP_ADDRESS} prefix "
95 "{PREFIX} interface {INTERFACE_NAME}",
96 "IP_ADDRESS", address(), "PREFIX", prefixLength(),
97 "INTERFACE_NAME", parent.get().interfaceName());
98 elog<InternalFailure>();
99 }
100
101 std::unique_ptr<IPAddress> ptr;
102 auto& addrs = parent.get().addrs;
103 for (auto it = addrs.begin(); it != addrs.end(); ++it)
104 {
105 if (it->second.get() == this)

--- 13 unchanged lines hidden ---
98 elog<InternalFailure>();
99 }
100
101 std::unique_ptr<IPAddress> ptr;
102 auto& addrs = parent.get().addrs;
103 for (auto it = addrs.begin(); it != addrs.end(); ++it)
104 {
105 if (it->second.get() == this)

--- 13 unchanged lines hidden ---