Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,20 @@
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 6bc207b..4fef019 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -221,10 +221,13 @@ void initSensorInfoOnDBus()
// For now the sensor path and type code are needed.
auto init = []() {
auto objServer = getObjectServer();
- std::unordered_map<std::string, uint16_t> sensorInfo;
+ // ipmi::sensor::Type, ipmi::sensor::ReadingType
+ using sensorCodes = std::vector<uint8_t>;
+ std::unordered_map<std::string, sensorCodes> sensorInfo;
for (const auto& s : invSensors)
{
- sensorInfo[s.first] = s.second.eventReadingType;
+ sensorInfo[s.first] = {s.second.sensorType,
+ s.second.eventReadingType};
}
sensorInfoInterface =
objServer->add_interface("/xyz/openbmc_project/Ipmi/SensorInfo",
@@ -0,0 +1,26 @@
From 335c1661c6dad640e941ec2378420c2128b78b8d Mon Sep 17 00:00:00 2001
From: wangbin <Bin-B.Wang@luxshare-ict.com>
Date: Thu, 30 Oct 2025 21:45:08 +0800
Subject: [PATCH] BMC status is set to normal by default
---
apphandler.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/apphandler.cpp b/apphandler.cpp
index 5628b35..d01bff9 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -711,7 +711,8 @@ ipmi::RspType<uint8_t, // Device ID
devId.fw[0] &= ipmiDevIdFw1Mask;
if (!getCurrentBmcStateWithFallback(defaultActivationSetting))
{
- devId.fw[0] |= (1 << ipmiDevIdStateShift);
+ // BMC status is set to normal by default
+ // devId.fw[0] |= (1 << ipmiDevIdStateShift);
}
return ipmi::responseSuccess(
--
2.25.1
@@ -0,0 +1,158 @@
From e473399654b26eba755a11abb3f949debe62557a Mon Sep 17 00:00:00 2001
From: roly <Rolyli.Li@luxshare-ict.com>
Date: Wed, 20 Nov 2024 15:23:06 +0800
Subject: [PATCH] Support ipmi cmd set sol bitrate
---
transporthandler.cpp | 118 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 116 insertions(+), 2 deletions(-)
diff --git a/transporthandler.cpp b/transporthandler.cpp
index dd2ac14..38faccc 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -1741,7 +1741,88 @@ RspType<> setSolConfParams(Context::ptr ctx, uint4_t channelBits,
return response(ipmiCCWriteReadParameter);
}
case SolConfParam::NonVbitrate:
+ {
+ uint4_t encodedBitRate;
+ uint4_t reserved2;
+ uint64_t baudRate;
+
+ if (req.unpack(encodedBitRate, reserved2) != 0 ||
+ !req.fullyUnpacked())
+ {
+ return responseReqDataLenInvalid();
+ }
+
+ switch (static_cast<uint8_t>(encodedBitRate))
+ {
+ case 0x06:
+ baudRate = 9600;
+ break;
+ case 0x07:
+ baudRate = 19200;
+ break;
+ case 0x08:
+ baudRate = 38400;
+ break;
+ case 0x09:
+ baudRate = 57600;
+ break;
+ case 0x0a:
+ baudRate = 115200;
+ break;
+ default:
+ return responseParmOutOfRange();
+ }
+
+ if (ipmi::setDbusProperty(
+ ctx, "xyz.openbmc_project.Console.default",
+ "/xyz/openbmc_project/console/default",
+ "xyz.openbmc_project.Console.UART", "NonVbitrate", baudRate))
+ {
+ return responseUnspecifiedError();
+ }
+ break;
+ }
case SolConfParam::Vbitrate:
+ {
+ uint4_t encodedBitRate;
+ uint4_t reserved2;
+ uint64_t baudRate;
+
+ if (req.unpack(encodedBitRate, reserved2) != 0 ||
+ !req.fullyUnpacked())
+ {
+ return responseReqDataLenInvalid();
+ }
+
+ switch (static_cast<uint8_t>(encodedBitRate))
+ {
+ case 0x06:
+ baudRate = 9600;
+ break;
+ case 0x07:
+ baudRate = 19200;
+ break;
+ case 0x08:
+ baudRate = 38400;
+ break;
+ case 0x09:
+ baudRate = 57600;
+ break;
+ case 0x0a:
+ baudRate = 115200;
+ break;
+ default:
+ return responseParmOutOfRange();
+ }
+ if (ipmi::setDbusProperty(
+ ctx, "xyz.openbmc_project.Console.default",
+ "/xyz/openbmc_project/console/default",
+ "xyz.openbmc_project.Console.UART", "Vbitrate", baudRate))
+ {
+ return responseUnspecifiedError();
+ }
+ break;
+ }
case SolConfParam::Channel:
default:
return response(ipmiCCParamNotSupported);
@@ -1895,10 +1976,10 @@ RspType<message::Payload> getSolConfParams(Context::ptr ctx,
if (ipmi::getDbusProperty(
ctx, "xyz.openbmc_project.Console.default",
"/xyz/openbmc_project/console/default",
- "xyz.openbmc_project.Console.UART", "Baud", baudRate))
+ "xyz.openbmc_project.Console.UART", "NonVbitrate", baudRate))
{
return ipmi::responseUnspecifiedError();
- }
+ }
switch (baudRate)
{
case 9600:
@@ -1923,6 +2004,39 @@ RspType<message::Payload> getSolConfParams(Context::ptr ctx,
return responseSuccess(std::move(ret));
}
case SolConfParam::Vbitrate:
+ {
+ uint64_t baudRate;
+ uint8_t encodedBitRate = 0;
+ if (ipmi::getDbusProperty(
+ ctx, "xyz.openbmc_project.Console.default",
+ "/xyz/openbmc_project/console/default",
+ "xyz.openbmc_project.Console.UART", "Vbitrate", baudRate))
+ {
+ return ipmi::responseUnspecifiedError();
+ }
+ switch (baudRate)
+ {
+ case 9600:
+ encodedBitRate = 0x06;
+ break;
+ case 19200:
+ encodedBitRate = 0x07;
+ break;
+ case 38400:
+ encodedBitRate = 0x08;
+ break;
+ case 57600:
+ encodedBitRate = 0x09;
+ break;
+ case 115200:
+ encodedBitRate = 0x0a;
+ break;
+ default:
+ break;
+ }
+ ret.pack(encodedBitRate);
+ return responseSuccess(std::move(ret));
+ }
default:
return response(ipmiCCParamNotSupported);
}
--
2.25.1
@@ -0,0 +1,96 @@
diff --git a/include/ipmid/utils.hpp b/include/ipmid/utils.hpp
index 20f9847..9d13fd0 100644
--- a/include/ipmid/utils.hpp
+++ b/include/ipmid/utils.hpp
@@ -464,4 +464,10 @@ void callDbusMethod(sdbusplus::bus_t& bus, const std::string& service,
ipmi::Cc i2cWriteRead(std::string i2cBus, const uint8_t slaveAddr,
std::vector<uint8_t> writeData,
std::vector<uint8_t>& readBuf);
+
+/** @brief Get board object path from DBUS object_mapper
+ * @param[in] bus - DBUS Bus Object.
+ * @return - string value of board object path
+ */
+std::string getBoardObjectPath(sdbusplus::bus::bus& bus);
} // namespace ipmi
diff --git a/libipmid/utils.cpp b/libipmid/utils.cpp
index 1261c2e..64a00d2 100644
--- a/libipmid/utils.cpp
+++ b/libipmid/utils.cpp
@@ -319,6 +319,36 @@ ObjectTree getAllAncestors(sdbusplus::bus_t& bus, const std::string& path,
return objectTree;
}
+std::string getBoardObjectPath(sdbusplus::bus::bus& bus)
+{
+ std::vector<std::string> paths;
+
+ auto method = bus.new_method_call(MAPPER_BUS_NAME, MAPPER_OBJ, MAPPER_INTF,
+ "GetSubTreePaths");
+ method.append("/xyz/openbmc_project/inventory/system/board");
+ method.append(0); // Depth 0 to search all
+ method.append(
+ std::vector<std::string>({"xyz.openbmc_project.Inventory.Item.Board"}));
+
+ try
+ {
+ auto reply = bus.call(method);
+ reply.read(paths);
+ }
+ catch (const sdbusplus::exception::exception& e)
+ {
+ log<level::ERR>("Error get board object path ",
+ entry("ERROR=%s", e.what()));
+ }
+
+ if (paths.empty())
+ {
+ log<level::ERR>("Error board object path is EMPTY");
+ return "";
+ }
+
+ return paths[0];
+}
namespace method_no_args
{
diff --git a/storagehandler.cpp b/storagehandler.cpp
index cf5ef5e..405a8a1 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -79,6 +79,7 @@ std::unique_ptr<sdbusplus::bus::match_t> selRemovedMatch
__attribute__((init_priority(101)));
std::unique_ptr<sdbusplus::bus::match_t> selUpdatedMatch
__attribute__((init_priority(101)));
+std::string boardObjectPath __attribute__((init_priority(101)));
static inline uint16_t getLoggingId(const std::string& p)
{
@@ -532,6 +533,27 @@ ipmi::RspType<uint8_t // erase status
return ipmi::responseUnspecifiedError();
}
+ if (boardObjectPath.empty())
+ {
+ boardObjectPath = ipmi::getBoardObjectPath(bus);
+ }
+ if (boardObjectPath.empty())
+ {
+ // Still empty, fail to add sel for clear SEL event
+ log<level::ERR>("Failed to get board object path");
+ return ipmi::responseUnspecifiedError();
+ }
+ std::string dbusIntfPath = boardObjectPath + "/Event_Log";
+ constexpr auto selSystemType = 0x02;
+ constexpr uint16_t genId = 0x0020;
+ constexpr std::array<uint8_t, 3> eventData = {0x02, 0x00, 0x00};
+ constexpr bool assert = true;
+ auto selDataStr = ipmi::sel::toHexStr(eventData);
+ report<SELCreated>(
+ Created::RECORD_TYPE(selSystemType), Created::GENERATOR_ID(genId),
+ Created::SENSOR_DATA(selDataStr.c_str()), Created::EVENT_DIR(assert),
+ Created::SENSOR_PATH(dbusIntfPath.c_str()));
+
return ipmi::responseSuccess(
static_cast<uint8_t>(ipmi::sel::eraseComplete));
}
@@ -0,0 +1,117 @@
diff --git a/include/ipmid/api.hpp b/include/ipmid/api.hpp
index 68e24ea..2366b91 100644
--- a/include/ipmid/api.hpp
+++ b/include/ipmid/api.hpp
@@ -35,6 +35,8 @@ std::shared_ptr<boost::asio::io_context> getIoContext();
// any client can interact with the main sdbus
std::shared_ptr<sdbusplus::asio::connection> getSdBus();
+// any client can interact with the object server
+std::shared_ptr<sdbusplus::asio::object_server> getObjectServer();
/**
* @brief post some work to the async exection queue
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index fd93097..c0b6c7d 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -810,7 +810,8 @@ std::unique_ptr<phosphor::host::command::Manager>& ipmid_get_host_cmd_manager()
// to be used except here (or maybe a unit test), so declare them here
extern void setIoContext(std::shared_ptr<boost::asio::io_context>& newIo);
extern void setSdBus(std::shared_ptr<sdbusplus::asio::connection>& newBus);
-
+extern void
+ setObjectServer(std::shared_ptr<sdbusplus::asio::object_server>& newServer);
int main(int argc, char* argv[])
{
// Connect to system bus
@@ -874,9 +875,10 @@ int main(int argc, char* argv[])
sdbusp->request_name("xyz.openbmc_project.Ipmi.Host");
// Add bindings for inbound IPMI requests
- auto server = sdbusplus::asio::object_server(sdbusp);
- auto iface = server.add_interface("/xyz/openbmc_project/Ipmi",
- "xyz.openbmc_project.Ipmi.Server");
+ auto server = std::make_shared<sdbusplus::asio::object_server>(sdbusp);
+ setObjectServer(server);
+ auto iface = server->add_interface("/xyz/openbmc_project/Ipmi",
+ "xyz.openbmc_project.Ipmi.Server");
iface->register_method("execute", ipmi::executionEntry);
iface->initialize();
diff --git a/libipmid/sdbus-asio.cpp b/libipmid/sdbus-asio.cpp
index 0f4cdaa..2ac9c1e 100644
--- a/libipmid/sdbus-asio.cpp
+++ b/libipmid/sdbus-asio.cpp
@@ -1,5 +1,6 @@
#include <boost/asio/io_context.hpp>
#include <sdbusplus/asio/connection.hpp>
+#include <sdbusplus/asio/object_server.hpp>
#include <memory>
@@ -8,6 +9,8 @@ namespace
std::shared_ptr<boost::asio::io_context> ioCtx;
std::shared_ptr<sdbusplus::asio::connection> sdbusp;
+std::shared_ptr<sdbusplus::asio::object_server> objServer;
+
} // namespace
@@ -30,3 +33,13 @@ std::shared_ptr<sdbusplus::asio::connection> getSdBus()
{
return sdbusp;
}
+
+void setObjectServer(std::shared_ptr<sdbusplus::asio::object_server>& s)
+{
+ objServer = s;
+}
+
+std::shared_ptr<sdbusplus::asio::object_server> getObjectServer()
+{
+ return objServer;
+}
\ No newline at end of file
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 405a8a1..6bc207b 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -214,6 +214,28 @@ void initSELCache()
selCacheMapInitialized = true;
}
+std::shared_ptr<sdbusplus::asio::dbus_interface> sensorInfoInterface
+ __attribute__((init_priority(101)));
+void initSensorInfoOnDBus()
+{
+ // For now the sensor path and type code are needed.
+ auto init = []() {
+ auto objServer = getObjectServer();
+ std::unordered_map<std::string, uint16_t> sensorInfo;
+ for (const auto& s : invSensors)
+ {
+ sensorInfo[s.first] = s.second.eventReadingType;
+ }
+ sensorInfoInterface =
+ objServer->add_interface("/xyz/openbmc_project/Ipmi/SensorInfo",
+ "xyz.openbmc_project.IPMI.SensorInfo");
+ sensorInfoInterface->register_property("SensorInfo", sensorInfo);
+ sensorInfoInterface->initialize();
+ };
+ boost::asio::post(*getIoContext(), std::move(init));
+}
+
+
/**
* @enum Device access mode
*/
@@ -899,6 +921,7 @@ void register_netfn_storage_functions()
{
selCacheMapInitialized = false;
initSELCache();
+ initSensorInfoOnDBus();
// Handlers with dbus-sdr handler implementation.
// Do not register the hander if it dynamic sensors stack is used.
@@ -0,0 +1,58 @@
From bfcde1e1685eeb7ca78c71bc399f39cbbf9e2ecc Mon Sep 17 00:00:00 2001
From: "Wang.Bin" <Bin-B.Wang@luxshare-ict.com>
Date: Fri, 20 Dec 2024 16:19:42 +0800
Subject: [PATCH 2/2] ClearSel Disable check SEL Reservation
---
storagehandler.cpp | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 67d76ea..389a805 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -516,7 +516,7 @@ ipmi::RspType<uint16_t // deleted record ID
ipmi::RspType<uint8_t // erase status
>
- clearSEL(uint16_t reservationID, const std::array<char, 3>& clr,
+ clearSEL(uint16_t /*reservationID*/, const std::array<char, 3>& clr,
uint8_t eraseOperation)
{
static constexpr std::array<char, 3> clrOk = {'C', 'L', 'R'};
@@ -525,10 +525,10 @@ ipmi::RspType<uint8_t // erase status
return ipmi::responseInvalidFieldRequest();
}
- if (!checkSELReservation(reservationID))
- {
- return ipmi::responseInvalidReservationId();
- }
+ // if (!checkSELReservation(reservationID))
+ // {
+ // return ipmi::responseInvalidReservationId();
+ // }
/*
* Erasure status cannot be fetched from DBUS, so always return erasure
@@ -794,6 +794,8 @@ ipmi::RspType<uint16_t // recordID of the Added SEL entry
// a maintenance procedure associated with eSEL record.
static constexpr auto procedureType = 0xDE;
cancelSELReservation();
+ std::cout << "sensorNumber:" << static_cast<int>(sensorNumber) <<"sensorType:"
+ << static_cast<int>(sensorType) << std::endl;
if (recordType == systemRecordType)
{
for (const auto& it : invSensors)
@@ -805,7 +807,7 @@ ipmi::RspType<uint16_t // recordID of the Added SEL entry
}
}
auto selDataStr = ipmi::sel::toHexStr(eventData);
-
+ std::cout << "eventData:" << selDataStr << std::endl;
bool assert = (eventDir & 0x80) ? false : true;
recordID = report<SELCreated>(Created::RECORD_TYPE(recordType),
--
2.25.1
@@ -0,0 +1,68 @@
From d329d711b3a31b55fa2299692c59a3621936327c Mon Sep 17 00:00:00 2001
From: "Wang.Bin" <Bin-B.Wang@luxshare-ict.com>
Date: Sun, 22 Dec 2024 15:41:07 +0800
Subject: [PATCH 3/3] Add-Free-Space-to-sel-info
---
storagehandler.cpp | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 389a805..476031a 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -32,6 +32,7 @@
void register_netfn_storage_functions() __attribute__((constructor));
unsigned int g_sel_time = 0xFFFFFFFF;
+constexpr uint16_t MaxEvtCount =1000;
namespace ipmi
{
namespace sensor
@@ -276,7 +277,7 @@ ipmi::RspType<uint8_t, // SEL revision.
uint16_t entries = 0;
// Most recent addition timestamp.
uint32_t addTimeStamp = ipmi::sel::invalidTimeStamp;
-
+ bool overflowFlag = false;
if (!selCacheMapInitialized)
{
// In case the initSELCache() fails, try it again
@@ -301,9 +302,24 @@ ipmi::RspType<uint8_t, // SEL revision.
}
constexpr uint8_t selVersion = ipmi::sel::selVersion;
- constexpr uint16_t freeSpace = 0xFFFF;
+ uint16_t freeSpace = 0xFFFF;
constexpr uint32_t eraseTimeStamp = ipmi::sel::invalidTimeStamp;
constexpr uint3_t reserved{0};
+ uint16_t u32FreeSpace = (MaxEvtCount - entries)*sizeof(SELEntry);
+ if (u32FreeSpace >= 0xFFFF)
+ {
+ freeSpace = 0xFFFF;
+ }
+ else
+ {
+ freeSpace = u32FreeSpace;
+ }
+
+ overflowFlag = ipmi::sel::operationSupport::overflow;
+ if (entries >= MaxEvtCount)
+ {
+ overflowFlag = true;
+ }
return ipmi::responseSuccess(
selVersion, entries, freeSpace, addTimeStamp, eraseTimeStamp,
@@ -311,7 +327,7 @@ ipmi::RspType<uint8_t, // SEL revision.
ipmi::sel::operationSupport::reserveSel,
ipmi::sel::operationSupport::partialAddSelEntry,
ipmi::sel::operationSupport::deleteSel, reserved,
- ipmi::sel::operationSupport::overflow);
+ overflowFlag);
}
ipmi_ret_t getSELEntry(ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t request,
--
2.25.1
@@ -0,0 +1,144 @@
From b56e70f39943812287be1668874f9df7bc2e3422 Mon Sep 17 00:00:00 2001
From: "Wang.Bin" <Bin-B.Wang@luxshare-ict.com>
Date: Fri, 21 Mar 2025 09:12:49 +0800
Subject: [PATCH 4/4] Keep the current IP when setting ipsrc to static
---
transporthandler.cpp | 60 ++++++++++++++++++++++++++++++++++++--------
transporthandler.hpp | 6 +++++
2 files changed, 56 insertions(+), 10 deletions(-)
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 38faccc..bab465b 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -1,5 +1,11 @@
#include "transporthandler.hpp"
+#include <boost/asio/ip/address.hpp>
+#include <boost/asio/ip/address_v4.hpp>
+#include <boost/asio/ip/address_v6.hpp>
+#include <stdplus/net/addr/subnet.hpp>
+#include <stdplus/raw.hpp>
+
using phosphor::logging::commit;
using phosphor::logging::elog;
using phosphor::logging::entry;
@@ -162,6 +168,23 @@ auto logWithChannel(const std::optional<ChannelParams>& params, Args&&... args)
return log<level>(std::forward<Args>(args)...);
}
+/** @brief Get / Set the Property value from phosphor-networkd EthernetInterface
+ */
+template <typename T>
+static T getEthProp(sdbusplus::bus_t& bus, const ChannelParams& params,
+ const std::string& prop)
+{
+ return std::get<T>(getDbusProperty(bus, params.service, params.logicalPath,
+ INTF_ETHERNET, prop));
+}
+template <typename T>
+static void setEthProp(sdbusplus::bus_t& bus, const ChannelParams& params,
+ const std::string& prop, const T& t)
+{
+ return setDbusProperty(bus, params.service, params.logicalPath,
+ INTF_ETHERNET, prop, t);
+}
+
EthernetInterface::DHCPConf getDHCPProperty(sdbusplus::bus_t& bus,
const ChannelParams& params)
{
@@ -316,18 +339,25 @@ void deleteObjectIfExists(sdbusplus::bus_t& bus, const std::string& service,
{
auto req = bus.new_method_call(service.c_str(), path.c_str(),
ipmi::DELETE_INTERFACE, "Delete");
- bus.call_noreply(req);
+
+ bus.call_noreply(req);
}
catch (const sdbusplus::exception_t& e)
{
if (strcmp(e.name(),
"xyz.openbmc_project.Common.Error.InternalFailure") != 0 &&
- strcmp(e.name(), "org.freedesktop.DBus.Error.UnknownObject") != 0)
+ strcmp(e.name(), "org.freedesktop.DBus.Error.UnknownObject") != 0 &&
+ strcmp(e.name(), "xyz.openbmc_project.Common.Error.NotAllowed") !=
+ 0)
{
// We want to rethrow real errors
throw;
}
}
+ catch (...)
+ {
+ throw;
+ }
}
/** @brief Sets the address info configured for the interface
@@ -383,18 +413,20 @@ void reconfigureIfAddr4(sdbusplus::bus_t& bus, const ChannelParams& params,
elog<InternalFailure>();
}
uint8_t fallbackPrefix = AddrFamily<AF_INET>::defaultPrefix;
+ auto addr = address.value_or(ifaddr->address);
+ // if (!validIntfIP(addr))
+ // {
+ // log<level::ERR>("IPv4 not unicast");
+ // elog<InternalFailure>();
+ // }
if (ifaddr)
{
fallbackPrefix = ifaddr->prefix;
deleteObjectIfExists(bus, params.service, ifaddr->path);
}
-
- if (struct in_addr nullIPv4{0};
- (address == std::nullopt && prefix != std::nullopt) ||
- (address != std::nullopt &&
- (address.value().s_addr != nullIPv4.s_addr)))
+ if (addr != stdplus::In4Addr{})
{
- createIfAddr<AF_INET>(bus, params, address.value_or(ifaddr->address),
+ createIfAddr<AF_INET>(bus, params, addr,
prefix.value_or(fallbackPrefix));
}
}
@@ -980,8 +1012,16 @@ RspType<> setLan(Context::ptr ctx, uint4_t channelBits, uint4_t reserved1,
case IPSrc::Unspecified:
case IPSrc::Static:
{
- channelCall<setDHCPv4Property>(
- channel, EthernetInterface::DHCPConf::none);
+ auto ifaddr = channelCall<getIfAddr4>(channel);
+
+ //channelCall<setDHCPv4Property>(channel, EthernetInterface::DHCPConf::none);
+ channelCall<setEthProp<bool>>(channel, "DHCP4", false);
+
+ if (ifaddr)
+ {
+ channelCall<reconfigureIfAddr4>(channel, ifaddr->address, ifaddr->prefix);
+ }
+
return responseSuccess();
}
case IPSrc::BIOS:
diff --git a/transporthandler.hpp b/transporthandler.hpp
index 8e1c4fb..a4e862b 100644
--- a/transporthandler.hpp
+++ b/transporthandler.hpp
@@ -17,6 +17,12 @@
#include <phosphor-logging/log.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/exception.hpp>
+
+#include <stdplus/net/addr/ether.hpp>
+#include <stdplus/net/addr/ip.hpp>
+#include <stdplus/str/conv.hpp>
+#include <stdplus/zstring_view.hpp>
+
#include <user_channel/channel_layer.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
#include <xyz/openbmc_project/Network/EthernetInterface/server.hpp>
--
2.25.1