Eric Newberry | 94996d6 | 2015-05-07 13:48:46 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (c) 2015, Arizona Board of Regents. |
| 4 | * |
| 5 | * This file is part of ndn-tools (Named Data Networking Essential Tools). |
| 6 | * See AUTHORS.md for complete list of ndn-tools authors and contributors. |
| 7 | * |
| 8 | * ndn-tools is free software: you can redistribute it and/or modify it under the terms |
| 9 | * 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 | * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 13 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 | * 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 |
| 17 | * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * @author Eric Newberry <enewberry@email.arizona.edu> |
| 20 | */ |
| 21 | |
| 22 | #ifndef NDN_TOOLS_PING_SERVER_TRACER_HPP |
| 23 | #define NDN_TOOLS_PING_SERVER_TRACER_HPP |
| 24 | |
| 25 | #include "core/common.hpp" |
| 26 | |
| 27 | #include "ping-server.hpp" |
| 28 | |
| 29 | namespace ndn { |
| 30 | namespace ping { |
| 31 | namespace server { |
| 32 | |
| 33 | /** |
| 34 | * @brief logs ping responses |
| 35 | */ |
| 36 | class Tracer : noncopyable |
| 37 | { |
| 38 | public: |
| 39 | Tracer(PingServer& pingServer, const Options& options); |
| 40 | |
| 41 | /** |
| 42 | * Prints ping information when interest received |
| 43 | * @param name interest name received |
| 44 | */ |
| 45 | void |
| 46 | onReceive(const Name& name); |
| 47 | |
| 48 | private: |
| 49 | const Options& m_options; |
| 50 | }; |
| 51 | |
| 52 | } // namespace server |
| 53 | } // namespace ping |
| 54 | } // namespace ndn |
| 55 | |
| 56 | #endif //NDN_TOOLS_PING_SERVER_TRACER_HPP |