Tomáš Pecka | 292bc9c | 2021-01-11 22:03:11 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 CESNET, https://photonics.cesnet.cz/ |
| 3 | * |
| 4 | * Written by Tomáš Pecka <tomas.pecka@fit.cvut.cz> |
| 5 | * |
| 6 | */ |
| 7 | #pragma once |
| 8 | |
| 9 | #include <filesystem> |
Tomáš Pecka | 79344c8 | 2021-09-16 18:25:59 +0200 | [diff] [blame] | 10 | #include <sdbus-c++/sdbus-c++.h> |
Tomáš Pecka | 292bc9c | 2021-01-11 22:03:11 +0100 | [diff] [blame] | 11 | #include <sysrepo-cpp/Session.hpp> |
| 12 | #include "utils/log-fwd.h" |
| 13 | |
| 14 | namespace velia::system { |
| 15 | |
Tomáš Pecka | f976c5b | 2021-01-23 21:19:52 +0100 | [diff] [blame] | 16 | class IETFSystem { |
Tomáš Pecka | 292bc9c | 2021-01-11 22:03:11 +0100 | [diff] [blame] | 17 | public: |
Tomáš Pecka | 79344c8 | 2021-09-16 18:25:59 +0200 | [diff] [blame] | 18 | IETFSystem(std::shared_ptr<::sysrepo::Session> srSession, const std::filesystem::path& osRelease, sdbus::IConnection& dbusConnection, const std::string& dbusName); |
Tomáš Pecka | 292bc9c | 2021-01-11 22:03:11 +0100 | [diff] [blame] | 19 | |
| 20 | private: |
Václav Kubernát | d2927cc | 2021-02-18 04:36:26 +0100 | [diff] [blame] | 21 | void initStaticProperties(const std::filesystem::path& osRelease); |
| 22 | void initSystemRestart(); |
Václav Kubernát | 566c940 | 2021-02-10 08:33:54 +0100 | [diff] [blame] | 23 | void initHostname(); |
Jan Kundrát | dcd50f0 | 2021-02-18 23:28:26 +0100 | [diff] [blame] | 24 | void initDummies(); |
Jan Kundrát | 51f1d6d | 2021-02-19 00:41:28 +0100 | [diff] [blame] | 25 | void initClock(); |
Tomáš Pecka | 79344c8 | 2021-09-16 18:25:59 +0200 | [diff] [blame] | 26 | void initDNS(sdbus::IConnection& connection, const std::string& dbusName); |
Václav Kubernát | d2927cc | 2021-02-18 04:36:26 +0100 | [diff] [blame] | 27 | |
Tomáš Pecka | 292bc9c | 2021-01-11 22:03:11 +0100 | [diff] [blame] | 28 | std::shared_ptr<::sysrepo::Session> m_srSession; |
Tomáš Pecka | 879a603 | 2021-02-03 17:21:48 +0100 | [diff] [blame] | 29 | std::shared_ptr<::sysrepo::Subscribe> m_srSubscribe; |
Tomáš Pecka | 292bc9c | 2021-01-11 22:03:11 +0100 | [diff] [blame] | 30 | velia::Log m_log; |
| 31 | }; |
| 32 | } |