Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2011 UCLA |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
Ilya Moiseenko | 25f7d4d | 2011-09-29 18:41:06 -0700 | [diff] [blame] | 18 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 19 | * Ilya Moiseenko <iliamo@cs.ucla.edu> |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
Alexander Afanasyev | 0c39537 | 2014-12-20 15:54:02 -0800 | [diff] [blame] | 22 | #include "ndn-stack-helper.hpp" |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 23 | |
| 24 | #include "ns3/log.h" |
| 25 | #include "ns3/names.h" |
Spyridon Mastorakis | de1f773 | 2014-12-05 22:43:34 -0800 | [diff] [blame^] | 26 | #include "ns3/string.h" |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 27 | #include "ns3/point-to-point-net-device.h" |
| 28 | |
| 29 | #include "model/ndn-l3-protocol.hpp" |
| 30 | #include "model/ndn-net-device-face.hpp" |
| 31 | #include "utils/ndn-time.hpp" |
Alexander Afanasyev | 34e13f3 | 2014-12-14 15:13:28 -0800 | [diff] [blame] | 32 | #include "utils/dummy-keychain.hpp" |
Spyridon Mastorakis | de1f773 | 2014-12-05 22:43:34 -0800 | [diff] [blame^] | 33 | #include "model/cs/ndn-content-store.hpp" |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 34 | |
| 35 | #include <limits> |
| 36 | #include <map> |
Alexander Afanasyev | b762684 | 2012-01-12 13:43:33 -0800 | [diff] [blame] | 37 | #include <boost/lexical_cast.hpp> |
Alexander Afanasyev | a5bbe0e | 2011-11-22 17:28:39 -0800 | [diff] [blame] | 38 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 39 | NS_LOG_COMPONENT_DEFINE("ndn.StackHelper"); |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 40 | |
| 41 | namespace ns3 { |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 42 | namespace ndn { |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 43 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 44 | StackHelper::StackHelper() |
Spyridon Mastorakis | 588fd10 | 2014-11-20 19:50:02 -0800 | [diff] [blame] | 45 | : m_needSetDefaultRoutes(false) |
Spyridon Mastorakis | de1f773 | 2014-12-05 22:43:34 -0800 | [diff] [blame^] | 46 | , m_shouldUseNfdCs(true) |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 47 | { |
Spyridon Mastorakis | 86edf6f | 2014-11-14 19:27:18 -0800 | [diff] [blame] | 48 | setCustomNdnCxxClocks(); |
| 49 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 50 | m_ndnFactory.SetTypeId("ns3::ndn::L3Protocol"); |
Spyridon Mastorakis | de1f773 | 2014-12-05 22:43:34 -0800 | [diff] [blame^] | 51 | m_contentStoreFactory.SetTypeId("ns3::ndn::cs::Lru"); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 52 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 53 | m_netDeviceCallbacks.push_back( |
| 54 | std::make_pair(PointToPointNetDevice::GetTypeId(), |
| 55 | MakeCallback(&StackHelper::PointToPointNetDeviceCallback, this))); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 56 | // default callback will be fired if non of others callbacks fit or did the job |
Ilya Moiseenko | 25f7d4d | 2011-09-29 18:41:06 -0700 | [diff] [blame] | 57 | } |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 58 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 59 | StackHelper::~StackHelper() |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 60 | { |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 61 | } |
| 62 | |
Alexander Afanasyev | 34e13f3 | 2014-12-14 15:13:28 -0800 | [diff] [blame] | 63 | KeyChain& |
| 64 | StackHelper::getKeyChain() |
| 65 | { |
| 66 | static ::ndn::DummyKeyChain keyChain; |
| 67 | return keyChain; |
| 68 | } |
| 69 | |
Alexander Afanasyev | 3a4a0b3 | 2012-06-28 14:14:22 -0700 | [diff] [blame] | 70 | void |
Spyridon Mastorakis | 86edf6f | 2014-11-14 19:27:18 -0800 | [diff] [blame] | 71 | StackHelper::setCustomNdnCxxClocks() |
| 72 | { |
| 73 | ::ndn::time::setCustomClocks(make_shared<ns3::ndn::time::CustomSteadyClock>(), |
| 74 | make_shared<ns3::ndn::time::CustomSystemClock>()); |
| 75 | } |
| 76 | |
Spyridon Mastorakis | 588fd10 | 2014-11-20 19:50:02 -0800 | [diff] [blame] | 77 | void |
| 78 | StackHelper::SetDefaultRoutes(bool needSet) |
| 79 | { |
| 80 | NS_LOG_FUNCTION(this << needSet); |
| 81 | m_needSetDefaultRoutes = needSet; |
| 82 | } |
| 83 | |
Spyridon Mastorakis | de1f773 | 2014-12-05 22:43:34 -0800 | [diff] [blame^] | 84 | void |
| 85 | StackHelper::SetStackAttributes(const std::string& attr1, const std::string& value1, |
| 86 | const std::string& attr2, const std::string& value2, |
| 87 | const std::string& attr3, const std::string& value3, |
| 88 | const std::string& attr4, const std::string& value4) |
| 89 | { |
| 90 | if (attr1 != "") |
| 91 | m_ndnFactory.Set(attr1, StringValue(value1)); |
| 92 | if (attr2 != "") |
| 93 | m_ndnFactory.Set(attr2, StringValue(value2)); |
| 94 | if (attr3 != "") |
| 95 | m_ndnFactory.Set(attr3, StringValue(value3)); |
| 96 | if (attr4 != "") |
| 97 | m_ndnFactory.Set(attr4, StringValue(value4)); |
| 98 | } |
| 99 | |
| 100 | void |
| 101 | StackHelper::SetContentStore(const std::string& contentStore, const std::string& attr1, |
| 102 | const std::string& value1, const std::string& attr2, |
| 103 | const std::string& value2, const std::string& attr3, |
| 104 | const std::string& value3, const std::string& attr4, |
| 105 | const std::string& value4) |
| 106 | { |
| 107 | NS_ASSERT_MSG(m_shouldUseNfdCs == false, |
| 108 | "First choose not to use NFD's CS and then select the replacement policy"); |
| 109 | |
| 110 | m_contentStoreFactory.SetTypeId(contentStore); |
| 111 | if (attr1 != "") |
| 112 | m_contentStoreFactory.Set(attr1, StringValue(value1)); |
| 113 | if (attr2 != "") |
| 114 | m_contentStoreFactory.Set(attr2, StringValue(value2)); |
| 115 | if (attr3 != "") |
| 116 | m_contentStoreFactory.Set(attr3, StringValue(value3)); |
| 117 | if (attr4 != "") |
| 118 | m_contentStoreFactory.Set(attr4, StringValue(value4)); |
| 119 | } |
| 120 | |
| 121 | void |
| 122 | StackHelper::SetContentStoreChoice(bool shouldUseNfdCs) |
| 123 | { |
| 124 | m_shouldUseNfdCs = shouldUseNfdCs; |
| 125 | } |
| 126 | |
| 127 | bool |
| 128 | StackHelper::shouldUseNfdCs() const |
| 129 | { |
| 130 | return m_shouldUseNfdCs; |
| 131 | } |
| 132 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 133 | Ptr<FaceContainer> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 134 | StackHelper::Install(const NodeContainer& c) const |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 135 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 136 | Ptr<FaceContainer> faces = Create<FaceContainer>(); |
| 137 | for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i) { |
| 138 | faces->AddAll(Install(*i)); |
| 139 | } |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 140 | return faces; |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 141 | } |
| 142 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 143 | Ptr<FaceContainer> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 144 | StackHelper::InstallAll() const |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 145 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 146 | return Install(NodeContainer::GetGlobal()); |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 147 | } |
| 148 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 149 | Ptr<FaceContainer> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 150 | StackHelper::Install(Ptr<Node> node) const |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 151 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 152 | Ptr<FaceContainer> faces = Create<FaceContainer>(); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 153 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 154 | if (node->GetObject<L3Protocol>() != 0) { |
| 155 | NS_FATAL_ERROR("StackHelper::Install (): Installing " |
| 156 | "a NdnStack to a node with an existing Ndn object"); |
| 157 | return 0; |
| 158 | } |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 159 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 160 | Ptr<L3Protocol> ndn = m_ndnFactory.Create<L3Protocol>(); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 161 | |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 162 | // NFD initialization |
Spyridon Mastorakis | de1f773 | 2014-12-05 22:43:34 -0800 | [diff] [blame^] | 163 | ndn->initialize(m_shouldUseNfdCs); |
| 164 | |
| 165 | // Create and aggregate content store if NFD's contest store has been disabled |
| 166 | if (!m_shouldUseNfdCs) |
| 167 | ndn->AggregateObject(m_contentStoreFactory.Create<ContentStore>()); |
| 168 | |
| 169 | // Aggregate L3Protocol on node (must be after setting ndnSIM CS) |
| 170 | node->AggregateObject(ndn); |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 171 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 172 | for (uint32_t index = 0; index < node->GetNDevices(); index++) { |
| 173 | Ptr<NetDevice> device = node->GetDevice(index); |
| 174 | // This check does not make sense: LoopbackNetDevice is installed only if IP stack is installed, |
| 175 | // Normally, ndnSIM works without IP stack, so no reason to check |
| 176 | // if (DynamicCast<LoopbackNetDevice> (device) != 0) |
| 177 | // continue; // don't create face for a LoopbackNetDevice |
Alexander Afanasyev | 1145314 | 2011-11-25 16:13:33 -0800 | [diff] [blame] | 178 | |
Spyridon Mastorakis | e4f0d3c | 2014-10-29 13:20:03 -0700 | [diff] [blame] | 179 | shared_ptr<NetDeviceFace> face; |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 180 | |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 181 | for (const auto& item : m_netDeviceCallbacks) { |
| 182 | if (device->GetInstanceTypeId() == item.first || |
| 183 | device->GetInstanceTypeId().IsChildOf(item.first)) { |
| 184 | face = item.second(node, ndn, device); |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 185 | if (face != 0) |
| 186 | break; |
| 187 | } |
Alexander Afanasyev | c5a23e2 | 2011-09-07 00:37:36 -0700 | [diff] [blame] | 188 | } |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 189 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 190 | if (face == 0) { |
| 191 | face = DefaultNetDeviceCallback(node, ndn, device); |
| 192 | } |
| 193 | |
Spyridon Mastorakis | 588fd10 | 2014-11-20 19:50:02 -0800 | [diff] [blame] | 194 | if (m_needSetDefaultRoutes) { |
| 195 | // default route with lowest priority possible |
| 196 | FibHelper::AddRoute(node, "/", face, std::numeric_limits<int32_t>::max()); |
| 197 | } |
| 198 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 199 | faces->Add(face); |
| 200 | } |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 201 | |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 202 | return faces; |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 203 | } |
| 204 | |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 205 | void |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 206 | StackHelper::AddNetDeviceFaceCreateCallback(TypeId netDeviceType, |
| 207 | StackHelper::NetDeviceFaceCreateCallback callback) |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 208 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 209 | m_netDeviceCallbacks.push_back(std::make_pair(netDeviceType, callback)); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 210 | } |
| 211 | |
Alexander Afanasyev | 2a269f7 | 2013-06-06 22:59:33 -0700 | [diff] [blame] | 212 | void |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 213 | StackHelper::UpdateNetDeviceFaceCreateCallback(TypeId netDeviceType, |
| 214 | NetDeviceFaceCreateCallback callback) |
Alexander Afanasyev | 2a269f7 | 2013-06-06 22:59:33 -0700 | [diff] [blame] | 215 | { |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 216 | for (auto& i : m_netDeviceCallbacks) { |
| 217 | if (i.first == netDeviceType) { |
| 218 | i.second = callback; |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 219 | return; |
Alexander Afanasyev | 2a269f7 | 2013-06-06 22:59:33 -0700 | [diff] [blame] | 220 | } |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 221 | } |
Alexander Afanasyev | 2a269f7 | 2013-06-06 22:59:33 -0700 | [diff] [blame] | 222 | } |
| 223 | |
| 224 | void |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 225 | StackHelper::RemoveNetDeviceFaceCreateCallback(TypeId netDeviceType, |
| 226 | NetDeviceFaceCreateCallback callback) |
Alexander Afanasyev | 2a269f7 | 2013-06-06 22:59:33 -0700 | [diff] [blame] | 227 | { |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 228 | m_netDeviceCallbacks.remove_if([&] (const std::pair<TypeId, NetDeviceFaceCreateCallback>& i) { |
| 229 | return (i.first == netDeviceType); |
| 230 | }); |
Alexander Afanasyev | 2a269f7 | 2013-06-06 22:59:33 -0700 | [diff] [blame] | 231 | } |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 232 | |
Spyridon Mastorakis | e4f0d3c | 2014-10-29 13:20:03 -0700 | [diff] [blame] | 233 | shared_ptr<NetDeviceFace> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 234 | StackHelper::DefaultNetDeviceCallback(Ptr<Node> node, Ptr<L3Protocol> ndn, |
| 235 | Ptr<NetDevice> netDevice) const |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 236 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 237 | NS_LOG_DEBUG("Creating default NetDeviceFace on node " << node->GetId()); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 238 | |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 239 | shared_ptr<NetDeviceFace> face = std::make_shared<NetDeviceFace>(node, netDevice); |
Alexander Afanasyev | c17e4bd | 2013-02-17 14:31:56 -0800 | [diff] [blame] | 240 | |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 241 | ndn->addFace(face); |
| 242 | NS_LOG_LOGIC("Node " << node->GetId() << ": added NetDeviceFace as face #" |
| 243 | << face->getLocalUri()); |
Alexander Afanasyev | c17e4bd | 2013-02-17 14:31:56 -0800 | [diff] [blame] | 244 | |
| 245 | return face; |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 246 | } |
| 247 | |
Spyridon Mastorakis | e4f0d3c | 2014-10-29 13:20:03 -0700 | [diff] [blame] | 248 | shared_ptr<NetDeviceFace> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 249 | StackHelper::PointToPointNetDeviceCallback(Ptr<Node> node, Ptr<L3Protocol> ndn, |
| 250 | Ptr<NetDevice> device) const |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 251 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 252 | NS_LOG_DEBUG("Creating point-to-point NetDeviceFace on node " << node->GetId()); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 253 | |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 254 | shared_ptr<NetDeviceFace> face = std::make_shared<NetDeviceFace>(node, device); |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 255 | |
Spyridon Mastorakis | 9760bd0 | 2014-11-12 13:32:55 -0800 | [diff] [blame] | 256 | ndn->addFace(face); |
| 257 | NS_LOG_LOGIC("Node " << node->GetId() << ": added NetDeviceFace as face #" |
| 258 | << face->getLocalUri()); |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 259 | |
Alexander Afanasyev | 122f378 | 2013-02-02 00:04:40 -0800 | [diff] [blame] | 260 | return face; |
| 261 | } |
| 262 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 263 | Ptr<FaceContainer> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 264 | StackHelper::Install(const std::string& nodeName) const |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 265 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 266 | Ptr<Node> node = Names::Find<Node>(nodeName); |
| 267 | return Install(node); |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 268 | } |
| 269 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 270 | } // namespace ndn |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 271 | } // namespace ns3 |