void
StrategyChoiceHelper::Install(Ptr<Node> node, const Name& namePrefix, const Name& strategy)
{
  ControlParameters parameters;
  parameters.setName(namePrefix);
  NS_LOG_DEBUG("Node ID: " << node->GetId() << " with forwarding strategy " << strategy);
  parameters.setStrategy(strategy);
  sendCommand(parameters, node);
}
Exemplo n.º 2
0
BOOST_FIXTURE_TEST_CASE(UnsignedCommand, AllStrategiesFixture)
{
  ControlParameters parameters;
  parameters.setName("/test");
  parameters.setStrategy("/localhost/nfd/strategy/best-route");

  Block encodedParameters(parameters.wireEncode());

  Name commandName("/localhost/nfd/strategy-choice");
  commandName.append("set");
  commandName.append(encodedParameters);

  shared_ptr<Interest> command(make_shared<Interest>(commandName));

  getFace()->onReceiveData +=
    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
         command->getName(), 401, "Signature required");

  getManager().onStrategyChoiceRequest(*command);

  BOOST_REQUIRE(didCallbackFire());
}