face: allow GenericLinkService to override MTU
refs #5056
Change-Id: I8eb2dd732b1431e0e809deb53792a14be1698ff1
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index dc8c20d..4a5948b 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -60,6 +60,18 @@
Transport*
getTransport() const;
+ /** \brief Request that the face be closed
+ *
+ * This operation is effective only if face is in the UP or DOWN state; otherwise, it has no effect.
+ * The face will change state to CLOSING, and then perform a cleanup procedure.
+ * When the cleanup is complete, the state will be changed to CLOSED, which may happen
+ * synchronously or asynchronously.
+ *
+ * \warning The face must not be deallocated until its state changes to CLOSED.
+ */
+ void
+ close();
+
public: // upper interface connected to forwarding
/** \brief send Interest to \p endpointId
*/
@@ -92,7 +104,7 @@
*/
signal::Signal<LinkService, Interest>& onDroppedInterest;
-public: // static properties
+public: // properties
/** \return face ID
*/
FaceId
@@ -134,7 +146,13 @@
ndn::nfd::LinkType
getLinkType() const;
-public: // dynamic properties
+ /** \brief Returns face effective MTU
+ *
+ * This function is a wrapper. The effective MTU of a face is determined by the link service.
+ */
+ ssize_t
+ getMtu() const;
+
/** \return face state
*/
FaceState
@@ -150,19 +168,6 @@
time::steady_clock::TimePoint
getExpirationTime() const;
- /** \brief request the face to be closed
- *
- * This operation is effective only if face is in UP or DOWN state,
- * otherwise it has no effect.
- * The face changes state to CLOSING, and performs cleanup procedure.
- * The state will be changed to CLOSED when cleanup is complete, which may
- * happen synchronously or asynchronously.
- *
- * \warning the face must not be deallocated until its state changes to CLOSED
- */
- void
- close();
-
const FaceCounters&
getCounters() const;
@@ -186,6 +191,12 @@
}
inline void
+Face::close()
+{
+ m_transport->close();
+}
+
+inline void
Face::sendInterest(const Interest& interest, const EndpointId& endpointId)
{
m_service->sendInterest(interest, endpointId);
@@ -251,6 +262,12 @@
return m_transport->getLinkType();
}
+inline ssize_t
+Face::getMtu() const
+{
+ return m_service->getEffectiveMtu();
+}
+
inline FaceState
Face::getState() const
{
@@ -263,12 +280,6 @@
return m_transport->getExpirationTime();
}
-inline void
-Face::close()
-{
- m_transport->close();
-}
-
inline const FaceCounters&
Face::getCounters() const
{