Support of isLocal interface for all face types
diff --git a/model/ccnx-face.cc b/model/ccnx-face.cc
index 38d76e6..7821055 100644
--- a/model/ccnx-face.cc
+++ b/model/ccnx-face.cc
@@ -132,6 +132,12 @@
}
bool
+CcnxFace::IsLocal() const
+{
+ return m_isLocal;
+}
+
+bool
CcnxFace::operator== (const CcnxFace &face) const
{
NS_ASSERT_MSG (m_node->GetId () == face.m_node->GetId (), "Faces of different nodes should not be compared to each other");
diff --git a/model/ccnx-face.h b/model/ccnx-face.h
index 07561a0..481a55d 100644
--- a/model/ccnx-face.h
+++ b/model/ccnx-face.h
@@ -136,6 +136,11 @@
*/
virtual bool IsDown () const;
+ /**
+ * \brief Return true for LocalFace, otherwise false
+ */
+ virtual bool IsLocal () const;
+
virtual std::ostream&
Print (std::ostream &os) const;
@@ -186,10 +191,11 @@
// uint16_t m_metric; ///< \brief Routing/forwarding metric
Ptr<Node> m_node; ///< \brief Smart pointer to Node
ProtocolHandler m_protocolHandler; ///< Callback via which packets are getting send to CCNx stack
-
+ bool m_isLocal;
private:
bool m_ifup; ///< \brief flag indicating that the interface is UP
uint32_t m_id; ///< \brief id of the interface in CCNx stack (per-node uniqueness)
+
};
std::ostream& operator<< (std::ostream& os, const CcnxFace &face);
diff --git a/model/ccnx-local-face.cc b/model/ccnx-local-face.cc
index aa2c787..5020877 100644
--- a/model/ccnx-local-face.cc
+++ b/model/ccnx-local-face.cc
@@ -54,6 +54,7 @@
, m_onContentObject (0)
{
NS_LOG_FUNCTION (this);
+ m_isLocal = true;
}
CcnxLocalFace::~CcnxLocalFace ()
@@ -78,10 +79,11 @@
{
m_onContentObject = onContentObject;
}
-
+
void
CcnxLocalFace::Send (Ptr<Packet> p)
{
+ NS_LOG_FUNCTION("Local face send");
NS_LOG_FUNCTION (*p);
if (!IsUp ())
{
diff --git a/model/ccnx-local-face.h b/model/ccnx-local-face.h
index 24cca9f..664130c 100644
--- a/model/ccnx-local-face.h
+++ b/model/ccnx-local-face.h
@@ -68,7 +68,7 @@
*/
virtual void
Send (Ptr<Packet> p);
-
+
virtual std::ostream&
Print (std::ostream &os) const;
////////////////////////////////////////////////////////////////////