-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsnmp_serialize.hpp
37 lines (29 loc) · 1.08 KB
/
snmp_serialize.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include "snmp_client.hpp"
#include <filesystem>
namespace phosphor
{
namespace network
{
namespace snmp
{
constexpr auto SEPARATOR = "_";
namespace fs = std::filesystem;
/** @brief Serialize and persist SNMP manager/client D-Bus object.
* @param[in] id - filename of the persisted SNMP manager object.
* @param[in] manager - const reference to snmp client/manager object.
* @param[in] path - path of persistent location where D-Bus object would be
* saved.
* @return fs::path - pathname of persisted snmp manager/client file.
*/
fs::path serialize(Id id, const Client& manager, const fs::path& path);
/** @brief Deserialize SNMP manager/client info into a D-Bus object
* @param[in] path - pathname of persisted manager/client file.
* @param[in] manager - reference to snmp client/manager object
* which is the target of deserialization.
* @return bool - true if the deserialization was successful, false otherwise.
*/
bool deserialize(const fs::path& path, Client& manager);
} // namespace snmp
} // namespace network
} // namespace phosphor