model: Add method that is necessary for python bindings
Refs: #2341
diff --git a/model/ndn-l3-protocol.cpp b/model/ndn-l3-protocol.cpp
index dc487bc..39ce2ca 100644
--- a/model/ndn-l3-protocol.cpp
+++ b/model/ndn-l3-protocol.cpp
@@ -351,5 +351,13 @@
return nullptr;
}
+Ptr<L3Protocol>
+L3Protocol::getL3Protocol(Ptr<Object> node)
+{
+ Ptr<L3Protocol> retval = node->GetObject<L3Protocol>();
+ NS_ASSERT_MSG(retval != nullptr, "L3Protocol is not aggregated on this object");
+ return retval;
+}
+
} // namespace ndn
} // namespace ns3
diff --git a/model/ndn-l3-protocol.hpp b/model/ndn-l3-protocol.hpp
index 11de1b8..79583c1 100644
--- a/model/ndn-l3-protocol.hpp
+++ b/model/ndn-l3-protocol.hpp
@@ -151,6 +151,10 @@
nfd::ConfigSection&
getConfig();
+public: // Workaround for python bindings
+ static Ptr<L3Protocol>
+ getL3Protocol(Ptr<Object> node);
+
protected:
virtual void
DoDispose(void); ///< @brief Do cleanup