blob: 10019dd1422761e3c333d915b826999ec5d29b52 [file] [log] [blame]
Qi Zhao3ec33312017-02-12 02:51:05 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2013-2017, Regents of the University of California,
4 *
5 * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
6 * authors and contributors.
7 *
8 * NFD Control Center is free software: you can redistribute it and/or modify it under the
9 * terms of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with NFD
17 * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef NCC_OSX_ADHOC_HPP
21#define NCC_OSX_ADHOC_HPP
22
23#include "config.hpp"
24
25#include <ndn-cxx/face.hpp>
26#include <ndn-cxx/mgmt/nfd/controller.hpp>
27#include <ndn-cxx/mgmt/nfd/face-monitor.hpp>
28
29#ifdef OSX_BUILD
30#define ADHOC_SUPPORTED 1
31#endif // OSX_BUILD
32
33#ifdef ADHOC_SUPPORTED
34
35namespace ndn {
36namespace ncc {
37
38class Adhoc
39{
40public:
41 Adhoc(Face& face, KeyChain& keychain);
42
43 ~Adhoc();
44
45 bool
46 createAdhoc();
47
48 void
49 onNotification(const ndn::nfd::FaceEventNotification& notification);
50
51 void
52 destroyAdhoc();
53
54private:
55 void
56 unregisterRoutes(uint16_t origin);
57
58private:
59 Face& m_face;
60 KeyChain& m_keyChain;
61 nfd::Controller* m_controller;
62 nfd::FaceMonitor* m_faceMonitor;
63};
64
65} // namespace ncc
66} // namespace ndn
67
68#endif // ADHOC_SUPPORTED
69
70#endif // NCC_OSX_ADHOC_HPP