[ndnSIM] ndn router setting

babak nikmard babak.nikmard at gmail.com
Thu Jul 18 09:00:56 PDT 2019


>
> dear Junxiao
> would you please help more about your viewpoint. my ndnsim version is
> ndnsim2.7 . and you told me h have to manipulate nfd cs class . how can i
> do it...
>
> in below, i put the cs.cpp, what should i do for your notion
> You are kind to me
>
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
> 2 /*
> 3  * Copyright (c) 2014-2018, Regents of the University of California,
> 4  * Arizona Board of Regents,
> 5  * Colorado State University,
> 6  * University Pierre & Marie Curie, Sorbonne University,
> 7  * Washington University in St. Louis,
> 8  * Beijing Institute of Technology,
> 9  * The University of Memphis.
> 10  *
> 11  * This file is part of NFD (Named Data Networking Forwarding Daemon).
> 12  * See AUTHORS.md for complete list of NFD authors and contributors.
> 13  *
> 14  * NFD is free software: you can redistribute it and/or modify it
> under the terms
> 15  * of the GNU General Public License as published by the Free Software
> Foundation,
> 16  * either version 3 of the License, or (at your option) any later
> version.
> 17  *
> 18  * NFD is distributed in the hope that it will be useful, but WITHOUT
> ANY WARRANTY;
> 19  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
> A PARTICULAR
> 20  * PURPOSE. See the GNU General Public License for more details.
> 21  *
> 22  * You should have received a copy of the GNU General Public License
> along with
> 23  * NFD, e.g., in COPYING.md file. If not, see <
> http://www.gnu.org/licenses/>.
> 24  */
> 25
> 26 #include "cs.hpp <https://ndnsim.net/2.6/doxygen/cs_8hpp.html>"
> 27 #include "core/algorithm.hpp
> <https://ndnsim.net/2.6/doxygen/core_2algorithm_8hpp.html>"
> 28 #include "core/logger.hpp
> <https://ndnsim.net/2.6/doxygen/NFD_2core_2logger_8hpp.html>"
> 29
> 30 #include <ndn-cxx/lp/tags.hpp>
> 31 #include <ndn-cxx/util/concepts.hpp>
> 32
> 33 namespace nfd <https://ndnsim.net/2.6/doxygen/namespacenfd.html> {
> 34 namespace cs {
> 35
> 36 NDN_CXX_ASSERT_FORWARD_ITERATOR
> <https://ndnsim.net/2.6/doxygen/namespacenfd_1_1cs.html#a406e9bfd27c72e0d8c8427885258dbe6>
> (Cs::const_iterator
> <https://ndnsim.net/2.6/doxygen/classnfd_1_1cs_1_1Cs.html#a59777b86bdfb8755c9e0429fb1317a1d>
> );
> 37
> 38
> <https://ndnsim.net/2.6/doxygen/namespacenfd_1_1cs.html#adfe18457b5fd31925745c0cb98d88cb0>
>  NFD_LOG_INIT
> <https://ndnsim.net/2.6/doxygen/NFD_2core_2logger_8hpp.html#a1bb17648669a80cb0e490bcfc43e6f9f>
> ("ContentStore");
> 39
> 40 unique_ptr<Policy>
> 41
> <https://ndnsim.net/2.6/doxygen/namespacenfd_1_1cs.html#ab1f0e314d2f9804b4f6eaa9152a7fb90>
>  makeDefaultPolicy
> <https://ndnsim.net/2.6/doxygen/namespacenfd_1_1cs.html#ab1f0e314d2f9804b4f6eaa9152a7fb90>
> ()
> 42 {
> 43  const std::string DEFAULT_POLICY = "priority_fifo";
> 44  return Policy::create
> <https://ndnsim.net/2.6/doxygen/classnfd_1_1cs_1_1Policy.html#a5c0d6bc7dc0f1f7077679bcc01584738>
> (DEFAULT_POLICY);
> 45 }
> 46
> 47
> <https://ndnsim.net/2.6/doxygen/classnfd_1_1cs_1_1Cs.html#a8bae7ccc9634ed1364ed4f6d28c8538a>
>  Cs::Cs
> <https://ndnsim.net/2.6/doxygen/classnfd_1_1cs_1_1Cs.html#a8bae7ccc9634ed1364ed4f6d28c8538a>
> (size_t nMaxPackets)
> 48  : m_shouldAdmit(true)
> 49  , m_shouldServe(true)
> 50 {
> 51  this->setPolicyImpl(makeDefaultPolicy
> <https://ndnsim.net/2.6/doxygen/namespacenfd_1_1cs.html#ab1f0e314d2f9804b4f6eaa9152a7fb90>
> ());
> 52  m_policy->setLimit(nMaxPackets);
> 53 }
> 54
> 55 void
> 56
> <https://ndnsim.net/2.6/doxygen/classnfd_1_1cs_1_1Cs.html#a8f17a41defc973cfa3bfba01f1486410>
>  Cs::insert
> <https://ndnsim.net/2.6/doxygen/classnfd_1_1cs_1_1Cs.html#a8f17a41defc973cfa3bfba01f1486410>
> (const Data <https://ndnsim.net/2.6/doxygen/classndn_1_1Data.html>& data,
> bool isUnsolicited)
> 57 {
> 58  if (!m_shouldAdmit || m_policy->getLimit() == 0) {
> 59  return;
> 60  }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20190718/6337da46/attachment-0001.html>


More information about the ndnSIM mailing list