summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey V.Kosteltsev <AKosteltsev@IBS.RU>2022-09-05 11:26:06 +0300
committerAndrey V.Kosteltsev <AKosteltsev@IBS.RU>2022-09-05 11:27:11 +0300
commitc04112aeee939192a93621850ddbc9a8b9e2e40f (patch)
treeed796867682664d8c0af1cc963f7c6bb7648f24f
parentcf3bf710628e0d636fe61c8b4f9dda7602a11e8d (diff)
downloadopenbmc-c04112aeee939192a93621850ddbc9a8b9e2e40f.tar.xz
phosphor-snmp: patches for next revision
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0001-main-Use-sdeventplus.patch10
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0003-conf_manager-use-snmpd-as-a-clients-storage.patch24
2 files changed, 18 insertions, 16 deletions
diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0001-main-Use-sdeventplus.patch b/meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0001-main-Use-sdeventplus.patch
index e38befa7d6..f0327a1602 100644
--- a/meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0001-main-Use-sdeventplus.patch
+++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0001-main-Use-sdeventplus.patch
@@ -1,7 +1,7 @@
-From d07ee811792a8440fc0cc99d7f51aa4121e50928 Mon Sep 17 00:00:00 2001
+From 6be186b7c47745fec7d0a19f88dc2b3470fc780d Mon Sep 17 00:00:00 2001
From: "Andrey V.Kosteltsev" <AKosteltsev@IBS.RU>
-Date: Sun, 17 Jul 2022 12:25:14 +0300
-Subject: [PATCH 1/3] main: Use sdeventplus
+Date: Mon, 5 Sep 2022 11:03:35 +0300
+Subject: [PATCH] main: Use sdeventplus
Makes use sdeventplus instead custom wrapper around the sd_event library calls.
@@ -54,7 +54,7 @@ index 73ca4a6..8a82752 100644
)
diff --git a/snmp_main.cpp b/snmp_main.cpp
-index be4bea1..ab3c4b6 100644
+index 29c18c3..591e507 100644
--- a/snmp_main.cpp
+++ b/snmp_main.cpp
@@ -4,38 +4,19 @@
@@ -98,7 +98,7 @@ index be4bea1..ab3c4b6 100644
+ bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
// Add sdbusplus Object Manager for the 'root' path of the snmp.
- sdbusplus::server::manager::manager objManager(bus, OBJ_NETWORK_SNMP);
+ sdbusplus::server::manager_t objManager(bus, OBJ_NETWORK_SNMP);
@@ -46,5 +27,5 @@ int main(int /*argc*/, char** /*argv[]*/)
manager->restoreClients();
diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0003-conf_manager-use-snmpd-as-a-clients-storage.patch b/meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0003-conf_manager-use-snmpd-as-a-clients-storage.patch
index e13de7ba74..54ac2c5ed6 100644
--- a/meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0003-conf_manager-use-snmpd-as-a-clients-storage.patch
+++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/network/phosphor-snmp/0003-conf_manager-use-snmpd-as-a-clients-storage.patch
@@ -1,7 +1,7 @@
-From 22a0736aa2613f0821e762e76db0efac17a0b7b1 Mon Sep 17 00:00:00 2001
+From 823b9e7b598723f8efc5eb3360aef09e65db05f5 Mon Sep 17 00:00:00 2001
From: "Andrey V.Kosteltsev" <AKosteltsev@IBS.RU>
-Date: Sun, 17 Jul 2022 19:05:14 +0300
-Subject: [PATCH 3/3] conf_manager: use snmpd as a clients storage
+Date: Mon, 5 Sep 2022 10:52:52 +0300
+Subject: [PATCH] conf_manager: use snmpd as a clients storage
This commit brings the alternative of storage of clients. It's able now to communicate with snmpd and manage the built-in list of snmp trap receivers.
@@ -14,10 +14,10 @@ Signed-off-by: Andrey V.Kosteltsev <AKosteltsev@IBS.RU>
snmp/oid.hpp | 42 +++++++++
snmp/pdu.hpp | 150 +++++++++++++++++++++++++++++
snmp/session.hpp | 110 ++++++++++++++++++++++
- snmp_conf_manager.cpp | 207 +++++++++++++++++++++++++++++++++++++++++
+ snmp_conf_manager.cpp | 209 ++++++++++++++++++++++++++++++++++++++++-
snmp_conf_manager.hpp | 8 ++
snmp_main.cpp | 11 +++
- 10 files changed, 685 insertions(+)
+ 10 files changed, 686 insertions(+), 1 deletion(-)
create mode 100644 snmp/exceptions.hpp
create mode 100644 snmp/notify_tables.hpp
create mode 100644 snmp/oid.hpp
@@ -532,7 +532,7 @@ index 0000000..6665882
+
+} // namespace snmp
diff --git a/snmp_conf_manager.cpp b/snmp_conf_manager.cpp
-index 4ddace1..2a631b7 100644
+index dab7317..ed3546e 100644
--- a/snmp_conf_manager.cpp
+++ b/snmp_conf_manager.cpp
@@ -6,6 +6,11 @@
@@ -547,7 +547,7 @@ index 4ddace1..2a631b7 100644
#include <arpa/inet.h>
#include <phosphor-logging/elog-errors.hpp>
-@@ -29,14 +34,97 @@ ConfManager::ConfManager(sdbusplus::bus::bus& bus, const char* objPath) :
+@@ -29,13 +34,97 @@ ConfManager::ConfManager(sdbusplus::bus_t& bus, const char* objPath) :
details::CreateIface::action::defer_emit),
dbusPersistentLocation(SNMP_CONF_PERSIST_PATH), bus(bus),
objectPath(objPath)
@@ -598,7 +598,7 @@ index 4ddace1..2a631b7 100644
// will throw exception if it is already configured.
checkClientConfigured(address, port);
- lastClientId++;
++ lastClientId++;
+
+#if defined( USE_SNMPD ) && ( USE_SNMPD == 1 )
+ auto data = encodeAddr(address, port);
@@ -645,14 +645,16 @@ index 4ddace1..2a631b7 100644
try
{
// just to check whether given address is valid or not.
-@@ -48,6 +136,7 @@ std::string ConfManager::client(std::string address, uint16_t port)
+@@ -47,8 +136,8 @@ std::string ConfManager::client(std::string address, uint16_t port)
elog<InvalidArgument>(Argument::ARGUMENT_NAME("Address"),
Argument::ARGUMENT_VALUE(address.c_str()));
}
+#endif
+- lastClientId++;
// create the D-Bus object
std::filesystem::path objPath;
+ objPath /= objectPath;
@@ -57,8 +146,10 @@ std::string ConfManager::client(std::string address, uint16_t port)
auto client = std::make_unique<phosphor::network::snmp::Client>(
bus, objPath.string().c_str(), *this, address, port);
@@ -808,7 +810,7 @@ index 4ddace1..2a631b7 100644
} // namespace snmp
diff --git a/snmp_conf_manager.hpp b/snmp_conf_manager.hpp
-index afbfad8..10ed4dd 100644
+index d8823f3..db49e65 100644
--- a/snmp_conf_manager.hpp
+++ b/snmp_conf_manager.hpp
@@ -1,6 +1,9 @@
@@ -834,7 +836,7 @@ index afbfad8..10ed4dd 100644
Id lastClientId = 0;
diff --git a/snmp_main.cpp b/snmp_main.cpp
-index df5850b..d6e6646 100644
+index f3474f0..9b59df1 100644
--- a/snmp_main.cpp
+++ b/snmp_main.cpp
@@ -42,5 +42,16 @@ int main(int /*argc*/, char** /*argv[]*/)