Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Davide Pesavento | 9a8bae5 | 2016-02-24 20:33:08 +0100 | [diff] [blame] | 3 | * Copyright (c) 2013-2016 Regents of the University of California. |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 6 | * |
| 7 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 8 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 16 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 20 | */ |
| 21 | |
Davide Pesavento | 9a8bae5 | 2016-02-24 20:33:08 +0100 | [diff] [blame] | 22 | #include "network-monitor.hpp" |
| 23 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 24 | #include "ndn-cxx-config.hpp" |
| 25 | |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 26 | #if defined(NDN_CXX_HAVE_COREFOUNDATION_COREFOUNDATION_H) |
Davide Pesavento | 9a8bae5 | 2016-02-24 20:33:08 +0100 | [diff] [blame] | 27 | #include "detail/network-monitor-impl-osx.hpp" |
Alexander Afanasyev | 7b3080f | 2015-01-28 21:21:01 -0800 | [diff] [blame] | 28 | #elif defined(NDN_CXX_HAVE_RTNETLINK) |
Davide Pesavento | 9a8bae5 | 2016-02-24 20:33:08 +0100 | [diff] [blame] | 29 | #include "detail/network-monitor-impl-rtnl.hpp" |
| 30 | #else |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 31 | |
| 32 | namespace ndn { |
| 33 | namespace util { |
| 34 | |
Alexander Afanasyev | 7b3080f | 2015-01-28 21:21:01 -0800 | [diff] [blame] | 35 | class NetworkMonitor::Impl |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 36 | { |
Alexander Afanasyev | 7b3080f | 2015-01-28 21:21:01 -0800 | [diff] [blame] | 37 | public: |
| 38 | Impl(NetworkMonitor& nm, boost::asio::io_service& io) |
Alexander Afanasyev | 7b3080f | 2015-01-28 21:21:01 -0800 | [diff] [blame] | 39 | { |
Davide Pesavento | 9a8bae5 | 2016-02-24 20:33:08 +0100 | [diff] [blame] | 40 | BOOST_THROW_EXCEPTION(Error("Network monitoring is not supported on this platform")); |
Alexander Afanasyev | 7b3080f | 2015-01-28 21:21:01 -0800 | [diff] [blame] | 41 | } |
Alexander Afanasyev | 7b3080f | 2015-01-28 21:21:01 -0800 | [diff] [blame] | 42 | }; |
| 43 | |
Davide Pesavento | 9a8bae5 | 2016-02-24 20:33:08 +0100 | [diff] [blame] | 44 | } // namespace util |
| 45 | } // namespace ndn |
Alexander Afanasyev | 7b3080f | 2015-01-28 21:21:01 -0800 | [diff] [blame] | 46 | |
Davide Pesavento | 9a8bae5 | 2016-02-24 20:33:08 +0100 | [diff] [blame] | 47 | #endif |
| 48 | |
| 49 | namespace ndn { |
| 50 | namespace util { |
Alexander Afanasyev | 7b3080f | 2015-01-28 21:21:01 -0800 | [diff] [blame] | 51 | |
| 52 | NetworkMonitor::NetworkMonitor(boost::asio::io_service& io) |
| 53 | : m_impl(new Impl(*this, io)) |
| 54 | { |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 55 | } |
| 56 | |
Davide Pesavento | 9a8bae5 | 2016-02-24 20:33:08 +0100 | [diff] [blame] | 57 | NetworkMonitor::~NetworkMonitor() = default; |
Alexander Afanasyev | e6c65e2 | 2015-01-28 19:56:03 -0800 | [diff] [blame] | 58 | |
| 59 | } // namespace util |
| 60 | } // namespace ndn |