handler.cpp (8d3d46a2746c03657a6406ec2a2dcd576e40626f) handler.cpp (b69209b498bf9b1c009c528e40280d13e68f8dbd)
1/*
2 * Copyright 2019 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0

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

61namespace ipmi
62{
63namespace fs = std::filesystem;
64using Json = nlohmann::json;
65using namespace phosphor::logging;
66using InternalFailure =
67 sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
68
1/*
2 * Copyright 2019 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0

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

61namespace ipmi
62{
63namespace fs = std::filesystem;
64using Json = nlohmann::json;
65using namespace phosphor::logging;
66using InternalFailure =
67 sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
68
69std::tuple<std::uint8_t, std::string> Handler::getEthDetails() const
69std::tuple<std::uint8_t, std::string>
70 Handler::getEthDetails(std::string intf) const
70{
71{
71 return std::make_tuple<std::uint8_t, std::string>(
72 ::ipmi::getChannelByName(NCSI_IF_NAME_STR), NCSI_IF_NAME_STR);
72 if (intf.empty())
73 {
74 intf = NCSI_IF_NAME_STR;
75 }
76 return std::make_tuple(::ipmi::getChannelByName(intf), std::move(intf));
73}
74
75std::int64_t Handler::getRxPackets(const std::string& name) const
76{
77 std::ostringstream opath;
78 opath << "/sys/class/net/" << name << "/statistics/rx_packets";
79 std::string path = opath.str();
80

--- 314 unchanged lines hidden ---
77}
78
79std::int64_t Handler::getRxPackets(const std::string& name) const
80{
81 std::ostringstream opath;
82 opath << "/sys/class/net/" << name << "/statistics/rx_packets";
83 std::string path = opath.str();
84

--- 314 unchanged lines hidden ---