clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I01547e98d27910919e09ebf7907c86292a6c825d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index 38fa1a9..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -6,7 +6,7 @@
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
-AlignOperands: Align
+AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
@@ -87,7 +87,7 @@
IndentWrappedFunctionNames: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
@@ -98,13 +98,14 @@
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
diff --git a/app/channel.cpp b/app/channel.cpp
index a1e42fa..0b3b73d 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -140,8 +140,8 @@
{
try
{
- std::tie(cipherRecords,
- supportedAlgorithms) = cipher::getCipherRecords();
+ std::tie(cipherRecords, supportedAlgorithms) =
+ cipher::getCipherRecords();
recordInit = true;
}
catch (const std::exception& e)
@@ -150,8 +150,8 @@
}
}
- const std::vector<uint8_t>& records = algoSelectBit ? cipherRecords
- : supportedAlgorithms;
+ const std::vector<uint8_t>& records =
+ algoSelectBit ? cipherRecords : supportedAlgorithms;
static constexpr auto respSize = 16;
// Session support is available in active LAN channels.
@@ -167,8 +167,8 @@
// set of 16 and so on.
// Calculate the number of record data bytes to be returned.
- auto start = std::min(static_cast<size_t>(listIndex) * respSize,
- records.size());
+ auto start =
+ std::min(static_cast<size_t>(listIndex) * respSize, records.size());
auto end = std::min((static_cast<size_t>(listIndex) * respSize) + respSize,
records.size());
auto size = end - start;
diff --git a/app/watchdog.cpp b/app/watchdog.cpp
index dd65e45..99e4c40 100644
--- a/app/watchdog.cpp
+++ b/app/watchdog.cpp
@@ -192,12 +192,11 @@
*
* @return completion code on success.
**/
-ipmi::RspType<>
- ipmiSetWatchdogTimer(uint3_t timerUse, uint3_t reserved, bool dontStopTimer,
- bool dontLog, uint3_t timeoutAction, uint1_t reserved1,
- uint3_t preTimeoutInterrupt, uint1_t reserved2,
- uint8_t preTimeoutInterval,
- std::bitset<8> expFlagValue, uint16_t initialCountdown)
+ipmi::RspType<> ipmiSetWatchdogTimer(
+ uint3_t timerUse, uint3_t reserved, bool dontStopTimer, bool dontLog,
+ uint3_t timeoutAction, uint1_t reserved1, uint3_t preTimeoutInterrupt,
+ uint1_t reserved2, uint8_t preTimeoutInterval, std::bitset<8> expFlagValue,
+ uint16_t initialCountdown)
{
if ((timerUse == wdTimerUseResTimer1) ||
(timerUse == wdTimerUseResTimer2) ||
diff --git a/apphandler.cpp b/apphandler.cpp
index c7b1c37..d1d4301 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -114,8 +114,8 @@
ipmi::ObjectTree objectTree;
try
{
- objectTree = ipmi::getAllDbusObjects(*ctx->bus, softwareRoot,
- redundancyIntf);
+ objectTree =
+ ipmi::getAllDbusObjects(*ctx->bus, softwareRoot, redundancyIntf);
}
catch (const sdbusplus::exception_t& e)
{
@@ -128,10 +128,10 @@
auto objectFound = false;
for (auto& softObject : objectTree)
{
- auto service = ipmi::getService(*ctx->bus, redundancyIntf,
- softObject.first);
- auto objValueTree = ipmi::getManagedObjects(*ctx->bus, service,
- softwareRoot);
+ auto service =
+ ipmi::getService(*ctx->bus, redundancyIntf, softObject.first);
+ auto objValueTree =
+ ipmi::getManagedObjects(*ctx->bus, service, softwareRoot);
auto minPriority = 0xFF;
for (const auto& objIter : objValueTree)
@@ -184,11 +184,11 @@
sdbusplus::bus_t bus{ipmid_get_sd_bus_connection()};
// Get the Inventory object implementing the BMC interface
- ipmi::DbusObjectInfo bmcObject = ipmi::getDbusObject(bus,
- bmc_state_interface);
- auto variant = ipmi::getDbusProperty(bus, bmcObject.second, bmcObject.first,
- bmc_state_interface,
- bmc_state_property);
+ ipmi::DbusObjectInfo bmcObject =
+ ipmi::getDbusObject(bus, bmc_state_interface);
+ auto variant =
+ ipmi::getDbusProperty(bus, bmcObject.second, bmcObject.first,
+ bmc_state_interface, bmc_state_property);
return std::holds_alternative<std::string>(variant) &&
BMC::convertBMCStateFromString(std::get<std::string>(variant)) ==
@@ -337,11 +337,11 @@
}
else
{
- auto found = std::find_if(acpi_state::dbusToIPMI.begin(),
- acpi_state::dbusToIPMI.end(),
- [&s](const auto& iter) {
- return (static_cast<uint8_t>(iter.second) == s);
- });
+ auto found = std::find_if(
+ acpi_state::dbusToIPMI.begin(), acpi_state::dbusToIPMI.end(),
+ [&s](const auto& iter) {
+ return (static_cast<uint8_t>(iter.second) == s);
+ });
value = found->first;
@@ -385,11 +385,11 @@
}
else
{
- auto found = std::find_if(acpi_state::dbusToIPMI.begin(),
- acpi_state::dbusToIPMI.end(),
- [&s](const auto& iter) {
- return (static_cast<uint8_t>(iter.second) == s);
- });
+ auto found = std::find_if(
+ acpi_state::dbusToIPMI.begin(), acpi_state::dbusToIPMI.end(),
+ [&s](const auto& iter) {
+ return (static_cast<uint8_t>(iter.second) == s);
+ });
value = found->first;
@@ -852,8 +852,8 @@
// Get the Inventory object implementing BMC interface
ipmi::DbusObjectInfo objectInfo{};
- boost::system::error_code ec = ipmi::getDbusObject(ctx, uuidInterface,
- objectInfo);
+ boost::system::error_code ec =
+ ipmi::getDbusObject(ctx, uuidInterface, objectInfo);
if (ec.value())
{
lg2::error("Failed to locate System UUID object, "
@@ -1034,11 +1034,10 @@
* @return success completion code if request data is valid
* else return the correcponding error completion code.
**/
-uint8_t getSessionInfoRequestData(const ipmi::Context::ptr ctx,
- const uint8_t sessionIndex,
- ipmi::message::Payload& payload,
- uint32_t& reqSessionId,
- uint8_t& reqSessionHandle)
+uint8_t getSessionInfoRequestData(
+ const ipmi::Context::ptr ctx, const uint8_t sessionIndex,
+ ipmi::message::Payload& payload, uint32_t& reqSessionId,
+ uint8_t& reqSessionHandle)
{
if ((sessionIndex > session::maxSessionCountPerChannel) &&
(sessionIndex < session::searchSessionByHandle))
@@ -1178,23 +1177,23 @@
sessionProps, "State", static_cast<uint8_t>(session::State::inactive));
if (sessionState == static_cast<uint8_t>(session::State::active))
{
- sessionHandle = ipmi::mappedVariant<uint8_t>(sessionProps,
- "SessionHandle", 0);
- std::get<0>(details) = ipmi::mappedVariant<uint8_t>(sessionProps,
- "UserID", 0xff);
+ sessionHandle =
+ ipmi::mappedVariant<uint8_t>(sessionProps, "SessionHandle", 0);
+ std::get<0>(details) =
+ ipmi::mappedVariant<uint8_t>(sessionProps, "UserID", 0xff);
// std::get<1>(details) = 0; // (default constructed to 0)
std::get<2>(details) =
ipmi::mappedVariant<uint8_t>(sessionProps, "CurrentPrivilege", 0);
// std::get<3>(details) = 0; // (default constructed to 0)
- std::get<4>(details) = ipmi::mappedVariant<uint8_t>(sessionProps,
- "ChannelNum", 0xff);
+ std::get<4>(details) =
+ ipmi::mappedVariant<uint8_t>(sessionProps, "ChannelNum", 0xff);
constexpr uint4_t rmcpPlusProtocol = 1;
std::get<5>(details) = rmcpPlusProtocol;
- std::get<6>(details) = ipmi::mappedVariant<uint32_t>(sessionProps,
- "RemoteIPAddr", 0);
+ std::get<6>(details) =
+ ipmi::mappedVariant<uint32_t>(sessionProps, "RemoteIPAddr", 0);
// std::get<7>(details) = {{0}}; // default constructed to all 0
- std::get<8>(details) = ipmi::mappedVariant<uint16_t>(sessionProps,
- "RemotePort", 0);
+ std::get<8>(details) =
+ ipmi::mappedVariant<uint16_t>(sessionProps, "RemotePort", 0);
}
return ipmi::ccSuccess;
@@ -1257,8 +1256,8 @@
std::string service = itr->first;
uint8_t sessionState = 0;
- completionCode = getSessionState(ctx, service, objectPath,
- sessionState);
+ completionCode =
+ getSessionState(ctx, service, objectPath, sessionState);
if (completionCode)
{
return ipmi::response(completionCode);
@@ -1696,11 +1695,10 @@
* @returns IPMI completion code plus response data
* - readData - i2c response data
*/
-ipmi::RspType<std::vector<uint8_t>>
- ipmiControllerWriteRead([[maybe_unused]] bool isPrivateBus, uint3_t busId,
- [[maybe_unused]] uint4_t channelNum, bool reserved,
- uint7_t targetAddr, uint8_t readCount,
- std::vector<uint8_t> writeData)
+ipmi::RspType<std::vector<uint8_t>> ipmiControllerWriteRead(
+ [[maybe_unused]] bool isPrivateBus, uint3_t busId,
+ [[maybe_unused]] uint4_t channelNum, bool reserved, uint7_t targetAddr,
+ uint8_t readCount, std::vector<uint8_t> writeData)
{
if (reserved)
{
@@ -1723,8 +1721,8 @@
}
#endif // ENABLE_I2C_WHITELIST_CHECK
std::vector<uint8_t> readBuf(readCount);
- std::string i2cBus = "/dev/i2c-" +
- std::to_string(static_cast<uint8_t>(busId));
+ std::string i2cBus =
+ "/dev/i2c-" + std::to_string(static_cast<uint8_t>(busId));
ipmi::Cc ret = ipmi::i2cWriteRead(i2cBus, static_cast<uint8_t>(targetAddr),
writeData, readBuf);
diff --git a/chassishandler.cpp b/chassishandler.cpp
index e089083..34e8822 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -196,9 +196,9 @@
properties = ipmi::getAllDbusProperties(
bus, ipObjectInfo.second, ipObjectInfo.first, IP_INTERFACE);
- auto variant = ipmi::getDbusProperty(bus, macObjectInfo.second,
- macObjectInfo.first, MAC_INTERFACE,
- "MACAddress");
+ auto variant = ipmi::getDbusProperty(
+ bus, macObjectInfo.second, macObjectInfo.first, MAC_INTERFACE,
+ "MACAddress");
auto ipAddress = std::get<std::string>(properties["Address"]);
@@ -518,10 +518,10 @@
} while (0);
// Cookie == 0 or it is a valid cookie
- hostNetworkConfig += "ipaddress="s + ipAddress + ",prefix="s +
- std::to_string(prefix) + ",gateway="s + gateway +
- ",mac="s + mac + ",addressOrigin="s +
- addressOrigin;
+ hostNetworkConfig +=
+ "ipaddress="s + ipAddress + ",prefix="s + std::to_string(prefix) +
+ ",gateway="s + gateway + ",mac="s + mac + ",addressOrigin="s +
+ addressOrigin;
sdbusplus::bus_t bus(ipmid_get_sd_bus_connection());
@@ -561,15 +561,15 @@
{
sdbusplus::bus_t bus{ipmid_get_sd_bus_connection()};
- auto chassisStateObj = ipmi::getDbusObject(bus, chassisPOHStateIntf,
- chassisStateRoot, match);
+ auto chassisStateObj =
+ ipmi::getDbusObject(bus, chassisPOHStateIntf, chassisStateRoot, match);
- auto service = ipmi::getService(bus, chassisPOHStateIntf,
- chassisStateObj.first);
+ auto service =
+ ipmi::getService(bus, chassisPOHStateIntf, chassisStateObj.first);
- auto propValue = ipmi::getDbusProperty(bus, service, chassisStateObj.first,
- chassisPOHStateIntf,
- pohCounterProperty);
+ auto propValue =
+ ipmi::getDbusProperty(bus, service, chassisStateObj.first,
+ chassisPOHStateIntf, pohCounterProperty);
return std::get<uint32_t>(propValue);
}
@@ -617,9 +617,9 @@
// [0] -1b = Chassis provides intrusion (physical security) sensor.
// set to default value 0x0.
- properties = ipmi::getAllDbusProperties(bus, chassisCapObject.second,
- chassisCapObject.first,
- chassisCapIntf);
+ properties =
+ ipmi::getAllDbusProperties(bus, chassisCapObject.second,
+ chassisCapObject.first, chassisCapIntf);
}
catch (const std::exception& e)
{
@@ -691,11 +691,11 @@
return ipmi::responseUnspecifiedError();
}
- return ipmi::responseSuccess(*chassisIntrusionFlag, *chassisFrontPanelFlag,
- *chassisNMIFlag, *chassisPowerInterlockFlag, 0,
- *chassisFRUInfoDevAddr, *chassisSDRDevAddr,
- *chassisSELDevAddr, *chassisSMDevAddr,
- *chassisBridgeDevAddr);
+ return ipmi::responseSuccess(
+ *chassisIntrusionFlag, *chassisFrontPanelFlag, *chassisNMIFlag,
+ *chassisPowerInterlockFlag, 0, *chassisFRUInfoDevAddr,
+ *chassisSDRDevAddr, *chassisSELDevAddr, *chassisSMDevAddr,
+ *chassisBridgeDevAddr);
}
/** @brief implements set chassis capalibities command
@@ -710,18 +710,18 @@
*
* @returns IPMI completion code
*/
-ipmi::RspType<> ipmiSetChassisCap(bool intrusion, bool fpLockout,
- uint6_t reserved1,
+ipmi::RspType<> ipmiSetChassisCap(
+ bool intrusion, bool fpLockout, uint6_t reserved1,
- uint8_t fruDeviceAddr,
+ uint8_t fruDeviceAddr,
- uint8_t sdrDeviceAddr,
+ uint8_t sdrDeviceAddr,
- uint8_t selDeviceAddr,
+ uint8_t selDeviceAddr,
- uint8_t smDeviceAddr,
+ uint8_t smDeviceAddr,
- uint8_t bridgeDeviceAddr)
+ uint8_t bridgeDeviceAddr)
{
// check input data
if (reserved1 != 0)
@@ -823,8 +823,8 @@
transition);
std::string service;
- boost::system::error_code ec = ipmi::getService(ctx, hostStateIntf,
- hostStatePath, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, hostStateIntf, hostStatePath, service);
if (!ec)
{
@@ -855,8 +855,8 @@
constexpr auto chassisStateIntf = "xyz.openbmc_project.State.Chassis";
std::string service;
- boost::system::error_code ec = ipmi::getService(ctx, chassisStateIntf,
- chassisStatePath, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, chassisStateIntf, chassisStatePath, service);
// Convert to string equivalent of the passed in transition enum.
auto request =
@@ -974,8 +974,8 @@
"/xyz/openbmc_project/state/chassis0";
constexpr const char* chassisStateIntf =
"xyz.openbmc_project.State.Chassis";
- auto service = ipmi::getService(*busp, chassisStateIntf,
- chassisStatePath);
+ auto service =
+ ipmi::getService(*busp, chassisStateIntf, chassisStatePath);
ipmi::Value powerState =
ipmi::getDbusProperty(*busp, service, chassisStatePath,
@@ -992,8 +992,8 @@
"/org/openbmc/control/power0";
constexpr const char* legacyPwrCtrlIntf =
"org.openbmc.control.Power";
- auto service = ipmi::getService(*busp, legacyPwrCtrlIntf,
- legacyPwrCtrlObj);
+ auto service =
+ ipmi::getService(*busp, legacyPwrCtrlIntf, legacyPwrCtrlObj);
ipmi::Value variant = ipmi::getDbusProperty(
*busp, service, legacyPwrCtrlObj, legacyPwrCtrlIntf, "pgood");
@@ -1023,8 +1023,8 @@
std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus();
try
{
- auto service = ipmi::getService(*bus, powerControlIntf,
- powerControlObj);
+ auto service =
+ ipmi::getService(*bus, powerControlIntf, powerControlObj);
ipmi::Value variant = ipmi::getDbusProperty(
*bus, service, powerControlObj, powerControlIntf, "PFail");
@@ -1101,8 +1101,8 @@
chassisIntrusionStr);
if (!ec)
{
- bool ret = (chassisIntrusionStr == "HardwareIntrusion") ? true
- : false;
+ bool ret =
+ (chassisIntrusionStr == "HardwareIntrusion") ? true : false;
return std::make_optional(ret);
}
}
@@ -1160,8 +1160,8 @@
}
// Front Panel Button Capabilities and disable/enable status(Optional)
- std::optional<bool> powerButtonReading = getButtonEnabled(powerButtonPath,
- powerButtonIntf);
+ std::optional<bool> powerButtonReading =
+ getButtonEnabled(powerButtonPath, powerButtonIntf);
// allow disable if the interface is present
bool powerButtonDisableAllow = static_cast<bool>(powerButtonReading);
// default return the button is enabled (not disabled)
@@ -1172,8 +1172,8 @@
powerButtonDisabled = *powerButtonReading;
}
- std::optional<bool> resetButtonReading = getButtonEnabled(resetButtonPath,
- resetButtonIntf);
+ std::optional<bool> resetButtonReading =
+ getButtonEnabled(resetButtonPath, resetButtonIntf);
// allow disable if the interface is present
bool resetButtonDisableAllow = static_cast<bool>(resetButtonReading);
// default return the button is enabled (not disabled)
@@ -1299,8 +1299,8 @@
constexpr const char* restartCauseIntf = "xyz.openbmc_project.State.Host";
std::string service;
- boost::system::error_code ec = ipmi::getService(ctx, restartCauseIntf,
- restartCausePath, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, restartCauseIntf, restartCausePath, service);
if (!ec)
{
std::string restartCauseStr;
@@ -1553,8 +1553,8 @@
using namespace chassis::internal;
std::string result;
std::string service;
- boost::system::error_code ec = getService(ctx, bootSourceIntf,
- bootSettingsPath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootSourceIntf, bootSettingsPath, service);
if (!ec)
{
ec = ipmi::getDbusProperty(ctx, service, bootSettingsPath,
@@ -1579,8 +1579,8 @@
{
using namespace chassis::internal;
std::string service;
- boost::system::error_code ec = getService(ctx, bootSourceIntf,
- bootSettingsPath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootSourceIntf, bootSettingsPath, service);
if (!ec)
{
ec = ipmi::setDbusProperty(ctx, service, bootSettingsPath,
@@ -1605,8 +1605,8 @@
using namespace chassis::internal;
std::string result;
std::string service;
- boost::system::error_code ec = getService(ctx, bootModeIntf,
- bootSettingsPath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootModeIntf, bootSettingsPath, service);
if (!ec)
{
ec = ipmi::getDbusProperty(ctx, service, bootSettingsPath, bootModeIntf,
@@ -1630,8 +1630,8 @@
{
using namespace chassis::internal;
std::string service;
- boost::system::error_code ec = getService(ctx, bootModeIntf,
- bootSettingsPath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootModeIntf, bootSettingsPath, service);
if (!ec)
{
ec = ipmi::setDbusProperty(ctx, service, bootSettingsPath, bootModeIntf,
@@ -1655,8 +1655,8 @@
using namespace chassis::internal;
std::string result;
std::string service;
- boost::system::error_code ec = getService(ctx, bootTypeIntf,
- bootSettingsPath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootTypeIntf, bootSettingsPath, service);
// Don't throw error if BootType interface is not present.
// This interface is not relevant for some Host architectures
@@ -1687,8 +1687,8 @@
{
using namespace chassis::internal;
std::string service;
- boost::system::error_code ec = getService(ctx, bootTypeIntf,
- bootSettingsPath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootTypeIntf, bootSettingsPath, service);
if (!ec)
{
ec = ipmi::setDbusProperty(ctx, service, bootSettingsPath, bootTypeIntf,
@@ -1716,8 +1716,8 @@
using namespace chassis::internal;
std::string result;
std::string service;
- boost::system::error_code ec = getService(ctx, bootEnableIntf,
- bootSettingsPath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootEnableIntf, bootSettingsPath, service);
if (!ec)
{
ec = ipmi::getDbusProperty(ctx, service, bootSettingsPath,
@@ -1741,8 +1741,8 @@
{
using namespace chassis::internal;
std::string service;
- boost::system::error_code ec = getService(ctx, bootEnableIntf,
- bootSettingsPath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootEnableIntf, bootSettingsPath, service);
if (!ec)
{
ec = ipmi::setDbusProperty(ctx, service, bootSettingsPath,
@@ -1767,8 +1767,8 @@
using namespace chassis::internal;
std::string result;
std::string service;
- boost::system::error_code ec = getService(ctx, bootOneTimeIntf,
- bootSettingsOneTimePath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootOneTimeIntf, bootSettingsOneTimePath, service);
if (!ec)
{
ec = ipmi::getDbusProperty(ctx, service, bootSettingsOneTimePath,
@@ -1792,8 +1792,8 @@
{
using namespace chassis::internal;
std::string service;
- boost::system::error_code ec = getService(ctx, bootOneTimeIntf,
- bootSettingsOneTimePath, service);
+ boost::system::error_code ec =
+ getService(ctx, bootOneTimeIntf, bootSettingsOneTimePath, service);
if (!ec)
{
ec = ipmi::setDbusProperty(ctx, service, bootSettingsOneTimePath,
@@ -1833,11 +1833,10 @@
* parmIndicator - parameter valid/invalid indicator
* data - configuration parameter data
*/
-ipmi::RspType<ipmi::message::Payload>
- ipmiChassisGetSysBootOptions(ipmi::Context::ptr ctx,
- uint7_t bootOptionParameter, bool reserved1,
- [[maybe_unused]] uint8_t setSelector,
- [[maybe_unused]] uint8_t blockSelector)
+ipmi::RspType<ipmi::message::Payload> ipmiChassisGetSysBootOptions(
+ ipmi::Context::ptr ctx, uint7_t bootOptionParameter, bool reserved1,
+ [[maybe_unused]] uint8_t setSelector,
+ [[maybe_unused]] uint8_t blockSelector)
{
ipmi::Cc rc;
if (reserved1)
@@ -2321,10 +2320,9 @@
return ipmi::responseSuccess(power_policy::allSupport, reserved);
}
-ipmi::RspType<> ipmiSetFrontPanelButtonEnables(ipmi::Context::ptr ctx,
- bool disablePowerButton,
- bool disableResetButton, bool,
- bool, uint4_t)
+ipmi::RspType<> ipmiSetFrontPanelButtonEnables(
+ ipmi::Context::ptr ctx, bool disablePowerButton, bool disableResetButton,
+ bool, bool, uint4_t)
{
using namespace chassis::internal;
diff --git a/dbus-sdr/sdrutils.cpp b/dbus-sdr/sdrutils.cpp
index 14eebb4..0c77ef7 100644
--- a/dbus-sdr/sdrutils.cpp
+++ b/dbus-sdr/sdrutils.cpp
@@ -85,8 +85,8 @@
{
return;
}
- nlohmann::json sensorFilterJSON = nlohmann::json::parse(filterFile, nullptr,
- false);
+ nlohmann::json sensorFilterJSON =
+ nlohmann::json::parse(filterFile, nullptr, false);
nlohmann::json::iterator svcFilterit =
sensorFilterJSON.find("ServiceFilter");
if (svcFilterit == sensorFilterJSON.end())
@@ -96,15 +96,16 @@
subtree.erase(std::remove_if(subtree.begin(), subtree.end(),
[svcFilterit](SensorSubTree::value_type& kv) {
- auto& [_, serviceToIfaces] = kv;
+ auto& [_, serviceToIfaces] = kv;
- for (auto service = svcFilterit->begin(); service != svcFilterit->end();
- ++service)
- {
- serviceToIfaces.erase(*service);
- }
- return serviceToIfaces.empty();
- }),
+ for (auto service = svcFilterit->begin();
+ service != svcFilterit->end();
+ ++service)
+ {
+ serviceToIfaces.erase(*service);
+ }
+ return serviceToIfaces.empty();
+ }),
subtree.end());
}
@@ -174,8 +175,8 @@
static constexpr const std::array vrInterfaces = {
"xyz.openbmc_project.Control.VoltageRegulatorMode"};
- bool sensorRez = lbdUpdateSensorTree("/xyz/openbmc_project/sensors",
- sensorInterfaces);
+ bool sensorRez =
+ lbdUpdateSensorTree("/xyz/openbmc_project/sensors", sensorInterfaces);
#ifdef FEATURE_HYBRID_SENSORS
@@ -291,8 +292,8 @@
return std::find_if(
ipmi::sensor::sensors.begin(), ipmi::sensor::sensors.end(),
[&path](const ipmi::sensor::IdInfoMap::value_type& findSensor) {
- return findSensor.second.sensorPath == path;
- });
+ return findSensor.second.sensorPath == path;
+ });
}
#endif
@@ -410,8 +411,8 @@
return interfacesResponse;
}
-std::map<std::string, Value> getEntityManagerProperties(const char* path,
- const char* interface)
+std::map<std::string, Value>
+ getEntityManagerProperties(const char* path, const char* interface)
{
std::map<std::string, Value> properties;
std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus();
@@ -462,8 +463,8 @@
return ipmiDecoratorPaths;
}
- ipmiDecoratorPaths = std::unordered_set<std::string>(paths.begin(),
- paths.end());
+ ipmiDecoratorPaths =
+ std::unordered_set<std::string>(paths.begin(), paths.end());
return ipmiDecoratorPaths;
}
diff --git a/dbus-sdr/sensorcommands.cpp b/dbus-sdr/sensorcommands.cpp
index 6517fdd..b3786c9 100644
--- a/dbus-sdr/sensorcommands.cpp
+++ b/dbus-sdr/sensorcommands.cpp
@@ -135,24 +135,24 @@
"type='signal',member='InterfacesAdded',arg0path='/xyz/openbmc_project/"
"sensors/'",
[](sdbusplus::message_t&) {
- getSensorTree().clear();
- getIpmiDecoratorPaths(/*ctx=*/std::nullopt).reset();
- sdrLastAdd = std::chrono::duration_cast<std::chrono::seconds>(
- std::chrono::system_clock::now().time_since_epoch())
- .count();
-});
+ getSensorTree().clear();
+ getIpmiDecoratorPaths(/*ctx=*/std::nullopt).reset();
+ sdrLastAdd = std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now().time_since_epoch())
+ .count();
+ });
static sdbusplus::bus::match_t sensorRemoved(
*getSdBus(),
"type='signal',member='InterfacesRemoved',arg0path='/xyz/openbmc_project/"
"sensors/'",
[](sdbusplus::message_t&) {
- getSensorTree().clear();
- getIpmiDecoratorPaths(/*ctx=*/std::nullopt).reset();
- sdrLastRemove = std::chrono::duration_cast<std::chrono::seconds>(
- std::chrono::system_clock::now().time_since_epoch())
- .count();
-});
+ getSensorTree().clear();
+ getIpmiDecoratorPaths(/*ctx=*/std::nullopt).reset();
+ sdrLastRemove = std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now().time_since_epoch())
+ .count();
+ });
ipmi_ret_t getSensorConnection(ipmi::Context::ptr ctx, uint8_t sensnum,
std::string& connection, std::string& path,
@@ -206,40 +206,43 @@
"type='signal',member='PropertiesChanged',interface='org.freedesktop.DBus."
"Properties',arg0namespace='xyz.openbmc_project.Sensor.Threshold'",
[](sdbusplus::message_t& m) {
- boost::container::flat_map<std::string, std::variant<bool, double>> values;
- m.read(std::string(), values);
+ boost::container::flat_map<std::string, std::variant<bool, double>>
+ values;
+ m.read(std::string(), values);
- auto findAssert = std::find_if(values.begin(), values.end(),
- [](const auto& pair) {
- return pair.first.find("Alarm") != std::string::npos;
- });
- if (findAssert != values.end())
- {
- auto ptr = std::get_if<bool>(&(findAssert->second));
- if (ptr == nullptr)
+ auto findAssert =
+ std::find_if(values.begin(), values.end(), [](const auto& pair) {
+ return pair.first.find("Alarm") != std::string::npos;
+ });
+ if (findAssert != values.end())
{
- lg2::error("thresholdChanged: Assert non bool");
- return;
- }
- if (*ptr)
- {
- lg2::info("thresholdChanged: Assert, sensor path: {SENSOR_PATH}",
- "SENSOR_PATH", m.get_path());
- thresholdDeassertMap[m.get_path()][findAssert->first] = *ptr;
- }
- else
- {
- auto& value = thresholdDeassertMap[m.get_path()][findAssert->first];
- if (value)
+ auto ptr = std::get_if<bool>(&(findAssert->second));
+ if (ptr == nullptr)
+ {
+ lg2::error("thresholdChanged: Assert non bool");
+ return;
+ }
+ if (*ptr)
{
lg2::info(
- "thresholdChanged: deassert, sensor path: {SENSOR_PATH}",
+ "thresholdChanged: Assert, sensor path: {SENSOR_PATH}",
"SENSOR_PATH", m.get_path());
- value = *ptr;
+ thresholdDeassertMap[m.get_path()][findAssert->first] = *ptr;
+ }
+ else
+ {
+ auto& value =
+ thresholdDeassertMap[m.get_path()][findAssert->first];
+ if (value)
+ {
+ lg2::info(
+ "thresholdChanged: deassert, sensor path: {SENSOR_PATH}",
+ "SENSOR_PATH", m.get_path());
+ value = *ptr;
+ }
}
}
- }
-});
+ });
namespace sensor
{
@@ -432,9 +435,8 @@
}
// Calculate VR Mode from input IPMI discrete event bytes
-static std::optional<std::string>
- calculateVRMode(uint15_t assertOffset,
- const ipmi::DbusInterfaceMap::mapped_type& VRObject)
+static std::optional<std::string> calculateVRMode(
+ uint15_t assertOffset, const ipmi::DbusInterfaceMap::mapped_type& VRObject)
{
// get VR mode profiles from Supported Interface
auto profiles = getSupportedVrProfiles(VRObject);
@@ -774,18 +776,16 @@
return ipmi::responseSuccess();
}
-ipmi::RspType<> ipmiSetSensorReading(ipmi::Context::ptr ctx,
- uint8_t sensorNumber, uint8_t,
- uint8_t reading, uint15_t assertOffset,
- bool, uint15_t, bool, uint8_t, uint8_t,
- uint8_t)
+ipmi::RspType<> ipmiSetSensorReading(
+ ipmi::Context::ptr ctx, uint8_t sensorNumber, uint8_t, uint8_t reading,
+ uint15_t assertOffset, bool, uint15_t, bool, uint8_t, uint8_t, uint8_t)
{
std::string connection;
std::string path;
std::vector<std::string> interfaces;
- ipmi::Cc status = getSensorConnection(ctx, sensorNumber, connection, path,
- &interfaces);
+ ipmi::Cc status =
+ getSensorConnection(ctx, sensorNumber, connection, path, &interfaces);
if (status)
{
return ipmi::response(status);
@@ -807,14 +807,14 @@
}
// Only allow external SetSensor if write permission granted
- if (!details::sdrWriteTable.getWritePermission((ctx->lun << 8) |
- sensorNumber))
+ if (!details::sdrWriteTable.getWritePermission(
+ (ctx->lun << 8) | sensorNumber))
{
return ipmi::responseResponseError();
}
- auto value = sensor::calculateValue(reading, sensorMap,
- sensorObject->second);
+ auto value =
+ sensor::calculateValue(reading, sensorMap, sensorObject->second);
if (!value)
{
return ipmi::responseResponseError();
@@ -863,8 +863,8 @@
// VR sensors are treated as a special case and we will not check the
// write permission for VR sensors, since they always deemed writable
// and permission table are not applied to VR sensors.
- auto vrMode = sensor::calculateVRMode(assertOffset,
- sensorObject->second);
+ auto vrMode =
+ sensor::calculateVRMode(assertOffset, sensorObject->second);
if (!vrMode)
{
return ipmi::responseResponseError();
@@ -982,8 +982,8 @@
return ipmi::responseResponseError();
}
- uint8_t value = scaleIPMIValueFromDouble(reading, mValue, rExp, bValue,
- bExp, bSigned);
+ uint8_t value =
+ scaleIPMIValueFromDouble(reading, mValue, rExp, bValue, bExp, bSigned);
uint8_t operation =
static_cast<uint8_t>(IPMISensorReadingByte2::sensorScanningEnable);
operation |=
@@ -1032,16 +1032,15 @@
{
// This is the first reading, show the coefficients
double step = (max - min) / 255.0;
- std::cerr << "IPMI sensor "
- << details::sdrStatsTable.getName((ctx->lun << 8) |
- sensnum)
- << ": Range min=" << min << " max=" << max
- << ", step=" << step
- << ", Coefficients mValue=" << static_cast<int>(mValue)
- << " rExp=" << static_cast<int>(rExp)
- << " bValue=" << static_cast<int>(bValue)
- << " bExp=" << static_cast<int>(bExp)
- << " bSigned=" << static_cast<int>(bSigned) << "\n";
+ std::cerr
+ << "IPMI sensor "
+ << details::sdrStatsTable.getName((ctx->lun << 8) | sensnum)
+ << ": Range min=" << min << " max=" << max << ", step=" << step
+ << ", Coefficients mValue=" << static_cast<int>(mValue)
+ << " rExp=" << static_cast<int>(rExp)
+ << " bValue=" << static_cast<int>(bValue)
+ << " bExp=" << static_cast<int>(bExp)
+ << " bSigned=" << static_cast<int>(bSigned) << "\n";
}
}
@@ -1296,8 +1295,8 @@
if (warningHigh != warningMap.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- warningHigh->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), warningHigh->second);
if (std::isfinite(value))
{
resp.warningHigh = scaleIPMIValueFromDouble(
@@ -1306,8 +1305,8 @@
}
if (warningLow != warningMap.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- warningLow->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), warningLow->second);
if (std::isfinite(value))
{
resp.warningLow = scaleIPMIValueFromDouble(
@@ -1324,8 +1323,8 @@
if (criticalHigh != criticalMap.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- criticalHigh->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), criticalHigh->second);
if (std::isfinite(value))
{
resp.criticalHigh = scaleIPMIValueFromDouble(
@@ -1334,8 +1333,8 @@
}
if (criticalLow != criticalMap.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- criticalLow->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), criticalLow->second);
if (std::isfinite(value))
{
resp.criticalLow = scaleIPMIValueFromDouble(
@@ -1511,8 +1510,8 @@
auto warningLow = warningMap.find("WarningLow");
if (warningHigh != warningMap.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- warningHigh->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), warningHigh->second);
if (std::isfinite(value))
{
assertionEnabledLsb |= static_cast<uint8_t>(
@@ -1525,8 +1524,8 @@
}
if (warningLow != warningMap.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- warningLow->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), warningLow->second);
if (std::isfinite(value))
{
assertionEnabledLsb |= static_cast<uint8_t>(
@@ -1547,8 +1546,8 @@
if (criticalHigh != criticalMap.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- criticalHigh->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), criticalHigh->second);
if (std::isfinite(value))
{
assertionEnabledMsb |= static_cast<uint8_t>(
@@ -1560,8 +1559,8 @@
}
if (criticalLow != criticalMap.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- criticalLow->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), criticalLow->second);
if (std::isfinite(value))
{
assertionEnabledLsb |= static_cast<uint8_t>(
@@ -1731,15 +1730,15 @@
}
if (warningHighAlarm)
{
- assertions.set(
- static_cast<size_t>(IPMIGetSensorEventEnableThresholds::
- upperNonCriticalGoingHigh));
+ assertions.set(static_cast<size_t>(
+ IPMIGetSensorEventEnableThresholds::
+ upperNonCriticalGoingHigh));
}
if (warningLowAlarm)
{
- assertions.set(
- static_cast<size_t>(IPMIGetSensorEventEnableThresholds::
- lowerNonCriticalGoingLow));
+ assertions.set(static_cast<size_t>(
+ IPMIGetSensorEventEnableThresholds::
+ lowerNonCriticalGoingLow));
}
}
if (criticalInterface != sensorMap.end())
@@ -1761,9 +1760,9 @@
}
if (criticalHighAlarm)
{
- assertions.set(
- static_cast<size_t>(IPMIGetSensorEventEnableThresholds::
- upperCriticalGoingHigh));
+ assertions.set(static_cast<size_t>(
+ IPMIGetSensorEventEnableThresholds::
+ upperCriticalGoingHigh));
}
if (criticalLowAlarm)
{
@@ -1898,8 +1897,8 @@
uint8_t bExpBits = bExp & 0x07;
// move rExp and bExp into place
- record.body.r_b_exponents = (rExpSign << 7) | (rExpBits << 4) |
- (bExpSign << 3) | bExpBits;
+ record.body.r_b_exponents =
+ (rExpSign << 7) | (rExpBits << 4) | (bExpSign << 3) | bExpBits;
// Set the analog reading byte interpretation accordingly
record.body.sensor_units_1 = (bSigned ? 1 : 0) << 7;
@@ -1923,8 +1922,8 @@
sensorMap.find("xyz.openbmc_project.Sensor.ValueMutability");
if (mutability != sensorMap.end())
{
- sensorSettable = mappedVariant<bool>(mutability->second, "Mutable",
- false);
+ sensorSettable =
+ mappedVariant<bool>(mutability->second, "Mutable", false);
}
get_sdr::body::init_settable_state(sensorSettable, &record.body);
@@ -2173,9 +2172,9 @@
ctx->lun = lun3;
}
- auto status = getSensorConnection(ctx,
- static_cast<uint8_t>(sensNumFromRecID),
- connection, path, &interfaces);
+ auto status =
+ getSensorConnection(ctx, static_cast<uint8_t>(sensNumFromRecID),
+ connection, path, &interfaces);
if (status)
{
lg2::error("getSensorDataRecord: getSensorConnection error");
@@ -2369,8 +2368,8 @@
// Return the number of sensors attached to the LUN
if ((ctx->lun == lun0) && (numSensors > 0))
{
- sdrCount = (numSensors > maxSensorsPerLUN) ? maxSensorsPerLUN
- : numSensors;
+ sdrCount =
+ (numSensors > maxSensorsPerLUN) ? maxSensorsPerLUN : numSensors;
}
else if ((ctx->lun == lun1) && (numSensors > maxSensorsPerLUN))
{
@@ -2435,8 +2434,8 @@
ipmiStorageGetSDRRepositoryInfo(ipmi::Context::ptr ctx)
{
constexpr const uint16_t unspecifiedFreeSpace = 0xFFFF;
- uint16_t recordCount = ipmi::getNumberOfSensors() +
- ipmi::sensor::getOtherSensorsCount(ctx);
+ uint16_t recordCount =
+ ipmi::getNumberOfSensors() + ipmi::sensor::getOtherSensorsCount(ctx);
uint8_t operationSupport = static_cast<uint8_t>(
SdrRepositoryInfoOps::overflow); // write not supported
@@ -2535,8 +2534,8 @@
return ipmi::responseSuccess(nextRecordId, record);
}
- size_t sdrLength = sizeof(get_sdr::SensorDataRecordHeader) +
- hdr->record_length;
+ size_t sdrLength =
+ sizeof(get_sdr::SensorDataRecordHeader) + hdr->record_length;
if (offset >= sdrLength)
{
lg2::error("ipmiStorageGetSDR: offset is outside the record");
@@ -2831,8 +2830,8 @@
for (const auto& sensor : sensorList)
{
- const auto& [readResult, tempVal,
- signBit] = readTemp(ctx, sensor.objectPath);
+ const auto& [readResult, tempVal, signBit] =
+ readTemp(ctx, sensor.objectPath);
if (readResult)
{
@@ -2931,14 +2930,14 @@
ipmi::storage::cmdGetSdr, ipmi::Privilege::User,
ipmiStorageGetSDR);
// <Get DCMI Sensor Info>
- ipmi::registerGroupHandler(ipmi::prioOpenBmcBase, ipmi::groupDCMI,
- ipmi::dcmi::cmdGetDcmiSensorInfo,
- ipmi::Privilege::Operator,
- ipmi::dcmi::getSensorInfo);
+ ipmi::registerGroupHandler(
+ ipmi::prioOpenBmcBase, ipmi::groupDCMI,
+ ipmi::dcmi::cmdGetDcmiSensorInfo, ipmi::Privilege::Operator,
+ ipmi::dcmi::getSensorInfo);
// <Get Temperature Readings>
- ipmi::registerGroupHandler(ipmi::prioOpenBmcBase, ipmi::groupDCMI,
- ipmi::dcmi::cmdGetTemperatureReadings,
- ipmi::Privilege::User,
- ipmi::dcmi::getTempReadings);
+ ipmi::registerGroupHandler(
+ ipmi::prioOpenBmcBase, ipmi::groupDCMI,
+ ipmi::dcmi::cmdGetTemperatureReadings, ipmi::Privilege::User,
+ ipmi::dcmi::getTempReadings);
}
} // namespace ipmi
diff --git a/dbus-sdr/sensorutils.cpp b/dbus-sdr/sensorutils.cpp
index e76a5f1..8c6952b 100644
--- a/dbus-sdr/sensorutils.cpp
+++ b/dbus-sdr/sensorutils.cpp
@@ -240,9 +240,8 @@
// Step 4: Constrain B, and set bExp accordingly
if (!(scaleFloatExp(dB, bExp)))
{
- std::cerr << "getSensorAttributes: Offset (B=" << dB
- << ", bExp=" << (int)bExp
- << ") exceeds multiplier scale (M=" << dM
+ std::cerr << "getSensorAttributes: Offset (B=" << dB << ", bExp="
+ << (int)bExp << ") exceeds multiplier scale (M=" << dM
<< ", rExp=" << (int)rExp << ")\n";
return false;
}
@@ -312,8 +311,8 @@
int8_t bExp = 0;
bool bSigned = false;
- bool result = getSensorAttributes(max, min, mValue, rExp, bValue, bExp,
- bSigned);
+ bool result =
+ getSensorAttributes(max, min, mValue, rExp, bValue, bExp, bSigned);
if (!result)
{
throw std::runtime_error("Illegal sensor attributes");
diff --git a/dbus-sdr/storagecommands.cpp b/dbus-sdr/storagecommands.cpp
index afe3535..a93a045 100644
--- a/dbus-sdr/storagecommands.cpp
+++ b/dbus-sdr/storagecommands.cpp
@@ -236,8 +236,8 @@
recalculateHashes();
}
-std::pair<ipmi::Cc, std::vector<uint8_t>> getFru(ipmi::Context::ptr ctx,
- uint8_t devId)
+std::pair<ipmi::Cc, std::vector<uint8_t>>
+ getFru(ipmi::Context::ptr ctx, uint8_t devId)
{
if (lastDevId == devId && devId != 0xFF)
{
@@ -297,55 +297,57 @@
fruMatches.reserve(2);
auto bus = getSdBus();
- fruMatches.emplace_back(*bus,
- "type='signal',arg0path='/xyz/openbmc_project/"
- "FruDevice/',member='InterfacesAdded'",
- [](sdbusplus::message_t& message) {
- sdbusplus::message::object_path path;
- ObjectType object;
- try
- {
- message.read(path, object);
- }
- catch (const sdbusplus::exception_t&)
- {
- return;
- }
- auto findType = object.find("xyz.openbmc_project.FruDevice");
- if (findType == object.end())
- {
- return;
- }
- writeFruIfRunning();
- frus[path] = object;
- recalculateHashes();
- lastDevId = 0xFF;
- });
+ fruMatches.emplace_back(
+ *bus,
+ "type='signal',arg0path='/xyz/openbmc_project/"
+ "FruDevice/',member='InterfacesAdded'",
+ [](sdbusplus::message_t& message) {
+ sdbusplus::message::object_path path;
+ ObjectType object;
+ try
+ {
+ message.read(path, object);
+ }
+ catch (const sdbusplus::exception_t&)
+ {
+ return;
+ }
+ auto findType = object.find("xyz.openbmc_project.FruDevice");
+ if (findType == object.end())
+ {
+ return;
+ }
+ writeFruIfRunning();
+ frus[path] = object;
+ recalculateHashes();
+ lastDevId = 0xFF;
+ });
- fruMatches.emplace_back(*bus,
- "type='signal',arg0path='/xyz/openbmc_project/"
- "FruDevice/',member='InterfacesRemoved'",
- [](sdbusplus::message_t& message) {
- sdbusplus::message::object_path path;
- std::set<std::string> interfaces;
- try
- {
- message.read(path, interfaces);
- }
- catch (const sdbusplus::exception_t&)
- {
- return;
- }
- auto findType = interfaces.find("xyz.openbmc_project.FruDevice");
- if (findType == interfaces.end())
- {
- return;
- }
- writeFruIfRunning();
- frus.erase(path);
- recalculateHashes();
- lastDevId = 0xFF;
- });
+ fruMatches.emplace_back(
+ *bus,
+ "type='signal',arg0path='/xyz/openbmc_project/"
+ "FruDevice/',member='InterfacesRemoved'",
+ [](sdbusplus::message_t& message) {
+ sdbusplus::message::object_path path;
+ std::set<std::string> interfaces;
+ try
+ {
+ message.read(path, interfaces);
+ }
+ catch (const sdbusplus::exception_t&)
+ {
+ return;
+ }
+ auto findType = interfaces.find("xyz.openbmc_project.FruDevice");
+ if (findType == interfaces.end())
+ {
+ return;
+ }
+ writeFruIfRunning();
+ frus.erase(path);
+ recalculateHashes();
+ lastDevId = 0xFF;
+ });
// call once to populate
boost::asio::spawn(*getIoContext(), [](boost::asio::yield_context yield) {
@@ -410,10 +412,9 @@
* @returns ipmi completion code plus response data
* - countWritten - Count written
*/
-ipmi::RspType<uint8_t>
- ipmiStorageWriteFruData(ipmi::Context::ptr ctx, uint8_t fruDeviceId,
- uint16_t fruInventoryOffset,
- std::vector<uint8_t>& dataToWrite)
+ipmi::RspType<uint8_t> ipmiStorageWriteFruData(
+ ipmi::Context::ptr ctx, uint8_t fruDeviceId, uint16_t fruInventoryOffset,
+ std::vector<uint8_t>& dataToWrite)
{
if (fruDeviceId == 0xFF)
{
@@ -558,31 +559,33 @@
uint8_t& address = device->second.second;
boost::container::flat_map<std::string, Value>* fruData = nullptr;
- auto fru = std::find_if(frus.begin(), frus.end(),
- [bus, address, &fruData](ManagedEntry& entry) {
- auto findFruDevice = entry.second.find("xyz.openbmc_project.FruDevice");
- if (findFruDevice == entry.second.end())
- {
- return false;
- }
- fruData = &(findFruDevice->second);
- auto findBus = findFruDevice->second.find("BUS");
- auto findAddress = findFruDevice->second.find("ADDRESS");
- if (findBus == findFruDevice->second.end() ||
- findAddress == findFruDevice->second.end())
- {
- return false;
- }
- if (std::get<uint32_t>(findBus->second) != bus)
- {
- return false;
- }
- if (std::get<uint32_t>(findAddress->second) != address)
- {
- return false;
- }
- return true;
- });
+ auto fru = std::find_if(
+ frus.begin(), frus.end(),
+ [bus, address, &fruData](ManagedEntry& entry) {
+ auto findFruDevice =
+ entry.second.find("xyz.openbmc_project.FruDevice");
+ if (findFruDevice == entry.second.end())
+ {
+ return false;
+ }
+ fruData = &(findFruDevice->second);
+ auto findBus = findFruDevice->second.find("BUS");
+ auto findAddress = findFruDevice->second.find("ADDRESS");
+ if (findBus == findFruDevice->second.end() ||
+ findAddress == findFruDevice->second.end())
+ {
+ return false;
+ }
+ if (std::get<uint32_t>(findBus->second) != bus)
+ {
+ return false;
+ }
+ if (std::get<uint32_t>(findAddress->second) != address)
+ {
+ return false;
+ }
+ return true;
+ });
if (fru == frus.end())
{
return IPMI_CC_RESPONSE_ERROR;
@@ -610,49 +613,49 @@
return ipmi::ccResponseError;
}
- auto entity =
- std::find_if(entities.begin(), entities.end(),
- [bus, address, &entityData, &name](ManagedEntry& entry) {
- auto findFruDevice = entry.second.find(
- "xyz.openbmc_project.Inventory.Decorator.I2CDevice");
- if (findFruDevice == entry.second.end())
- {
- return false;
- }
+ auto entity = std::find_if(
+ entities.begin(), entities.end(),
+ [bus, address, &entityData, &name](ManagedEntry& entry) {
+ auto findFruDevice = entry.second.find(
+ "xyz.openbmc_project.Inventory.Decorator.I2CDevice");
+ if (findFruDevice == entry.second.end())
+ {
+ return false;
+ }
- // Integer fields added via Entity-Manager json are uint64_ts by
- // default.
- auto findBus = findFruDevice->second.find("Bus");
- auto findAddress = findFruDevice->second.find("Address");
+ // Integer fields added via Entity-Manager json are uint64_ts by
+ // default.
+ auto findBus = findFruDevice->second.find("Bus");
+ auto findAddress = findFruDevice->second.find("Address");
- if (findBus == findFruDevice->second.end() ||
- findAddress == findFruDevice->second.end())
- {
- return false;
- }
- if ((std::get<uint64_t>(findBus->second) != bus) ||
- (std::get<uint64_t>(findAddress->second) != address))
- {
- return false;
- }
+ if (findBus == findFruDevice->second.end() ||
+ findAddress == findFruDevice->second.end())
+ {
+ return false;
+ }
+ if ((std::get<uint64_t>(findBus->second) != bus) ||
+ (std::get<uint64_t>(findAddress->second) != address))
+ {
+ return false;
+ }
- auto fruName = findFruDevice->second.find("Name");
- if (fruName != findFruDevice->second.end())
- {
- name = std::get<std::string>(fruName->second);
- }
+ auto fruName = findFruDevice->second.find("Name");
+ if (fruName != findFruDevice->second.end())
+ {
+ name = std::get<std::string>(fruName->second);
+ }
- // At this point we found the device entry and should return
- // true.
- auto findIpmiDevice =
- entry.second.find("xyz.openbmc_project.Inventory.Decorator.Ipmi");
- if (findIpmiDevice != entry.second.end())
- {
- entityData = &(findIpmiDevice->second);
- }
+ // At this point we found the device entry and should return
+ // true.
+ auto findIpmiDevice = entry.second.find(
+ "xyz.openbmc_project.Inventory.Decorator.Ipmi");
+ if (findIpmiDevice != entry.second.end())
+ {
+ entityData = &(findIpmiDevice->second);
+ }
- return true;
- });
+ return true;
+ });
if (entity == entities.end())
{
@@ -747,8 +750,8 @@
dynamic_sensors::ipmi::sel::selLogFilename))
{
// If we find an ipmi_sel log file, save the path
- selLogFiles.emplace_back(dynamic_sensors::ipmi::sel::selLogDir /
- filename);
+ selLogFiles.emplace_back(
+ dynamic_sensors::ipmi::sel::selLogDir / filename);
}
}
// As the log files rotate, they are appended with a ".#" that is higher for
@@ -1139,10 +1142,9 @@
uint8_t eventType, uint8_t eventData1, uint8_t eventData2,
uint8_t eventData3
*/
-ipmi::RspType<uint16_t> ipmiStorageAddSELEntry(uint16_t, uint8_t, uint32_t,
- uint16_t, uint8_t, uint8_t,
- uint8_t, uint8_t, uint8_t,
- uint8_t, uint8_t)
+ipmi::RspType<uint16_t>
+ ipmiStorageAddSELEntry(uint16_t, uint8_t, uint32_t, uint16_t, uint8_t,
+ uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
{
// Per the IPMI spec, need to cancel any reservation when a SEL entry is
// added
@@ -1152,10 +1154,9 @@
return ipmi::responseSuccess(responseID);
}
-ipmi::RspType<uint8_t> ipmiStorageClearSEL(ipmi::Context::ptr ctx,
- uint16_t reservationID,
- const std::array<uint8_t, 3>& clr,
- uint8_t eraseOperation)
+ipmi::RspType<uint8_t> ipmiStorageClearSEL(
+ ipmi::Context::ptr ctx, uint16_t reservationID,
+ const std::array<uint8_t, 3>& clr, uint8_t eraseOperation)
{
if (!checkSELReservation(reservationID))
{
@@ -1198,9 +1199,8 @@
return ipmi::responseSuccess(ipmi::sel::eraseComplete);
}
-std::vector<uint8_t>
- getType8SDRs(ipmi::sensor::EntityInfoMap::const_iterator& entity,
- uint16_t recordId)
+std::vector<uint8_t> getType8SDRs(
+ ipmi::sensor::EntityInfoMap::const_iterator& entity, uint16_t recordId)
{
std::vector<uint8_t> resp;
get_sdr::SensorDataEntityRecord data{};
@@ -1252,8 +1252,8 @@
}
else
{
- throw std::runtime_error("getType12SDRs:: Illegal index " +
- std::to_string(index));
+ throw std::runtime_error(
+ "getType12SDRs:: Illegal index " + std::to_string(index));
}
return resp;
diff --git a/dcmihandler.cpp b/dcmihandler.cpp
index 77fe6c5..cfe8be2 100644
--- a/dcmihandler.cpp
+++ b/dcmihandler.cpp
@@ -107,8 +107,8 @@
std::optional<uint32_t> getPcap(ipmi::Context::ptr& ctx)
{
std::string service{};
- boost::system::error_code ec = ipmi::getService(ctx, pcapInterface,
- pcapPath, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, pcapInterface, pcapPath, service);
if (ec.value())
{
return std::nullopt;
@@ -128,8 +128,8 @@
std::optional<bool> getPcapEnabled(ipmi::Context::ptr& ctx)
{
std::string service{};
- boost::system::error_code ec = ipmi::getService(ctx, pcapInterface,
- pcapPath, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, pcapInterface, pcapPath, service);
if (ec.value())
{
return std::nullopt;
@@ -149,8 +149,8 @@
bool setPcap(ipmi::Context::ptr& ctx, const uint32_t powerCap)
{
std::string service{};
- boost::system::error_code ec = ipmi::getService(ctx, pcapInterface,
- pcapPath, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, pcapInterface, pcapPath, service);
if (ec.value())
{
return false;
@@ -170,8 +170,8 @@
bool setPcapEnable(ipmi::Context::ptr& ctx, bool enabled)
{
std::string service{};
- boost::system::error_code ec = ipmi::getService(ctx, pcapInterface,
- pcapPath, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, pcapInterface, pcapPath, service);
if (ec.value())
{
return false;
@@ -202,9 +202,9 @@
}
std::string assetTag{};
- ec = ipmi::getDbusProperty(ctx, objectInfo.second, objectInfo.first,
- dcmi::assetTagIntf, dcmi::assetTagProp,
- assetTag);
+ ec =
+ ipmi::getDbusProperty(ctx, objectInfo.second, objectInfo.first,
+ dcmi::assetTagIntf, dcmi::assetTagProp, assetTag);
if (ec.value())
{
lg2::error("Error in reading asset tag: {ERROR}", "ERROR",
@@ -228,9 +228,9 @@
return false;
}
- ec = ipmi::setDbusProperty(ctx, objectInfo.second, objectInfo.first,
- dcmi::assetTagIntf, dcmi::assetTagProp,
- assetTag);
+ ec =
+ ipmi::setDbusProperty(ctx, objectInfo.second, objectInfo.first,
+ dcmi::assetTagIntf, dcmi::assetTagProp, assetTag);
if (ec.value())
{
lg2::error("Error in writing asset tag: {ERROR}", "ERROR",
@@ -244,8 +244,8 @@
std::optional<std::string> getHostName(ipmi::Context::ptr& ctx)
{
std::string service{};
- boost::system::error_code ec = ipmi::getService(ctx, networkConfigIntf,
- networkConfigObj, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, networkConfigIntf, networkConfigObj, service);
if (ec.value())
{
return std::nullopt;
@@ -579,9 +579,9 @@
return ipmi::responseSuccess(nameSize, data);
}
-ipmi::RspType<uint8_t> setMgmntCtrlIdStr(ipmi::Context::ptr& ctx,
- uint8_t offset, uint8_t count,
- std::vector<char> data)
+ipmi::RspType<uint8_t>
+ setMgmntCtrlIdStr(ipmi::Context::ptr& ctx, uint8_t offset, uint8_t count,
+ std::vector<char> data)
{
if ((offset > dcmi::maxCtrlIdStrLen) || (count > dcmi::maxBytes) ||
((offset + count) > dcmi::maxCtrlIdStrLen))
@@ -689,8 +689,8 @@
data.value("FlushEntireSELUponRollOver", 0);
bool recordLevelSELFlushUponRollOver =
data.value("RecordLevelSELFlushUponRollOver", 0);
- uint12_t numberOfSELEntries = data.value("NumberOfSELEntries",
- 0xcac);
+ uint12_t numberOfSELEntries =
+ data.value("NumberOfSELEntries", 0xcac);
uint8_t tempMonitoringSamplingFreq =
data.value("TempMonitoringSamplingFreq", 0);
payload.pack(numberOfSELEntries, reserved1,
@@ -739,9 +739,9 @@
namespace temp_readings
{
-std::tuple<bool, bool, uint8_t> readTemp(ipmi::Context::ptr& ctx,
- const std::string& dbusService,
- const std::string& dbusPath)
+std::tuple<bool, bool, uint8_t>
+ readTemp(ipmi::Context::ptr& ctx, const std::string& dbusService,
+ const std::string& dbusPath)
{
// Read the temperature value from d-bus object. Need some conversion.
// As per the interface xyz.openbmc_project.Sensor.Value, the
@@ -756,8 +756,8 @@
{
return std::make_tuple(false, false, 0);
}
- auto temperature = std::visit(ipmi::VariantToDoubleVisitor(),
- result.at("Value"));
+ auto temperature =
+ std::visit(ipmi::VariantToDoubleVisitor(), result.at("Value"));
double absTemp = std::abs(temperature);
auto findFactor = result.find("Scale");
@@ -933,9 +933,8 @@
return ipmi::responseSuccess();
}
-ipmi::RspType<ipmi::message::Payload> getDCMIConfParams(ipmi::Context::ptr& ctx,
- uint8_t parameter,
- uint8_t setSelector)
+ipmi::RspType<ipmi::message::Payload> getDCMIConfParams(
+ ipmi::Context::ptr& ctx, uint8_t parameter, uint8_t setSelector)
{
if (setSelector)
{
@@ -1015,8 +1014,8 @@
// Return default value if failed to read from D-Bus object
std::string service{};
- boost::system::error_code ec = ipmi::getService(ctx, dcmi::sensorValueIntf,
- objectPath, service);
+ boost::system::error_code ec =
+ ipmi::getService(ctx, dcmi::sensorValueIntf, objectPath, service);
if (ec.value())
{
lg2::error("Failed to fetch service for D-Bus object, "
@@ -1106,10 +1105,9 @@
namespace sensor_info
{
-std::tuple<std::vector<uint16_t>, uint8_t> read(const std::string& type,
- uint8_t instance,
- const nlohmann::json& config,
- uint8_t count)
+std::tuple<std::vector<uint16_t>, uint8_t>
+ read(const std::string& type, uint8_t instance,
+ const nlohmann::json& config, uint8_t count)
{
std::vector<uint16_t> responses{};
diff --git a/globalhandler.cpp b/globalhandler.cpp
index 63767c7..c164a20 100644
--- a/globalhandler.cpp
+++ b/globalhandler.cpp
@@ -20,8 +20,8 @@
{
sdbusplus::bus_t bus{ipmid_get_sd_bus_connection()};
- auto bmcStateObj = ipmi::getDbusObject(bus, bmcStateIntf, bmcStateRoot,
- match);
+ auto bmcStateObj =
+ ipmi::getDbusObject(bus, bmcStateIntf, bmcStateRoot, match);
auto service = ipmi::getService(bus, bmcStateIntf, bmcStateObj.first);
diff --git a/host-interface.cpp b/host-interface.cpp
index 7aa36c6..bc01d65 100644
--- a/host-interface.cpp
+++ b/host-interface.cpp
@@ -51,10 +51,10 @@
lg2::debug("Pushing cmd on to queue, control host cmd: {CONTROL_HOST_CMD}",
"CONTROL_HOST_CMD", convertForMessage(command));
- auto cmd = std::make_tuple(ipmiCommand.at(command),
- std::bind(&Host::commandStatusHandler, this,
- std::placeholders::_1,
- std::placeholders::_2));
+ auto cmd = std::make_tuple(
+ ipmiCommand.at(command),
+ std::bind(&Host::commandStatusHandler, this, std::placeholders::_1,
+ std::placeholders::_2));
ipmid_send_cmd_to_host(std::move(cmd));
}
diff --git a/include/dbus-sdr/sdrutils.hpp b/include/dbus-sdr/sdrutils.hpp
index 69864f9..db462db 100644
--- a/include/dbus-sdr/sdrutils.hpp
+++ b/include/dbus-sdr/sdrutils.hpp
@@ -120,9 +120,8 @@
if ((numStreakRead == 0) && (numReadings != 0))
{
std::cerr << "IPMI sensor " << sensorName
- << ": Recovered reading, value=" << reading
- << " byte=" << raw
- << ", Reading counts good=" << numReadings
+ << ": Recovered reading, value=" << reading << " byte="
+ << raw << ", Reading counts good=" << numReadings
<< " miss=" << numMissings
<< ", Prior miss streak=" << numStreakMiss << "\n";
}
@@ -346,8 +345,8 @@
std::optional<std::map<std::string, std::vector<std::string>>>
getObjectInterfaces(const char* path);
-std::map<std::string, Value> getEntityManagerProperties(const char* path,
- const char* interface);
+std::map<std::string, Value>
+ getEntityManagerProperties(const char* path, const char* interface);
std::optional<std::unordered_set<std::string>>&
getIpmiDecoratorPaths(const std::optional<ipmi::Context::ptr>& ctx);
diff --git a/include/dbus-sdr/storagecommands.hpp b/include/dbus-sdr/storagecommands.hpp
index 2ae9291..21c7613 100644
--- a/include/dbus-sdr/storagecommands.hpp
+++ b/include/dbus-sdr/storagecommands.hpp
@@ -99,8 +99,8 @@
uint8_t pwrStateNotification, uint8_t capabilities,
uint8_t eid, uint8_t entityInst, uint8_t mfrDefined,
const std::string& sensorname) :
- targetAddress(address),
- channelNumber(chNumber), powerStateNotification(pwrStateNotification),
+ targetAddress(address), channelNumber(chNumber),
+ powerStateNotification(pwrStateNotification),
deviceCapabilities(capabilities), reserved{}, entityID(eid),
entityInstance(entityInst), oem(mfrDefined)
{
@@ -108,9 +108,9 @@
header.sdr_version = ipmiSdrVersion;
header.record_type = 0x12;
size_t nameLen = std::min(sensorname.size(), sizeof(name));
- header.record_length = sizeof(Type12Record) -
- sizeof(get_sdr::SensorDataRecordHeader) -
- sizeof(name) + nameLen;
+ header.record_length =
+ sizeof(Type12Record) - sizeof(get_sdr::SensorDataRecordHeader) -
+ sizeof(name) + nameLen;
typeLengthCode = 0xc0 | nameLen;
std::copy(sensorname.begin(), sensorname.begin() + nameLen, name);
}
@@ -128,9 +128,8 @@
ipmi_ret_t getFruSdrCount(ipmi::Context::ptr ctx, size_t& count);
-std::vector<uint8_t>
- getType8SDRs(ipmi::sensor::EntityInfoMap::const_iterator& entity,
- uint16_t recordId);
+std::vector<uint8_t> getType8SDRs(
+ ipmi::sensor::EntityInfoMap::const_iterator& entity, uint16_t recordId);
std::vector<uint8_t> getType12SDRs(uint16_t index, uint16_t recordId);
std::vector<uint8_t> getNMDiscoverySDR(uint16_t index, uint16_t recordId);
} // namespace storage
diff --git a/include/ipmid/message.hpp b/include/ipmid/message.hpp
index 64f7777..5264112 100644
--- a/include/ipmid/message.hpp
+++ b/include/ipmid/message.hpp
@@ -47,10 +47,9 @@
uint8_t lun, Cmd cmd, int channel, int userId, uint32_t sessionId,
Privilege priv, int rqSA, int hostIdx,
boost::asio::yield_context& yield) :
- bus(bus),
- netFn(netFn), lun(lun), cmd(cmd), channel(channel), userId(userId),
- sessionId(sessionId), priv(priv), rqSA(rqSA), hostIdx(hostIdx),
- yield(yield)
+ bus(bus), netFn(netFn), lun(lun), cmd(cmd), channel(channel),
+ userId(userId), sessionId(sessionId), priv(priv), rqSA(rqSA),
+ hostIdx(hostIdx), yield(yield)
{}
std::shared_ptr<sdbusplus::asio::connection> bus;
@@ -256,8 +255,8 @@
template <typename Arg, typename... Args>
int pack(Arg&& arg, Args&&... args)
{
- int packRet = details::PackSingle_t<Arg>::op(*this,
- std::forward<Arg>(arg));
+ int packRet =
+ details::PackSingle_t<Arg>::op(*this, std::forward<Arg>(arg));
if (packRet)
{
return packRet;
@@ -464,8 +463,8 @@
size_t priorIndex = rawIndex;
fixed_uint_t<details::bitStreamSize> priorBits = bitStream;
- int ret = std::apply([this](Types&... args) { return unpack(args...); },
- t);
+ int ret =
+ std::apply([this](Types&... args) { return unpack(args...); }, t);
if (ret)
{
bitCount = priorBitCount;
diff --git a/include/ipmid/message/pack.hpp b/include/ipmid/message/pack.hpp
index 00fcf46..5ca94b6 100644
--- a/include/ipmid/message/pack.hpp
+++ b/include/ipmid/message/pack.hpp
@@ -310,8 +310,8 @@
{
return std::visit(
[&p](const auto& arg) {
- return PackSingle<std::decay_t<decltype(arg)>>::op(p, arg);
- },
+ return PackSingle<std::decay_t<decltype(arg)>>::op(p, arg);
+ },
v);
}
};
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index 7b26b6f..aacfb18 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -147,14 +147,14 @@
inline Mutability operator|(Mutability lhs, Mutability rhs)
{
- return static_cast<Mutability>(static_cast<uint8_t>(lhs) |
- static_cast<uint8_t>(rhs));
+ return static_cast<Mutability>(
+ static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
}
inline Mutability operator&(Mutability lhs, Mutability rhs)
{
- return static_cast<Mutability>(static_cast<uint8_t>(lhs) &
- static_cast<uint8_t>(rhs));
+ return static_cast<Mutability>(
+ static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
}
struct Info
@@ -289,7 +289,7 @@
{
public:
using SecureStringBase::basic_string;
- SecureString(const SecureStringBase& other) : SecureStringBase(other){};
+ SecureString(const SecureStringBase& other) : SecureStringBase(other) {};
SecureString(SecureString&) = default;
SecureString(const SecureString&) = default;
SecureString(SecureString&&) = default;
@@ -308,7 +308,7 @@
{
public:
using SecureBufferBase::vector;
- SecureBuffer(const SecureBufferBase& other) : SecureBufferBase(other){};
+ SecureBuffer(const SecureBufferBase& other) : SecureBufferBase(other) {};
SecureBuffer(SecureBuffer&) = default;
SecureBuffer(const SecureBuffer&) = default;
SecureBuffer(SecureBuffer&&) = default;
diff --git a/include/ipmid/utils.hpp b/include/ipmid/utils.hpp
index dd1eaa0..f31a532 100644
--- a/include/ipmid/utils.hpp
+++ b/include/ipmid/utils.hpp
@@ -120,10 +120,9 @@
* @param[in] match - identifier for object.
* @return On success returns the object having objectpath and servicename.
*/
-DbusObjectInfo getDbusObject(sdbusplus::bus_t& bus,
- const std::string& interface,
- const std::string& subtreePath = ROOT,
- const std::string& match = {});
+DbusObjectInfo getDbusObject(
+ sdbusplus::bus_t& bus, const std::string& interface,
+ const std::string& subtreePath = ROOT, const std::string& match = {});
/** @brief Gets the value associated with the given object
* and the interface.
@@ -147,11 +146,10 @@
* @param[in] interface - Dbus interface.
* @return On success returns the map of name value pair.
*/
-PropertyMap
- getAllDbusProperties(sdbusplus::bus_t& bus, const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT);
+PropertyMap getAllDbusProperties(
+ sdbusplus::bus_t& bus, const std::string& service,
+ const std::string& objPath, const std::string& interface,
+ std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT);
/** @brief Gets all managed objects associated with the given object
* path and service.
@@ -185,10 +183,9 @@
* @param[in] match - Identifier for a path.
* @returns map of object path and service info.
*/
-ObjectTree getAllDbusObjects(sdbusplus::bus_t& bus,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match = {});
+ObjectTree getAllDbusObjects(
+ sdbusplus::bus_t& bus, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match = {});
/** @brief Deletes all the dbus objects from the given service root
which matches the object identifier.
@@ -224,9 +221,9 @@
* @return boost error code
*
*/
-boost::system::error_code getService(Context::ptr ctx, const std::string& intf,
- const std::string& path,
- std::string& service);
+boost::system::error_code
+ getService(Context::ptr ctx, const std::string& intf,
+ const std::string& path, std::string& service);
/** @brief Gets the dbus sub tree implementing the given interface.
* @param[in] ctx - ipmi::Context::ptr
@@ -237,10 +234,9 @@
* @param[out] objectTree - map of object path and service info.
* @return map of object path and service info.
*/
-boost::system::error_code getSubTree(Context::ptr ctx,
- const InterfaceList& interface,
- const std::string& subtreePath,
- int32_t depth, ObjectTree& objectTree);
+boost::system::error_code getSubTree(
+ Context::ptr ctx, const InterfaceList& interface,
+ const std::string& subtreePath, int32_t depth, ObjectTree& objectTree);
/** @brief Gets the D-Bus object info implementing the given interface
* from the given subtree.
@@ -251,16 +247,14 @@
* @param[out] D-Bus object with path and service name
* @return - boost error code object
*/
-boost::system::error_code getDbusObject(Context::ptr ctx,
- const std::string& interface,
- const std::string& subtreePath,
- const std::string& match,
- DbusObjectInfo& dbusObject);
+boost::system::error_code
+ getDbusObject(Context::ptr ctx, const std::string& interface,
+ const std::string& subtreePath, const std::string& match,
+ DbusObjectInfo& dbusObject);
// default for ROOT for subtreePath and std::string{} for match
-static inline boost::system::error_code
- getDbusObject(Context::ptr ctx, const std::string& interface,
- DbusObjectInfo& dbusObject)
+static inline boost::system::error_code getDbusObject(
+ Context::ptr ctx, const std::string& interface, DbusObjectInfo& dbusObject)
{
return getDbusObject(ctx, interface, ROOT, {}, dbusObject);
}
@@ -317,11 +311,9 @@
* @param[out] properties - map of name value pair.
* @return - boost error code object
*/
-boost::system::error_code getAllDbusProperties(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- PropertyMap& properties);
+boost::system::error_code getAllDbusProperties(
+ Context::ptr ctx, const std::string& service, const std::string& objPath,
+ const std::string& interface, PropertyMap& properties);
/** @brief Sets the property value of the given object.
* @param[in] ctx - ipmi::Context::ptr
@@ -346,11 +338,10 @@
* @param[out] objectree - map of object path and service info.
* @return - boost error code object
*/
-boost::system::error_code getAllDbusObjects(Context::ptr ctx,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match,
- ObjectTree& objectTree);
+boost::system::error_code
+ getAllDbusObjects(Context::ptr ctx, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match,
+ ObjectTree& objectTree);
// default std::string{} for match
static inline boost::system::error_code
@@ -368,10 +359,9 @@
* @param[in] interface - D-Bus interface.
* @param[in] match - Identifier for object.
*/
-boost::system::error_code deleteAllDbusObjects(Context::ptr ctx,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match = {})
+boost::system::error_code deleteAllDbusObjects(
+ Context::ptr ctx, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match = {})
__attribute__((deprecated));
/** @brief Gets all managed objects associated with the given object
@@ -382,10 +372,9 @@
* @param[out] objects - map of name value pair.
* @return - boost error code object
*/
-boost::system::error_code getManagedObjects(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- ObjectValueTree& objects);
+boost::system::error_code
+ getManagedObjects(Context::ptr ctx, const std::string& service,
+ const std::string& objPath, ObjectValueTree& objects);
/** @brief Gets the ancestor objects of the given object
which implements the given interface.
@@ -410,11 +399,9 @@
* @return - boost error code object
*/
-boost::system::error_code callDbusMethod(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- const std::string& method);
+boost::system::error_code callDbusMethod(
+ Context::ptr ctx, const std::string& service, const std::string& objPath,
+ const std::string& interface, const std::string& method);
/********* End co-routine yielding alternatives ***************/
diff --git a/ipmi_fru_info_area.cpp b/ipmi_fru_info_area.cpp
index 3cbfb09..ed02179 100644
--- a/ipmi_fru_info_area.cpp
+++ b/ipmi_fru_info_area.cpp
@@ -47,8 +47,8 @@
static constexpr auto secs_from_1970_1996 = 820454400;
static constexpr auto maxMfgDateValue = 0xFFFFFF; // 3 Byte length
static constexpr auto secs_per_min = 60;
-static constexpr auto secsToMaxMfgdate = secs_from_1970_1996 +
- secs_per_min * maxMfgDateValue;
+static constexpr auto secsToMaxMfgdate =
+ secs_from_1970_1996 + secs_per_min * maxMfgDateValue;
// Minimum size of resulting FRU blob.
// This is also the theoretical maximum size according to the spec:
@@ -118,8 +118,8 @@
padData(data);
// Set size of data info area
- data.at(areaSizeOffset) = (data.size() + checksumSize) /
- (recordUnitOfMeasurement);
+ data.at(areaSizeOffset) =
+ (data.size() + checksumSize) / (recordUnitOfMeasurement);
// Finally add area checksum
appendDataChecksum(data);
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index a34b581..1f3dfc1 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -297,8 +297,8 @@
return errorResponse(request, ccReqDataLenInvalid);
}
auto group = static_cast<Group>(bytes);
- message::Response::ptr response = executeIpmiCommandCommon(groupHandlerMap,
- group, request);
+ message::Response::ptr response =
+ executeIpmiCommandCommon(groupHandlerMap, group, request);
ipmi::message::Payload prefix;
prefix.pack(bytes);
response->prepend(prefix);
@@ -317,8 +317,8 @@
lg2::debug("unpack IANA {IANA}", "IANA", lg2::hex, iana);
- message::Response::ptr response = executeIpmiCommandCommon(oemHandlerMap,
- iana, request);
+ message::Response::ptr response =
+ executeIpmiCommandCommon(oemHandlerMap, iana, request);
ipmi::message::Payload prefix;
prefix.pack(bytes);
response->prepend(prefix);
@@ -366,27 +366,29 @@
conn.async_method_call(
[name](const boost::system::error_code ec,
const std::string& nameOwner) {
- if (ec)
- {
- lg2::error("Error getting dbus owner for {INTERFACE}", "INTERFACE",
- name);
- return;
- }
- // start after ipmiDbusChannelPrefix (after the '.')
- std::string chName = name.substr(std::strlen(ipmiDbusChannelMatch) + 1);
- try
- {
- uint8_t channel = getChannelByName(chName);
- uniqueNameToChannelNumber[nameOwner] = channel;
- lg2::info("New interface mapping: {INTERFACE} -> channel {CHANNEL}",
- "INTERFACE", name, "CHANNEL", channel);
- }
- catch (const std::exception& e)
- {
- lg2::info("Failed interface mapping, no such name: {INTERFACE}",
- "INTERFACE", name);
- }
- },
+ if (ec)
+ {
+ lg2::error("Error getting dbus owner for {INTERFACE}",
+ "INTERFACE", name);
+ return;
+ }
+ // start after ipmiDbusChannelPrefix (after the '.')
+ std::string chName =
+ name.substr(std::strlen(ipmiDbusChannelMatch) + 1);
+ try
+ {
+ uint8_t channel = getChannelByName(chName);
+ uniqueNameToChannelNumber[nameOwner] = channel;
+ lg2::info(
+ "New interface mapping: {INTERFACE} -> channel {CHANNEL}",
+ "INTERFACE", name, "CHANNEL", channel);
+ }
+ catch (const std::exception& e)
+ {
+ lg2::info("Failed interface mapping, no such name: {INTERFACE}",
+ "INTERFACE", name);
+ }
+ },
"org.freedesktop.DBus", "/", "org.freedesktop.DBus", "GetNameOwner",
name);
}
@@ -396,26 +398,26 @@
conn.async_method_call(
[&io, &conn](const boost::system::error_code ec,
std::vector<std::string> busNames) {
- if (ec)
- {
- lg2::error("Error getting dbus names: {ERROR}", "ERROR",
- ec.message());
- std::exit(EXIT_FAILURE);
- return;
- }
- // Try to make startup consistent
- std::sort(busNames.begin(), busNames.end());
-
- const std::string channelPrefix = std::string(ipmiDbusChannelMatch) +
- ".";
- for (const std::string& busName : busNames)
- {
- if (busName.find(channelPrefix) == 0)
+ if (ec)
{
- updateOwners(conn, busName);
+ lg2::error("Error getting dbus names: {ERROR}", "ERROR",
+ ec.message());
+ std::exit(EXIT_FAILURE);
+ return;
}
- }
- },
+ // Try to make startup consistent
+ std::sort(busNames.begin(), busNames.end());
+
+ const std::string channelPrefix =
+ std::string(ipmiDbusChannelMatch) + ".";
+ for (const std::string& busName : busNames)
+ {
+ if (busName.find(channelPrefix) == 0)
+ {
+ updateOwners(conn, busName);
+ }
+ }
+ },
"org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus",
"ListNames");
}
@@ -489,10 +491,10 @@
{
const auto dbusResponse =
[netFn, lun, cmd](Cc cc, const ipmi::SecureBuffer& data = {}) {
- constexpr uint8_t netFnResponse = 0x01;
- uint8_t retNetFn = netFn | netFnResponse;
- return std::make_tuple(retNetFn, lun, cmd, cc, data);
- };
+ constexpr uint8_t netFnResponse = 0x01;
+ uint8_t retNetFn = netFn | netFnResponse;
+ return std::make_tuple(retNetFn, lun, cmd, cc, data);
+ };
std::string sender = m.get_sender();
Privilege privilege = Privilege::None;
int rqSA = 0;
@@ -572,9 +574,9 @@
"SESSIONID", lg2::hex, sessionId, "PRIVILEGE",
static_cast<uint8_t>(privilege), "RQSA", lg2::hex, rqSA);
- auto ctx = std::make_shared<ipmi::Context>(getSdBus(), netFn, lun, cmd,
- channel, userId, sessionId,
- privilege, rqSA, hostIdx, yield);
+ auto ctx = std::make_shared<ipmi::Context>(
+ getSdBus(), netFn, lun, cmd, channel, userId, sessionId, privilege,
+ rqSA, hostIdx, yield);
auto request = std::make_shared<ipmi::message::Request>(
ctx, std::forward<ipmi::SecureBuffer>(data));
message::Response::ptr response = executeIpmiCommand(request);
@@ -762,8 +764,8 @@
{
// make a copy so the next two moves don't wreak havoc on the stack
sdbusplus::message_t b{m};
- boost::asio::spawn(*getIoContext(),
- [b = std::move(b)](boost::asio::yield_context yield) {
+ boost::asio::spawn(*getIoContext(), [b = std::move(b)](
+ boost::asio::yield_context yield) {
sdbusplus::message_t m{std::move(b)};
unsigned char seq = 0, netFn = 0, lun = 0, cmd = 0;
ipmi::SecureBuffer data;
@@ -869,8 +871,8 @@
int exitCode = 0;
// set up boost::asio signal handling
- std::function<SignalResponse(int)> stopAsioRunLoop =
- [&io, &exitCode](int signalNumber) {
+ std::function<SignalResponse(int)> stopAsioRunLoop = [&io, &exitCode](
+ int signalNumber) {
lg2::info("Received signal {SIGNAL}; quitting", "SIGNAL", signalNumber);
io->stop();
exitCode = signalNumber;
diff --git a/ipmisensor.cpp b/ipmisensor.cpp
index ee9be19..55e4914 100644
--- a/ipmisensor.cpp
+++ b/ipmisensor.cpp
@@ -50,33 +50,34 @@
char text[64];
};
-event_data_t g_fwprogress02h[] = {{0x00, "Unspecified"},
- {0x01, "Memory Init"},
- {0x02, "HD Init"},
- {0x03, "Secondary Proc Init"},
- {0x04, "User Authentication"},
- {0x05, "User init system setup"},
- {0x06, "USB configuration"},
- {0x07, "PCI configuration"},
- {0x08, "Option ROM Init"},
- {0x09, "Video Init"},
- {0x0A, "Cache Init"},
- {0x0B, "SM Bus init"},
- {0x0C, "Keyboard Init"},
- {0x0D, "Embedded ctrl init"},
- {0x0E, "Docking station attachment"},
- {0x0F, "Enable docking station"},
- {0x10, "Docking station ejection"},
- {0x11, "Disabling docking station"},
- {0x12, "Calling OS Wakeup"},
- {0x13, "Starting OS"},
- {0x14, "Baseboard Init"},
- {0x15, ""},
- {0x16, "Floppy Init"},
- {0x17, "Keyboard Test"},
- {0x18, "Pointing Device Test"},
- {0x19, "Primary Proc Init"},
- {0xFF, "Unknown"}};
+event_data_t g_fwprogress02h[] = {
+ {0x00, "Unspecified"},
+ {0x01, "Memory Init"},
+ {0x02, "HD Init"},
+ {0x03, "Secondary Proc Init"},
+ {0x04, "User Authentication"},
+ {0x05, "User init system setup"},
+ {0x06, "USB configuration"},
+ {0x07, "PCI configuration"},
+ {0x08, "Option ROM Init"},
+ {0x09, "Video Init"},
+ {0x0A, "Cache Init"},
+ {0x0B, "SM Bus init"},
+ {0x0C, "Keyboard Init"},
+ {0x0D, "Embedded ctrl init"},
+ {0x0E, "Docking station attachment"},
+ {0x0F, "Enable docking station"},
+ {0x10, "Docking station ejection"},
+ {0x11, "Disabling docking station"},
+ {0x12, "Calling OS Wakeup"},
+ {0x13, "Starting OS"},
+ {0x14, "Baseboard Init"},
+ {0x15, ""},
+ {0x16, "Floppy Init"},
+ {0x17, "Keyboard Test"},
+ {0x18, "Pointing Device Test"},
+ {0x19, "Primary Proc Init"},
+ {0xFF, "Unknown"}};
event_data_t g_fwprogress00h[] = {
{0x00, "Unspecified."},
diff --git a/libipmid/signals.cpp b/libipmid/signals.cpp
index 757103a..4ac5685 100644
--- a/libipmid/signals.cpp
+++ b/libipmid/signals.cpp
@@ -101,8 +101,8 @@
if (!signals[signalNumber])
{
std::shared_ptr<boost::asio::io_context> io = getIoContext();
- signals[signalNumber] = std::make_unique<SignalHandler>(io,
- signalNumber);
+ signals[signalNumber] =
+ std::make_unique<SignalHandler>(io, signalNumber);
}
signals[signalNumber]->registerHandler(priority, handler);
}
diff --git a/libipmid/utils.cpp b/libipmid/utils.cpp
index 81cc4c4..fb96ea6 100644
--- a/libipmid/utils.cpp
+++ b/libipmid/utils.cpp
@@ -39,10 +39,9 @@
// Currently mapper doesn't give the readable busname(gives busid) so we can't
// use busname to find the object,will do later once the support is there.
-DbusObjectInfo getDbusObject(sdbusplus::bus_t& bus,
- const std::string& interface,
- const std::string& serviceRoot,
- const std::string& match)
+DbusObjectInfo
+ getDbusObject(sdbusplus::bus_t& bus, const std::string& interface,
+ const std::string& serviceRoot, const std::string& match)
{
std::vector<DbusInterface> interfaces;
interfaces.emplace_back(interface);
@@ -67,10 +66,10 @@
}
// else search the match string in the object path
- auto found = std::find_if(objectTree.begin(), objectTree.end(),
- [&match](const auto& object) {
- return (object.first.find(match) != std::string::npos);
- });
+ auto found = std::find_if(
+ objectTree.begin(), objectTree.end(), [&match](const auto& object) {
+ return (object.first.find(match) != std::string::npos);
+ });
if (found == objectTree.end())
{
@@ -101,11 +100,10 @@
return value;
}
-PropertyMap getAllDbusProperties(sdbusplus::bus_t& bus,
- const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- std::chrono::microseconds timeout)
+PropertyMap getAllDbusProperties(
+ sdbusplus::bus_t& bus, const std::string& service,
+ const std::string& objPath, const std::string& interface,
+ std::chrono::microseconds timeout)
{
PropertyMap properties;
@@ -181,9 +179,8 @@
cachedService = std::nullopt;
}
-sdbusplus::message_t ServiceCache::newMethodCall(sdbusplus::bus_t& bus,
- const char* intf,
- const char* method)
+sdbusplus::message_t ServiceCache::newMethodCall(
+ sdbusplus::bus_t& bus, const char* intf, const char* method)
{
return bus.new_method_call(getService(bus).c_str(), path.c_str(), intf,
method);
@@ -197,10 +194,10 @@
std::string getService(sdbusplus::bus_t& bus, const std::string& intf,
const std::string& path)
{
- auto mapperCall = bus.new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetObject");
+ auto mapperCall =
+ bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetObject");
mapperCall.append(path);
mapperCall.append(std::vector<std::string>({intf}));
@@ -233,10 +230,9 @@
return objectTree;
}
-ipmi::ObjectTree getAllDbusObjects(sdbusplus::bus_t& bus,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match)
+ipmi::ObjectTree
+ getAllDbusObjects(sdbusplus::bus_t& bus, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match)
{
std::vector<std::string> interfaces;
interfaces.emplace_back(interface);
@@ -331,9 +327,9 @@
/********* Begin co-routine yielding alternatives ***************/
-boost::system::error_code getService(Context::ptr ctx, const std::string& intf,
- const std::string& path,
- std::string& service)
+boost::system::error_code
+ getService(Context::ptr ctx, const std::string& intf,
+ const std::string& path, std::string& service)
{
boost::system::error_code ec;
std::map<std::string, std::vector<std::string>> mapperResponse =
@@ -350,10 +346,9 @@
return ec;
}
-boost::system::error_code getSubTree(Context::ptr ctx,
- const InterfaceList& interfaces,
- const std::string& subtreePath,
- int32_t depth, ObjectTree& objectTree)
+boost::system::error_code getSubTree(
+ Context::ptr ctx, const InterfaceList& interfaces,
+ const std::string& subtreePath, int32_t depth, ObjectTree& objectTree)
{
boost::system::error_code ec;
objectTree = ctx->bus->yield_method_call<ObjectTree>(
@@ -363,19 +358,18 @@
return ec;
}
-boost::system::error_code getDbusObject(Context::ptr ctx,
- const std::string& interface,
- const std::string& subtreePath,
- const std::string& match,
- DbusObjectInfo& dbusObject)
+boost::system::error_code
+ getDbusObject(Context::ptr ctx, const std::string& interface,
+ const std::string& subtreePath, const std::string& match,
+ DbusObjectInfo& dbusObject)
{
std::vector<DbusInterface> interfaces;
interfaces.emplace_back(interface);
auto depth = 0;
ObjectTree objectTree;
- boost::system::error_code ec = getSubTree(ctx, interfaces, subtreePath,
- depth, objectTree);
+ boost::system::error_code ec =
+ getSubTree(ctx, interfaces, subtreePath, depth, objectTree);
if (ec)
{
@@ -402,10 +396,10 @@
}
// else search the match string in the object path
- auto found = std::find_if(objectTree.begin(), objectTree.end(),
- [&match](const auto& object) {
- return (object.first.find(match) != std::string::npos);
- });
+ auto found = std::find_if(
+ objectTree.begin(), objectTree.end(), [&match](const auto& object) {
+ return (object.first.find(match) != std::string::npos);
+ });
if (found == objectTree.end())
{
@@ -423,11 +417,9 @@
return ec;
}
-boost::system::error_code getAllDbusProperties(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- PropertyMap& properties)
+boost::system::error_code getAllDbusProperties(
+ Context::ptr ctx, const std::string& service, const std::string& objPath,
+ const std::string& interface, PropertyMap& properties)
{
boost::system::error_code ec;
properties = ctx->bus->yield_method_call<PropertyMap>(
@@ -448,18 +440,17 @@
return ec;
}
-boost::system::error_code getAllDbusObjects(Context::ptr ctx,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match,
- ObjectTree& objectTree)
+boost::system::error_code
+ getAllDbusObjects(Context::ptr ctx, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match,
+ ObjectTree& objectTree)
{
std::vector<std::string> interfaces;
interfaces.emplace_back(interface);
auto depth = 0;
- boost::system::error_code ec = getSubTree(ctx, interfaces, serviceRoot,
- depth, objectTree);
+ boost::system::error_code ec =
+ getSubTree(ctx, interfaces, serviceRoot, depth, objectTree);
if (ec)
{
return ec;
@@ -480,10 +471,9 @@
return ec;
}
-boost::system::error_code deleteAllDbusObjects(Context::ptr ctx,
- const std::string& serviceRoot,
- const std::string& interface,
- const std::string& match)
+boost::system::error_code
+ deleteAllDbusObjects(Context::ptr ctx, const std::string& serviceRoot,
+ const std::string& interface, const std::string& match)
{
ObjectTree objectTree;
boost::system::error_code ec =
@@ -512,10 +502,9 @@
return ec;
}
-boost::system::error_code getManagedObjects(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- ObjectValueTree& objects)
+boost::system::error_code
+ getManagedObjects(Context::ptr ctx, const std::string& service,
+ const std::string& objPath, ObjectValueTree& objects)
{
boost::system::error_code ec;
objects = ctx->bus->yield_method_call<ipmi::ObjectValueTree>(
@@ -524,10 +513,9 @@
return ec;
}
-boost::system::error_code getAllAncestors(Context::ptr ctx,
- const std::string& path,
- const InterfaceList& interfaces,
- ObjectTree& objectTree)
+boost::system::error_code
+ getAllAncestors(Context::ptr ctx, const std::string& path,
+ const InterfaceList& interfaces, ObjectTree& objectTree)
{
std::string interfaceList = convertToString(interfaces);
@@ -552,11 +540,9 @@
return ec;
}
-boost::system::error_code callDbusMethod(Context::ptr ctx,
- const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- const std::string& method)
+boost::system::error_code callDbusMethod(
+ Context::ptr ctx, const std::string& service, const std::string& objPath,
+ const std::string& interface, const std::string& method)
{
boost::system::error_code ec;
ctx->bus->yield_method_call(ctx->yield, ec, service, objPath, interface,
diff --git a/read_fru_data.cpp b/read_fru_data.cpp
index ec1b181..9e5fd59 100644
--- a/read_fru_data.cpp
+++ b/read_fru_data.cpp
@@ -144,8 +144,8 @@
{
for (auto& intf : instance.interfaces)
{
- ipmi::PropertyMap allProp = readAllProperties(intf.first,
- instance.path);
+ ipmi::PropertyMap allProp =
+ readAllProperties(intf.first, instance.path);
for (auto& properties : intf.second)
{
auto iter = allProp.find(properties.first);
diff --git a/selutility.cpp b/selutility.cpp
index f868708..4daebb1 100644
--- a/selutility.cpp
+++ b/selutility.cpp
@@ -296,8 +296,8 @@
// Evaluate if the event is assertion or deassertion event
if (std::get<bool>(iterResolved->second))
{
- record.event.eventRecord.eventType = deassertEvent |
- iter->second.eventReadingType;
+ record.event.eventRecord.eventType =
+ deassertEvent | iter->second.eventReadingType;
}
else
{
@@ -322,8 +322,8 @@
try
{
auto service = ipmi::getService(bus, assocIntf, objPath);
- auto propValue = ipmi::getDbusProperty(bus, service, objPath, assocIntf,
- assocProp);
+ auto propValue =
+ ipmi::getDbusProperty(bus, service, objPath, assocIntf, assocProp);
assocs = std::get<std::vector<ipmi::Association>>(propValue);
}
catch (const std::exception& e)
@@ -417,14 +417,14 @@
std::sort(paths.begin(), paths.end(),
[](const std::string& a, const std::string& b) {
- namespace fs = std::filesystem;
- fs::path pathA(a);
- fs::path pathB(b);
- auto idA = std::stoul(pathA.filename().string());
- auto idB = std::stoul(pathB.filename().string());
+ namespace fs = std::filesystem;
+ fs::path pathA(a);
+ fs::path pathB(b);
+ auto idA = std::stoul(pathA.filename().string());
+ auto idB = std::stoul(pathB.filename().string());
- return idA < idB;
- });
+ return idA < idB;
+ });
}
} // namespace sel
diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp
index 45e3835..3505dfb 100644
--- a/sensordatahandler.cpp
+++ b/sensordatahandler.cpp
@@ -199,9 +199,9 @@
ipmi_ret_t eventdata(const SetSensorReadingReq&, const Info& sensorInfo,
uint8_t data)
{
- auto msg = makeDbusMsg("org.freedesktop.DBus.Properties",
- sensorInfo.sensorPath, "Set",
- sensorInfo.sensorInterface);
+ auto msg =
+ makeDbusMsg("org.freedesktop.DBus.Properties", sensorInfo.sensorPath,
+ "Set", sensorInfo.sensorInterface);
const auto& interface = sensorInfo.propertyInterfaces.begin();
msg.append(interface->first);
diff --git a/sensordatahandler.hpp b/sensordatahandler.hpp
index f111df1..1cedda5 100644
--- a/sensordatahandler.hpp
+++ b/sensordatahandler.hpp
@@ -243,8 +243,8 @@
double value = std::get<T>(propValue) *
std::pow(10, sensorInfo.scale - sensorInfo.exponentR);
- int32_t rawData = (value - sensorInfo.scaledOffset) /
- sensorInfo.coefficientM;
+ int32_t rawData =
+ (value - sensorInfo.scaledOffset) / sensorInfo.coefficientM;
constexpr uint8_t sensorUnitsSignedBits = 2 << 6;
constexpr uint8_t signedDataFormat = 0x80;
@@ -365,9 +365,8 @@
* @return Response for get sensor reading command.
*/
template <typename T>
-std::optional<GetSensorResponse> readingAssertion(uint8_t id,
- const Info& sensorInfo,
- const PropertyMap& properties)
+std::optional<GetSensorResponse> readingAssertion(
+ uint8_t id, const Info& sensorInfo, const PropertyMap& properties)
{
GetSensorResponse response{};
enableScanning(&response);
@@ -436,8 +435,8 @@
double value = std::get<T>(iter->second) *
std::pow(10, sensorInfo.scale - sensorInfo.exponentR);
- int32_t rawData = (value - sensorInfo.scaledOffset) /
- sensorInfo.coefficientM;
+ int32_t rawData =
+ (value - sensorInfo.scaledOffset) / sensorInfo.coefficientM;
constexpr uint8_t sensorUnitsSignedBits = 2 << 6;
constexpr uint8_t signedDataFormat = 0x80;
@@ -514,17 +513,17 @@
ipmi_ret_t readingAssertion(const SetSensorReadingReq& cmdData,
const Info& sensorInfo)
{
- auto msg = makeDbusMsg("org.freedesktop.DBus.Properties",
- sensorInfo.sensorPath, "Set",
- sensorInfo.sensorInterface);
+ auto msg =
+ makeDbusMsg("org.freedesktop.DBus.Properties", sensorInfo.sensorPath,
+ "Set", sensorInfo.sensorInterface);
const auto& interface = sensorInfo.propertyInterfaces.begin();
msg.append(interface->first);
for (const auto& property : interface->second)
{
msg.append(property.first);
- std::variant<T> value = static_cast<T>((cmdData.assertOffset8_14 << 8) |
- cmdData.assertOffset0_7);
+ std::variant<T> value = static_cast<T>(
+ (cmdData.assertOffset8_14 << 8) | cmdData.assertOffset0_7);
msg.append(value);
}
return updateToDbus(msg);
@@ -544,9 +543,9 @@
raw_value *= std::pow(10, sensorInfo.exponentR - sensorInfo.scale);
- auto msg = makeDbusMsg("org.freedesktop.DBus.Properties",
- sensorInfo.sensorPath, "Set",
- sensorInfo.sensorInterface);
+ auto msg =
+ makeDbusMsg("org.freedesktop.DBus.Properties", sensorInfo.sensorPath,
+ "Set", sensorInfo.sensorInterface);
const auto& interface = sensorInfo.propertyInterfaces.begin();
msg.append(interface->first);
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 7cbd2f8..dc0d85c 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -159,59 +159,60 @@
std::make_unique<sdbusplus::bus::match_t>(
bus, interfacesRemoved() + argNpath(0, s.second.sensorPath),
[id = s.first](auto& /*msg*/) {
- // Ideally this should work.
- // But when a service is terminated or crashed, it does not
- // emit interfacesRemoved signal. In that case it's handled
- // by sensorsOwnerMatch
- sensorCacheMap[id].reset();
- }));
+ // Ideally this should work.
+ // But when a service is terminated or crashed, it does not
+ // emit interfacesRemoved signal. In that case it's handled
+ // by sensorsOwnerMatch
+ sensorCacheMap[id].reset();
+ }));
sensorUpdatedMatches.emplace(
- s.first, std::make_unique<sdbusplus::bus::match_t>(
- bus,
- type::signal() + path(s.second.sensorPath) +
- member("PropertiesChanged"s) +
- interface("org.freedesktop.DBus.Properties"s),
- [&s](auto& msg) {
- fillSensorIdServiceMap(s.second.sensorPath,
- s.second.propertyInterfaces.begin()->first,
- s.first);
- try
- {
- // This is signal callback
- std::string interfaceName;
- msg.read(interfaceName);
- ipmi::PropertyMap props;
- msg.read(props);
- s.second.getFunc(s.first, s.second, props);
- }
- catch (const std::exception& e)
- {
- sensorCacheMap[s.first].reset();
- }
- }));
+ s.first,
+ std::make_unique<sdbusplus::bus::match_t>(
+ bus,
+ type::signal() + path(s.second.sensorPath) +
+ member("PropertiesChanged"s) +
+ interface("org.freedesktop.DBus.Properties"s),
+ [&s](auto& msg) {
+ fillSensorIdServiceMap(
+ s.second.sensorPath,
+ s.second.propertyInterfaces.begin()->first, s.first);
+ try
+ {
+ // This is signal callback
+ std::string interfaceName;
+ msg.read(interfaceName);
+ ipmi::PropertyMap props;
+ msg.read(props);
+ s.second.getFunc(s.first, s.second, props);
+ }
+ catch (const std::exception& e)
+ {
+ sensorCacheMap[s.first].reset();
+ }
+ }));
}
sensorsOwnerMatch = std::make_unique<sdbusplus::bus::match_t>(
bus, nameOwnerChanged(), [](auto& msg) {
- std::string name;
- std::string oldOwner;
- std::string newOwner;
- msg.read(name, oldOwner, newOwner);
+ std::string name;
+ std::string oldOwner;
+ std::string newOwner;
+ msg.read(name, oldOwner, newOwner);
- if (!name.empty() && newOwner.empty())
- {
- // The service exits
- const auto it = serviceToIdMap.find(name);
- if (it == serviceToIdMap.end())
+ if (!name.empty() && newOwner.empty())
{
- return;
+ // The service exits
+ const auto it = serviceToIdMap.find(name);
+ if (it == serviceToIdMap.end())
+ {
+ return;
+ }
+ for (const auto& id : it->second)
+ {
+ // Invalidate cache
+ sensorCacheMap[id].reset();
+ }
}
- for (const auto& id : it->second)
- {
- // Invalidate cache
- sensorCacheMap[id].reset();
- }
- }
- });
+ });
}
#endif
@@ -233,8 +234,8 @@
try
{
sdbusplus::bus_t bus{ipmid_get_sd_bus_connection()};
- serviceName = ipmi::getService(bus, info.sensorInterface,
- info.sensorPath);
+ serviceName =
+ ipmi::getService(bus, info.sensorInterface, info.sensorPath);
}
catch (const sdbusplus::exception_t&)
{
@@ -470,13 +471,11 @@
@return completion code on success.
**/
-ipmi::RspType<> ipmiSetSensorReading(uint8_t sensorNumber, uint8_t operation,
- uint8_t reading, uint8_t assertOffset0_7,
- uint8_t assertOffset8_14,
- uint8_t deassertOffset0_7,
- uint8_t deassertOffset8_14,
- uint8_t eventData1, uint8_t eventData2,
- uint8_t eventData3)
+ipmi::RspType<> ipmiSetSensorReading(
+ uint8_t sensorNumber, uint8_t operation, uint8_t reading,
+ uint8_t assertOffset0_7, uint8_t assertOffset8_14,
+ uint8_t deassertOffset0_7, uint8_t deassertOffset8_14, uint8_t eventData1,
+ uint8_t eventData2, uint8_t eventData3)
{
lg2::debug("IPMI SET_SENSOR, sensorNumber: {SENSOR_NUM}", "SENSOR_NUM",
lg2::hex, sensorNumber);
@@ -612,10 +611,10 @@
constexpr uint8_t assertionStatesLsb = 0;
constexpr uint8_t assertionStatesMsb = 0;
- return ipmi::responseSuccess(senReading, reserved, readState,
- senScanState, allEventMessageState,
- assertionStatesLsb,
- assertionStatesMsb);
+ return ipmi::responseSuccess(
+ senReading, reserved, readState, senScanState,
+ allEventMessageState, assertionStatesLsb,
+ assertionStatesMsb);
}
sensorInfo.getFunc(sensorNum, sensorInfo, props);
}
@@ -631,12 +630,12 @@
ipmi::sensor::GetSensorResponse getResponse =
iter->second.getFunc(iter->second);
- return ipmi::responseSuccess(getResponse.reading, uint5_t(0),
- getResponse.readingOrStateUnavailable,
- getResponse.scanningEnabled,
- getResponse.allEventMessagesEnabled,
- getResponse.thresholdLevelsStates,
- getResponse.discreteReadingSensorStates);
+ return ipmi::responseSuccess(
+ getResponse.reading, uint5_t(0),
+ getResponse.readingOrStateUnavailable, getResponse.scanningEnabled,
+ getResponse.allEventMessagesEnabled,
+ getResponse.thresholdLevelsStates,
+ getResponse.discreteReadingSensorStates);
#endif
}
#ifdef UPDATE_FUNCTIONAL_ON_FAIL
@@ -815,10 +814,10 @@
const auto& resp = sensorThresholdMap[sensorNum];
- return ipmi::responseSuccess(resp.validMask, resp.lowerNonCritical,
- resp.lowerCritical, resp.lowerNonRecoverable,
- resp.upperNonCritical, resp.upperCritical,
- resp.upperNonRecoverable);
+ return ipmi::responseSuccess(
+ resp.validMask, resp.lowerNonCritical, resp.lowerCritical,
+ resp.lowerNonRecoverable, resp.upperNonCritical, resp.upperCritical,
+ resp.upperNonRecoverable);
}
/** @brief implements the Set Sensor threshold command
@@ -1179,10 +1178,10 @@
const auto& entityRecords =
ipmi::sensor::EntityInfoMapContainer::getContainer()
->getIpmiEntityRecords();
- auto next_record_id = (entityRecords.size())
- ? entityRecords.begin()->first +
- ENTITY_RECORD_ID_START
- : END_OF_RECORD;
+ auto next_record_id =
+ (entityRecords.size())
+ ? entityRecords.begin()->first + ENTITY_RECORD_ID_START
+ : END_OF_RECORD;
get_sdr::response::set_next_record_id(next_record_id, resp);
}
else
@@ -1463,8 +1462,8 @@
std::vector<uint8_t> eventData(req->data, req->data + count);
sdbusplus::bus_t dbus(bus);
- std::string service = ipmi::getService(dbus, ipmiSELAddInterface,
- ipmiSELPath);
+ std::string service =
+ ipmi::getService(dbus, ipmiSELAddInterface, ipmiSELPath);
sdbusplus::message_t writeSEL = dbus.new_method_call(
service.c_str(), ipmiSELPath, ipmiSELAddInterface, "IpmiSelAdd");
writeSEL.append(ipmiSELAddMessage, sensorPath, eventData, assert,
diff --git a/settings.cpp b/settings.cpp
index 3acb888..4564fa4 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -52,8 +52,8 @@
Service Objects::service(const Path& path, const Interface& interface) const
{
using Interfaces = std::vector<Interface>;
- auto mapperCall = bus.new_method_call(mapperService, mapperPath, mapperIntf,
- "GetObject");
+ auto mapperCall =
+ bus.new_method_call(mapperService, mapperPath, mapperIntf, "GetObject");
mapperCall.append(path);
mapperCall.append(Interfaces({interface}));
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index c8580b5..96695b9 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -31,8 +31,8 @@
void SoftPowerOff::sendHostShutDownCmd()
{
- auto ctrlHostPath = std::string{CONTROL_HOST_OBJ_MGR} + '/' + HOST_NAME +
- '0';
+ auto ctrlHostPath =
+ std::string{CONTROL_HOST_OBJ_MGR} + '/' + HOST_NAME + '0';
auto host = ::ipmi::getService(this->bus, CONTROL_HOST_BUSNAME,
ctrlHostPath.c_str());
diff --git a/storagehandler.cpp b/storagehandler.cpp
index f90de63..954ec7b 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -380,8 +380,8 @@
}
auto diff = ipmi::sel::selRecordSize - requestData->offset;
- auto readLength = std::min(diff,
- static_cast<int>(requestData->readLength));
+ auto readLength =
+ std::min(diff, static_cast<int>(requestData->readLength));
std::memcpy(response, &record.nextRecordID,
sizeof(record.nextRecordID));
@@ -526,9 +526,9 @@
sdbusplus::bus_t bus{ipmid_get_sd_bus_connection()};
auto service = ipmi::getService(bus, ipmi::sel::logIntf, ipmi::sel::logObj);
- auto method = bus.new_method_call(service.c_str(), ipmi::sel::logObj,
- ipmi::sel::logIntf,
- ipmi::sel::logDeleteAllMethod);
+ auto method =
+ bus.new_method_call(service.c_str(), ipmi::sel::logObj,
+ ipmi::sel::logIntf, ipmi::sel::logDeleteAllMethod);
try
{
bus.call_noreply(method);
@@ -703,11 +703,11 @@
bool assert = (eventDir & 0x80) ? false : true;
- recordID = report<SELCreated>(Created::RECORD_TYPE(recordType),
- Created::GENERATOR_ID(generatorID),
- Created::SENSOR_DATA(selDataStr.c_str()),
- Created::EVENT_DIR(assert),
- Created::SENSOR_PATH(objpath.c_str()));
+ recordID = report<SELCreated>(
+ Created::RECORD_TYPE(recordType),
+ Created::GENERATOR_ID(generatorID),
+ Created::SENSOR_DATA(selDataStr.c_str()),
+ Created::EVENT_DIR(assert), Created::SENSOR_PATH(objpath.c_str()));
}
#ifdef OPEN_POWER_SUPPORT
else if (recordType == procedureType)
@@ -726,8 +726,8 @@
using namespace ipmi::fru;
std::string service;
- boost::system::error_code ec = getService(ctx, invItemInterface,
- invObjPath + fruPath, service);
+ boost::system::error_code ec =
+ getService(ctx, invItemInterface, invObjPath + fruPath, service);
if (!ec)
{
bool result;
@@ -866,8 +866,8 @@
const auto& entityRecords =
ipmi::sensor::EntityInfoMapContainer::getContainer()
->getIpmiEntityRecords();
- uint16_t records = ipmi::sensor::sensors.size() + frus.size() +
- entityRecords.size();
+ uint16_t records =
+ ipmi::sensor::sensors.size() + frus.size() + entityRecords.size();
return ipmi::responseSuccess(sdrVersion, records, freeSpace,
additionTimestamp, deletionTimestamp,
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index 39ed323..7768030 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -181,8 +181,8 @@
objManager = std::make_unique<sdbusplus::server::manager_t>(
*sdbusp, CONTROL_HOST_OBJ_MGR);
- host = std::make_unique<phosphor::host::command::Host>(*sdbusp,
- objPath.c_str());
+ host = std::make_unique<phosphor::host::command::Host>(
+ *sdbusp, objPath.c_str());
sdbusp->request_name(CONTROL_HOST_BUSNAME);
return;
diff --git a/test/dbus-sdr/sensorcommands_unittest.cpp b/test/dbus-sdr/sensorcommands_unittest.cpp
index 6cdcd2b..bcd2f44 100644
--- a/test/dbus-sdr/sensorcommands_unittest.cpp
+++ b/test/dbus-sdr/sensorcommands_unittest.cpp
@@ -67,8 +67,8 @@
if (bSigned)
{
int8_t expect = x;
- int8_t actual = ipmi::scaleIPMIValueFromDouble(y, M, rExp, B, bExp,
- bSigned);
+ int8_t actual =
+ ipmi::scaleIPMIValueFromDouble(y, M, rExp, B, bExp, bSigned);
result = actual;
yRoundtrip = ipmitool_y_from_x(actual, M, rExp, B, bExp, bSigned);
@@ -78,8 +78,8 @@
else
{
uint8_t expect = x;
- uint8_t actual = ipmi::scaleIPMIValueFromDouble(y, M, rExp, B, bExp,
- bSigned);
+ uint8_t actual =
+ ipmi::scaleIPMIValueFromDouble(y, M, rExp, B, bExp, bSigned);
result = actual;
yRoundtrip = ipmitool_y_from_x(actual, M, rExp, B, bExp, bSigned);
@@ -430,8 +430,8 @@
EXPECT_EQ(bExp, -1);
}
- scaledVal = ipmi::scaleIPMIValueFromDouble(5, mValue, rExp, bValue, bExp,
- bSigned);
+ scaledVal =
+ ipmi::scaleIPMIValueFromDouble(5, mValue, rExp, bValue, bExp, bSigned);
expected = 5 / (mValue * std::pow(10, rExp));
EXPECT_NEAR(scaledVal, expected, expected * 0.01);
diff --git a/test/message/pack.cpp b/test/message/pack.cpp
index 334750e..57bff06 100644
--- a/test/message/pack.cpp
+++ b/test/message/pack.cpp
@@ -479,19 +479,19 @@
ipmi::message::Payload p;
p.pack(handle, maxSessions, currentSessions, activeSession, lanSession);
- ASSERT_EQ(p.size(), sizeof(handle) + sizeof(maxSessions) +
- sizeof(currentSessions) + 3 * sizeof(uint8_t) +
- sizeof(uint32_t) + sizeof(uint8_t) * macSize +
- sizeof(uint16_t));
- uint8_t protocol_channel = (static_cast<uint8_t>(protocol) << 4) |
- static_cast<uint8_t>(channel);
- ipmi::SecureBuffer k = {handle, maxSessions, currentSessions, userID, priv,
- protocol_channel,
- // ip addr
- 0x05, 0x01, 0x01, 0x0a,
- // mac addr
- 0, 0, 0, 0, 0, 0,
- // port
- 0x1f, 0xd8};
+ ASSERT_EQ(p.size(),
+ sizeof(handle) + sizeof(maxSessions) + sizeof(currentSessions) +
+ 3 * sizeof(uint8_t) + sizeof(uint32_t) +
+ sizeof(uint8_t) * macSize + sizeof(uint16_t));
+ uint8_t protocol_channel =
+ (static_cast<uint8_t>(protocol) << 4) | static_cast<uint8_t>(channel);
+ ipmi::SecureBuffer k = {
+ handle, maxSessions, currentSessions, userID, priv, protocol_channel,
+ // ip addr
+ 0x05, 0x01, 0x01, 0x0a,
+ // mac addr
+ 0, 0, 0, 0, 0, 0,
+ // port
+ 0x1f, 0xd8};
ASSERT_EQ(p.raw, k);
}
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 24b84c0..6e7dae2 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -75,8 +75,8 @@
(path.size() == is || path[is] == '/');
}
-std::optional<ChannelParams> maybeGetChannelParams(sdbusplus::bus_t& bus,
- uint8_t channel)
+std::optional<ChannelParams>
+ maybeGetChannelParams(sdbusplus::bus_t& bus, uint8_t channel)
{
auto ifname = getChannelName(channel);
if (ifname.empty())
@@ -86,8 +86,8 @@
// Enumerate all VLAN + ETHERNET interfaces
std::vector<std::string> interfaces = {INTF_VLAN, INTF_ETHERNET};
- ipmi::ObjectTree objs = ipmi::getSubTree(bus, interfaces,
- std::string{PATH_ROOT});
+ ipmi::ObjectTree objs =
+ ipmi::getSubTree(bus, interfaces, std::string{PATH_ROOT});
ChannelParams params;
for (const auto& [path, impls] : objs)
@@ -258,9 +258,9 @@
void createIfAddr(sdbusplus::bus_t& bus, const ChannelParams& params,
typename AddrFamily<family>::addr address, uint8_t prefix)
{
- auto newreq = bus.new_method_call(params.service.c_str(),
- params.logicalPath.c_str(),
- INTF_IP_CREATE, "IP");
+ auto newreq =
+ bus.new_method_call(params.service.c_str(), params.logicalPath.c_str(),
+ INTF_IP_CREATE, "IP");
std::string protocol =
sdbusplus::common::xyz::openbmc_project::network::convertForMessage(
AddrFamily<family>::protocol);
@@ -312,9 +312,9 @@
}
template <int family>
-std::optional<IfNeigh<family>> findGatewayNeighbor(sdbusplus::bus_t& bus,
- const ChannelParams& params,
- ObjectLookupCache& neighbors)
+std::optional<IfNeigh<family>>
+ findGatewayNeighbor(sdbusplus::bus_t& bus, const ChannelParams& params,
+ ObjectLookupCache& neighbors)
{
auto gateway = getGatewayProperty<family>(bus, params);
if (!gateway)
@@ -326,8 +326,8 @@
}
template <int family>
-std::optional<IfNeigh<family>> getGatewayNeighbor(sdbusplus::bus_t& bus,
- const ChannelParams& params)
+std::optional<IfNeigh<family>>
+ getGatewayNeighbor(sdbusplus::bus_t& bus, const ChannelParams& params)
{
ObjectLookupCache neighbors(bus, params, INTF_NEIGHBOR);
return findGatewayNeighbor<family>(bus, params, neighbors);
@@ -345,8 +345,8 @@
}
ObjectLookupCache neighbors(bus, params, INTF_NEIGHBOR);
- auto neighbor = findStaticNeighbor<family>(bus, params, *gateway,
- neighbors);
+ auto neighbor =
+ findStaticNeighbor<family>(bus, params, *gateway, neighbors);
if (neighbor)
{
deleteObjectIfExists(bus, params.service, neighbor->path);
@@ -550,8 +550,8 @@
std::vector<IfAddr<AF_INET6>> ifaddrs6;
for (uint8_t i = 0; i < MAX_IPV6_STATIC_ADDRESSES; ++i)
{
- auto ifaddr6 = findIfAddr<AF_INET6>(bus, params, i, originsV6Static,
- ips);
+ auto ifaddr6 =
+ findIfAddr<AF_INET6>(bus, params, i, originsV6Static, ips);
if (!ifaddr6)
{
break;
@@ -672,9 +672,9 @@
*/
RspType<> setLanOem(uint8_t channel, uint8_t parameter, message::Payload& req)
__attribute__((weak));
-RspType<message::Payload> getLanOem(uint8_t channel, uint8_t parameter,
- uint8_t set, uint8_t block)
- __attribute__((weak));
+RspType<message::Payload>
+ getLanOem(uint8_t channel, uint8_t parameter, uint8_t set, uint8_t block)
+ __attribute__((weak));
RspType<> setLanOem(uint8_t, uint8_t, message::Payload& req)
{
@@ -970,8 +970,8 @@
return responseReqDataLenInvalid();
}
unpackFinal(req);
- if (std::bitset<8> expected(control &
- std::bitset<8>(reservedRACCBits));
+ if (std::bitset<8> expected(
+ control & std::bitset<8>(reservedRACCBits));
expected.any())
{
return response(ccParamNotSupported);
@@ -1033,9 +1033,9 @@
return responseInvalidFieldRequest();
}
- uint8_t resp = getCipherConfigObject(csPrivFileName,
- csPrivDefaultFileName)
- .setCSPrivilegeLevels(channel, cipherSuitePrivs);
+ uint8_t resp =
+ getCipherConfigObject(csPrivFileName, csPrivDefaultFileName)
+ .setCSPrivilegeLevels(channel, cipherSuitePrivs);
if (!resp)
{
return responseSuccess();
@@ -1532,11 +1532,9 @@
return responseSuccess();
}
-RspType<message::Payload> getSolConfParams(Context::ptr ctx,
- uint4_t channelBits,
- uint3_t /*reserved*/, bool revOnly,
- uint8_t parameter, uint8_t /*set*/,
- uint8_t /*block*/)
+RspType<message::Payload> getSolConfParams(
+ Context::ptr ctx, uint4_t channelBits, uint3_t /*reserved*/, bool revOnly,
+ uint8_t parameter, uint8_t /*set*/, uint8_t /*block*/)
{
message::Payload ret;
constexpr uint8_t current_revision = 0x11;
diff --git a/transporthandler.hpp b/transporthandler.hpp
index 165eeda..a2137cd 100644
--- a/transporthandler.hpp
+++ b/transporthandler.hpp
@@ -65,8 +65,8 @@
* @param[in] channel - The channel id corresponding to an ethernet interface
* @return Ethernet interface service and object path if it exists
*/
-std::optional<ChannelParams> maybeGetChannelParams(sdbusplus::bus_t& bus,
- uint8_t channel);
+std::optional<ChannelParams>
+ maybeGetChannelParams(sdbusplus::bus_t& bus, uint8_t channel);
/** @brief A trivial helper around maybeGetChannelParams() that throws an
* exception when it is unable to acquire parameters for the channel.
@@ -172,8 +172,7 @@
*/
ObjectLookupCache(sdbusplus::bus_t& bus, const ChannelParams& params,
const char* intf) :
- bus(bus),
- params(params), intf(intf),
+ bus(bus), params(params), intf(intf),
objs(getAllDbusObjects(bus, params.logicalPath, intf, ""))
{}
@@ -349,10 +348,9 @@
}
template <int family>
-std::optional<IfNeigh<family>>
- findStaticNeighbor(sdbusplus::bus_t&, const ChannelParams&,
- typename AddrFamily<family>::addr ip,
- ObjectLookupCache& neighbors)
+std::optional<IfNeigh<family>> findStaticNeighbor(
+ sdbusplus::bus_t&, const ChannelParams&,
+ typename AddrFamily<family>::addr ip, ObjectLookupCache& neighbors)
{
using sdbusplus::server::xyz::openbmc_project::network::Neighbor;
const auto state =
@@ -395,9 +393,9 @@
typename AddrFamily<family>::addr address,
stdplus::EtherAddr mac)
{
- auto newreq = bus.new_method_call(params.service.c_str(),
- params.logicalPath.c_str(),
- INTF_NEIGHBOR_CREATE_STATIC, "Neighbor");
+ auto newreq =
+ bus.new_method_call(params.service.c_str(), params.logicalPath.c_str(),
+ INTF_NEIGHBOR_CREATE_STATIC, "Neighbor");
stdplus::ToStrHandle<stdplus::ToStr<stdplus::EtherAddr>> macToStr;
stdplus::ToStrHandle<stdplus::ToStr<typename AddrFamily<family>::addr>>
addrToStr;
diff --git a/user_channel/channel_layer.cpp b/user_channel/channel_layer.cpp
index 02dd055..26bc3fa 100644
--- a/user_channel/channel_layer.cpp
+++ b/user_channel/channel_layer.cpp
@@ -104,8 +104,8 @@
Cc getChannelAccessPersistData(const uint8_t chNum, ChannelAccess& chAccessData)
{
- return getChannelConfigObject().getChannelAccessPersistData(chNum,
- chAccessData);
+ return getChannelConfigObject().getChannelAccessPersistData(
+ chNum, chAccessData);
}
Cc setChannelAccessPersistData(const uint8_t chNum,
@@ -125,8 +125,8 @@
Cc getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv,
EAuthType& authType)
{
- return getChannelConfigObject().getChannelEnabledAuthType(chNum, priv,
- authType);
+ return getChannelConfigObject().getChannelEnabledAuthType(
+ chNum, priv, authType);
}
std::string getChannelName(const uint8_t chNum)
diff --git a/user_channel/channel_layer.hpp b/user_channel/channel_layer.hpp
index 37d2b90..551b0b6 100644
--- a/user_channel/channel_layer.hpp
+++ b/user_channel/channel_layer.hpp
@@ -284,8 +284,8 @@
* @return same channel number or proper channel number for current channel
* number (0xE).
*/
-static inline uint8_t convertCurrentChannelNum(const uint8_t chNum,
- const uint8_t devChannel)
+static inline uint8_t
+ convertCurrentChannelNum(const uint8_t chNum, const uint8_t devChannel)
{
if (chNum == currentChNum)
{
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 13ea55b..ed95271 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -346,12 +346,12 @@
dBusPropertiesInterface) +
sdbusplus::bus::match::rules::argN(0, networkChConfigIntfName),
[&](sdbusplus::message_t& msg) {
- DbusChObjProperties props;
- std::string iface;
- std::string path = msg.get_path();
- msg.read(iface, props);
- processChAccessPropChange(path, props);
- });
+ DbusChObjProperties props;
+ std::string iface;
+ std::string path = msg.get_path();
+ msg.read(iface, props);
+ processChAccessPropChange(path, props);
+ });
signalHndlrObjectState = true;
chInterfaceAddedSignal = std::make_unique<sdbusplus::bus::match_t>(
@@ -676,9 +676,8 @@
return ccSuccess;
}
-Cc ChannelConfig::getChannelEnabledAuthType(const uint8_t chNum,
- const uint8_t priv,
- EAuthType& authType)
+Cc ChannelConfig::getChannelEnabledAuthType(
+ const uint8_t chNum, const uint8_t priv, EAuthType& authType)
{
if (!isValidChannel(chNum))
{
@@ -767,8 +766,8 @@
EChannelSessSupported
ChannelConfig::convertToSessionSupportIndex(const std::string& value)
{
- auto iter = std::find(sessionSupportList.begin(), sessionSupportList.end(),
- value);
+ auto iter =
+ std::find(sessionSupportList.begin(), sessionSupportList.end(), value);
if (iter == sessionSupportList.end())
{
lg2::error("Invalid session supported: {SESS_STR}", "SESS_STR", value);
@@ -972,8 +971,8 @@
chData.isChValid = channelFound &&
jsonChData[isValidString].get<bool>();
chData.activeSessCount = jsonChData.value(activeSessionsString, 0);
- chData.maxTransferSize = jsonChData.value(maxTransferSizeString,
- smallChannelSize);
+ chData.maxTransferSize =
+ jsonChData.value(maxTransferSizeString, smallChannelSize);
if (jsonChData.count(isManagementNIC) != 0)
{
chData.isManagementNIC =
@@ -1287,17 +1286,16 @@
return ret;
}
-int ChannelConfig::setDbusProperty(const std::string& service,
- const std::string& objPath,
- const std::string& interface,
- const std::string& property,
- const DbusVariant& value)
+int ChannelConfig::setDbusProperty(
+ const std::string& service, const std::string& objPath,
+ const std::string& interface, const std::string& property,
+ const DbusVariant& value)
{
try
{
- auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
- "org.freedesktop.DBus.Properties",
- "Set");
+ auto method =
+ bus.new_method_call(service.c_str(), objPath.c_str(),
+ "org.freedesktop.DBus.Properties", "Set");
method.append(interface, property, value);
diff --git a/user_channel/channelcommands.cpp b/user_channel/channelcommands.cpp
index 321526f..f98a5e7 100644
--- a/user_channel/channelcommands.cpp
+++ b/user_channel/channelcommands.cpp
@@ -40,11 +40,10 @@
*
* @ returns IPMI completion code
**/
-RspType<> ipmiSetChannelAccess(Context::ptr ctx, uint4_t channel,
- uint4_t reserved1, uint3_t accessMode,
- bool usrAuth, bool msgAuth, bool alertDisabled,
- uint2_t chanAccess, uint4_t channelPrivLimit,
- uint2_t reserved2, uint2_t channelPrivMode)
+RspType<> ipmiSetChannelAccess(
+ Context::ptr ctx, uint4_t channel, uint4_t reserved1, uint3_t accessMode,
+ bool usrAuth, bool msgAuth, bool alertDisabled, uint2_t chanAccess,
+ uint4_t channelPrivLimit, uint2_t reserved2, uint2_t channelPrivMode)
{
if (reserved1 || reserved2 ||
!isValidPrivLimit(static_cast<uint8_t>(channelPrivLimit)))
@@ -256,8 +255,8 @@
return responseInvalidFieldRequest();
}
- uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
- ctx->channel);
+ uint8_t chNum =
+ convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
if (!isValidChannel(chNum))
{
lg2::debug("Get channel Info - No support on channel: {CHANNEL}",
@@ -325,8 +324,8 @@
ipmiGetChannelPayloadSupport(Context::ptr ctx, uint4_t channel,
uint4_t reserved)
{
- uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
- ctx->channel);
+ uint8_t chNum =
+ convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
if (!doesDeviceExist(chNum) || !isValidChannel(chNum) || reserved)
{
@@ -369,8 +368,8 @@
ipmiGetChannelPayloadVersion(Context::ptr ctx, uint4_t chNum,
uint4_t reserved, uint8_t payloadTypeNum)
{
- uint8_t channel = convertCurrentChannelNum(static_cast<uint8_t>(chNum),
- ctx->channel);
+ uint8_t channel =
+ convertCurrentChannelNum(static_cast<uint8_t>(chNum), ctx->channel);
constexpr uint8_t payloadTypeNotSupported = 0x80;
if (reserved || !isValidChannel(channel))
diff --git a/user_channel/cipher_mgmt.cpp b/user_channel/cipher_mgmt.cpp
index f1bc543..c954f65 100644
--- a/user_channel/cipher_mgmt.cpp
+++ b/user_channel/cipher_mgmt.cpp
@@ -118,8 +118,8 @@
int CipherConfig::writeCSPrivilegeLevels(const Json& jsonData)
{
- std::string tmpFile = static_cast<std::string>(cipherSuitePrivFileName) +
- "_tmpXXXXXX";
+ std::string tmpFile =
+ static_cast<std::string>(cipherSuitePrivFileName) + "_tmpXXXXXX";
std::vector<char> tmpRandomFile(tmpFile.length() + 1);
strncpy(tmpRandomFile.data(), tmpFile.c_str(), tmpFile.length() + 1);
diff --git a/user_channel/file.hpp b/user_channel/file.hpp
index 76a03c7..204cfef 100644
--- a/user_channel/file.hpp
+++ b/user_channel/file.hpp
@@ -42,9 +42,7 @@
* @param[in] removeOnExit - File to be removed at exit or no
*/
File(const std::string& name, const std::string& mode,
- bool removeOnExit = false) :
- name(name),
- removeOnExit(removeOnExit)
+ bool removeOnExit = false) : name(name), removeOnExit(removeOnExit)
{
fp = fopen(name.c_str(), mode.c_str());
}
@@ -57,9 +55,7 @@
* @param[in] removeOnExit - File to be removed at exit or no
*/
File(int fd, const std::string& name, const std::string& mode,
- bool removeOnExit = false) :
- name(name),
- removeOnExit(removeOnExit)
+ bool removeOnExit = false) : name(name), removeOnExit(removeOnExit)
{
fp = fdopen(fd, mode.c_str());
}
diff --git a/user_channel/passwd_mgr.cpp b/user_channel/passwd_mgr.cpp
index 9b35ac7..f712779 100644
--- a/user_channel/passwd_mgr.cpp
+++ b/user_channel/passwd_mgr.cpp
@@ -141,12 +141,10 @@
}
}
-int PasswdMgr::encryptDecryptData(bool doEncrypt, const EVP_CIPHER* cipher,
- uint8_t* key, size_t keyLen, uint8_t* iv,
- size_t ivLen, uint8_t* inBytes,
- size_t inBytesLen, uint8_t* mac,
- size_t* macLen, unsigned char* outBytes,
- size_t* outBytesLen)
+int PasswdMgr::encryptDecryptData(
+ bool doEncrypt, const EVP_CIPHER* cipher, uint8_t* key, size_t keyLen,
+ uint8_t* iv, size_t ivLen, uint8_t* inBytes, size_t inBytesLen,
+ uint8_t* mac, size_t* macLen, unsigned char* outBytes, size_t* outBytesLen)
{
if (cipher == NULL || key == NULL || iv == NULL || inBytes == NULL ||
outBytes == NULL || mac == NULL || inBytesLen == 0 ||
@@ -163,9 +161,9 @@
std::array<uint8_t, EVP_MAX_MD_SIZE> calMac;
size_t calMacLen = calMac.size();
// calculate MAC for the encrypted message.
- if (NULL == HMAC(EVP_sha256(), key, keyLen, inBytes, inBytesLen,
- calMac.data(),
- reinterpret_cast<unsigned int*>(&calMacLen)))
+ if (NULL ==
+ HMAC(EVP_sha256(), key, keyLen, inBytes, inBytesLen, calMac.data(),
+ reinterpret_cast<unsigned int*>(&calMacLen)))
{
lg2::debug("Error: Failed to calculate MAC");
return -EIO;
@@ -203,8 +201,8 @@
inBytes, inBytesLen)))
{
outLen += outEVPLen;
- if ((retval = EVP_CipherFinal(ctx.get(), outBytes + outLen,
- &outEVPLen)))
+ if ((retval =
+ EVP_CipherFinal(ctx.get(), outBytes + outLen, &outEVPLen)))
{
outLen += outEVPLen;
*outBytesLen = outLen;
@@ -503,9 +501,9 @@
lg2::debug("Hash genertion failed, bailing out");
return -EIO;
}
- if (NULL == HMAC(digest, keyBuff.data(), keyBuff.size(), hash.data(),
- hashLen, key.data(),
- reinterpret_cast<unsigned int*>(&keyLen)))
+ if (NULL ==
+ HMAC(digest, keyBuff.data(), keyBuff.size(), hash.data(), hashLen,
+ key.data(), reinterpret_cast<unsigned int*>(&keyLen)))
{
lg2::debug("Failed to create MAC for authentication");
return -EIO;
diff --git a/user_channel/passwd_mgr.hpp b/user_channel/passwd_mgr.hpp
index 338f249..8932ac5 100644
--- a/user_channel/passwd_mgr.hpp
+++ b/user_channel/passwd_mgr.hpp
@@ -118,11 +118,10 @@
*
* @return error response
*/
- int encryptDecryptData(bool doEncrypt, const EVP_CIPHER* cipher,
- uint8_t* key, size_t keyLen, uint8_t* iv,
- size_t ivLen, uint8_t* inBytes, size_t inBytesLen,
- uint8_t* mac, size_t* macLen, uint8_t* outBytes,
- size_t* outBytesLen);
+ int encryptDecryptData(
+ bool doEncrypt, const EVP_CIPHER* cipher, uint8_t* key, size_t keyLen,
+ uint8_t* iv, size_t ivLen, uint8_t* inBytes, size_t inBytesLen,
+ uint8_t* mac, size_t* macLen, uint8_t* outBytes, size_t* outBytesLen);
/** @brief returns updated file time of passwd file entry.
*
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index 979aaa6..81e409e 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -158,9 +158,9 @@
{
try
{
- auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
- dBusPropertiesInterface,
- setPropertiesMethod);
+ auto method =
+ bus.new_method_call(service.c_str(), objPath.c_str(),
+ dBusPropertiesInterface, setPropertiesMethod);
method.append(interface, property, value);
bus.call(method);
}
@@ -182,8 +182,8 @@
{
try
{
- userMgmtService = ipmi::getUserService(bus, userMgrInterface,
- userMgrObjBasePath);
+ userMgmtService =
+ ipmi::getUserService(bus, userMgrInterface, userMgrObjBasePath);
}
catch (const sdbusplus::exception_t& e)
{
@@ -653,8 +653,8 @@
return PAM_BUF_ERR;
}
- void* ptr = calloc(static_cast<size_t>(numMsg),
- sizeof(struct pam_response));
+ void* ptr =
+ calloc(static_cast<size_t>(numMsg), sizeof(struct pam_response));
if (ptr == nullptr)
{
free(pass);
@@ -687,8 +687,8 @@
const_cast<char*>(password)};
pam_handle_t* localAuthHandle = NULL; // this gets set by pam_start
- int retval = pam_start("passwd", username, &localConversation,
- &localAuthHandle);
+ int retval =
+ pam_start("passwd", username, &localConversation, &localAuthHandle);
if (retval != PAM_SUCCESS)
{
@@ -831,10 +831,9 @@
return ccSuccess;
}
-Cc UserAccess::setUserPayloadAccess(const uint8_t chNum,
- const uint8_t operation,
- const uint8_t userId,
- const PayloadAccess& payloadAccess)
+Cc UserAccess::setUserPayloadAccess(
+ const uint8_t chNum, const uint8_t operation, const uint8_t userId,
+ const PayloadAccess& payloadAccess)
{
constexpr uint8_t enable = 0x0;
constexpr uint8_t disable = 0x1;
@@ -1390,8 +1389,8 @@
readPayloadAccessFromUserInfo(usersTbl.user[usrIndex], stdPayload,
oemPayload);
- Json jsonPayloadEnabledInfo = constructJsonPayloadEnables(stdPayload,
- oemPayload);
+ Json jsonPayloadEnabledInfo =
+ constructJsonPayloadEnables(stdPayload, oemPayload);
jsonUserInfo[payloadEnabledStr] = jsonPayloadEnabledInfo;
jsonUsersTbl.push_back(jsonUserInfo);
@@ -1652,16 +1651,16 @@
sdbusplus::bus::match::rules::interface(dBusObjManager) +
sdbusplus::bus::match::rules::path(userMgrObjBasePath),
[&](sdbusplus::message_t& msg) {
- userUpdatedSignalHandler(*this, msg);
- });
+ userUpdatedSignalHandler(*this, msg);
+ });
userMgrRenamedSignal = std::make_unique<sdbusplus::bus::match_t>(
bus,
sdbusplus::bus::match::rules::type::signal() +
sdbusplus::bus::match::rules::interface(userMgrInterface) +
sdbusplus::bus::match::rules::path(userMgrObjBasePath),
[&](sdbusplus::message_t& msg) {
- userUpdatedSignalHandler(*this, msg);
- });
+ userUpdatedSignalHandler(*this, msg);
+ });
userPropertiesSignal = std::make_unique<sdbusplus::bus::match_t>(
bus,
sdbusplus::bus::match::rules::type::signal() +
@@ -1671,8 +1670,8 @@
sdbusplus::bus::match::rules::member(propertiesChangedSignal) +
sdbusplus::bus::match::rules::argN(0, usersInterface),
[&](sdbusplus::message_t& msg) {
- userUpdatedSignalHandler(*this, msg);
- });
+ userUpdatedSignalHandler(*this, msg);
+ });
signalHndlrObject = true;
}
std::map<DbusUserObjPath, DbusUserObjValue> managedObjs;
diff --git a/user_channel/usercommands.cpp b/user_channel/usercommands.cpp
index 53b34f8..cc7174f 100644
--- a/user_channel/usercommands.cpp
+++ b/user_channel/usercommands.cpp
@@ -48,15 +48,15 @@
*
* @returns ipmi completion code
*/
-ipmi::RspType<> ipmiSetUserAccess(ipmi::Context::ptr ctx, uint4_t channel,
- uint1_t ipmiEnabled, uint1_t linkAuthEnabled,
- uint1_t accessCallback, uint1_t bitsUpdate,
+ipmi::RspType<> ipmiSetUserAccess(
+ ipmi::Context::ptr ctx, uint4_t channel, uint1_t ipmiEnabled,
+ uint1_t linkAuthEnabled, uint1_t accessCallback, uint1_t bitsUpdate,
- uint6_t userId, uint2_t reserved1,
+ uint6_t userId, uint2_t reserved1,
- uint4_t privilege, uint4_t reserved2,
+ uint4_t privilege, uint4_t reserved2,
- std::optional<uint8_t> sessionLimit)
+ std::optional<uint8_t> sessionLimit)
{
uint8_t sessLimit = sessionLimit.value_or(0);
if (reserved1 || reserved2 || sessLimit ||
@@ -66,8 +66,8 @@
return ipmi::responseInvalidFieldRequest();
}
- uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
- ctx->channel);
+ uint8_t chNum =
+ convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
if (!isValidChannel(chNum))
{
lg2::debug("Set user access - Invalid channel request");
@@ -137,8 +137,8 @@
uint6_t userId, uint2_t reserved2)
{
- uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
- ctx->channel);
+ uint8_t chNum =
+ convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
if (reserved1 || reserved2 || !isValidChannel(chNum))
{
@@ -166,8 +166,8 @@
}
bool enabledState = false;
- retStatus = ipmiUserCheckEnabled(static_cast<uint8_t>(userId),
- enabledState);
+ retStatus =
+ ipmiUserCheckEnabled(static_cast<uint8_t>(userId), enabledState);
if (retStatus != ccSuccess)
{
return ipmi::response(retStatus);
@@ -205,10 +205,9 @@
* @returns ipmi response
*/
-ipmi::RspType<>
- ipmiSetUserName([[maybe_unused]] ipmi::Context::ptr ctx, uint6_t id,
- uint2_t reserved,
- const std::array<uint8_t, ipmi::ipmiMaxUserName>& name)
+ipmi::RspType<> ipmiSetUserName(
+ [[maybe_unused]] ipmi::Context::ptr ctx, uint6_t id, uint2_t reserved,
+ const std::array<uint8_t, ipmi::ipmiMaxUserName>& name)
{
if (reserved)
{
@@ -319,8 +318,8 @@
}
else if (operation == opEnableUser || operation == opDisableUser)
{
- ipmi::Cc res = ipmiUserUpdateEnabledState(userId,
- static_cast<bool>(operation));
+ ipmi::Cc res =
+ ipmiUserUpdateEnabledState(userId, static_cast<bool>(operation));
return ipmi::response(res);
}
else if (operation == opTestPassword)
@@ -405,14 +404,12 @@
uint24_t, // oemID
uint8_t // oemAuxillary
>
- ipmiGetChannelAuthenticationCapabilities(ipmi::Context::ptr ctx,
- uint4_t chNum, uint3_t reserved1,
- [[maybe_unused]] bool extData,
- uint4_t privLevel,
- uint4_t reserved2)
+ ipmiGetChannelAuthenticationCapabilities(
+ ipmi::Context::ptr ctx, uint4_t chNum, uint3_t reserved1,
+ [[maybe_unused]] bool extData, uint4_t privLevel, uint4_t reserved2)
{
- uint8_t channel = convertCurrentChannelNum(static_cast<uint8_t>(chNum),
- ctx->channel);
+ uint8_t channel =
+ convertCurrentChannelNum(static_cast<uint8_t>(chNum), ctx->channel);
if (reserved1 || reserved2 || !isValidChannel(channel) ||
!isValidPrivLimit(static_cast<uint8_t>(privLevel)))
@@ -498,8 +495,8 @@
uint8_t oemPayloadEnables2Reserved)
{
- auto chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
- ctx->channel);
+ auto chNum =
+ convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
// Validate the reserved args. Only SOL payload is supported as on date.
if (reserved || stdPayload0ipmiReserved || stdPayload2 || stdPayload3 ||
stdPayload4 || stdPayload5 || stdPayload6 || stdPayload7 ||
@@ -593,8 +590,8 @@
uint6_t userId, uint2_t reserved2)
{
- uint8_t chNum = convertCurrentChannelNum(static_cast<uint8_t>(channel),
- ctx->channel);
+ uint8_t chNum =
+ convertCurrentChannelNum(static_cast<uint8_t>(channel), ctx->channel);
if (reserved1 || reserved2 || !isValidChannel(chNum))
{
@@ -618,27 +615,28 @@
return ipmi::response(retStatus);
}
constexpr uint8_t res8bits = 0;
- return ipmi::responseSuccess(payloadAccess.stdPayloadEnables1.test(0),
- payloadAccess.stdPayloadEnables1.test(1),
- payloadAccess.stdPayloadEnables1.test(2),
- payloadAccess.stdPayloadEnables1.test(3),
- payloadAccess.stdPayloadEnables1.test(4),
- payloadAccess.stdPayloadEnables1.test(5),
- payloadAccess.stdPayloadEnables1.test(6),
- payloadAccess.stdPayloadEnables1.test(7),
+ return ipmi::responseSuccess(
+ payloadAccess.stdPayloadEnables1.test(0),
+ payloadAccess.stdPayloadEnables1.test(1),
+ payloadAccess.stdPayloadEnables1.test(2),
+ payloadAccess.stdPayloadEnables1.test(3),
+ payloadAccess.stdPayloadEnables1.test(4),
+ payloadAccess.stdPayloadEnables1.test(5),
+ payloadAccess.stdPayloadEnables1.test(6),
+ payloadAccess.stdPayloadEnables1.test(7),
- res8bits,
+ res8bits,
- payloadAccess.oemPayloadEnables1.test(0),
- payloadAccess.oemPayloadEnables1.test(1),
- payloadAccess.oemPayloadEnables1.test(2),
- payloadAccess.oemPayloadEnables1.test(3),
- payloadAccess.oemPayloadEnables1.test(4),
- payloadAccess.oemPayloadEnables1.test(5),
- payloadAccess.oemPayloadEnables1.test(6),
- payloadAccess.oemPayloadEnables1.test(7),
+ payloadAccess.oemPayloadEnables1.test(0),
+ payloadAccess.oemPayloadEnables1.test(1),
+ payloadAccess.oemPayloadEnables1.test(2),
+ payloadAccess.oemPayloadEnables1.test(3),
+ payloadAccess.oemPayloadEnables1.test(4),
+ payloadAccess.oemPayloadEnables1.test(5),
+ payloadAccess.oemPayloadEnables1.test(6),
+ payloadAccess.oemPayloadEnables1.test(7),
- res8bits);
+ res8bits);
}
void registerUserIpmiFunctions() __attribute__((constructor));
diff --git a/whitelist-filter.cpp b/whitelist-filter.cpp
index 5e22f54..7fe4e22 100644
--- a/whitelist-filter.cpp
+++ b/whitelist-filter.cpp
@@ -59,8 +59,8 @@
lg2::info("Loading allowlist filter");
ipmi::registerFilter(ipmi::prioOpenBmcBase,
[this](ipmi::message::Request::ptr request) {
- return filterMessage(request);
- });
+ return filterMessage(request);
+ });
// wait until io->run is going to fetch RestrictionMode
post_work([this]() { postInit(); });
@@ -84,8 +84,8 @@
try
{
restrictionModeSetting = dev;
- restrictionModeService = objects->service(restrictionModeSetting,
- restrictionModeIntf);
+ restrictionModeService =
+ objects->service(restrictionModeSetting, restrictionModeIntf);
}
catch (const std::out_of_range& e)
{
@@ -210,8 +210,8 @@
modeChangeMatch = std::make_unique<sdbusplus::bus::match_t>(
*bus, filterStr, [this, deviceList](sdbusplus::message_t& m) {
- handleRestrictedModeChange(m, deviceList);
- });
+ handleRestrictedModeChange(m, deviceList);
+ });
}
/** @brief Filter IPMI messages with RestrictedMode