1 #pragma once
2 
3 #include "snmp_client.hpp"
4 
5 #include <experimental/filesystem>
6 
7 namespace phosphor
8 {
9 namespace network
10 {
11 namespace snmp
12 {
13 
14 constexpr auto SEPARATOR = "_";
15 
16 namespace fs = std::experimental::filesystem;
17 
18 /** @brief Serialize and persist SNMP manager/client D-Bus object.
19  *  @param[in] id - filename of the persisted SNMP manager object.
20  *  @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  */
25 fs::path serialize(Id id, const Client& manager, const fs::path& path);
26 
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  */
33 bool deserialize(const fs::path& path, Client& manager);
34 
35 } // namespace snmp
36 } // namespace network
37 } // namespace phosphor
38