diff options
author | eportnov <eportnov@ibs.ru> | 2022-09-09 11:10:14 +0300 |
---|---|---|
committer | eportnov <eportnov@ibs.ru> | 2022-09-09 12:41:59 +0300 |
commit | 9fa4addff6f90a8b5697a594e034f5517d64dd25 (patch) | |
tree | b429545eba770ea5aadd030b40f62ca8ab5b208a /src/smtp_service.hpp | |
download | obmc-sila-smtp-9fa4addff6f90a8b5697a594e034f5517d64dd25.tar.xz |
first comit
Diffstat (limited to 'src/smtp_service.hpp')
-rw-r--r-- | src/smtp_service.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/smtp_service.hpp b/src/smtp_service.hpp new file mode 100644 index 0000000..7149e3a --- /dev/null +++ b/src/smtp_service.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include <boost/asio/io_service.hpp> + +#include <sdbusplus/asio/connection.hpp> +#include <sdbusplus/asio/object_server.hpp> + +#include "settings_storage.hpp" + +namespace smtp +{ + using ConnectionPtr = std::shared_ptr<sdbusplus::asio::connection>; + using InterfacePtr = std::shared_ptr<sdbusplus::asio::dbus_interface>; + using ObjectServerPtr = std::shared_ptr<sdbusplus::asio::object_server>; + + class SmtpService + { + public: + SmtpService( ConnectionPtr connection ); + ~SmtpService() = default; + private: + void FillStorageByDefault(); + void CreateService( ConnectionPtr bus ); + void CreateInterface( ConnectionPtr connection ); + void AddProperties(); + void AddMethods(); + bool RefreshSettings(std::string const& user, + std::string const& password, + std::string const& host, + std::string const& port); + + InterfacePtr mInterface; + ObjectServerPtr mObjectServer; + SettingsStorage mStorage; + }; +} |