Junxiao Shi | ea48d8b | 2014-03-16 13:53:47 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2014 Named Data Networking Project |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #ifndef NFD_MGMT_STATUS_SERVER_HPP |
| 8 | #define NFD_MGMT_STATUS_SERVER_HPP |
| 9 | |
| 10 | #include "mgmt/app-face.hpp" |
Junxiao Shi | 88d6937 | 2014-03-28 11:52:39 -0700 | [diff] [blame^] | 11 | #include <ndn-cpp-dev/management/nfd-forwarder-status.hpp> |
Junxiao Shi | ea48d8b | 2014-03-16 13:53:47 -0700 | [diff] [blame] | 12 | |
| 13 | namespace nfd { |
| 14 | |
| 15 | class Forwarder; |
| 16 | |
| 17 | class StatusServer : noncopyable |
| 18 | { |
| 19 | public: |
| 20 | StatusServer(shared_ptr<AppFace> face, Forwarder& forwarder); |
| 21 | |
| 22 | private: |
| 23 | void |
| 24 | onInterest(const Interest& interest) const; |
| 25 | |
Junxiao Shi | 88d6937 | 2014-03-28 11:52:39 -0700 | [diff] [blame^] | 26 | shared_ptr<ndn::nfd::ForwarderStatus> |
Junxiao Shi | ea48d8b | 2014-03-16 13:53:47 -0700 | [diff] [blame] | 27 | collectStatus() const; |
| 28 | |
| 29 | private: |
| 30 | static const Name DATASET_PREFIX; |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame] | 31 | static const time::milliseconds RESPONSE_FRESHNESS; |
Junxiao Shi | ea48d8b | 2014-03-16 13:53:47 -0700 | [diff] [blame] | 32 | |
| 33 | shared_ptr<AppFace> m_face; |
| 34 | Forwarder& m_forwarder; |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame] | 35 | time::system_clock::TimePoint m_startTimestamp; |
Junxiao Shi | ea48d8b | 2014-03-16 13:53:47 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // namespace nfd |
| 39 | |
| 40 | #endif // NFD_MGMT_STATUS_SERVER_HPP |