face: Connect faces to the parent (unicast) or associated (multicast) channels
Change-Id: Ie7b2e8fb60050a2bc6e4f5ad053c26e121f3c3d5
Refs: #4973
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 4a5948b..1bb474e 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -34,6 +34,8 @@
namespace nfd {
namespace face {
+class Channel;
+
/** \brief indicates the state of a face
*/
typedef TransportState FaceState;
@@ -171,11 +173,30 @@
const FaceCounters&
getCounters() const;
+ /**
+ * \brief Get channel on which face was created (unicast) or the associated channel (multicast)
+ */
+ weak_ptr<Channel>
+ getChannel() const
+ {
+ return m_channel;
+ }
+
+ /**
+ * \brief Set channel on which face was created (unicast) or the associated channel (multicast)
+ */
+ void
+ setChannel(weak_ptr<Channel> channel)
+ {
+ m_channel = std::move(channel);
+ }
+
private:
FaceId m_id;
unique_ptr<LinkService> m_service;
unique_ptr<Transport> m_transport;
FaceCounters m_counters;
+ weak_ptr<Channel> m_channel;
};
inline LinkService*