Steve DiBenedetto | 042bfe9 | 2014-01-30 15:05:08 -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 | #include "manager-base.hpp" |
| 8 | #include "mgmt/app-face.hpp" |
| 9 | |
| 10 | #include <ndn-cpp-dev/management/control-response.hpp> |
| 11 | |
| 12 | namespace nfd { |
| 13 | |
| 14 | ManagerBase::ManagerBase(shared_ptr<AppFace> face) |
| 15 | : m_face(face) |
| 16 | { |
| 17 | |
| 18 | } |
| 19 | |
| 20 | ManagerBase::~ManagerBase() |
| 21 | { |
| 22 | |
| 23 | } |
| 24 | |
| 25 | void |
| 26 | ManagerBase::sendResponse(const Name& name, |
| 27 | uint32_t code, |
| 28 | const std::string& text) |
| 29 | { |
| 30 | Data response(name); |
| 31 | |
| 32 | response.setContent(ndn::ControlResponse(code, text).wireEncode()); |
| 33 | m_face->put(response); |
| 34 | } |
| 35 | |
| 36 | |
| 37 | } // namespace nfd |