summaryrefslogtreecommitdiff
path: root/src/service/smtp.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/smtp.hpp')
-rw-r--r--src/service/smtp.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/service/smtp.hpp b/src/service/smtp.hpp
new file mode 100644
index 0000000..c311645
--- /dev/null
+++ b/src/service/smtp.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <boost/asio/io_service.hpp>
+
+#include <sdbusplus/asio/connection.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+
+#include "settings.hpp"
+
+namespace smtp::service
+{
+ 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 Smtp
+ {
+ public:
+ Smtp( ConnectionPtr connection );
+ ~Smtp() = default;
+ private:
+ void FillStorageByDefault();
+ void CreateService( ConnectionPtr bus );
+ void CreateInterface( ConnectionPtr connection );
+ void AddProperties();
+ void AddMethods();
+ bool RefreshSettings( bool is_need_auth, bool is_need_ssl,
+ std::string const& user, std::string const& password,
+ std::string const& host, std::string const& port );
+
+ InterfacePtr mInterface;
+ ObjectServerPtr mObjectServer;
+ Settings mSettingsStorage;
+ };
+}