blob: 36040d9b5e4c228b8339f36e9d70450db76726df [file] [log] [blame]
Tomáš Pecka39bbb512021-05-23 22:07:22 +02001/*
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át7efd6d52021-11-09 01:31:11 +010010#include <map>
Tomáš Pecka39bbb512021-05-23 22:07:22 +020011#include <sysrepo-cpp/Session.hpp>
12#include "utils/log-fwd.h"
13
14namespace velia::system {
15
16class Rtnetlink;
17
18class IETFInterfacesConfig {
19public:
20 using reload_cb_t = std::function<void(const std::vector<std::string>&)>;
Václav Kubernát7efd6d52021-11-09 01:31:11 +010021 explicit IETFInterfacesConfig(::sysrepo::Session srSess, std::filesystem::path configDirectory, std::vector<std::string> managedLinks, reload_cb_t reloadCallback);
Tomáš Pecka39bbb512021-05-23 22:07:22 +020022
23private:
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át7efd6d52021-11-09 01:31:11 +010028 ::sysrepo::Session m_srSession;
29 std::optional<::sysrepo::Subscription> m_srSubscribe;
Tomáš Pecka39bbb512021-05-23 22:07:22 +020030
Václav Kubernát7efd6d52021-11-09 01:31:11 +010031 sysrepo::ErrorCode moduleChange(::sysrepo::Session session) const;
Tomáš Pecka39bbb512021-05-23 22:07:22 +020032 std::vector<std::string> updateNetworkFiles(const std::map<std::string, std::string>& networkConfig, const std::filesystem::path& configDir) const;
33};
34}