tests/management: improved callback validation Fixed bad shared_ptr NULL checks Fixed bad iterator decrement in InternalFace.sendInterest Removed semi-useless constants in FibManager Clarified ControlResponse text messages Change-Id: Ic327a0b6b57827e401c7c3115d0ee92bae996a34 refs: #1138
49 lines
995 B
C++
49 lines
995 B
C++
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
|
/**
|
|
* Copyright (C) 2014 Named Data Networking Project
|
|
* See COPYING for copyright and distribution information.
|
|
*/
|
|
|
|
#include "manager-base.hpp"
|
|
#include "mgmt/app-face.hpp"
|
|
|
|
#include <ndn-cpp-dev/management/control-response.hpp>
|
|
|
|
namespace nfd {
|
|
|
|
NFD_LOG_INIT("ManagerBase");
|
|
|
|
ManagerBase::ManagerBase(shared_ptr<AppFace> face)
|
|
: m_face(face)
|
|
{
|
|
|
|
}
|
|
|
|
ManagerBase::~ManagerBase()
|
|
{
|
|
|
|
}
|
|
|
|
void
|
|
ManagerBase::sendResponse(const Name& name,
|
|
uint32_t code,
|
|
const std::string& text)
|
|
{
|
|
ndn::ControlResponse control(code, text);
|
|
const Block& encodedControl = control.wireEncode();
|
|
|
|
NFD_LOG_DEBUG("sending control response"
|
|
<< " Name: " << name
|
|
<< " code: " << code
|
|
<< " text: " << text);
|
|
|
|
Data response(name);
|
|
response.setContent(encodedControl);
|
|
|
|
m_face->sign(response);
|
|
m_face->put(response);
|
|
}
|
|
|
|
|
|
} // namespace nfd
|