Tomáš Pecka | f10b930 | 2021-02-23 19:02:02 +0100 | [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 <sysrepo-cpp/Session.hpp> |
| 10 | #include "utils/log-fwd.h" |
| 11 | |
| 12 | struct rtnl_link; |
Tomáš Pecka | 0972938 | 2021-03-08 19:36:50 +0100 | [diff] [blame] | 13 | struct rtnl_addr; |
Tomáš Pecka | f10b930 | 2021-02-23 19:02:02 +0100 | [diff] [blame] | 14 | |
| 15 | namespace velia::system { |
| 16 | |
| 17 | class Rtnetlink; |
| 18 | |
| 19 | class IETFInterfaces { |
| 20 | public: |
| 21 | explicit IETFInterfaces(std::shared_ptr<::sysrepo::Session> srSess); |
| 22 | |
| 23 | private: |
| 24 | void onLinkUpdate(rtnl_link* link, int action); |
Tomáš Pecka | 0972938 | 2021-03-08 19:36:50 +0100 | [diff] [blame] | 25 | void onAddrUpdate(rtnl_addr* addr, int action); |
Tomáš Pecka | f10b930 | 2021-02-23 19:02:02 +0100 | [diff] [blame] | 26 | |
| 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 | } |