Skip to content

Commit

Permalink
model: Remove deprecated "old" content store policies
Browse files Browse the repository at this point in the history
Use policies and policy interface provided by NFD

Change-Id: I6d4b06225114d1680c9ff3c17b2616298959b0dc
  • Loading branch information
cawka committed May 31, 2020
1 parent 5a80831 commit 8fbcc64
Show file tree
Hide file tree
Showing 37 changed files with 6 additions and 5,216 deletions.
7 changes: 0 additions & 7 deletions bindings/modulegen__gcc_ILP32.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ def reg_stackhelper(cls):
param('const std::string&', 'attr4', default_value='""'), param('const std::string&', 'value4', default_value='""')])

cls.add_method('setCsSize', retval('void'), [param('size_t', 'maxSize')])
cls.add_method('SetOldContentStore',
retval('void'),
[param('const std::string&', 'contentStoreClass'),
param('const std::string&', 'attr1', default_value='""'), param('const std::string&', 'value1', default_value='""'),
param('const std::string&', 'attr2', default_value='""'), param('const std::string&', 'value2', default_value='""'),
param('const std::string&', 'attr3', default_value='""'), param('const std::string&', 'value3', default_value='""'),
param('const std::string&', 'attr4', default_value='""'), param('const std::string&', 'value4', default_value='""')])
reg_stackhelper(root_module['ns3::ndn::StackHelper'])

def reg_fibhelper(cls):
Expand Down
7 changes: 0 additions & 7 deletions bindings/modulegen__gcc_LP64.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ def reg_stackhelper(cls):
param('const std::string&', 'attr4', default_value='""'), param('const std::string&', 'value4', default_value='""')])

cls.add_method('setCsSize', retval('void'), [param('size_t', 'maxSize')])
cls.add_method('SetOldContentStore',
retval('void'),
[param('const std::string&', 'contentStoreClass'),
param('const std::string&', 'attr1', default_value='""'), param('const std::string&', 'value1', default_value='""'),
param('const std::string&', 'attr2', default_value='""'), param('const std::string&', 'value2', default_value='""'),
param('const std::string&', 'attr3', default_value='""'), param('const std::string&', 'value3', default_value='""'),
param('const std::string&', 'attr4', default_value='""'), param('const std::string&', 'value4', default_value='""')])
reg_stackhelper(root_module['ns3::ndn::StackHelper'])

def reg_fibhelper(cls):
Expand Down
31 changes: 1 addition & 30 deletions helper/ndn-stack-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "model/ndn-net-device-transport.hpp"
#include "utils/ndn-time.hpp"
#include "utils/dummy-keychain.hpp"
#include "model/cs/ndn-content-store.hpp"

#include <limits>
#include <map>
Expand Down Expand Up @@ -64,7 +63,6 @@ StackHelper::StackHelper()
m_csPolicyCreationFunc = m_csPolicies["nfd::cs::lru"];

m_ndnFactory.SetTypeId("ns3::ndn::L3Protocol");
m_contentStoreFactory.SetTypeId("ns3::ndn::cs::Lru");

m_netDeviceCallbacks.push_back(
std::make_pair(PointToPointNetDevice::GetTypeId(),
Expand Down Expand Up @@ -113,26 +111,6 @@ StackHelper::SetStackAttributes(const std::string& attr1, const std::string& val
m_ndnFactory.Set(attr4, StringValue(value4));
}

void
StackHelper::SetOldContentStore(const std::string& contentStore, const std::string& attr1,
const std::string& value1, const std::string& attr2,
const std::string& value2, const std::string& attr3,
const std::string& value3, const std::string& attr4,
const std::string& value4)
{
m_maxCsSize = 0;

m_contentStoreFactory.SetTypeId(contentStore);
if (attr1 != "")
m_contentStoreFactory.Set(attr1, StringValue(value1));
if (attr2 != "")
m_contentStoreFactory.Set(attr2, StringValue(value2));
if (attr3 != "")
m_contentStoreFactory.Set(attr3, StringValue(value3));
if (attr4 != "")
m_contentStoreFactory.Set(attr4, StringValue(value4));
}

void
StackHelper::setCsSize(size_t maxSize)
{
Expand Down Expand Up @@ -197,14 +175,7 @@ StackHelper::doInstall(Ptr<Node> node) const

ndn->getConfig().put("tables.cs_max_packets", (m_maxCsSize == 0) ? 1 : m_maxCsSize);

// Create and aggregate content store if NFD's contest store has been disabled
if (m_maxCsSize == 0) {
ndn->AggregateObject(m_contentStoreFactory.Create<ContentStore>());
}
// if NFD's CS is enabled, check if a replacement policy has been specified
else {
ndn->setCsReplacementPolicy(m_csPolicyCreationFunc);
}
ndn->setCsReplacementPolicy(m_csPolicyCreationFunc);

// Aggregate L3Protocol on node (must be after setting ndnSIM CS)
node->AggregateObject(ndn);
Expand Down
14 changes: 0 additions & 14 deletions helper/ndn-stack-helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,6 @@ class StackHelper : boost::noncopyable {
void
setPolicy(const std::string& policy);

/**
* @brief Set ndnSIM 1.0 content store implementation and its attributes
* @param contentStoreClass string, representing class of the content store
* @note ndnSIM 1.0 content store implementation have limited support for Interest selectors
* Do not use these implementations if your scenario relies on proper selector processing.
*/
void
SetOldContentStore(const std::string& contentStoreClass, const std::string& attr1 = "",
const std::string& value1 = "", const std::string& attr2 = "",
const std::string& value2 = "", const std::string& attr3 = "",
const std::string& value3 = "", const std::string& attr4 = "",
const std::string& value4 = "");

typedef Callback<shared_ptr<Face>, Ptr<Node>, Ptr<L3Protocol>, Ptr<NetDevice>>
FaceCreateCallback;

Expand Down Expand Up @@ -266,7 +253,6 @@ class StackHelper : boost::noncopyable {

private:
ObjectFactory m_ndnFactory;
ObjectFactory m_contentStoreFactory;

bool m_needSetDefaultRoutes;
size_t m_maxCsSize;
Expand Down
121 changes: 0 additions & 121 deletions model/cs/content-store-impl.cpp

This file was deleted.

Loading

0 comments on commit 8fbcc64

Please sign in to comment.