blob: a12e373465f3a4cc570cf82c07348aa4bb91ae83 [file] [log] [blame]
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Davide Pesavento9a8bae52016-02-24 20:33:08 +01003 * Copyright (c) 2013-2016 Regents of the University of California.
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -08004 *
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 Afanasyeve6c65e22015-01-28 19:56:03 -080020 */
21
Davide Pesavento9a8bae52016-02-24 20:33:08 +010022#include "network-monitor.hpp"
23
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080024#include "ndn-cxx-config.hpp"
25
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080026#if defined(NDN_CXX_HAVE_COREFOUNDATION_COREFOUNDATION_H)
Davide Pesavento9a8bae52016-02-24 20:33:08 +010027#include "detail/network-monitor-impl-osx.hpp"
Alexander Afanasyev7b3080f2015-01-28 21:21:01 -080028#elif defined(NDN_CXX_HAVE_RTNETLINK)
Davide Pesavento9a8bae52016-02-24 20:33:08 +010029#include "detail/network-monitor-impl-rtnl.hpp"
30#else
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080031
32namespace ndn {
33namespace util {
34
Alexander Afanasyev7b3080f2015-01-28 21:21:01 -080035class NetworkMonitor::Impl
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080036{
Alexander Afanasyev7b3080f2015-01-28 21:21:01 -080037public:
38 Impl(NetworkMonitor& nm, boost::asio::io_service& io)
Alexander Afanasyev7b3080f2015-01-28 21:21:01 -080039 {
Davide Pesavento9a8bae52016-02-24 20:33:08 +010040 BOOST_THROW_EXCEPTION(Error("Network monitoring is not supported on this platform"));
Alexander Afanasyev7b3080f2015-01-28 21:21:01 -080041 }
Alexander Afanasyev7b3080f2015-01-28 21:21:01 -080042};
43
Davide Pesavento9a8bae52016-02-24 20:33:08 +010044} // namespace util
45} // namespace ndn
Alexander Afanasyev7b3080f2015-01-28 21:21:01 -080046
Davide Pesavento9a8bae52016-02-24 20:33:08 +010047#endif
48
49namespace ndn {
50namespace util {
Alexander Afanasyev7b3080f2015-01-28 21:21:01 -080051
52NetworkMonitor::NetworkMonitor(boost::asio::io_service& io)
53 : m_impl(new Impl(*this, io))
54{
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080055}
56
Davide Pesavento9a8bae52016-02-24 20:33:08 +010057NetworkMonitor::~NetworkMonitor() = default;
Alexander Afanasyeve6c65e22015-01-28 19:56:03 -080058
59} // namespace util
60} // namespace ndn