Tomáš Pecka | 39bbb51 | 2021-05-23 22:07:22 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 CESNET, https://photonics.cesnet.cz/ |
| 3 | * |
| 4 | * Written by Tomáš Pecka <tomas.pecka@cesnet.cz> |
| 5 | * |
| 6 | */ |
| 7 | #pragma once |
| 8 | |
| 9 | #include <filesystem> |
Václav Kubernát | 7efd6d5 | 2021-11-09 01:31:11 +0100 | [diff] [blame] | 10 | #include <map> |
Tomáš Pecka | 39bbb51 | 2021-05-23 22:07:22 +0200 | [diff] [blame] | 11 | #include <sysrepo-cpp/Session.hpp> |
| 12 | #include "utils/log-fwd.h" |
| 13 | |
| 14 | namespace velia::system { |
| 15 | |
| 16 | class Rtnetlink; |
| 17 | |
| 18 | class IETFInterfacesConfig { |
| 19 | public: |
| 20 | using reload_cb_t = std::function<void(const std::vector<std::string>&)>; |
Václav Kubernát | 7efd6d5 | 2021-11-09 01:31:11 +0100 | [diff] [blame] | 21 | explicit IETFInterfacesConfig(::sysrepo::Session srSess, std::filesystem::path configDirectory, std::vector<std::string> managedLinks, reload_cb_t reloadCallback); |
Tomáš Pecka | 39bbb51 | 2021-05-23 22:07:22 +0200 | [diff] [blame] | 22 | |
| 23 | private: |
| 24 | velia::Log m_log; |
| 25 | reload_cb_t m_reloadCb; |
| 26 | std::filesystem::path m_configDirectory; |
| 27 | std::vector<std::string> m_managedLinks; |
Václav Kubernát | 7efd6d5 | 2021-11-09 01:31:11 +0100 | [diff] [blame] | 28 | ::sysrepo::Session m_srSession; |
| 29 | std::optional<::sysrepo::Subscription> m_srSubscribe; |
Tomáš Pecka | 39bbb51 | 2021-05-23 22:07:22 +0200 | [diff] [blame] | 30 | |
Václav Kubernát | 7efd6d5 | 2021-11-09 01:31:11 +0100 | [diff] [blame] | 31 | sysrepo::ErrorCode moduleChange(::sysrepo::Session session) const; |
Tomáš Pecka | 39bbb51 | 2021-05-23 22:07:22 +0200 | [diff] [blame] | 32 | std::vector<std::string> updateNetworkFiles(const std::map<std::string, std::string>& networkConfig, const std::filesystem::path& configDir) const; |
| 33 | }; |
| 34 | } |