blob: c5e621e8a7f57f9b061b329852dbe4afcefd2345 [file] [log] [blame]
Tomáš Peckaf10b9302021-02-23 19:02:02 +01001/*
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 <sysrepo-cpp/Session.hpp>
10#include "utils/log-fwd.h"
11
12struct rtnl_link;
Tomáš Pecka09729382021-03-08 19:36:50 +010013struct rtnl_addr;
Tomáš Peckaf10b9302021-02-23 19:02:02 +010014
15namespace velia::system {
16
17class Rtnetlink;
18
19class IETFInterfaces {
20public:
21 explicit IETFInterfaces(std::shared_ptr<::sysrepo::Session> srSess);
22
23private:
24 void onLinkUpdate(rtnl_link* link, int action);
Tomáš Pecka09729382021-03-08 19:36:50 +010025 void onAddrUpdate(rtnl_addr* addr, int action);
Tomáš Peckaf10b9302021-02-23 19:02:02 +010026
27 std::shared_ptr<::sysrepo::Session> m_srSession;
28 velia::Log m_log;
29 std::shared_ptr<Rtnetlink> m_rtnetlink; // first to destroy, because the callback to rtnetlink uses m_srSession and m_log
30};
31}