Exemplo n.º 1
0
void
HelloProtocol::onRegistrationFailure(const ndn::nfd::ControlResponse& response,
                                     const ndn::Name& name)
{
  _LOG_DEBUG(response.getText() << " (code: " << response.getCode() << ")");
  /*
  * If NLSR can not create face for given faceUri then it will treat this
  * failure as one INFO interest timed out. So that NLSR can move on with
  * building Adj Lsa and calculate routing table. NLSR does not build Adj
  * Lsa unless all the neighbors are ACTIVE or DEAD. For considering the
  * missconfigured(link) neighbour dead this is required.
  */
  Adjacent *adjacent = m_nlsr.getAdjacencyList().findAdjacent(name);
  if (adjacent != 0) {
    adjacent->setInterestTimedOutNo(adjacent->getInterestTimedOutNo() + 1);
    Adjacent::Status status = adjacent->getStatus();
    uint32_t infoIntTimedOutCount = adjacent->getInterestTimedOutNo();

    if (infoIntTimedOutCount == m_nlsr.getConfParameter().getInterestRetryNumber()) {
      if (status == Adjacent::STATUS_ACTIVE) {
        adjacent->setStatus(Adjacent::STATUS_INACTIVE);
      }

      m_nlsr.getLsdb().scheduleAdjLsaBuild();
    }
  }
}
Exemplo n.º 2
0
void
FaceIdFetcher::onFaceCreateError(const ndn::nfd::ControlResponse& response,
                                 const std::string& message)
{
  std::stringstream ss;
  ss << message << " : " << response.getText() << " (code " << response.getCode() << ")";
  fail(ss.str());
}
Exemplo n.º 3
0
Arquivo: fib.cpp Projeto: cawka/NLSR
void
Fib::onRegistrationFailure(const ndn::nfd::ControlResponse& response,
                           const std::string& message,
                           const ndn::nfd::ControlParameters& parameters,
                           const ndn::FaceUri& faceUri,
                           uint8_t times)
{
  NLSR_LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
  NLSR_LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << times);
  if (times < 3) {
    NLSR_LOG_DEBUG("Trying to register again...");
    registerPrefix(parameters.getName(), faceUri,
                   parameters.getCost(),
                   parameters.getExpirationPeriod(),
                   parameters.getFlags(), times+1);
  }
  else {
    NLSR_LOG_DEBUG("Registration trial given up");
  }
}
Exemplo n.º 4
0
Arquivo: fib.cpp Projeto: cawka/NLSR
void
Fib::onUnregistrationFailure(const ndn::nfd::ControlResponse& response,
                             const std::string& message)
{
  NLSR_LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
}