blob: 2031e2236645c9d739810fa3a6550d5812028d81 [file] [log] [blame]
Ratan Gupta212f53e2018-04-30 17:28:05 +05301#pragma once
2
3#include <experimental/filesystem>
4#include "snmp_client.hpp"
5
6namespace phosphor
7{
8namespace network
9{
10namespace snmp
11{
12
Gunnar Millsf3fac222018-08-14 11:59:10 -050013constexpr auto SEPARATOR = "_";
Ratan Gupta212f53e2018-04-30 17:28:05 +053014
15namespace fs = std::experimental::filesystem;
16
17/** @brief Serialize and persist SNMP manager/client D-Bus object
18 * @param[in] manager - const reference to snmp client/manager object.
19 * @param[in] path - path of persistent location where D-Bus object would be
20 * saved.
21 * @return fs::path - pathname of persisted snmp manager/client file.
22 */
23fs::path serialize(const Client& manager, const fs::path& path);
24
25/** @brief Deserialze SNMP manager/client info into a D-Bus object
26 * @param[in] path - pathname of persisted manager/client file.
27 * @param[in] manager - reference to snmp client/manager object
28 * which is the target of deserialization.
29 * @return bool - true if the deserialization was successful, false otherwise.
30 */
31bool deserialize(const fs::path& path, Client& manager);
32
33} // namespace snmp
34} // namespace network
35} // namespace phosphor