blob: d5189a98962600dfb436dcbea94c2f471fdfa144 [file] [log] [blame]
Ratan Gupta212f53e2018-04-30 17:28:05 +05301#pragma once
2
Ratan Gupta212f53e2018-04-30 17:28:05 +05303#include "snmp_client.hpp"
4
Ratan Gupta34d129a2021-12-04 21:04:51 +05305#include <filesystem>
Patrick Williams1334b7b2021-02-22 17:15:12 -06006
Ratan Gupta212f53e2018-04-30 17:28:05 +05307namespace phosphor
8{
9namespace network
10{
11namespace snmp
12{
13
Gunnar Millsf3fac222018-08-14 11:59:10 -050014constexpr auto SEPARATOR = "_";
Ratan Gupta212f53e2018-04-30 17:28:05 +053015
Ratan Gupta34d129a2021-12-04 21:04:51 +053016namespace fs = std::filesystem;
Ratan Gupta212f53e2018-04-30 17:28:05 +053017
Ratan Guptaa7ff3852018-11-16 14:05:57 +053018/** @brief Serialize and persist SNMP manager/client D-Bus object.
19 * @param[in] id - filename of the persisted SNMP manager object.
Ratan Gupta212f53e2018-04-30 17:28:05 +053020 * @param[in] manager - const reference to snmp client/manager object.
21 * @param[in] path - path of persistent location where D-Bus object would be
22 * saved.
23 * @return fs::path - pathname of persisted snmp manager/client file.
24 */
Ratan Guptaa7ff3852018-11-16 14:05:57 +053025fs::path serialize(Id id, const Client& manager, const fs::path& path);
Ratan Gupta212f53e2018-04-30 17:28:05 +053026
27/** @brief Deserialze SNMP manager/client info into a D-Bus object
28 * @param[in] path - pathname of persisted manager/client file.
29 * @param[in] manager - reference to snmp client/manager object
30 * which is the target of deserialization.
31 * @return bool - true if the deserialization was successful, false otherwise.
32 */
33bool deserialize(const fs::path& path, Client& manager);
34
35} // namespace snmp
36} // namespace network
37} // namespace phosphor